AW: [ECOS] ARM SDT2.51 vs arm-elf-gcc

Hr. Backhaus w.backhaus@newage-avkseg.com
Wed Apr 24 07:22:00 GMT 2002


hello,

>  BTW, I have linked successfully, but can't get subroutine call's address 
>correctly(offset 2 instructions) which I post before, does these functions 
>affect linking results?


there is a difference between the ELF object types generated by armcc and 
gcc, the operating System/ABI version ( ABI - Aplications Binary 
Interface).
this information is set by gcc in an ELF object file in the 8th byte of the 
e_ident field of the ELF Header. this is actually the 8th byte in the ELF 
Object file.
gcc sets this byte to 0x61 (ELFOSABI_ARM).
armcc considers this byte as the first unused byte in the header of an ELF 
object, and sets to 0.

when relocating, the linker calculates the target address for B/BL 
instructions. here it checks the ABI indication and if this is 0, it's 
substract 8 from the computed branch address. it does this, for 
compatibility to older versions.

for a quick and dirty solution, write a 0x61 in the 8th byte of the object 
file generated with ADS.


Regards,
Willy







-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss



More information about the Ecos-discuss mailing list