gc sections and .eh_frame

Jonathan Larmour jifl@eCosCentric.com
Wed Jun 8 21:36:00 GMT 2005


Richard Henderson wrote:
> On Wed, Jun 08, 2005 at 08:30:34PM +0100, Jonathan Larmour wrote:
> 
>>But empirically, powerpc-eabi does put exception stuff referenced from 
>>.eh_frame into .rodata:
> 
> 
> Which is correct, that's where it belongs.
> 
> 
>>there is no .gcc_except_table section present at all.
> 
> 
> This is, and has always been, created by the linker.

Now I'm really confused:

dargo:/tmp$ arm-elf-g++ -c e.cxx
dargo:/tmp$ arm-elf-objdump -h e.o

e.o:     file format elf32-littlearm

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
   0 .text         000000a8  00000000  00000000  00000034  2**2
                   CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
   1 .data         00000000  00000000  00000000  000000dc  2**0
                   CONTENTS, ALLOC, LOAD, DATA
   2 .bss          00000000  00000000  00000000  000000dc  2**0
                   ALLOC
   3 .gcc_except_table 00000010  00000000  00000000  000000dc  2**2
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
   4 .comment      00000020  00000000  00000000  000000ec  2**0
                   CONTENTS, READONLY
dargo:/tmp$ i386-elf-g++ -c e.cxx
dargo:/tmp$ i386-elf-objdump -h e.o

e.o:     file format elf32-i386

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
   0 .text         00000049  00000000  00000000  00000034  2**2
                   CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
   1 .data         00000000  00000000  00000000  00000080  2**2
                   CONTENTS, ALLOC, LOAD, DATA
   2 .bss          00000000  00000000  00000000  00000080  2**2
                   ALLOC
   3 .gcc_except_table 00000014  00000000  00000000  00000080  2**2
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
   4 .eh_frame     00000040  00000000  00000000  00000094  2**2
                   CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
   5 .comment      00000020  00000000  00000000  000000d4  2**0
                   CONTENTS, READONLY
dargo:/tmp$ m68k-elf-g++ -c e.cxx
dargo:/tmp$ m68k-elf-objdump -h e.o

e.o:     file format elf32-m68k

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
   0 .text         00000030  00000000  00000000  00000034  2**2
                   CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
   1 .data         00000000  00000000  00000000  00000064  2**2
                   CONTENTS, ALLOC, LOAD, DATA
   2 .bss          00000000  00000000  00000000  00000064  2**2
                   ALLOC
   3 .gcc_except_table 00000014  00000000  00000000  00000064  2**2
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
   4 .eh_frame     00000040  00000000  00000000  00000078  2**2
                   CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
   5 .comment      00000020  00000000  00000000  000000b8  2**0
                   CONTENTS, READONLY
dargo:/tmp$ mipsisa32-elf-g++ -c e.cxx
dargo:/tmp$ mipsisa32-elf-objdump -h e.o

e.o:     file format elf32-bigmips

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
   0 .text         00000068  00000000  00000000  00000034  2**2
                   CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
   1 .data         00000000  00000000  00000000  0000009c  2**0
                   CONTENTS, ALLOC, LOAD, DATA
   2 .bss          00000000  00000000  00000000  0000009c  2**0
                   ALLOC
   3 .reginfo      00000018  00000000  00000000  0000009c  2**2
                   CONTENTS, READONLY, LINK_ONCE_SAME_SIZE
   4 .pdr          00000020  00000000  00000000  000000b4  2**2
                   CONTENTS, RELOC, READONLY
   5 .mdebug.eabi32 00000000  00000000  00000000  000000d4  2**0
                   CONTENTS, READONLY
   6 .gcc_except_table 00000014  00000000  00000000  000000d4  2**2
                   CONTENTS, ALLOC, LOAD, READONLY, DATA
   7 .eh_frame     00000040  00000000  00000000  000000e8  2**2
                   CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA

and so on.

Are the powerpc-eabi tools the only ones behaving correctly (putting it in 
.rodata) and all the others wrong?

Jifl
-- 
eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
--["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine



More information about the Binutils mailing list