[llvm-bugs] [Bug 44452] New: Wildcard in linker script matches non-SHF_ALLOC sections causing error

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jan 3 08:58:33 PST 2020


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

            Bug ID: 44452
           Summary: Wildcard in linker script matches non-SHF_ALLOC
                    sections causing error
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: john.brawn at arm.com
                CC: llvm-bugs at lists.llvm.org, peter.smith at linaro.org

If you have the following linker script:
  SECTIONS
  {
    ALL 0x1000 : { *(*) }
  }

and try to link pretty much anything using it you get the errors

ld.lld: error: section type mismatch for .rela.plt
>>> <internal>:(.rela.plt): SHT_RELA
>>> output section ALL: SHT_PROGBITS

ld.lld: error: section type mismatch for .rela.dyn
>>> <internal>:(.rela.dyn): SHT_RELA
>>> output section ALL: SHT_PROGBITS

ld.lld: error: section type mismatch for .symtab
>>> <internal>:(.symtab): SHT_SYMTAB
>>> output section ALL: SHT_PROGBITS

ld.lld: error: section type mismatch for .symtab_shndx
>>> <internal>:(.symtab_shndx): SHT_SYMTAB_SHNDX
>>> output section ALL: SHT_PROGBITS

ld.lld: error: section type mismatch for .shstrtab
>>> <internal>:(.shstrtab): SHT_STRTAB
>>> output section ALL: SHT_PROGBITS

ld.lld: error: section type mismatch for .strtab
>>> <internal>:(.strtab): SHT_STRTAB
>>> output section ALL: SHT_PROGBITS

GNU ld doesn't match such sections for this same linker script, and instead
generates separate output sections for them.

-- 
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/20200103/773d50a3/attachment-0001.html>


More information about the llvm-bugs mailing list