bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/23561] New: linux x86_64: ELF PHDR not mapped


From: felix-glibc at fefe dot de
Subject: [Bug ld/23561] New: linux x86_64: ELF PHDR not mapped
Date: Wed, 22 Aug 2018 10:32:37 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=23561

            Bug ID: 23561
           Summary: linux x86_64: ELF PHDR not mapped
           Product: binutils
           Version: 2.31
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: felix-glibc at fefe dot de
  Target Milestone: ---

I'm using gcc 8.2.0 with binutils 2.31.1 to build my dietlibc
(www.fefe.de/dietlibc/, use CVS version to reproduce).

Part of the startup code of my libc goes through auxvec to find PT_TLS and then
initialize the thread local storage.

Now, this code worked fine for years. When I make clean and build with the
above mentioned versions, I get a segfault in the AT_PHDR traversal, because
AT_PHDR points to 0x400040 but /proc/pid/maps says:

00401000-00404000 r-xp 00001000 08:12 19664433

And indeed, readelf on the binary shows that:

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  LOAD           0x0000000000001000 0x0000000000401000 0x0000000000401000
                 0x00000000000021e7 0x00000000000021e7  R E    0x1000

So the kernel did as it was told and loaded starting from 1000.

My current understanding is that I did it right and this is a bug in binutils
to put the wrong value in the ELF header. Am I wrong? How else am I supposed to
access the PHDR? Or maybe I am supposed to find the thread local storage data
some other way?

Please advise.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]