Error - Subtractive relocations not supported

I was trying to add RO data size to a FW image header.

In header.inc file I had done

DCD     ||Image$$TEXT$$ZI$$Limit|| - ||Image$$TEXT$$Base||

It generated error - Error: A1142E: Subtractive relocations not supported for ELF format output

I see there is an error information - developer.arm.com/.../list-of-the-armasm-error-and-warning-messages
--------------------------------------------------------------------------------------------------------------

This can occur when subtracting symbols that are in different areas, for example:

IMPORT sym1
IMPORT sym2
DCD (sym2 - sym1)
--------------------------------------------------------------------------------------------------------------

However If i individually insert the ||Image$$TEXT$$ZI$$Limit|| and ||Image$$TEXT$$Base|| into header.inc, there is no issue.
Both of them are plain integers and should be ok to subtract. And both the addresses are like base address and then end adresss, subtracting which the size will be calculated
Is there any workaround to / correct way of doing that?

 

Parents Reply Children
No data
More questions in this forum