Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Feb 2018 00:05:51 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 225775] btxld does not handle input with other than 2 PT_LOAD segments
Message-ID:  <bug-225775-8-ZYNTlRgfgy@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-225775-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-225775-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D225775

--- Comment #2 from Ed Maste <emaste@freebsd.org> ---
It is because lld collects read-only contents into a separate segment, for
example:

% readelf -l zfsloader.sym

Elf file type is EXEC (Executable file)
Entry point 0x0
There are 5 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x001000 0x00000000 0x00000000 0x58694 0x58694 R E 0x1000
  LOAD           0x05a000 0x00059000 0x00059000 0x0afcc 0x0afcc R   0x1000
  LOAD           0x065000 0x00064000 0x00064000 0x07854 0x14c9c RW  0x1000
  GNU_RELRO      0x06c000 0x0006b000 0x0006b000 0x00854 0x01000 R   0x1
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0

 Section to Segment mapping:
  Segment Sections...
   00     .text .gnu_debuglink .comment .debug_str .debug_loc .debug_abbrev
.debug_info .debug_ranges .debug_macinfo .debug_pubnames .debug_pubtypes
.debug_frame .debug_line .debug_aranges .symtab .shstrtab .strtab=20
   01     .rodata set_Xcommand_set=20
   02     .data set_Xficl_compile_set .data.rel.ro .got .bss=20
   03     .data.rel.ro .got=20
   04=20=20=20=20=20

Linking with -z norelro leaves the three PT_LOADs, just the PT_GNU_RELRO is=
 not
emitted. From the output above btxld should coalesce two PT_LOADs, and
discarding a PT_LOAD should be an error not a warning.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-225775-8-ZYNTlRgfgy>