[llvm-bugs] [Bug 42327] New: Misplaced orphaned sections in output with lld 8.0

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 19 07:25:07 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42327

            Bug ID: 42327
           Summary: Misplaced orphaned sections in output with lld 8.0
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: royger at freebsd.org
                CC: llvm-bugs at lists.llvm.org, peter.smith at linaro.org

lld 8.0 seems to misplace orphaned sections, according to GNU ld manual,
orphaned sections should be placed at the end of the output:

https://sourceware.org/binutils/docs/ld/Orphan-Sections.html

lld 8.0 however seems to place some of them at the start, for example giving
the following (start) of a linker file:

SECTIONS
{
  [...]
  .text : AT(...) {

lld 8.0 produces the following section headers:

  [ 0]                   NULL            0000000000000000 000000 000000 00     
0   0  0
  [ 1] .reloc            PROGBITS        ffff82d080000000 001000 000008 00   A 
0   0  4
  [ 2] .init.rodata.cst8 PROGBITS        ffff82d080000008 001008 000008 08  AM 
0   0  8
  [ 3] .text             PROGBITS        ffff82d080200000 201000 1631ba 00  AX 
0   0 4096
[...]

Placing the orphaned .reloc and .init.rodata.cst8 before the linker script
defined sections. Note that previos lld versions did not exhibit this
behaviour. The output of LLD_REPRODUCE can be found at:

http://xenbits.xen.org/people/royger/xen-lld-repro.tar.gz

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190619/87c43d16/attachment.html>


More information about the llvm-bugs mailing list