[PATCH] D135897: [LLD][ELF] --wrap: __real_foo references should trigger archive extraction for foo

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 14 15:00:08 PDT 2022


MaskRay accepted this revision.
MaskRay added a comment.
This revision is now accepted and ready to land.

The new semantics look good.



================
Comment at: lld/ELF/Driver.cpp:2249
+
+    // If there is a reference to __real_ pull in the symbol being wrapped.
+    // Do this after processing the __wrap_ symbol as that may have referenced
----------------
`If __real_ is referenced, pull in the symbol if it is lazy`


================
Comment at: lld/test/ELF/wrap-extract-real.s:17
+# REAL-NEXT:        {{.*}}               0 NOTYPE  LOCAL  DEFAULT   UND
+# REAL-NEXT:        {{.*}}               0 NOTYPE  GLOBAL DEFAULT     1 _start
+# REAL-NEXT:        {{.*}}               0 NOTYPE  GLOBAL DEFAULT     1 foo
----------------
1 => `[[#]]`


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135897/new/

https://reviews.llvm.org/D135897



More information about the llvm-commits mailing list