SHA256
3
0
forked from pool/glibc
glibc/m68k-Scrt1.patch
Andreas Schwab f765de7465 Accepting request 202951 from home:Andreas_Schwab:Factory
- Enable ports addon for m68k and adapt file list
- m68k-Scrt1.patch: Use PIC for Scrt1.o

OBS-URL: https://build.opensuse.org/request/show/202951
OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=313
2013-10-11 10:21:14 +00:00

51 lines
1.3 KiB
Diff

2013-10-08 Andreas Schwab <schwab@suse.de>
* sysdeps/m68k/start.S [SHARED]: Use PIC.
Index: glibc-2.18/ports/sysdeps/m68k/start.S
===================================================================
--- glibc-2.18.orig/ports/sysdeps/m68k/start.S
+++ glibc-2.18/ports/sysdeps/m68k/start.S
@@ -52,6 +52,8 @@
NULL
*/
+#include <sysdep.h>
+
.text
.globl _start
.type _start,@function
@@ -74,6 +76,24 @@ _start:
pea (%a1) /* Push address of the shared library
termination function. */
+#ifdef SHARED
+ /* Load PIC register. */
+ LOAD_GOT (%a5)
+
+ /* Push the address of our own entry points to `.fini' and
+ `.init'. */
+ move.l __libc_csu_fini@GOT(%a5), -(%sp)
+ move.l __libc_csu_init@GOT(%a5), -(%sp)
+
+ pea (%a0) /* Push second argument: argv. */
+ move.l %d0, -(%sp) /* Push first argument: argc. */
+
+ move.l main@GOT(%a5), -(%sp)
+
+ /* Call the user's main function, and exit with its value. But
+ let the libc call main. */
+ jbsr __libc_start_main@PLTPC
+#else
/* Push the address of our own entry points to `.fini' and
`.init'. */
pea __libc_csu_fini
@@ -87,6 +107,7 @@ _start:
/* Call the user's main function, and exit with its value. But
let the libc call main. */
jbsr __libc_start_main
+#endif
illegal /* Crash if somehow `exit' does return. */