diff options
Diffstat (limited to 'lld/ELF/Driver.cpp')
-rw-r--r-- | lld/ELF/Driver.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index 5c561610ad0..244e8e1f8a8 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -1080,6 +1080,11 @@ template <class ELFT> void LinkerDriver::link(opt::InputArgList &Args) { if (errorCount()) return; + // We want to declare linker script's symbols early, + // so that we can version them. + // They also might be exported if referenced by DSOs. + Script->declareSymbols(); + // Handle undefined symbols in DSOs. if (!Config->Shared) Symtab->scanShlibUndefined<ELFT>(); @@ -1097,10 +1102,6 @@ template <class ELFT> void LinkerDriver::link(opt::InputArgList &Args) { if (!Config->Relocatable) addReservedSymbols(); - // We want to declare linker script's symbols early, - // so that we can version them. - Script->declareSymbols(); - // Apply version scripts. // // For a relocatable output, version scripts don't make sense, and |