forked from OSchip/llvm-project
A weak reference to a symbol that is only weakly referenced in
dependencies should remain weak, not get promoted to undef or dropped. llvm-svn: 189793
This commit is contained in:
parent
1ecb96f652
commit
7d5aed5ce5
|
@ -57,7 +57,9 @@ public:
|
|||
if (i->st_shndx == llvm::ELF::SHN_ABS)
|
||||
continue;
|
||||
|
||||
if (useShlibUndefines && (i->st_shndx == llvm::ELF::SHN_UNDEF)) {
|
||||
if (i->st_shndx == llvm::ELF::SHN_UNDEF) {
|
||||
if (!useShlibUndefines)
|
||||
continue;
|
||||
// Create an undefined atom.
|
||||
if (!name->empty()) {
|
||||
auto *newAtom =
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,7 @@
|
|||
# Tests that a weak reference remains a weak reference,
|
||||
# even if a shared library defines the symbol weak as well.
|
||||
|
||||
RUN: lld -flavor gnu -target x86_64 -shared %p/Inputs/weaksym.o -L%p/Inputs -lweaksym -o %t1
|
||||
RUN: llvm-nm -n %t1 | FileCheck -check-prefix CHECKSYMS %s
|
||||
|
||||
CHECKSYMS: w weaksym
|
Loading…
Reference in New Issue