This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[patch] ensure nothing is linked at address 0 on the SPU
- From: Ken Werner <ken at linux dot vnet dot ibm dot com>
- To: newlib at sourceware dot org
- Date: Wed, 13 May 2009 17:21:39 +0200
- Subject: [patch] ensure nothing is linked at address 0 on the SPU
Hi,
this patch provides a dummy .interrupt section to ensure nothing is linked at
address 0. This is in crtn.S to make sure any user-provided real .interrupt
section will get linked in front of this dummy. This replaces the old nop of
the .init section in crti.S.
Ken
libgloss/ChangeLog:
2009-05-13 Ulrich Weigand <uweigand@de.ibm.com>
* spu/crtn.S: Add dummy to ensure nothing gets linked at address 0.
* spu/crti.S: Remove nop.
diff -urNp src/libgloss/spu.orig/crti.S src/libgloss/spu/crti.S
--- src/libgloss/spu.orig/crti.S 2006-12-08 22:50:56.000000000 +0100
+++ src/libgloss/spu/crti.S 2009-05-06 17:41:41.000000000 +0200
@@ -46,11 +46,6 @@
.section ".init"
.align 2
-
- # To make sure the address of _init is not zero, because
- # the default linker entry point is 0.
- nop
-
.global _init
.type _init, @function
_init:
diff -urNp src/libgloss/spu.orig/crtn.S src/libgloss/spu/crtn.S
--- src/libgloss/spu.orig/crtn.S 2006-12-08 22:50:56.000000000 +0100
+++ src/libgloss/spu/crtn.S 2009-05-06 17:43:42.000000000 +0200
@@ -53,4 +53,12 @@
FUNC_END
+ # To ensure nothing is linked at address 0, provide a dummy
+ # .interrupt section. This is in crtn.S to make sure any
+ # user-provided real .interrupt section will get linked
+ # in front of this dummy.
+ .section ".interrupt","ax"
+ .align 2
+ heq $0,$0
+
# end of crtn.S