mirror of
https://github.com/intel/llvm.git
synced 2026-01-24 08:30:34 +08:00
Handle empty dynamic lists.
llvm-svn: 312820
This commit is contained in:
@@ -126,6 +126,7 @@ struct Configuration {
|
||||
bool GcSections;
|
||||
bool GdbIndex;
|
||||
bool GnuHash;
|
||||
bool HasDynamicList = false;
|
||||
bool ICF;
|
||||
bool MipsN32Abi = false;
|
||||
bool NoGnuUnique;
|
||||
|
||||
@@ -180,6 +180,7 @@ static ExprValue bitOr(ExprValue A, ExprValue B) {
|
||||
}
|
||||
|
||||
void ScriptParser::readDynamicList() {
|
||||
Config->HasDynamicList = true;
|
||||
expect("{");
|
||||
std::vector<SymbolVersion> Locals;
|
||||
std::vector<SymbolVersion> Globals;
|
||||
|
||||
@@ -1244,7 +1244,7 @@ static bool computeIsPreemptible(const SymbolBody &B) {
|
||||
return true;
|
||||
|
||||
// If we have a dynamic list it specifies which local symbols are preemptible.
|
||||
if (!Config->DynamicList.empty())
|
||||
if (Config->HasDynamicList)
|
||||
return false;
|
||||
|
||||
if (!Config->Shared)
|
||||
|
||||
18
lld/test/ELF/dynamic-list-empty.s
Normal file
18
lld/test/ELF/dynamic-list-empty.s
Normal file
@@ -0,0 +1,18 @@
|
||||
# REQUIRES: x86
|
||||
|
||||
# BFD reports a parse error on empty lists, but it is clear how to
|
||||
# handle it.
|
||||
|
||||
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
|
||||
# RUN: echo "{ };" > %t.list
|
||||
# RUN: ld.lld -dynamic-list %t.list -shared %t.o -o %t.so
|
||||
# RUN: llvm-readobj -r %t.so | FileCheck %s
|
||||
|
||||
# CHECK: Relocations [
|
||||
# CHECK-NEXT: ]
|
||||
|
||||
.globl foo
|
||||
foo:
|
||||
ret
|
||||
|
||||
call foo@PLT
|
||||
Reference in New Issue
Block a user