This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH][libgloss][AArch64] Overwrite crt0 in specs files.
- From: Tamar Christina <Tamar dot Christina at arm dot com>
- To: "newlib at sourceware dot org" <newlib at sourceware dot org>
- Cc: Richard Earnshaw <Richard dot Earnshaw at arm dot com>, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>, nd <nd at arm dot com>
- Date: Wed, 9 Aug 2017 12:47:48 +0000
- Subject: [PATCH][libgloss][AArch64] Overwrite crt0 in specs files.
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tamar dot Christina at arm dot com;
- Nodisclaimer: True
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Hi All,
On AArch64 we currently always link in crt0 regardless of if another
one is being provided by something else, like rdimon.a. This was never
an issue before as nosys was not supported on AArch64.
This updates the specs to supply a different crt0 when a semihosting
call is required.
Regtested aarch64_be-none-elf and no regressions.
This reverts cd26662dc590235e27e17eec773c5a308e6d863f
Also tested
- rdimon.specs
- nosys.specs
- aem-validation.specs
and manual inspection of generated commandline from collect2.
Ok for master?
PS. I don't have commit rights so if OK can someone apply?
Thanks,
Tamar
From 698d0677fd743d50f5f0585f4e18549ac05f3f54 Mon Sep 17 00:00:00 2001
From: Tamar Christina <tamar.christina@arm.com>
Date: Tue, 8 Aug 2017 15:47:54 +0100
Subject: [PATCH] Fix crt0 overwriting.
On AArch64 we currently always link in crt0 regardless of if another
one is being provided by something else, like rdimon.a. This was never
an issue before as nosys was not supported on AArch64.
This updates the specs to supply a different crt0 when a semihosting
call is required.
Signed-off-by: Tamar Christina <tamar.christina@arm.com>
---
libgloss/aarch64/Makefile.in | 2 +-
libgloss/aarch64/elf-aem-validation.specs | 3 +++
libgloss/aarch64/elf-aem-ve.specs | 3 +++
libgloss/aarch64/elf-rdimon.specs | 3 +++
4 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/libgloss/aarch64/Makefile.in b/libgloss/aarch64/Makefile.in
index 8111f262c..546557e3c 100644
--- a/libgloss/aarch64/Makefile.in
+++ b/libgloss/aarch64/Makefile.in
@@ -118,7 +118,7 @@ test:
#
crt0.o: crt0.S
- $(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
+ $(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -o $@ -c $<
rdimon-crt0${${MULTILIBNAME}}.o: crt0.S
$(CC) $(CFLAGS_FOR_TARGET) $($(MULTI_FLAGS_FOR_TARGET)) $(CFLAGS) $(INCLUDES) -DARM_RDI_MONITOR -o $@ -c $<
diff --git a/libgloss/aarch64/elf-aem-validation.specs b/libgloss/aarch64/elf-aem-validation.specs
index 800791ac1..db31441e4 100644
--- a/libgloss/aarch64/elf-aem-validation.specs
+++ b/libgloss/aarch64/elf-aem-validation.specs
@@ -10,3 +10,6 @@
*lib:
cpu-init/rdimon-aem-el3.o%s --start-group %(libc) %(libgloss) --end-group
+
+*startfile:
+crti%O%s crtbegin%O%s %{!pg:rdimon-crt0%O%s} %{pg:rdimon-crt0%O%s}
\ No newline at end of file
diff --git a/libgloss/aarch64/elf-aem-ve.specs b/libgloss/aarch64/elf-aem-ve.specs
index 8d86de1be..d5c48edf8 100644
--- a/libgloss/aarch64/elf-aem-ve.specs
+++ b/libgloss/aarch64/elf-aem-ve.specs
@@ -17,3 +17,6 @@
*lib:
cpu-init/rdimon-aem-el3.o%s --start-group %(libc) %(libgloss) --end-group
+
+*startfile:
+crti%O%s crtbegin%O%s %{!pg:rdimon-crt0%O%s} %{pg:rdimon-crt0%O%s}
\ No newline at end of file
diff --git a/libgloss/aarch64/elf-rdimon.specs b/libgloss/aarch64/elf-rdimon.specs
index a1d84c2bb..be2373556 100644
--- a/libgloss/aarch64/elf-rdimon.specs
+++ b/libgloss/aarch64/elf-rdimon.specs
@@ -10,3 +10,6 @@
*lib:
--start-group %(libc) %(libgloss) --end-group
+
+*startfile:
+crti%O%s crtbegin%O%s %{!pg:rdimon-crt0%O%s} %{pg:rdimon-crt0%O%s}
\ No newline at end of file
--
2.13.0