Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ELF] Demote symbols in /DISCARD/ discarded sections to Undefined #69295

Closed
wants to merge 0 commits into from

Conversation

MaskRay
Copy link
Member

@MaskRay MaskRay commented Oct 17, 2023

When an input section is matched by /DISCARD/ in a linker script, GNU ld
reports errors for relocations referencing symbols defined in the section:

`.aaa' referenced in section `.bbb' of a.o: defined in discarded section `.aaa' of a.o

Implement the error by demoting eligible symbols to Undefined and changing
STB_WEAK to STB_GLOBAL. As a side benefit, in relocatable links, relocations
referencing symbols defined relative to /DISCARD/ discarded sections no longer
set symbol/type to zeros.

It's arguable whether a weak reference to a discarded symbol should lead to
errors. GNU ld reports an error and our demoting approach reports an error as
well.

Close #58891

Co-authored-by: Bevin Hansson bevin.hansson@ericsson.com

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 17, 2023

@llvm/pr-subscribers-lld-elf

@llvm/pr-subscribers-lld

Author: Fangrui Song (MaskRay)

Changes

When an input section is matched by /DISCARD/ in a linker script, GNU ld
reports errors for relocations referencing symbols in the section:

`.aaa' referenced in section `.bbb' of a.o: defined in discarded section `.aaa' of a.o

Implement the error by demoting eligible symbols to Undefined and
changing STB_WEAK to STB_GLOBAL.

It's arguable whether a weak reference to a discarded symbol should lead to
errors. GNU ld reports an error and our demoting approach reports an error as
well.

Close #58891

Co-authored-by: Bevin Hansson <bevin.hansson@ericsson.com>


This an alternative to https://github.com/MaskRay/llvm-project/tree/lld-symbols-in-discard
that uses demoteSymbols.


Full diff: https://github.com/llvm/llvm-project/pull/69295.diff

8 Files Affected:

  • (modified) lld/ELF/Driver.cpp (+44-4)
  • (modified) lld/ELF/LinkerScript.cpp (+1)
  • (modified) lld/ELF/LinkerScript.h (+1)
  • (modified) lld/ELF/MapFile.cpp (+1-1)
  • (modified) lld/ELF/Relocations.cpp (+3-3)
  • (modified) lld/ELF/Symbols.cpp (+10-6)
  • (modified) lld/test/ELF/gc-sections-tls.s (+8)
  • (modified) lld/test/ELF/linkerscript/discard-section.s (+26-3)
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index d082463d34e576c..5d3c944f18cf15c 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -2248,17 +2248,38 @@ static void replaceCommonSymbols() {
   }
 }
 
+static void demoteDefined(Defined &sym, DenseMap<SectionBase *, size_t> &map) {
+  if (map.empty())
+    for (auto [i, sec] : llvm::enumerate(sym.file->getSections()))
+      map.try_emplace(sec, i);
+  // Change WEAK to GLOBAL so that if a scanned relocation references sym,
+  // maybeReportUndefined will report an error.
+  uint8_t binding = sym.isWeak() ? uint8_t(STB_GLOBAL) : sym.binding;
+  Undefined(sym.file, sym.getName(), binding, sym.stOther, sym.type,
+            /*discardedSecIdx=*/map.lookup(sym.section))
+      .overwrite(sym);
+}
+
 // If all references to a DSO happen to be weak, the DSO is not added to
 // DT_NEEDED. If that happens, replace ShardSymbol with Undefined to avoid
 // dangling references to an unneeded DSO. Use a weak binding to avoid
 // --no-allow-shlib-undefined diagnostics. Similarly, demote lazy symbols.
