This is GCC Bugzilla
This is GCC Bugzilla Version 2.20+
View Bug Activity | Format For Printing | Clone This Bug
There seems to be variations in the COFF format, more specific that the Texas Instruments compiler cl470 generates a different structure of the coff format. The interesting thing is that both the gcc generated and the TI generated coff format is readable with the coff2elf utility found at http://www.arm.com/support/downloads/info/2320.html. I'm not sure if this problem actually belongs to the "binutils" package. Two different coff2elf outputs provided: Texas Instrument object file: ============================= R:\coff>coff2elf -r t_ti_arm_coff.obj Header ====== ID = 0xc2 date : Thu Jan 29 15:28:20 2004 number of sections = 4 number of symbol table entries = 14 size of auxiliary header = 0 flags=0x200 ( BIG ) Sections ======== .text: (1) address: physical=0x0, virtual=0x0 data: size=0x8, pointer=0xd6 relocations: size=0, pointer=0x0 line numbers: size=0, pointer=0x0 flags=0x220 ( TEXT alignment=4 ) .data: (2) address: physical=0x0, virtual=0x0 data: size=0x0, pointer=0x0 relocations: size=0, pointer=0x0 line numbers: size=0, pointer=0x0 flags=0x240 ( DATA alignment=4 ) .bss: (3) address: physical=0x0, virtual=0x0 data: size=0x0, pointer=0x0 relocations: size=0, pointer=0x0 line numbers: size=0, pointer=0x0 flags=0x280 ( BSS alignment=4 ) .text:v$0: (4) address: physical=0x0, virtual=0x0 data: size=0x8, pointer=0xde relocations: size=1, pointer=0xe6 line numbers: size=0, pointer=0x0 flags=0x4240 ( DATA CLINK alignment=4 ) Relocation entries: 0x00000004 : PCR24W : 0001 (.text) GCC Object File: ================ R:\coff>coff2elf -r t_gcc_arm_coff.o Header ====== ID = 0xa00 date : Thu Jan 01 00:00:00 1970 number of sections = 3 number of symbol table entries = 8 size of auxiliary header = 0 flags=0x4d04 ( LNNO LITTLE ) Sections ======== .text: (1) address: physical=0x0, virtual=0x0 data: size=0x28, pointer=0x8c relocations: size=1, pointer=0xb4 line numbers: size=0, pointer=0x0 flags=0x20 ( TEXT ) Relocation entries: 0x00000010 : 0x10 : 0007 (___gccmain) .data: (2) address: physical=0x0, virtual=0x0 data: size=0x0, pointer=0x0 relocations: size=0, pointer=0x0 line numbers: size=0, pointer=0x0 flags=0x40 ( DATA ) .bss: (3) address: physical=0x0, virtual=0x0 data: size=0x0, pointer=0x0 relocations: size=0, pointer=0x0 line numbers: size=0, pointer=0x0 flags=0x80 ( BSS )
Created an attachment (id=5609) [edit] Source file and produced object files Provided attachment contains the C source file and generated object files for various compilers. Object file name specifies compiler: t_ti_arm_coff.obj - Texas Instruments TMS470 ANSI C Shell Version 1.22e t_gcc_arm_coff.o - Gnu C 3.3.2 ARM coff t_gcc_arm_elf.o - Gnu C 3.3.2 ARM elf (Provided for reference) t.c - Source file used for all of above
Not a gcc bug, we only produce asm, take this to the binutils guys but looking at this bug report, I cannot find the problem.
Resolution: Problem resides in binutils. Edit file include/coff/arm.h and change: #define ARMMAGIC 0xa00 /* I just made this up */ To: #define ARMMAGIC 0xc2 /* To be compatible with Texas Instruments ARM tools. */