[Bug 207631] rtld requires the first PT_LOAD segment to be .text and is incompatible with output produced by lld

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Mar 2 03:58:05 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207631

--- Comment #1 from Ed Maste <emaste at freebsd.org> ---
For reference here is the segment layout currently produced by lld:

% readelf -l bin/sh

Elf file type is EXEC (Executable file)
Entry point 0x19000
There are 10 program headers, starting at offset 64

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  PHDR           0x0000000000000040 0x0000000000010040 0x0000000000010040
                 0x0000000000000230 0x0000000000000230  R      8
  INTERP         0x0000000000000270 0x0000000000010270 0x0000000000010270
                 0x0000000000000015 0x0000000000000015  R      1
      [Requesting program interpreter: /libexec/ld-elf.so.1]
  LOAD           0x0000000000000000 0x0000000000010000 0x0000000000010000
                 0x000000000000875c 0x000000000000875c  R      1000
  LOAD           0x0000000000009000 0x0000000000019000 0x0000000000019000
                 0x000000000001b220 0x000000000001b220  R E    1000
  LOAD           0x0000000000025000 0x0000000000035000 0x0000000000035000
                 0x0000000000001500 0x0000000000003a50  RW     1000
  DYNAMIC        0x0000000000025028 0x0000000000035028 0x0000000000035028
                 0x0000000000000130 0x0000000000000130  RW     8
  GNU_RELRO      0x0000000000025000 0x0000000000035000 0x0000000000035000
                 0x0000000000000160 0x0000000000000160  R      1
  GNU_EH_FRAME   0x0000000000007f18 0x0000000000017f18 0x0000000000017f18
                 0x0000000000000844 0x0000000000000844  R      1
  GNU_STACK      0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000000000 0x0000000000000000  RW     0
  NOTE           0x0000000000000288 0x0000000000010288 0x0000000000010288
                 0x0000000000000030 0x0000000000000030  R      4

 Section to Segment mapping:
  Segment Sections...
   00     
   01     .interp 
   02     .interp .note.tag .rodata .eh_frame .rodata .rodata .rodata .dynsym
.gnu.hash .hash .dynstr .rela.dyn .rela.plt .eh_frame_hdr 
   03     .text .init .fini .plt 
   04     .ctors .dtors .jcr .dynamic .got .data .got.plt .bss 
   05     .dynamic 
   06     .ctors .dtors .jcr .dynamic .got 
   07     .eh_frame_hdr 
   08     
   09     .note.tag

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list