This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

AW: ARM SDT2.51 vs arm-elf-gcc


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]