diff options
-rw-r--r-- | lld/ELF/Driver.cpp | 12 | ||||
-rw-r--r-- | lld/ELF/SymbolTable.cpp | 2 | ||||
-rw-r--r-- | lld/test/ELF/gc-sections-shared.s | 9 |
3 files changed, 11 insertions, 12 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index 0a003ee6225..c259a172084 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -790,18 +790,8 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args) { 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)) diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp index 2564c677fe4..2f90043d3ba 100644 --- a/lld/ELF/SymbolTable.cpp +++ b/lld/ELF/SymbolTable.cpp @@ -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; } diff --git a/lld/test/ELF/gc-sections-shared.s b/lld/test/ELF/gc-sections-shared.s index efb21faee6b..ffb4219e832 100644 --- a/lld/test/ELF/gc-sections-shared.s +++ b/lld/test/ELF/gc-sections-shared.s @@ -19,6 +19,15 @@ # CHECK-NEXT: Section: Undefined (0x0) # CHECK-NEXT: } # CHECK-NEXT: Symbol { +# CHECK-NEXT: Name: bar +# CHECK-NEXT: Value: +# CHECK-NEXT: Size: +# CHECK-NEXT: Binding: Global +# CHECK-NEXT: Type: +# CHECK-NEXT: Other: +# CHECK-NEXT: Section: .text +# CHECK-NEXT: } +# CHECK-NEXT: Symbol { # CHECK-NEXT: Name: bar2 # CHECK-NEXT: Value: # CHECK-NEXT: Size: |