https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61577

--- Comment #54 from The Written Word <bugzilla-gcc at thewrittenword dot com> 
---
(In reply to EML from comment #52)
> objdump -h -s foo
> Contents of section .rodata:
>  40007f8 48656c6c 6f732057 6f726c64 00        Hellos World.   
> 
> 
> So gcc 4.9.x also puts the string into rodata?
> 
> (Not sure I'm reading all the files correctly, so perhaps I'm just reading
> it all wrong)

I'm seeing the string in .rodata as well regardless of compiler version:
$ gobjdump -h -s -j .rodata a.out
a.out:     file format elf32-ia64-hpux-big

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
 10 .rodata       0000000d  040007c8  040007c8  000007c8  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
Contents of section .rodata:
 40007c8 48656c6c 6f732057 6f726c64 00        Hellos World.   

And the HP C compiler has it in .rodata as well:
$ cc a.out
$ gobjdump -h -s -j .rodata a.out
a.out:     file format elf32-ia64-hpux-big

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
 11 .rodata       0000000e  040007c0  040007c0  000007c0  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
Contents of section .rodata:
 40007c0 48656c6c 6f732057 6f726c64 0a00      Hellos World..

Reply via email to