[lld] r315119 - Reland r315114, "ELF: Export preempted symbols even if there is a dynamic list." which was reverted in r315116.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 6 15:09:03 PDT 2017
Author: pcc
Date: Fri Oct 6 15:09:03 2017
New Revision: 315119
URL: http://llvm.org/viewvc/llvm-project?rev=315119&view=rev
Log:
Reland r315114, "ELF: Export preempted symbols even if there is a dynamic list." which was reverted in r315116.
I hadn't synced past the change that changed the default hash style
to --hash-style=both, so my test had the symbols in the wrong order.
Modified:
lld/trunk/ELF/Driver.cpp
lld/trunk/ELF/SymbolTable.cpp
lld/trunk/test/ELF/gc-sections-shared.s
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=315119&r1=315118&r2=315119&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Fri Oct 6 15:09:03 2017
@@ -790,18 +790,8 @@ void LinkerDriver::readConfigs(opt::Inpu
readDynamicList(*Buffer);
for (auto *Arg : Args.filtered(OPT_export_dynamic_symbol))
- Config->VersionScriptGlobals.push_back(
+ Config->DynamicList.push_back(
{Arg->getValue(), /*IsExternCpp*/ false, /*HasWildcard*/ false});
-
- // Dynamic lists are a simplified linker script that doesn't need the
- // "global:" and implicitly ends with a "local:*". Set the variables
- // needed to simulate that.
- if (Args.hasArg(OPT_dynamic_list) ||
- Args.hasArg(OPT_export_dynamic_symbol)) {
- Config->ExportDynamic = true;
- if (!Config->Shared)
- Config->DefaultSymbolVersion = VER_NDX_LOCAL;
- }
}
if (auto *Arg = Args.getLastArg(OPT_version_script))
Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=315119&r1=315118&r2=315119&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Fri Oct 6 15:09:03 2017
@@ -733,7 +733,7 @@ void SymbolTable::handleDynamicList() {
for (SymbolBody *B : Syms) {
if (!Config->Shared)
- B->symbol()->VersionId = VER_NDX_GLOBAL;
+ B->symbol()->ExportDynamic = true;
else if (B->symbol()->includeInDynsym())
B->IsPreemptible = true;
}
Modified: lld/trunk/test/ELF/gc-sections-shared.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/gc-sections-shared.s?rev=315119&r1=315118&r2=315119&view=diff
==============================================================================
--- lld/trunk/test/ELF/gc-sections-shared.s (original)
+++ lld/trunk/test/ELF/gc-sections-shared.s Fri Oct 6 15:09:03 2017
@@ -19,13 +19,13 @@
# CHECK-NEXT: Section: Undefined (0x0)
# CHECK-NEXT: }
# CHECK-NEXT: Symbol {
-# CHECK-NEXT: Name: bar2
+# CHECK-NEXT: Name: bar
# CHECK-NEXT: Value:
# CHECK-NEXT: Size:
# CHECK-NEXT: Binding: Global
# CHECK-NEXT: Type:
# CHECK-NEXT: Other:
-# CHECK-NEXT: Section: Undefined
+# CHECK-NEXT: Section: .text
# CHECK-NEXT: }
# CHECK-NEXT: Symbol {
# CHECK-NEXT: Name: foo
@@ -36,6 +36,15 @@
# CHECK-NEXT: Other:
# CHECK-NEXT: Section: .text
# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: bar2
+# CHECK-NEXT: Value:
+# CHECK-NEXT: Size:
+# CHECK-NEXT: Binding: Global
+# CHECK-NEXT: Type:
+# CHECK-NEXT: Other:
+# CHECK-NEXT: Section: Undefined
+# CHECK-NEXT: }
# CHECK-NEXT: ]
# CHECK: NEEDED Shared library: [{{.*}}.so]
More information about the llvm-commits
mailing list