https://bugs.llvm.org/show_bug.cgi?id=33145
Bug ID: 33145
Summary: --wrap doesn't work with lto
Product: lld
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: ELF
Assignee: unassignedb...@nondot.org
Reporter: rafael.espind...@gmail.com
CC: llvm-bugs@lists.llvm.org
Created attachment 18498
--> https://bugs.llvm.org/attachment.cgi?id=18498&action=edit
testcase
In the included testcase we have
void foo() {
bar();
__real_bar();
}
When linking without lto, we get
0000000000001000 <foo>:
1000: 50 push %rax
1001: 31 c0 xor %eax,%eax
1003: e8 28 00 00 00 callq 1030 <__wrap_bar@plt>
1008: 31 c0 xor %eax,%eax
100a: 59 pop %rcx
100b: e9 30 00 00 00 jmpq 1040 <bar@plt>
Which is what is expected.
With lto we get
0000000000001000 <foo>:
1000: 50 push %rax
1001: 31 c0 xor %eax,%eax
1003: e8 28 00 00 00 callq 1030 <this_is_bar@plt>
1008: 31 c0 xor %eax,%eax
100a: 59 pop %rcx
100b: e9 30 00 00 00 jmpq 1040 <this_is_real_bar@plt>
Showing that bar and __real_bar were inlined before the wrapping.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs