This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH] Allow overriding of symbols in libgloss/arm/crt0.S.
- From: Carlos O'Donell <carlos at codesourcery dot com>
- To: newlib at sources dot redhat dot com
- Cc: Paul Brook <paul at codesourcery dot com>
- Date: Fri, 10 Aug 2007 16:06:00 -0400
- Subject: [PATCH] Allow overriding of symbols in libgloss/arm/crt0.S.
A bug in crt0.S prevents overriding the values of __stack,
hardware_init_hook, and software_init_hook by linker scripts or program
code.
In the libgloss/arm/crt0.S startup the symbols __stack,
hardware_init_hook, software_init_hook are set with '.set <symbol>,0'.
Using '.set' causes the linker to emit a relocation against *ABS*, and
therefore the value cannot be overriden in a linker script or program.
A weak reference that remains unresolved will be given a value of zero,
giving the desired behaviour.
This patch removes the '.set' for __stack, hardware_init_hook, and
software_init_hook, allowing the linker script to override the value if
required.
Tested on arm-none-eabi without regressions.
Please apply.
Cheers,
Carlos.
--
Carlos O'Donell
CodeSourcery
carlos@codesourcery.com
(650) 331-3385 x716
2007-08-10 Carlos O'Donell <carlos@codesourcery.com>
* arm/crt0.S: Remove '.set' for __stack, hardware_init_hook,
and software_init_hook.
Index: libgloss/arm/crt0.S
===================================================================
RCS file: /cvs/src/src/libgloss/arm/crt0.S,v
retrieving revision 1.5
diff -u -p -r1.5 crt0.S
--- libgloss/arm/crt0.S 7 Feb 2006 18:46:23 -0000 1.5
+++ libgloss/arm/crt0.S 10 Aug 2007 19:58:59 -0000
@@ -352,10 +352,6 @@ change_back:
and only if, a normal version of the same symbol isn't provided
e.g. by a linker script or another object file.) */
- .set __stack, 0
- .set FUNCTION (hardware_init_hook), 0
- .set FUNCTION (software_init_hook), 0
-
.weak __stack
.weak FUNCTION (hardware_init_hook)
.weak FUNCTION (software_init_hook)