Dash:
[t2-trunk.git] / package / base / dietlibc / ppc-static-ctor-dtor.patch
blobd1f71be4b6ff8abd8f5f8ecbf03e6338b69b9e50
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../dietlibc/ppc-static-ctor-dtor.patch
5 # Copyright (C) 2004 - 2018 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 We build dietlibc with WANT_DYNAMIC so we get ctor/dtor handling, even
18 for static programs, as normally needed.
20 The patch zeros register 6 passed for dl_init to _dyn_start since otherwise
21 we end up in an inf. loop calling the _dyn_start (where r6 points to) again
22 and again ... This is NOT intended for upstream merge - just a quick hack
23 to get it working.
25 For ppc64 it is not an inf. loop but segfault on exit due invalid pointed
26 in the atexit array.
28 - Rene Rebe <rene@exactcode.de>
30 diff -u dietlibc-0.28/ppc/start.S dietlibc-0.28-fixed/ppc/start.S
31 --- dietlibc-0.28/ppc/start.S 2004-09-11 14:37:57.000000000 +0200
32 +++ dietlibc-0.28-fixed/ppc/start.S 2005-05-03 23:47:09.000000000 +0200
33 @@ -27,7 +29,7 @@
34 stw 5,environ@l(14)
36 #ifdef WANT_DYNAMIC
37 - mr 6,7
38 + xor 6,6,6
39 bl _dyn_start
40 #else
41 #ifdef WANT_STACKGAP
42 --- dietlibc-0.34/ppc64/start.S.orig 2018-10-23 12:23:43.397399098 +0000
43 +++ dietlibc-0.34/ppc64/start.S 2018-10-23 12:26:19.301396754 +0000
44 @@ -71,7 +71,8 @@
46 #ifdef WANT_DYNAMIC
47 /* #warning dynamic */
48 - mr 6,7
49 + xor 6,6,6
50 +#warning dynamic
51 /* This has not been tested on ppc64le yet... */
52 bl FN_NAME_DOTIFY(_dyn_start)
53 #else