summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2017-11-28 18:02:22 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2017-11-28 18:02:22 +0000
commitb45c164fc25200afcf48fd5df8912a52319be3e5 (patch)
tree4cbec14a4f88a2a2e74d9ee63949fe522a4a6077
parentb3384001883afdf5d4fe7a1f52789386136f4a39 (diff)
downloadbcm5719-llvm-b45c164fc25200afcf48fd5df8912a52319be3e5.tar.gz
bcm5719-llvm-b45c164fc25200afcf48fd5df8912a52319be3e5.zip
Handle binding in --wrap.
Copying the binding seems reasonable and matches the bfd behavior. llvm-svn: 319196
-rw-r--r--lld/ELF/Symbols.cpp1
-rw-r--r--lld/test/ELF/Inputs/wrap.s4
-rw-r--r--lld/test/ELF/wrap.s6
3 files changed, 9 insertions, 2 deletions
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index 203551c37a7..3ee15b77d2d 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -141,7 +141,6 @@ void Symbol::copyFrom(Symbol *Other) {
Symbol Sym = *this;
memcpy(this, Other, sizeof(SymbolUnion));
- Binding = Sym.Binding;
VersionId = Sym.VersionId;
Visibility = Sym.Visibility;
IsUsedInRegularObj = Sym.IsUsedInRegularObj;
diff --git a/lld/test/ELF/Inputs/wrap.s b/lld/test/ELF/Inputs/wrap.s
index 584e27033d5..a5be8e8c067 100644
--- a/lld/test/ELF/Inputs/wrap.s
+++ b/lld/test/ELF/Inputs/wrap.s
@@ -1,4 +1,6 @@
-.globl foo, __wrap_foo, __real_foo
+.global foo
+.weak __wrap_foo
+.global __real_foo
foo = 0x11000
__wrap_foo = 0x11010
__real_foo = 0x11020
diff --git a/lld/test/ELF/wrap.s b/lld/test/ELF/wrap.s
index 22eba309d6a..e327cb21b3d 100644
--- a/lld/test/ELF/wrap.s
+++ b/lld/test/ELF/wrap.s
@@ -15,10 +15,16 @@
// RUN: llvm-readobj -t %t3 | FileCheck -check-prefix=SYM %s
// SYM: Name: foo
// SYM-NEXT: Value: 0x11000
+// SYM-NEXT: Size:
+// SYM-NEXT: Binding: Global
// SYM: Name: __wrap_foo
// SYM-NEXT: Value: 0x11010
+// SYM-NEXT: Size:
+// SYM-NEXT: Binding: Weak
// SYM: Name: __real_foo
// SYM-NEXT: Value: 0x11020
+// SYM-NEXT: Size:
+// SYM-NEXT: Binding: Global
.global _start
_start:
OpenPOWER on IntegriCloud