[LLD][ELF] --wrap: __real_foo references should trigger archive extraction for foo
authorBen Dunbobbin <Ben.Dunbobbin@sony.com>
Tue, 18 Oct 2022 11:47:56 +0000 (12:47 +0100)
committerBen Dunbobbin <Ben.Dunbobbin@sony.com>
Tue, 18 Oct 2022 11:53:06 +0000 (12:53 +0100)
commit13816e0358123baa411419048a9ce5c432ddab55
tree9247fbab8c512081e6c001766544919f6fc84dd1
parente7fc7540daa9333f0be4f380fc9c619236d17f57
[LLD][ELF] --wrap: __real_foo references should trigger archive extraction for foo

A reference to __real_foo should trigger archive extraction of the input file that defines foo, otherwise a link using --wrap=foo might fail to link with an undefined reference to foo.
This matches bfd linker behaviour.

Differential Revision: https://reviews.llvm.org/D135897
lld/ELF/Driver.cpp
lld/test/ELF/wrap-extract-real.ll [new file with mode: 0644]
lld/test/ELF/wrap-extract-real.s [new file with mode: 0644]