powerpc64-linux hack

Alan Modra amodra@bigpond.net.au
Tue Aug 12 00:25:00 GMT 2003


On Mon, Aug 11, 2003 at 11:11:13AM -0700, Ulrich Drepper wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Alan Modra wrote:
> > We won't ever be returning to anything in crt1.o, so a toc adjustment is
> > fine.
> > 
> > 	* elf64-ppc.c (ppc64_elf_relocate_section): Add special case for crt1.o
> > 	branch to __libc_start_main.
> 
> That's a stupid change.  There is no guarantee that future glibc
> versions won't have different libc entry point names.  I would never
> accept hardcoding a name like this.  If you need new functionality
> design and implement it and use it for the __libc_start_main call.  But
> don't add a hack like this.

Calm down.  I did say it was a hack.  Please apply the following.

	* sysdeps/powerpc/powerpc64/elf/start.S: Add a nop after
	__libc_start_main branch.

Index: sysdeps/powerpc/powerpc64/elf/start.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/powerpc/powerpc64/elf/start.S,v
retrieving revision 1.4
diff -u -p -r1.4 start.S
--- sysdeps/powerpc/powerpc64/elf/start.S	10 Jul 2003 17:06:24 -0000	1.4
+++ sysdeps/powerpc/powerpc64/elf/start.S	12 Aug 2003 00:10:36 -0000
@@ -56,6 +56,9 @@ ENTRY(_start)
 
  /* and continue in libc-start, in glibc.  */
 	b	JUMPTARGET(BP_SYM(__libc_start_main))
+/* The linker needs this nop to recognize that it's OK to call via a
+   TOC adjusting stub.  */
+	nop
 
 END(_start)
 
-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list