summaryrefslogtreecommitdiff
path: root/libc/startup
diff options
context:
space:
mode:
authorSiva Chandra Reddy <sivachandra@google.com>2023-03-12 08:21:50 +0000
committerSiva Chandra Reddy <sivachandra@google.com>2023-03-13 07:47:00 +0000
commit5b1ad43c2b40896efb06736a9ee4399dbda91fee (patch)
tree6f2180eb558714f7b48d3e96de41af1cef58e0a6 /libc/startup
parentbb53249884367d4d8fb6a52bf248e02e5a0cc2df (diff)
downloadllvm-5b1ad43c2b40896efb06736a9ee4399dbda91fee.tar.gz
[libc] Declare __dso_handle in the integration test instead of startup.
Fixes #61355. The __dso_handle decl was introduced incorrectly into the startup objects during the integration test cleanup which moved the integration tests away from using an artificial sysroot to using -nostdlib. Having it in the startup creates the duplicate symbol error when one does not use -nostdlib. Since this is an integration test only problem, it is meaningful to keep it in the integration test anyway. Differential Revision: https://reviews.llvm.org/D145898
Diffstat (limited to 'libc/startup')
-rw-r--r--libc/startup/linux/aarch64/start.cpp3
-rw-r--r--libc/startup/linux/riscv64/start.cpp3
-rw-r--r--libc/startup/linux/x86_64/start.cpp3
3 files changed, 0 insertions, 9 deletions
diff --git a/libc/startup/linux/aarch64/start.cpp b/libc/startup/linux/aarch64/start.cpp
index 389682279956..b02ea7d3a613 100644
--- a/libc/startup/linux/aarch64/start.cpp
+++ b/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
diff --git a/libc/startup/linux/riscv64/start.cpp b/libc/startup/linux/riscv64/start.cpp
index c65407d06d64..068658c4d033 100644
--- a/libc/startup/linux/riscv64/start.cpp
+++ b/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 {
diff --git a/libc/startup/linux/x86_64/start.cpp b/libc/startup/linux/x86_64/start.cpp
index 666cfeb65751..15d5de59d42c 100644
--- a/libc/startup/linux/x86_64/start.cpp
+++ b/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 {