public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Fix crt0 overwriting.
@ 2017-08-09 12:50 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2017-08-09 12:50 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=61ddc7a436dee9ef40782400ba618be8dee9a0e8

commit 61ddc7a436dee9ef40782400ba618be8dee9a0e8
Author: Tamar Christina <tamar.christina@arm.com>
Date:   Tue Aug 8 15:47:54 2017 +0100

    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>

Diff:
---
 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 8111f26..546557e 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 800791a..db31441 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 8d86de1..d5c48ed 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 a1d84c2..be23735 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-08-09 12:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-09 12:50 [newlib-cygwin] Fix crt0 overwriting Corinna Vinschen

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).