This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][AArch64] elf toolchain does not pass -shared linker option
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Marcus Shawcroft <marcus dot shawcroft at arm dot com>
- Date: Wed, 22 Jul 2015 18:22:15 +0100
- Subject: [PATCH][AArch64] elf toolchain does not pass -shared linker option
- Authentication-results: sourceware.org; auth=none
Valid linker options should be treated for elf consistently
with the linux-gnu target.
I'm not sure about the undocumented -h option (blindly copied
LINUX_TARGET_LINK_SPEC from aarch64-linux without the
dynamic-linker flag).
(Not passing -shared can cause broken vdso.so in the linux
kernel when it is built with the elf toolchain.)
2015-07-22 Szabolcs Nagy <szabolcs.nagy@arm.com>
* config/aarch64/aarch64-elf-raw.h (LINK_SPEC): Handle -h, -static,
-shared, -symbolic, -rdynamic.
diff --git a/gcc/config/aarch64/aarch64-elf-raw.h b/gcc/config/aarch64/aarch64-elf-raw.h
index bd5e51c..d8c682f 100644
--- a/gcc/config/aarch64/aarch64-elf-raw.h
+++ b/gcc/config/aarch64/aarch64-elf-raw.h
@@ -44,7 +44,12 @@
#endif
#ifndef LINK_SPEC
-#define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} -X \
+#define LINK_SPEC "%{h*} \
+ %{static:-Bstatic} \
+ %{shared:-shared} \
+ %{symbolic:-Bsymbolic} \
+ %{!static:%{rdynamic:-export-dynamic}} \
+ %{mbig-endian:-EB} %{mlittle-endian:-EL} -X \
-maarch64elf%{mabi=ilp32*:32}%{mbig-endian:b}" \
CA53_ERR_835769_SPEC \
CA53_ERR_843419_SPEC