You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.8 KiB

# --- T2-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# T2 SDE: package/.../dietlibc/ppc-static-ctor-dtor.patch
# Copyright (C) 2004 - 2006 The T2 SDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- T2-COPYRIGHT-NOTE-END ---
We build dietlibc with WANT_DYNAMIC so we get ctor/dtor handling, even
for static programs, as normally needed.
The patch zeros register 6 passed for dl_init to _dyn_start since otherwise
we end up in an inf. loop calling the _dyn_start (where r6 points to) again
and again ... This is NOT intended for upstream merge - just a quick hack
to get it working.
For ppc64 it is not an inf. loop but segfault on exit due invalid pointed
in the atexit array.
- Rene Rebe <rene@exactcode.de>
diff -u dietlibc-0.28/ppc/start.S dietlibc-0.28-fixed/ppc/start.S
--- dietlibc-0.28/ppc/start.S 2004-09-11 14:37:57.000000000 +0200
+++ dietlibc-0.28-fixed/ppc/start.S 2005-05-03 23:47:09.000000000 +0200
@@ -27,7 +29,7 @@
stw 5,environ@l(14)
#ifdef WANT_DYNAMIC
- mr 6,7
+ xor 6,6,6
bl _dyn_start
#else
#ifdef WANT_STACKGAP
--- dietlibc-0.29/ppc64/start.S 2005-05-13 18:39:32.000000000 +0000
+++ dietlibc-0.29-fixed/ppc64/start.S 2005-12-26 20:40:18.000000000 +0000
@@ -60,7 +60,7 @@
#ifdef WANT_DYNAMIC
/* #warning dynamic */
- mr 6,7
+ xor 6,6,6
bl ._dyn_start
#else
/* #warning static */