[llvm-bugs] [Bug 28868] New: Error "invalid section index: xxx" when linking FreeBSD kernel.

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Aug 5 05:32:20 PDT 2016


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

            Bug ID: 28868
           Summary: Error "invalid section index: xxx" when linking
                    FreeBSD kernel.
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: grimar at accesssoftek.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 16888
  --> https://llvm.org/bugs/attachment.cgi?id=16888&action=edit
hpt27xx_lib.o

I found that when tried to link kernel.
Minimal reproduce is:
-flavor gnu -o kernel.debug hpt27xx_lib.o
File is attached.

Problem is that file contains symbols which combines STT_SECTION and 
are associated with a SHT_RELA/SHT_STRTAB/SHT_SYMTAB sections.
And we do not create section for those and that triggers this error.

For example:
  Section {
    Index: 2
    Name: .rela.text (27)
    Type: SHT_RELA (0x4)
    Flags [ (0x0)
    ]
    Address: 0x0
    Offset: 0x9C138
    Size: 220176
    Link: 14
    Info: 1
    AddressAlignment: 8
    EntrySize: 24
  }

  Symbol {
    Name:  (0)
    Value: 0x0
    Size: 0
    Binding: Local (0x0)
    Type: Section (0x3)
    Other: 0
    Section: .rela.text (0x2)
  }

There are in total 7 symbols affected in this file assotiated with one of next
sections:
.rela.text, .rela.rodata, .rela.data, .rela.eh_frame, .shstrtab, .symtab,
.strtab

-- 
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/20160805/5e6acba5/attachment.html>


More information about the llvm-bugs mailing list