[lld] [ELF] Fix unnecessary inclusion of unreferenced provide symbols (PR #84512)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 24 23:45:41 PDT 2024


================
@@ -0,0 +1,60 @@
+# REQUIRES: x86
+
+# This test verifies that garbage-collection is correctly garbage collecting
+# unused sections when the symbol of the unused section is only referred by
+# an unused PROVIDE symbol.
+
+# RUN: rm -rf %t && split-file %s %t && cd %t
+# RUN: llvm-mc -filetype=obj -triple=x86_64 a.s -o a.o
+# RUN: ld.lld -o a_nogc a.o -T script.t
+# RUN: llvm-readobj --sections --symbols a_nogc | FileCheck -check-prefix=NOGC %s
----------------
MaskRay wrote:

`-S` (--sections) is unused

https://github.com/llvm/llvm-project/pull/84512


More information about the llvm-commits mailing list