Index: lld/trunk/ELF/Driver.cpp =================================================================== --- lld/trunk/ELF/Driver.cpp +++ lld/trunk/ELF/Driver.cpp @@ -643,7 +643,7 @@ for (auto *Arg : Args.filtered(OPT_undefined)) Config->Undefined.push_back(Arg->getValue()); - if (auto *Arg = Args.getLastArg(OPT_dynamic_list)) + for (auto *Arg : Args.filtered(OPT_dynamic_list)) if (Optional Buffer = readFile(Arg->getValue())) readDynamicList(*Buffer); Index: lld/trunk/ELF/LinkerScript.cpp =================================================================== --- lld/trunk/ELF/LinkerScript.cpp +++ lld/trunk/ELF/LinkerScript.cpp @@ -1942,7 +1942,8 @@ if (peek() != "local") { if (consume("global")) expect(":"); - Config->VersionScriptGlobals = readSymbols(); + for (SymbolVersion V : readSymbols()) + Config->VersionScriptGlobals.push_back(V); } readLocals(); expect("}"); Index: lld/trunk/test/ELF/dynamic-list.s =================================================================== --- lld/trunk/test/ELF/dynamic-list.s +++ lld/trunk/test/ELF/dynamic-list.s @@ -51,6 +51,10 @@ # RUN: echo "{ foo1; foo2; foo31; };" > %t.list # RUN: ld.lld --dynamic-list %t.list %t %t2.so -o %t.exe # RUN: llvm-readobj -dyn-symbols %t.exe | FileCheck -check-prefix=CHECK2 %s +# RUN: echo "{ foo1; foo2; };" > %t1.list +# RUN: echo "{ foo31; };" > %t2.list +# RUN: ld.lld --dynamic-list %t1.list --dynamic-list %t2.list %t %t2.so -o %t.exe +# RUN: llvm-readobj -dyn-symbols %t.exe | FileCheck -check-prefix=CHECK2 %s # CHECK2: DynamicSymbols [ # CHECK2-NEXT: Symbol {