diff mbox

[AArch64] Fix LINUX_TARGET_LINK_SPEC to be consistent with ARM

Message ID 55AFCF1F.20000@arm.com
State New
Headers show

Commit Message

Szabolcs Nagy July 22, 2015, 5:13 p.m. UTC
Same as
https://gcc.gnu.org/ml/gcc-patches/2015-04/msg01387.html
but for AArch64.

-dynamic-linker is only passed to the linker if !static && !shared.

-rdynamic handling is changed too to be consistent with arm:
only pass -export-dynamic if !static.

2015-07-22  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	PR target/65711
	* config/aarch64/aarch64-linux.h (LINUX_TARGET_LINK_SPEC): Move
	-dynamic-linker within %{!static %{!shared, and -rdynamic within
	%{!static.

Comments

Marcus Shawcroft July 24, 2015, 12:50 p.m. UTC | #1
On 22 July 2015 at 18:13, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
> Same as
> https://gcc.gnu.org/ml/gcc-patches/2015-04/msg01387.html
> but for AArch64.
>
> -dynamic-linker is only passed to the linker if !static && !shared.
>
> -rdynamic handling is changed too to be consistent with arm:
> only pass -export-dynamic if !static.
>
> 2015-07-22  Szabolcs Nagy  <szabolcs.nagy@arm.com>
>
>         PR target/65711
>         * config/aarch64/aarch64-linux.h (LINUX_TARGET_LINK_SPEC): Move
>         -dynamic-linker within %{!static %{!shared, and -rdynamic within
>         %{!static.

OK and I think we should backport this to 5 and 4.9

Cheers
/Marcus
Szabolcs Nagy July 24, 2015, 4:17 p.m. UTC | #2
On 24/07/15 13:50, Marcus Shawcroft wrote:
> On 22 July 2015 at 18:13, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
>> Same as
>> https://gcc.gnu.org/ml/gcc-patches/2015-04/msg01387.html
>> but for AArch64.
>>
>> -dynamic-linker is only passed to the linker if !static && !shared.
>>
>> -rdynamic handling is changed too to be consistent with arm:
>> only pass -export-dynamic if !static.
>>
>> 2015-07-22  Szabolcs Nagy  <szabolcs.nagy@arm.com>
>>
>>         PR target/65711
>>         * config/aarch64/aarch64-linux.h (LINUX_TARGET_LINK_SPEC): Move
>>         -dynamic-linker within %{!static %{!shared, and -rdynamic within
>>         %{!static.
> 
> OK and I think we should backport this to 5 and 4.9
> 

Committed to trunk in r226158.
Backported to 5 in r226165.
Backported to 4.9 in r226169.
diff mbox

Patch

diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
index 1600a32..c51c8b2 100644
--- a/gcc/config/aarch64/aarch64-linux.h
+++ b/gcc/config/aarch64/aarch64-linux.h
@@ -38,8 +38,9 @@ 
    %{static:-Bstatic}				\
    %{shared:-shared}				\
    %{symbolic:-Bsymbolic}			\
-   %{rdynamic:-export-dynamic}			\
-   -dynamic-linker " GNU_USER_DYNAMIC_LINKER "	\
+   %{!static:					\
+     %{rdynamic:-export-dynamic}		\
+     %{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \
    -X						\
    %{mbig-endian:-EB} %{mlittle-endian:-EL}     \
    -maarch64linux%{mabi=ilp32:32}%{mbig-endian:b}"