[lld] r322580 - Fix another case we were using the wrong visibility.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 16 10:21:23 PST 2018
Author: rafael
Date: Tue Jan 16 10:21:23 2018
New Revision: 322580
URL: http://llvm.org/viewvc/llvm-project?rev=322580&view=rev
Log:
Fix another case we were using the wrong visibility.
Added:
lld/trunk/test/ELF/Inputs/undef-shared2.s
lld/trunk/test/ELF/undef-shared2.s
Modified:
lld/trunk/ELF/Relocations.cpp
Modified: lld/trunk/ELF/Relocations.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.cpp?rev=322580&r1=322579&r2=322580&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.cpp (original)
+++ lld/trunk/ELF/Relocations.cpp Tue Jan 16 10:21:23 2018
@@ -613,7 +613,7 @@ static bool maybeReportUndefined(Symbol
return false;
bool CanBeExternal =
- Sym.computeBinding() != STB_LOCAL && Sym.getVisibility() == STV_DEFAULT;
+ Sym.computeBinding() != STB_LOCAL && Sym.Visibility == STV_DEFAULT;
if (Config->UnresolvedSymbols == UnresolvedPolicy::Ignore && CanBeExternal)
return false;
Added: lld/trunk/test/ELF/Inputs/undef-shared2.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/Inputs/undef-shared2.s?rev=322580&view=auto
==============================================================================
--- lld/trunk/test/ELF/Inputs/undef-shared2.s (added)
+++ lld/trunk/test/ELF/Inputs/undef-shared2.s Tue Jan 16 10:21:23 2018
@@ -0,0 +1,2 @@
+.data
+.quad foo
Added: lld/trunk/test/ELF/undef-shared2.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/undef-shared2.s?rev=322580&view=auto
==============================================================================
--- lld/trunk/test/ELF/undef-shared2.s (added)
+++ lld/trunk/test/ELF/undef-shared2.s Tue Jan 16 10:21:23 2018
@@ -0,0 +1,10 @@
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/undef-shared2.s -o %t2.o
+# RUN: not ld.lld %t.o %t2.o -o %t.so -shared 2>&1 | FileCheck %s
+# RUN: not ld.lld %t2.o %t.o -o %t.so -shared 2>&1 | FileCheck %s
+
+# CHECK: error: undefined symbol: foo
+
+.data
+.quad foo
+.protected foo
More information about the llvm-commits
mailing list