[lld] r319196 - Handle binding in --wrap.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 28 10:02:22 PST 2017
Author: rafael
Date: Tue Nov 28 10:02:22 2017
New Revision: 319196
URL: http://llvm.org/viewvc/llvm-project?rev=319196&view=rev
Log:
Handle binding in --wrap.
Copying the binding seems reasonable and matches the bfd behavior.
Modified:
lld/trunk/ELF/Symbols.cpp
lld/trunk/test/ELF/Inputs/wrap.s
lld/trunk/test/ELF/wrap.s
Modified: lld/trunk/ELF/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.cpp?rev=319196&r1=319195&r2=319196&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.cpp (original)
+++ lld/trunk/ELF/Symbols.cpp Tue Nov 28 10:02:22 2017
@@ -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;
Modified: lld/trunk/test/ELF/Inputs/wrap.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/Inputs/wrap.s?rev=319196&r1=319195&r2=319196&view=diff
==============================================================================
--- lld/trunk/test/ELF/Inputs/wrap.s (original)
+++ lld/trunk/test/ELF/Inputs/wrap.s Tue Nov 28 10:02:22 2017
@@ -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
Modified: lld/trunk/test/ELF/wrap.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/wrap.s?rev=319196&r1=319195&r2=319196&view=diff
==============================================================================
--- lld/trunk/test/ELF/wrap.s (original)
+++ lld/trunk/test/ELF/wrap.s Tue Nov 28 10:02:22 2017
@@ -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:
More information about the llvm-commits
mailing list