Handle binding in --wrap.

Copying the binding seems reasonable and matches the bfd behavior.

llvm-svn: 319196
This commit is contained in:
Rafael Espindola 2017-11-28 18:02:22 +00:00
parent b338400188
commit b45c164fc2
3 changed files with 9 additions and 2 deletions

View File

@ -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;

View File

@ -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

View File

@ -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: