[lld] [lld][ELF] Demote symbols in discarded sections to Undefined. (PR #68777)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 11 23:45:18 PDT 2023


================
@@ -714,6 +714,22 @@ template <class ELFT> void Writer<ELFT>::copyLocalSymbols() {
       // No reason to keep local undefined symbol in symtab.
       if (!dr)
         continue;
+
+      // Demote locals which did not end up in any partition. This is similar
+      // to what we do in Driver.cpp, but that only works on globals.
+      // Don't do this for section symbols; they are expected to be lost.
----------------
smithp35 wrote:

I'm surprised about test failures in .ARM.exidx. As there shouldn't be any relocations to a .ARM.exidx input section. There will be relocations from a .ARM.exidx section, but given that when a section is discarded, any section with a SHF_LINK_ORDER dependency on it is discarded.

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


More information about the llvm-commits mailing list