mirror of
https://github.com/intel/llvm.git
synced 2026-01-25 01:07:04 +08:00
Don't produce a duplicated __wrap_foo if there is no __real_foo.
This fixes a regression from r317426. llvm-svn: 317956
This commit is contained in:
@@ -196,11 +196,11 @@ void SymbolTable::applySymbolWrap() {
|
||||
W.Sym->copyFrom(W.Wrap);
|
||||
W.Sym->Binding = W.SymBinding;
|
||||
|
||||
if (Real) {
|
||||
// We now have two copies of __wrap_sym. Drop one.
|
||||
W.Wrap->IsUsedInRegularObj = false;
|
||||
// We now have two copies of __wrap_sym. Drop one.
|
||||
W.Wrap->IsUsedInRegularObj = false;
|
||||
|
||||
if (Real)
|
||||
SymVector.push_back(Real);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,13 +16,59 @@
|
||||
// CHECK-NEXT: movl $0x11000, %edx
|
||||
|
||||
// RUN: llvm-readobj -t %t | FileCheck -check-prefix=SYM %s
|
||||
// SYM-NOT: Name: __real_foo
|
||||
// SYM: Name: foo
|
||||
// SYM-NEXT: Value: 0x11000
|
||||
// SYM-NOT: Name: __real_foo
|
||||
// SYM: Name: __wrap_foo
|
||||
// SYM-NEXT: Value: 0x11010
|
||||
// SYM-NOT: Name: __real_foo
|
||||
|
||||
// Test the full symbol table. It is verbose, but lld at times
|
||||
// produced duplicated symbols which are hard to test otherwise.
|
||||
|
||||
// SYM: Symbols [
|
||||
// SYM-NEXT: Symbol {
|
||||
// SYM-NEXT: Name: (0)
|
||||
// SYM-NEXT: Value:
|
||||
// SYM-NEXT: Size:
|
||||
// SYM-NEXT: Binding:
|
||||
// SYM-NEXT: Type
|
||||
// SYM-NEXT: Other:
|
||||
// SYM-NEXT: Section:
|
||||
// SYM-NEXT: }
|
||||
// SYM-NEXT: Symbol {
|
||||
// SYM-NEXT: Name: _DYNAMIC
|
||||
// SYM-NEXT: Value:
|
||||
// SYM-NEXT: Size:
|
||||
// SYM-NEXT: Binding:
|
||||
// SYM-NEXT: Type:
|
||||
// SYM-NEXT: Other [
|
||||
// SYM-NEXT: STV_HIDDEN
|
||||
// SYM-NEXT: ]
|
||||
// SYM-NEXT: Section: .dynamic
|
||||
// SYM-NEXT: }
|
||||
// SYM-NEXT: Symbol {
|
||||
// SYM-NEXT: Name: foo
|
||||
// SYM-NEXT: Value: 0x11000
|
||||
// SYM-NEXT: Size:
|
||||
// SYM-NEXT: Binding:
|
||||
// SYM-NEXT: Type:
|
||||
// SYM-NEXT: Other:
|
||||
// SYM-NEXT: Section:
|
||||
// SYM-NEXT: }
|
||||
// SYM-NEXT: Symbol {
|
||||
// SYM-NEXT: Name: _start
|
||||
// SYM-NEXT: Value:
|
||||
// SYM-NEXT: Size:
|
||||
// SYM-NEXT: Binding:
|
||||
// SYM-NEXT: Type
|
||||
// SYM-NEXT: Other:
|
||||
// SYM-NEXT: Section:
|
||||
// SYM-NEXT: }
|
||||
// SYM-NEXT: Symbol {
|
||||
// SYM-NEXT: Name: __wrap_foo
|
||||
// SYM-NEXT: Value: 0x11010
|
||||
// SYM-NEXT: Size:
|
||||
// SYM-NEXT: Binding:
|
||||
// SYM-NEXT: Type:
|
||||
// SYM-NEXT: Other:
|
||||
// SYM-NEXT: Section:
|
||||
// SYM-NEXT: }
|
||||
// SYM-NEXT: ]
|
||||
|
||||
.global _start
|
||||
_start:
|
||||
|
||||
Reference in New Issue
Block a user