-static void demoteSharedAndLazySymbols() {
-  llvm::TimeTraceScope timeScope("Demote shared and lazy symbols");
+//
+// In addition, demote symbols defined in discarded sections, so that
+// references to /DISCARD/ discarded symbols will lead to errors.
+static void demoteSymbols() {
+  llvm::TimeTraceScope timeScope("Demote symbols");
+  DenseMap<InputFile *, DenseMap<SectionBase *, size_t>> sectionIndexMap;
   for (Symbol *sym : symtab.getSymbols()) {
+    if (auto *d = dyn_cast<Defined>(sym)) {
+      if (d->section && !d->section->isLive())
+        demoteDefined(*d, sectionIndexMap[d->file]);
+      continue;
+    }
+
     auto *s = dyn_cast<SharedSymbol>(sym);
     if (!(s && !cast<SharedFile>(s->file)->isNeeded) && !sym->isLazy())
       continue;
-
     uint8_t binding = sym->isLazy() ? sym->binding : uint8_t(STB_WEAK);
     Undefined(nullptr, sym->getName(), binding, sym->stOther, sym->type)
         .overwrite(*sym);
@@ -2266,6 +2287,18 @@ static void demoteSharedAndLazySymbols() {
   }
 }
 
+static void demoteLocalSymbolsInDiscardedSections() {
+  llvm::TimeTraceScope timeScope("Demote local symbols");
+  parallelForEach(ctx.objectFiles, [&](ELFFileBase *file) {
+    DenseMap<SectionBase *, size_t> sectionIndexMap;
+    for (Symbol *sym : file->getLocalSymbols()) {
+      Defined *d = dyn_cast<Defined>(sym);
+      if (d && d->file == file && d->section && !d->section->isLive())
+        demoteDefined(*d, sectionIndexMap);
+    }
+  });
+}
+
 // The section referred to by `s` is considered address-significant. Set the
 // keepUnique flag on the section if appropriate.
 static void markAddrsig(Symbol *s) {
@@ -3023,7 +3056,6 @@ void LinkerDriver::link(opt::InputArgList &args) {
 
   // Garbage collection and removal of shared symbols from unused shared objects.
   invokeELFT(markLive,);
-  demoteSharedAndLazySymbols();
 
   // Make copies of any input sections that need to be copied into each
   // partition.
@@ -3061,6 +3093,14 @@ void LinkerDriver::link(opt::InputArgList &args) {
     script->addOrphanSections();
   }
 
+  demoteSymbols();
+  // Also demote local symbols defined relative to discarded input sections so
+  // that relocations referencing them will lead to errors. To avoid unneeded
+  // work, we only do this when /DISCARD/ is seen, but this demotation also
+  // applies to --gc-sections discarded sections.
+  if (script->seenDiscard)
+    demoteLocalSymbolsInDiscardedSections();
+
   {
     llvm::TimeTraceScope timeScope("Merge/finalize input sections");
 
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index df091613dc0a144..00e583903f1b455 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -613,6 +613,7 @@ void LinkerScript::processSectionCommands() {
         discard(*s);
       discardSynthetic(*osec);
       osec->commands.clear();
+      seenDiscard = true;
       return false;
     }
 
diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h
index 18eaf58b785e370..c97fdfab1d2f21c 100644
--- a/lld/ELF/LinkerScript.h
+++ b/lld/ELF/LinkerScript.h
@@ -356,6 +356,7 @@ class LinkerScript final {
 
   bool hasSectionsCommand = false;
   bool seenDataAlign = false;
+  bool seenDiscard = false;
   bool seenRelroEnd = false;
   bool errorOnMissingSection = false;
   std::string backwardDotErr;
diff --git a/lld/ELF/MapFile.cpp b/lld/ELF/MapFile.cpp
index 1b6dfcc57176b5f..8b10ae183ae35dd 100644
--- a/lld/ELF/MapFile.cpp
+++ b/lld/ELF/MapFile.cpp
@@ -229,7 +229,7 @@ static void writeCref(raw_fd_ostream &os) {
       if (isa<SharedSymbol>(sym))
         map[sym].insert(file);
       if (auto *d = dyn_cast<Defined>(sym))
-        if (!d->isLocal() && (!d->section || d->section->isLive()))
+        if (!d->isLocal())
           map[d].insert(file);
     }
   }
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index ee27cc15e040a49..f3fb0c71a8b3064 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -507,8 +507,7 @@ int64_t RelocationScanner::computeMipsAddend(const RelTy &rel, RelExpr expr,
 template <class ELFT>
 static std::string maybeReportDiscarded(Undefined &sym) {
   auto *file = dyn_cast_or_null<ObjFile<ELFT>>(sym.file);
-  if (!file || !sym.discardedSecIdx ||
-      file->getSections()[sym.discardedSecIdx] != &InputSection::discarded)
+  if (!file || !sym.discardedSecIdx)
     return "";
   ArrayRef<typename ELFT::Shdr> objSections =
       file->template getELFShdrs<ELFT>();
@@ -1575,7 +1574,8 @@ template <class ELFT> void elf::scanRelocations() {
         scanner.template scanSection<ELFT>(*sec);
       if (part.armExidx && part.armExidx->isLive())
         for (InputSection *sec : part.armExidx->exidxSections)
-          scanner.template scanSection<ELFT>(*sec);
+          if (sec->isLive())
+            scanner.template scanSection<ELFT>(*sec);
     }
   });
 }
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index 07061d3a1223e9e..88140904f2f8f8e 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -316,12 +316,13 @@ void elf::maybeWarnUnorderableSymbol(const Symbol *sym) {
   if (!config->warnSymbolOrdering)
     return;
 
-  // If UnresolvedPolicy::Ignore is used, no "undefined symbol" error/warning
-  // is emitted. It makes sense to not warn on undefined symbols.
+  // If UnresolvedPolicy::Ignore is used, no "undefined symbol" error/warning is
+  // emitted. It makes sense to not warn on undefined symbols (excluding those
+  // demoted by demoteSymbolsInDiscardedSections).
   //
   // Note, ld.bfd --symbol-ordering-file= does not warn on undefined symbols,
   // but we don't have to be compatible here.
-  if (sym->isUndefined() &&
+  if (sym->isUndefined() && !cast<Undefined>(sym)->discardedSecIdx &&
       config->unresolvedSymbols == UnresolvedPolicy::Ignore)
     return;
 
@@ -330,9 +331,12 @@ void elf::maybeWarnUnorderableSymbol(const Symbol *sym) {
 
   auto report = [&](StringRef s) { warn(toString(file) + s + sym->getName()); };
 
-  if (sym->isUndefined())
-    report(": unable to order undefined symbol: ");
-  else if (sym->isShared())
+  if (sym->isUndefined()) {
+    if (cast<Undefined>(sym)->discardedSecIdx)
+      report(": unable to order discarded symbol: ");
+    else
+      report(": unable to order undefined symbol: ");
+  } else if (sym->isShared())
     report(": unable to order shared symbol: ");
   else if (d && !d->section)
     report(": unable to order absolute symbol: ");
diff --git a/lld/test/ELF/gc-sections-tls.s b/lld/test/ELF/gc-sections-tls.s
index ccc9ac3c74e5670..e476951213440a1 100644
--- a/lld/test/ELF/gc-sections-tls.s
+++ b/lld/test/ELF/gc-sections-tls.s
@@ -7,6 +7,11 @@
 
 # ERR: error: {{.*}}.o has an STT_TLS symbol but doesn't have an SHF_TLS section
 
+## As a corner case, when /DISCARD/ is present, demoteLocalSymbolsInDiscardedSections
+## demotes tls and the error is not triggered.
+# RUN: echo 'SECTIONS { /DISCARD/ : {} }' > %t.lds
+# RUN: ld.lld %t.o --gc-sections -T %t.lds -o /dev/null
+
 ## If we happen to have a PT_TLS, we will resolve the relocation to
 ## an arbitrary value (current implementation uses a negative value).
 # RUN: echo '.section .tbss,"awT"; .globl root; root: .long 0' | \
@@ -17,6 +22,9 @@
 # CHECK:      Hex dump of section '.noalloc':
 # CHECK-NEXT: 0x00000000 {{[0-9a-f]+}} ffffffff
 
+.globl _start
+_start:
+
 .section .tbss,"awT",@nobits
 tls:
   .long 0
diff --git a/lld/test/ELF/linkerscript/discard-section.s b/lld/test/ELF/linkerscript/discard-section.s
index 9e021ac83f563a4..eba3e772a21f197 100644
--- a/lld/test/ELF/linkerscript/discard-section.s
+++ b/lld/test/ELF/linkerscript/discard-section.s
@@ -4,9 +4,32 @@
 # RUN: rm -rf %t && split-file %s %t && cd %t
 # RUN: llvm-mc -filetype=obj -triple=x86_64 a.s -o a.o
 # RUN: llvm-mc -filetype=obj -triple=x86_64 b.s -o b.o
-# RUN: ld.lld -T a.lds a.o b.o -z undefs -o /dev/null 2>&1 | count 0
-# RUN: ld.lld -T a.lds a.o b.o -o /dev/null 2>&1 | count 0
-# RUN: ld.lld -r -T a.lds a.o b.o -o /dev/null 2>&1 | count 0
+# RUN: not ld.lld --threads=1 -T a.lds a.o b.o -z undefs -o /dev/null 2>&1 | FileCheck %s --check-prefix=SECTION --implicit-check-not=error:
+# RUN: not ld.lld --threads=1 -T a.lds a.o b.o -o /dev/null 2>&1 | FileCheck %s --check-prefixes=SECTION,SYMBOL --implicit-check-not=error:
+# RUN: ld.lld -r -T a.lds a.o b.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=WARNING --implicit-check-not=warning:
+
+# SECTION:      error: relocation refers to a discarded section: .aaa
+# SECTION-NEXT: >>> defined in a.o
+# SECTION-NEXT: >>> referenced by a.o:(.bbb+0x0)
+
+# SYMBOL:      error: relocation refers to a symbol in a discarded section: global
+# SYMBOL-NEXT: >>> defined in a.o
+# SYMBOL-NEXT: >>> referenced by b.o:(.data+0x0)
+
+# SYMBOL:      error: relocation refers to a symbol in a discarded section: weak
+# SYMBOL-NEXT: >>> defined in a.o
+# SYMBOL-NEXT: >>> referenced by b.o:(.data+0x8)
+
+# SYMBOL:      error: relocation refers to a symbol in a discarded section: weakref1
+# SYMBOL-NEXT: >>> defined in a.o
+# SYMBOL-NEXT: >>> referenced by b.o:(.data+0x10)
+
+# SYMBOL:      error: relocation refers to a symbol in a discarded section: weakref2
+# SYMBOL-NEXT: >>> defined in a.o
+# SYMBOL-NEXT: >>> referenced by b.o:(.data+0x18)
+
+# WARNING:      warning: relocation refers to a discarded section: .aaa
+# WARNING-NEXT: >>> referenced by a.o:(.rela.bbb+0x0)
 
 #--- a.s
 .globl _start

@github-actions
Copy link

github-actions bot commented Oct 17, 2023

✅ With the latest revision this PR passed the C/C++ code formatter.

Copy link
Contributor

@bevin-hansson bevin-hansson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, though I don't know how it might affect other parts of the linking than what we use downstream.

lld/ELF/Symbols.cpp Outdated Show resolved Hide resolved
lld/ELF/Driver.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@smithp35 smithp35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approach looks good to me, I've approved on my side.

lld/test/ELF/gc-sections-tls.s Outdated Show resolved Hide resolved
@MaskRay MaskRay force-pushed the lld-symbols-in-discard2 branch 2 times, most recently from b110660 to 0011a4f Compare October 17, 2023 19:06
MaskRay added a commit that referenced this pull request Oct 17, 2023
Check that #69295 will fix symbols referenced by relocations that are
defined in discarded sections.
MaskRay added a commit that referenced this pull request Oct 17, 2023
History of demoteSharedSymbols:

* https://reviews.llvm.org/D45536 demotes SharedSymbol
* https://reviews.llvm.org/D111365 demotes lazy symbols
* The pending #69295 will demote symbols defined in discarded sections

The pass is placed after markLive just to be clear that it needs `isNeeded`
information computed by markLive. The remaining passes in Driver.cpp do not use
symbol information. Move the pass to Writer.cpp to be closer to other
symbol-related passes.
@MaskRay
Copy link
Member Author

MaskRay commented Oct 17, 2023

Rebase

@MaskRay MaskRay force-pushed the lld-symbols-in-discard2 branch 2 times, most recently from e5ddadd to a838f5e Compare October 17, 2023 21:04
MaskRay added a commit that referenced this pull request Oct 17, 2023
…9295)

When an input section is matched by /DISCARD/ in a linker script, GNU ld
reports errors for relocations referencing symbols defined in the section:

    `.aaa' referenced in section `.bbb' of a.o: defined in discarded section `.aaa' of a.o

Implement the error by demoting eligible symbols to `Undefined` and changing
STB_WEAK to STB_GLOBAL. As a side benefit, in relocatable links, relocations
referencing symbols defined relative to /DISCARD/ discarded sections no longer
set symbol/type to zeros.

It's arguable whether a weak reference to a discarded symbol should lead to
errors. GNU ld reports an error and our demoting approach reports an error as
well.

Close #58891

Co-authored-by: Bevin Hansson <bevin.hansson@ericsson.com>
@MaskRay MaskRay closed this Oct 17, 2023
@MaskRay MaskRay deleted the lld-symbols-in-discard2 branch October 17, 2023 21:13
MaskRay added a commit that referenced this pull request Oct 17, 2023
One use of setSymbolAndType (related to https://reviews.llvm.org/D53864
"Do not crash when -r output uses linker script with `/DISCARD/`")
is no longer needed after commit 1981b1b
demotes symbols in discarded sections to Undefined.
MaskRay added a commit that referenced this pull request Oct 18, 2023
#69425)

Follow-up to #69295: In `Writer<ELFT>::run`, the symbol passes are
flexible:
they can be placed almost everywhere before `scanRelocations`, with a
constraint
that the `computeIsPreemptible` pass must be invoked for linker-defined
non-local symbols.

Merge copyLocalSymbols and demoteLocalSymbolsInDiscardedSections to
simplify
code:

* Demoting local symbols can be made unconditional, not constrainted to
/DISCARD/ uses due to performance concerns
* `includeInSymtab` can be made faster
* Make symbol passes close to each other
* Decrease data cache misses due to saving an iteration over local
symbols

There is no speedup, likely due to the unconditional `dr->section`
access in `demoteAndCopyLocalSymbols`.

`gc-sections-tls.s` no longer reports an error because the TLS symbol is
converted to an Undefined.
@MaskRay
Copy link
Member Author

MaskRay commented Oct 19, 2023

Demoting defined has another behavior change, which is unintended but IMO correct.
--no-allow-shlib-undefined checking is now improved as we now emit error: undefined reference due to --no-allow-shlib-undefined: _unresolved for the new RUN line below

+# RUN: not ld.lld --gc-sections %t.o %t.so %tdef.o -o /dev/null 2>&1 | FileCheck %s
--- i/lld/test/ELF/allow-shlib-undefined.s
+++ w/lld/test/ELF/allow-shlib-undefined.s
@@ -39,2 +39,5 @@

+# RUN: echo '.globl _unresolved; .hidden _unresolved; _unresolved:' | llvm-mc -filetype=obj -triple=x86_64- -o %tdef.o
+# RUN: not ld.lld --gc-sections %t.o %t.so %tdef.o -o /dev/null 2>&1 | FileCheck %s
+# RUN: ld.lld %t.o %t.so %tdef.o -o /dev/null 2>&1 | count 0
+
 .globl _start

The Defined _unresolved is demoted to Undefined, triggering the --no-allow-shlib-undefined diagnostic.
Before this patch, _unresolved remained Defined so the --no-allow-shlib-undefined diagnostic was suppressed.

The hidden visibility is important for the test. If we use STV_DEFAULT, _unresolved's exportDynamic bit will be set and MarkLive.cpp will make _unresolved a GC root, retaining the symbol.

@petrhosek
Copy link
Member

This broke Fuchsia ASan build which is now failing with the following error:

"../../prebuilt/third_party/clang/linux-x64/bin/lld" "-flavor" "gnu" "--build-id" "--hash-style=gnu" "-z" "max-page-size=4096" "-z" "now" "-z" "rodynamic" "-z" "separate-loadable-segments" "--pack-dyn-relocs=relr" "x64-asan-ubsan/gen/zircon/public/sysroot/cpp/lib/Scrt1.o" "/tmp/rustc9Y9zpL/symbols.o" "x64-asan-ubsan/exe.unstripped/openthread_lib_test.openthread_lib_test.7b20e9115c9ce23b-cgu.0.rcgu.o" "--as-needed" "-L" "x64-asan-ubsan/gen/zircon/public/sysroot/cpp/lib" "-L" "x64-asan-ubsan/obj/sdk/fidl/fuchsia.diagnostics/fuchsia.diagnostics_rust" "-L" "x64-asan-ubsan/obj/src/lib/fidl/rust/fidl" "-L" "x64-asan-ubsan/obj/src/lib/fuchsia-async" "-L" "host_x64/obj/src/lib/fuchsia-async-macro" "-L" "x64-asan-ubsan/obj/third_party/rust_crates" "-L" "host_x64/obj/third_party/rust_crates" "-L" "x64-asan-ubsan/obj/src/lib/zircon/rust" "-L" "x64-asan-ubsan/obj/zircon/vdso/zx_zither.rust_syscall" "-L" "x64-asan-ubsan/obj/sdk/fidl/fuchsia.mem/fuchsia.mem_rust" "-L" "x64-asan-ubsan/obj/zircon/vdso/zx/zx_rust" "-L" "x64-asan-ubsan/obj/sdk/fidl/fuchsia.lowpan.thread/fuchsia.lowpan.thread_rust" "-L" "x64-asan-ubsan/obj/sdk/fidl/fuchsia.lowpan/fuchsia.lowpan_rust" "-L" "x64-asan-ubsan/obj/sdk/fidl/fuchsia.net/fuchsia.net_rust" "-L" "x64-asan-ubsan/obj/src/connectivity/lowpan/lib/openthread_sys" "-L" "x64-asan-ubsan/obj/sdk/lib/syslog/cpp" "-L" "x64-asan-ubsan/obj/BUILD_DIR/fidling/gen/sdk/fidl/fuchsia.diagnostics.stream/fuchsia.diagnostics.stream/hlcpp/fuchsia/diagnostics/stream/cpp" "-L" "x64-asan-ubsan/obj/BUILD_DIR/fidling/gen/sdk/fidl/fuchsia.diagnostics.stream/fuchsia.diagnostics.stream/c" "-L" "x64-asan-ubsan/obj/BUILD_DIR/fidling/gen/sdk/fidl/fuchsia.diagnostics/fuchsia.diagnostics/hlcpp/fuchsia/diagnostics/cpp" "-L" "x64-asan-ubsan/obj/BUILD_DIR/fidling/gen/sdk/fidl/fuchsia.diagnostics/fuchsia.diagnostics/c" "-L" "x64-asan-ubsan/obj/BUILD_DIR/fidling/gen/sdk/fidl/fuchsia.mem/fuchsia.mem/hlcpp/fuchsia/mem/cpp" "-L" "x64-asan-ubsan/obj/BUILD_DIR/fidling/gen/sdk/fidl/fuchsia.mem/fuchsia.mem/c" "-L" "x64-asan-ubsan/obj/BUILD_DIR/fidling/gen/zircon/vdso/zx/zx/c" "-L" "x64-asan-ubsan/obj/sdk/lib/fidl/cpp/internal" "-L" "x64-asan-ubsan/obj/sdk/lib/fidl/cpp" "-L" "x64-asan-ubsan/obj/BUILD_DIR/fidling/gen/sdk/fidl/fuchsia.logger/fuchsia.logger/hlcpp/fuchsia/logger/cpp" "-L" "x64-asan-ubsan/obj/BUILD_DIR/fidling/gen/sdk/fidl/fuchsia.logger/fuchsia.logger/c" "-L" "x64-asan-ubsan/obj/sdk/lib/syslog/structured_backend/cpp" "-L" "user.libc_x64-asan-ubsan/obj/zircon/system/ulib/c" "-L" "x64-asan-ubsan/obj/third_party/openthread/src/cli" "-L" "x64-asan-ubsan/obj/third_party/openthread/src/core" "-L" "x64-asan-ubsan/obj/third_party/openthread/third_party/mbedtls" "-L" "x64-asan-ubsan/obj/third_party/openthread/src/ncp" "-L" "x64-asan-ubsan/obj/third_party/openthread/src/lib/spinel" "-L" "x64-asan-ubsan/obj/third_party/openthread/src/lib/platform" "-L" "x64-asan-ubsan-shared/link_stub" "-L" "x64-asan-ubsan/obj/sdk/lib/fit-promise" "-L" "x64-asan-ubsan/obj/sdk/lib/fit" "-L" "x64-asan-ubsan/obj/sdk/lib/stdcompat" "-L" "x64-asan-ubsan/obj/zircon/system/ulib/zx" "-L" "x64-asan-ubsan/obj/sdk/lib/fidl_base" "-L" "x64-asan-ubsan/obj/sdk/lib/utf-utils" "-L" "x64-asan-ubsan/obj/sdk/lib/fidl" "-L" "x64-asan-ubsan/obj/zircon/system/ulib/async" "-L" "x64-asan-ubsan/obj/zircon/system/ulib/async-loop" "-L" "x64-asan-ubsan/obj/zircon/system/ulib/sync" "-L" "x64-asan-ubsan/obj/build/config/sanitizers" "-L" "gen/src/zircon/lib/zircon/zircon.x86_64" "-L" "gen/zircon/system/ulib/c/c.x86_64" "-L" "../../build/config/zircon/libc-dummy" "-L" "../../prebuilt/third_party/rust/linux-x64/lib/rustlib/x86_64-fuchsia/lib" "-Bstatic" "/b/f/w/out/not-default/x64-asan-ubsan/obj/sdk/fidl/fuchsia.net/fuchsia.net_rust/libfidl_fuchsia_net.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libchrono-5f4599162f3bf073.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libserde-703d0860e891586d.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libtime-f3381b83c7164a8b.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libhex-67ad4b3000c63154.rlib" "-L" "../../prebuilt/third_party/rust/linux-x64/lib/rustlib/x86_64-fuchsia/lib" "-Bdynamic" "-ltest-6faa8927fb89bce3" "-Bstatic" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libanyhow-99a34437cafed13a.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libassert_matches-568351bf14d9d02.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/sdk/fidl/fuchsia.lowpan.thread/fuchsia.lowpan.thread_rust/libfidl_fuchsia_lowpan_thread.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/sdk/fidl/fuchsia.diagnostics/fuchsia.diagnostics_rust/libfidl_fuchsia_diagnostics.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/sdk/fidl/fuchsia.mem/fuchsia.mem_rust/libfidl_fuchsia_mem.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/src/lib/fidl/rust/fidl/libfidl.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/src/lib/fuchsia-async/libfuchsia_async.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libsocket2-eb52e051ac66cd02.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libthiserror-dcdc66d3bbb690d3.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libtracing-5bf51f3eb026ae27.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libtracing_core-81bafb5c25495bc2.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libonce_cell-283c53dba5ff9f5a.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libparking_lot_core-a7bb8576751f5ea9.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libsmallvec-2ac5f197ec7958a6.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/librustc_hash-d18fd5c05c7b0ca4.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libcrossbeam-8cfd474d0e0be27.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libcrossbeam_channel-4f2cca7fb0f4b481.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libcrossbeam_deque-6f0af594d373cabc.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libcrossbeam_queue-14b2ad0739ad313f.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libcrossbeam_epoch-5332a575293037f6.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libmemoffset-4f8761547d1c3d9f.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/liblazy_static-cdf593bd3fb3d68f.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libcrossbeam_utils-d51f793976478e1e.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/src/lib/zircon/rust/libfuchsia_zircon.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/zircon/vdso/zx_zither.rust_syscall/libfuchsia_zircon_sys.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libparking_lot-6721767503fecbee.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libparking_lot_core-32ade8d5cf038200.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libcfg_if-de3fee777d28505f.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libsmallvec-17cff5ddbac2d3b4.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libmaybe_uninit-fb89acfa5fdd5d93.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/liblock_api-12f3d9bb96757377.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libscopeguard-6ef302a7f864fbb3.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libfutures-e6516813fcd2ea59.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libfutures_executor-5454b73f7d5eee50.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libfutures_util-fde13ada8c10d5f9.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libmemchr-7c7563bbdbb1ab9.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libfutures_io-13ea868f3a902971.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libslab-bf82e5c05d7edc0d.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libfutures_channel-bbc95929c179c5c3.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libpin_project_lite-f819d22e1946203f.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libfutures_sink-3c76929821bf0d.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libfutures_task-176189a99c38d371.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libpin_utils-f6d0191654b565d6.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libfutures_core-328f95cc9ee7790f.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/src/lib/zircon/rust/libfuchsia_zircon_status.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/src/lib/zircon/rust/libfuchsia_zircon_types.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libzerocopy-ff9dd6de05140af4.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libbyteorder-eb0270683cf7e0fd.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libstatic_assertions-5fff9c36214c34b7.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libbitflags-d696f344bc6327ae.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libnum-bbbc48fd5d807e0a.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libnum_iter-a257411d06b07f30.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libnum_rational-dcc88f7010610c33.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libnum_complex-2c955e71eec8ce6e.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libnum_bigint-362cd991252bf6d3.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/librand-3acdc77c21a3a508.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/librand_chacha-fcec8b118d26a7b7.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libppv_lite86-e73b5df0490cc9a.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/librand_core-c72139d238b8db6b.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libgetrandom-a3378427d5ef87b9.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/liblibc-219d623e972ed388.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libcfg_if-5f200286e6ae9b7a.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libnum_integer-2a84ff8675296986.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/third_party/rust_crates/libnum_traits-eace97eec9f18ef0.rlib" "/b/f/w/out/not-default/x64-asan-ubsan/obj/src/connectivity/lowpan/lib/openthread_sys/libopenthread_sys.rlib" "-L" "../../prebuilt/third_party/rust/linux-x64/lib/rustlib/x86_64-fuchsia/lib" "-Bdynamic" "-lstd-20989b12d5b820fd" "-Bstatic" "../../prebuilt/third_party/rust/linux-x64/lib/rustlib/x86_64-fuchsia/lib/libcompiler_builtins-79a8aefee474261f.rlib" "-Bdynamic" "-lfdio" "-lzircon" "-lzircon" "-lc" "-lfdio" "-lzircon" "-lfdio" "-lc" "-lfdio" "--dynamic-linker=ld.so.1" "--eh-frame-hdr" "-z" "noexecstack" "-L" "../../prebuilt/third_party/rust/linux-x64/lib/rustlib/x86_64-fuchsia/lib" "-o" "x64-asan-ubsan/exe.unstripped/openthread_lib_test" "--gc-sections" "-pie" "--Map=x64-asan-ubsan/exe.unstripped/openthread_lib_test.map" "--sysroot=x64-asan-ubsan/gen/zircon/public/sysroot/cpp" "-L../../prebuilt/third_party/clang/linux-x64/bin/../lib/x86_64-unknown-fuchsia" "-L../../prebuilt/third_party/clang/linux-x64/lib/clang/18/lib/x86_64-unknown-fuchsia" "--pack-dyn-relocs=relr" "-dynamic-linker=ld.so.1" "--icf=all" "-zrel" "--compress-debug-sections=zstd" "-zstack-size=0x200000" "../../prebuilt/third_party/clang/linux-x64/lib/clang/18/lib/x86_64-unknown-fuchsia/libclang_rt.asan.so" "-dynamic-linker=asan/ld.so.1" "-dynamic-linker=asan-ubsan/ld.so.1" "--push-state" "-Bstatic" "-lc++" "-Bdynamic" "-lm" "--pop-state" "-l:libunwind.a" "-Bdynamic" "x64-asan-ubsan/obj/sdk/lib/syslog/cpp/backend_fuchsia_lib.fx_log_api.cc.o" "x64-asan-ubsan/obj/sdk/lib/syslog/cpp/backend_fuchsia_lib.logging_backend_fuchsia.cc.o" "x64-asan-ubsan/obj/sdk/lib/syslog/cpp/cpp.log_settings.cc.o" "x64-asan-ubsan/obj/sdk/lib/syslog/cpp/cpp.macros.cc.o" "x64-asan-ubsan/obj/BUILD_DIR/fidling/gen/sdk/fidl/fuchsia.diagnostics.stream/fuchsia.diagnostics.stream/hlcpp/fuchsia/diagnostics/stream/cpp/fuchsia.diagnostics.stream_hlcpp.fidl.cc.o" "x64-asan-ubsan/obj/BUILD_DIR/fidling/gen/sdk/fidl/fuchsia.diagnostics.stream/fuchsia.diagnostics.stream/c/fuchsia.diagnostics.stream_tables.fuchsia.diagnostics.stream.fidl.tables.c.o" "x64-asan-ubsan/obj/BUILD_DIR/fidling/gen/sdk/fidl/fuchsia.diagnostics/fuchsia.diagnostics/hlcpp/fuchsia/diagnostics/cpp/fuchsia.diagnostics_hlcpp.fidl.cc.o" "x64-asan-ubsan/obj/BUILD_DIR/fidling/gen/sdk/fidl/fuchsia.diagnostics/fuchsia.diagnostics/c/fuchsia.diagnostics_tables.fuchsia.diagnostics.fidl.tables.c.o" "x64-asan-ubsan/obj/BUILD_DIR/fidling/gen/sdk/fidl/fuchsia.mem/fuchsia.mem/hlcpp/fuchsia/mem/cpp/fuchsia.mem_hlcpp.fidl.cc.o" "x64-asan-ubsan/obj/BUILD_DIR/fidling/gen/sdk/fidl/fuchsia.mem/fuchsia.mem/c/fuchsia.mem_tables.fuchsia.mem.fidl.tables.c.o" "x64-asan-ubsan/obj/BUILD_DIR/fidling/gen/zircon/vdso/zx/zx/c/zx_tables.zx.fidl.tables.c.o" "x64-asan-ubsan/obj/sdk/lib/fidl/cpp/internal/cpp.message_handler.cc.o" "x64-asan-ubsan/obj/sdk/lib/fidl/cpp/internal/cpp.message_reader.cc.o" "x64-asan-ubsan/obj/sdk/lib/fidl/cpp/internal/cpp.pending_response.cc.o" "x64-asan-ubsan/obj/sdk/lib/fidl/cpp/internal/cpp.proxy.cc.o" "x64-asan-ubsan/obj/sdk/lib/fidl/cpp/internal/cpp.proxy_controller.cc.o" "x64-asan-ubsan/obj/sdk/lib/fidl/cpp/internal/cpp.stub.cc.o" "x64-asan-ubsan/obj/sdk/lib/fidl/cpp/internal/cpp.stub_controller.cc.o" "x64-asan-ubsan/obj/sdk/lib/fidl/cpp/internal/cpp.unknown_interactions_table.c.o" "x64-asan-ubsan/obj/sdk/lib/fidl/cpp/internal/cpp.weak_stub_controller.cc.o" "x64-asan-ubsan/obj/sdk/lib/fidl/cpp/cpp.unknown_interactions_hlcpp.cc.o" "x64-asan-ubsan/obj/sdk/lib/fidl/cpp/internal/cpp_sync.logging.cc.o" "x64-asan-ubsan/obj/sdk/lib/fidl/cpp/internal/cpp_sync.message_sender.cc.o" "x64-asan-ubsan/obj/sdk/lib/fidl/cpp/internal/cpp_sync.synchronous_proxy.cc.o" "x64-asan-ubsan/obj/sdk/lib/fidl/cpp/cpp_base.clone.cc.o" "x64-asan-ubsan/obj/sdk/lib/fidl/cpp/cpp_base.decoder.cc.o" "x64-asan-ubsan/obj/sdk/lib/fidl/cpp/cpp_base.encoder.cc.o" "x64-asan-ubsan/obj/sdk/lib/fidl/cpp/cpp_base.message.cc.o" "x64-asan-ubsan/obj/sdk/lib/fidl/cpp/cpp_base.message_buffer.cc.o" "x64-asan-ubsan/obj/BUILD_DIR/fidling/gen/sdk/fidl/fuchsia.logger/fuchsia.logger/hlcpp/fuchsia/logger/cpp/fuchsia.logger_hlcpp.fidl.cc.o" "x64-asan-ubsan/obj/BUILD_DIR/fidling/gen/sdk/fidl/fuchsia.logger/fuchsia.logger/c/fuchsia.logger_tables.fuchsia.logger.fidl.tables.c.o" "x64-asan-ubsan/obj/sdk/lib/syslog/structured_backend/cpp/structured_backend.fuchsia_syslog.cc.o" "user.libc_x64-asan-ubsan/obj/zircon/system/ulib/c/crt1.Scrt1.cc.o" "x64-asan-ubsan/obj/third_party/openthread/src/cli/libopenthread-cli-ftd.a" "x64-asan-ubsan/obj/third_party/openthread/src/core/libopenthread-ftd.a" "x64-asan-ubsan/obj/third_party/openthread/third_party/mbedtls/libmbedtls.a" "x64-asan-ubsan/obj/third_party/openthread/src/ncp/libopenthread-ncp-ftd.a" "x64-asan-ubsan/obj/third_party/openthread/src/lib/spinel/libopenthread-spinel-ncp.a" "x64-asan-ubsan/obj/third_party/openthread/src/lib/platform/libopenthread-platform.a" "x64-asan-ubsan-shared/link_stub/libbackend_fuchsia_globals.so" "x64-asan-ubsan/obj/sdk/lib/fit-promise/libfit-promise.a" "x64-asan-ubsan/obj/sdk/lib/fit/libfit.a" "x64-asan-ubsan/obj/sdk/lib/stdcompat/libstdcompat.a" "x64-asan-ubsan/obj/zircon/system/ulib/zx/libzx.a" "x64-asan-ubsan/obj/sdk/lib/fidl_base/libfidl_base.a" "x64-asan-ubsan/obj/sdk/lib/utf-utils/libutf-utils.a" "x64-asan-ubsan/obj/sdk/lib/fidl/libfidl.a" "x64-asan-ubsan/obj/zircon/system/ulib/async/libasync.a" "x64-asan-ubsan-shared/link_stub/libasync-default.so" "x64-asan-ubsan-shared/link_stub/libfdio.so" "x64-asan-ubsan/obj/zircon/system/ulib/async/libasync-cpp.a" "x64-asan-ubsan/obj/zircon/system/ulib/async-loop/libasync-loop-cpp.a" "x64-asan-ubsan/obj/zircon/system/ulib/async-loop/libasync-loop.a" "x64-asan-ubsan/obj/zircon/system/ulib/sync/libsync.a" "x64-asan-ubsan/obj/build/config/sanitizers/asan_default_options.a" "x64-asan-ubsan/obj/build/config/sanitizers/lsan_default_options.a" "x64-asan-ubsan/obj/build/config/sanitizers/ubsan_default_options.a" "gen/src/zircon/lib/zircon/zircon.x86_64/libzircon.so" "x64-asan-ubsan/obj/build/config/sanitizers/asan_default_options.sanitizer_default_options.c.o" "x64-asan-ubsan/obj/build/config/sanitizers/lsan_default_options.sanitizer_default_options.c.o" "x64-asan-ubsan/obj/build/config/sanitizers/ubsan_default_options.sanitizer_default_options.c.o" "gen/zircon/system/ulib/c/c.x86_64/libc.so"
  = note: lld: error: undefined reference due to --no-allow-shlib-undefined: operator new[](unsigned long)
          >>> referenced by x64-asan-ubsan-shared/link_stub/libfdio.so

I have uploaded the reproducer to https://storage.googleapis.com/fuchsia-build/undef-new-reference.tar.xz, would it be possible to take a look?

@petrhosek
Copy link
Member

@MaskRay would it be possible to revert this change while #69684 is being investigated?

@MaskRay
Copy link
Member Author

MaskRay commented Oct 23, 2023

@MaskRay would it be possible to revert this change while #69684 is being investigated?

I think the patch is correct and #69684 is a user error. That said, I also have internal users which may need time to migrate, so I will think more on the problem.

MaskRay added a commit to MaskRay/llvm-project that referenced this pull request Mar 14, 2024
 llvm#69295 demoted Defined symbols relative to discarded sections.
If such a symbol is unreferenced, the desired behavior is to
eliminate it from .symtab just like --gc-sections discarded
definitions.
Linux kernel's CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y configuration expects
that the unreferenced `unused` is not emitted to .symtab
(ClangBuiltLinux/linux#2006).

For relocations referencing demoted symbols, the symbol index restores
to 0 like older lld (`R_X86_64_64 0` in `discard-section.s`).

Fix llvm#85048
MaskRay added a commit that referenced this pull request Mar 14, 2024
…85167)

#69295 demoted Defined symbols relative to discarded sections.
If such a symbol is unreferenced, the desired behavior is to
eliminate it from .symtab just like --gc-sections discarded
definitions.
Linux kernel's CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y configuration expects
that the unreferenced `unused` is not emitted to .symtab
(ClangBuiltLinux/linux#2006).

For relocations referencing demoted symbols, the symbol index restores
to 0 like older lld (`R_X86_64_64 0` in `discard-section.s`).

Fix #85048
llvmbot pushed a commit to llvmbot/llvm-project that referenced this pull request Mar 14, 2024
…lvm#85167)

llvm#69295 demoted Defined symbols relative to discarded sections.
If such a symbol is unreferenced, the desired behavior is to
eliminate it from .symtab just like --gc-sections discarded
definitions.
Linux kernel's CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y configuration expects
that the unreferenced `unused` is not emitted to .symtab
(ClangBuiltLinux/linux#2006).

For relocations referencing demoted symbols, the symbol index restores
to 0 like older lld (`R_X86_64_64 0` in `discard-section.s`).

Fix llvm#85048

(cherry picked from commit 8fe3e70)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lld: no error for referenced symbols defined in sections discarded by linker script
5 participants