This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

impact of --abi choice on codesize



just pulled down v4.5.2 of the TI arm compiler, and built some reference applications using --abi=eabi (ELF) and --abi=ti_arm9_abi (COFF)....  in general, the .text section of the eabi (ELF) version is about 10% larger; looking at the sizes of individual functions reported in the linker map confirms this....  here's a snip from an ELF map....

.text      0    00000000    00000978    
                  00000000    00000383     App_xv7M3-TI-E.ov7M3-TI-E (.text:xdc_runtime_System_doPrint__I)
                  00000383    00000001     --HOLE-- [fill = 0]
                  00000384    000000e8     App_xv7M3-TI-E.ov7M3-TI-E (.text:xdc_runtime_Startup_startMods__I)
                  0000046c    000000d4     App_xv7M3-TI-E.ov7M3-TI-E (.text:xdc_runtime_System_printfExtend__I)

and here's the corresponding snip from the COFF map....

.text      0    00000000    00000896    
                  00000000    0000032f     App_xv7M3-TI-C.ov7M3-TI-C (.text:_xdc_runtime_System_doPrint__I)
                  0000032f    00000001     --HOLE-- [fill = 0]
                  00000330    000000e8     App_xv7M3-TI-C.ov7M3-TI-C (.text:_xdc_runtime_Startup_startMods__I)
                  00000418    000000bc     App_xv7M3-TI-C.ov7M3-TI-C (.text:_xdc_runtime_System_printfExtend__I)

while some functions show no change in size, others show quite a bit of growth....

is there something in the eabi spec (versus the TI arm9_abi) that accounts for this growth in program size on a per-function basis???  note that in both cases, i'm using conditional linking to eliminating unreferenced functions; the problem is that the functions which remain are somewhat larger....  otherwise, the options used to build these applications are identical in the ELF vs COFF cases

has anyone else observed this using the TI arm compiler???

 

  • We are aware of one issue.  When the compiler calls a built-in function (such as I$MOD, which is used to compute %), does it know which registers are modified by that function?  Under TI_ARM9_ABI, it does.  Under EABI, it doesn't.  That is because there is no guarantee that the TI EABI RTS library gets used.  Some other EABI compliant ARM library could supply that function.  The compiler has to be conservative and presume that all registers, except the few registers the calling convention requires be saved by a function,  are modified.  And this presumption has negative consequences on how registers get used generally, which increases memory accesses and code size.

    Thanks and regards,

    -George