--wrap with a wrapper function from a DSO fails
| Bugzilla Link | 47017 |
| Resolution | FIXED |
| Resolved on | Aug 10, 2020 02:31 |
| Version | unspecified |
| OS | All |
| Attachments | Test to reproduce issue. |
| CC | @MaskRay,@smithp35 |
Extended Description
Since the commit "[ELF] --wrap: set isUsedInRegularObj of _wrap only if it is defined" (https://github.com/llvm/llvm-project/commit/e281376e996e37fb6411363510e917b5b2c53c89), which fixed llvm/llvm-project#45514 , --wrap with a wrapper function from a DSO no longer works.
I have attached the test 'wrap-shared.s' to reproduce the issue.
Thanks for fixing this.
I noticed another problem: in the new test in wrap-shlib-undefined.s, GNU ld does not add an undefined
barin .dynsym
Fixed by 0334578edc60ad8a7455e7b76e41901376245b56
I spent more time studying --wrap. We still have behavior differences with GNU ld and gold, but I think our approach is superior. Filed https://sourceware.org/bugzilla/show_bug.cgi?id=26358 --wrap: the special rule for "undefined symbol" is incompatible with -flto or relocatable links
Thanks, fixed by 99cd56906a4dd00db25b045eccddcb6802d39f8d [ELF] --wrap: set isUsedInRegularObj of _wrap if it is defined or shared
I noticed another problem: in the new test in wrap-shlib-undefined.s, GNU ld does not add an undefined bar in .dynsym