[PATCH] D93783: [ELFObjectWriter] emit STT_SECTION symbols for sections

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 23 14:57:37 PST 2020


nickdesaulniers created this revision.
nickdesaulniers added a reviewer: MaskRay.
Herald added subscribers: pengfei, rupprecht, steven_wu, hiraditya, nemanjai, emaste.
Herald added a reviewer: espindola.
Herald added a reviewer: jhenderson.
nickdesaulniers requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Effectively a revert of r239045 ("Omit unused section symbols from the symbol table.")

By not emitted STT_SECTION symbols for each section, external utilities
that rely on address calculations from these symbols break when moving
from GNU `as` (via `-no-integrated-as`) to Clang's integrated assembler.

Particularly, the Linux kernel's `objtool` utility which is used to
embed custom format unwind info for x86 into the kernel image.

To improve compatibility with GAS, do not intentionally omit these
section symbols.

Increases binary sizes slightly due to additional symbol entries in the
symbol table.

Link: https://github.com/ClangBuiltLinux/linux/issues/669
Link: https://github.com/ClangBuiltLinux/linux/issues/872
Link: https://github.com/ClangBuiltLinux/linux/issues/1209


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93783

Files:
  lld/test/ELF/icf-safe.s
  lld/test/ELF/lto/thinlto-single-module.ll
  llvm/lib/MC/ELFObjectWriter.cpp
  llvm/test/CodeGen/PowerPC/pcrel-tls-general-dynamic.ll
  llvm/test/CodeGen/PowerPC/pcrel-tls-initial-exec.ll
  llvm/test/MC/AArch64/size-directive.s
  llvm/test/MC/ELF/alias.s
  llvm/test/MC/ELF/cgprofile.s
  llvm/test/MC/ELF/comdat.s
  llvm/test/MC/ELF/empty.s
  llvm/test/MC/ELF/reloc-same-name-section.s
  llvm/test/MC/ELF/relocation-alias.s
  llvm/test/MC/ELF/section-sym.s
  llvm/test/MC/ELF/undef.s
  llvm/test/tools/llvm-objdump/X86/demangle.s
  llvm/test/tools/llvm-readobj/ELF/many-sections2.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93783.313617.patch
Type: text/x-patch
Size: 13002 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201223/984bcb85/attachment.bin>


More information about the llvm-commits mailing list