[libc-commits] [PATCH] D145898: [libc] Declare __dso_handle in the integration test instead of startup.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Mar 13 00:47:46 PDT 2023


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5b1ad43c2b40: [libc] Declare __dso_handle in the integration test instead of startup. (authored by sivachandra).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145898

Files:
  libc/startup/linux/aarch64/start.cpp
  libc/startup/linux/riscv64/start.cpp
  libc/startup/linux/x86_64/start.cpp
  libc/test/IntegrationTest/test.cpp


Index: libc/test/IntegrationTest/test.cpp
===================================================================
--- libc/test/IntegrationTest/test.cpp
+++ libc/test/IntegrationTest/test.cpp
@@ -34,4 +34,7 @@
   return malloc(s);
 }
 
+// Integration tests are linked with -nostdlib. BFD linker expects
+// __dso_handle when -nostdlib is used.
+void *__dso_handle = nullptr;
 } // extern "C"
Index: libc/startup/linux/x86_64/start.cpp
===================================================================
--- libc/startup/linux/x86_64/start.cpp
+++ libc/startup/linux/x86_64/start.cpp
@@ -22,9 +22,6 @@
 #include <unistd.h>
 
 extern "C" int main(int, char **, char **);
-// The BFD linker requires a reference to __dso_handle to trigger creating
-// a symbol for it when -nostdlib is used..
-extern "C" void *__dso_handle = nullptr;
 
 namespace __llvm_libc {
 
Index: libc/startup/linux/riscv64/start.cpp
===================================================================
--- libc/startup/linux/riscv64/start.cpp
+++ libc/startup/linux/riscv64/start.cpp
@@ -21,9 +21,6 @@
 #include <unistd.h>
 
 extern "C" int main(int, char **, char **);
-// The BFD linker requires a reference to __dso_handle to trigger creating
-// a symbol for it when -nostdlib is used..
-extern "C" void *__dso_handle = nullptr;
 
 namespace __llvm_libc {
 
Index: libc/startup/linux/aarch64/start.cpp
===================================================================
--- libc/startup/linux/aarch64/start.cpp
+++ libc/startup/linux/aarch64/start.cpp
@@ -23,9 +23,6 @@
 #include <unistd.h>
 
 extern "C" int main(int, char **, char **);
-// The BFD linker requires a reference to __dso_handle to trigger creating
-// a symbol for it when -nostdlib is used..
-extern "C" void *__dso_handle = nullptr;
 
 // Source documentation:
 // https://github.com/ARM-software/abi-aa/tree/main/sysvabi64


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145898.504530.patch
Type: text/x-patch
Size: 1864 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230313/83d02982/attachment-0001.bin>


More information about the libc-commits mailing list