Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 13922
Product:  
Component:  
Status: RESOLVED
Resolution: INVALID
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Nils Hammar <m4341@abc.se>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
coff.zip Source file and produced object files application/octet-stream 2004-01-29 16:00 859 bytes Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 13922 depends on: Show dependency tree
Show dependency graph
Bug 13922 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: Opened: 2004-01-29 15:53
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 )

------- Comment #1 From Nils Hammar 2004-01-29 16:00 -------
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

------- Comment #2 From Andrew Pinski 2004-01-29 16:08 -------
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.

------- Comment #3 From Nils Hammar 2004-01-31 09:16 -------
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. */

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug