[all-commits] [llvm/llvm-project] be01af: [ELF] Fix non-relocatable-non-emit-relocs --gc-sec...

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Apr 7 14:34:45 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: be01af4a0f4ae4633929985cc689ad98a449db05
      https://github.com/llvm/llvm-project/commit/be01af4a0f4ae4633929985cc689ad98a449db05
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-04-07 (Thu, 07 Apr 2022)

  Changed paths:
    M lld/ELF/Writer.cpp
    M lld/test/ELF/discard-locals.s

  Log Message:
  -----------
  [ELF] Fix non-relocatable-non-emit-relocs --gc-sections to discard .L symbols

This reverts commit 764cd491b126318add093c7c8ba3884967d64b21, which I
incorrectly assumed NFC partly because there were no test coverage for the
non-relocatable non-emit-relocs case before 9d6d936243fe343abe89323a27c7241b395af541.

The interaction of {,-r,--emit-relocs} {,--discard-locals} {,--gc-sections} is
complex but without -r/--emit-relocs, --gc-sections does need to discard .L
symbols like --no-gc-sections. The behavior matches GNU ld.




More information about the All-commits mailing list