[all-commits] [llvm/llvm-project] 11bb7c: [MC] Set sh_link to 0 if the associated symbol is ...

Fangrui Song via All-commits all-commits at lists.llvm.org
Mon Aug 3 13:44:10 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 11bb7c220ccdff1ffec4780ff92fb5acec8f6f0b
      https://github.com/llvm/llvm-project/commit/11bb7c220ccdff1ffec4780ff92fb5acec8f6f0b
  Author: Fangrui Song <maskray at google.com>
  Date:   2020-08-03 (Mon, 03 Aug 2020)

  Changed paths:
    M llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
    M llvm/lib/MC/ELFObjectWriter.cpp
    M llvm/lib/MC/MCParser/ELFAsmParser.cpp
    M llvm/lib/MC/MCSectionELF.cpp
    A llvm/test/CodeGen/X86/elf-associated-discarded.ll
    M llvm/test/CodeGen/X86/elf-associated.ll
    A llvm/test/MC/ELF/section-linkorder.s

  Log Message:
  -----------
  [MC] Set sh_link to 0 if the associated symbol is undefined

Part of https://bugs.llvm.org/show_bug.cgi?id=41734

LTO can drop externally available definitions. Such AssociatedSymbol is
not associated with a symbol. ELFWriter::writeSection() will assert.

Allow a SHF_LINK_ORDER section to have sh_link=0.

We need to give sh_link a syntax, a literal zero in the linked-to symbol
position, e.g. `.section name,"ao", at progbits,0`

Reviewed By: pcc

Differential Revision: https://reviews.llvm.org/D72899




More information about the All-commits mailing list