current binutils cvs causes problems with libstdc++-v3

H . J . Lu hjl@lucon.org
Fri May 24 08:18:00 GMT 2002


On Fri, May 24, 2002 at 12:17:04AM -0700, Jason R Thorpe wrote:
> I noticed this while doing a current gcc cvs boostrap/test run, and
> I can't help but think "linker bug".
> 
> When building these tests, the executables end up with one one PT_LOAD
> section, marked rwx.  Here is an objdump of the object built from the
> 17_intro/header_cerrno.cc test:
> 
> a.out:     file format elf32-i386
> a.out
> architecture: i386, flags 0x00000112:
> EXEC_P, HAS_SYMS, D_PAGED
> start address 0x08048754
> 
> Program Header:
>     PHDR off    0x00000034 vaddr 0x08048034 paddr 0x08048034 align 2**2
>          filesz 0x000000c0 memsz 0x000000c0 flags r-x
>   INTERP off    0x000000f4 vaddr 0x080480f4 paddr 0x080480f4 align 2**0
>          filesz 0x00000017 memsz 0x00000017 flags r--
>     LOAD off    0x00000000 vaddr 0x08048000 paddr 0x08048000 align 2**12
>          filesz 0x00005bcc memsz 0x00006434 flags rwx
>  DYNAMIC off    0x00005a9c vaddr 0x0804da9c paddr 0x0804da9c align 2**2
>          filesz 0x000000b8 memsz 0x000000b8 flags rw-
>     NOTE off    0x0000010c vaddr 0x0804810c paddr 0x0804810c align 2**2
>          filesz 0x00000018 memsz 0x00000018 flags r--
> 
> This certainly seems wrong, as I know there is read-only data in the
> executable.  And, because it is wrong, it trips an assertion in NetBSD's
> ELF dynamic linker, and thus causes a testsuite failure.
> 

With the yesterday's binutils from CVS, I got

./header_cerrno.exe:     file format elf32-i386
./header_cerrno.exe
architecture: i386, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x080482e0

Program Header:
    PHDR off    0x00000034 vaddr 0x08048034 paddr 0x08048034 align 2**2
         filesz 0x000000c0 memsz 0x000000c0 flags r-x
  INTERP off    0x000000f4 vaddr 0x080480f4 paddr 0x080480f4 align 2**0
         filesz 0x00000013 memsz 0x00000013 flags r--
    LOAD off    0x00000000 vaddr 0x08048000 paddr 0x08048000 align 2**12
         filesz 0x0000042c memsz 0x0000042c flags r-x
    LOAD off    0x0000042c vaddr 0x0804942c paddr 0x0804942c align 2**12
         filesz 0x0000011c memsz 0x00000120 flags rw-
 DYNAMIC off    0x0000043c vaddr 0x0804943c paddr 0x0804943c align 2**2
         filesz 0x000000e0 memsz 0x000000e0 flags rw-
    NOTE off    0x00000108 vaddr 0x08048108 paddr 0x08048108 align 2**2
         filesz 0x00000020 memsz 0x00000020 flags r--

Can you find out why it failed on NetBSD?

I do have some local changes. But I don't believe they will cause the
difference here.


H.J.



More information about the Binutils mailing list