This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: powerpc64-linux hack
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Ulrich Drepper <drepper at redhat dot com>, libc-alpha at sources dot redhat dot com
- Cc: binutils at sources dot redhat dot com, mostrows at watson dot ibm dot com
- Date: Tue, 12 Aug 2003 09:52:29 +0930
- Subject: Re: powerpc64-linux hack
- References: <20030811112952.GZ27145@bubble.sa.bigpond.net.au><3F37DC41.1060005@redhat.com>
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