public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: Marcus Shawcroft <marcus.shawcroft@arm.com>
Subject: [PATCH][AArch64] elf toolchain does not pass -shared linker option
Date: Wed, 22 Jul 2015 17:33:00 -0000	[thread overview]
Message-ID: <55AFD147.4010106@arm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 503 bytes --]

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.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: elf-link-spec-2.diff --]
[-- Type: text/x-patch; name=elf-link-spec-2.diff, Size: 650 bytes --]

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

             reply	other threads:[~2015-07-22 17:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-22 17:33 Szabolcs Nagy [this message]
2015-07-24 13:46 ` Marcus Shawcroft
2015-07-24 16:30   ` Szabolcs Nagy
2015-08-05 11:49     ` Christophe Lyon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55AFD147.4010106@arm.com \
    --to=szabolcs.nagy@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=marcus.shawcroft@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).