binutils/bfd/elf64-ppc.c patch: Add PLTREL24 support

Elliot Lee sopwith at redhat.com
Thu Sep 19 20:51:39 EST 2002


On Thu, 19 Sep 2002, Alan Modra wrote:

> On Wed, Sep 18, 2002 at 10:48:11AM -0400, Elliot Lee wrote:
> > This patch makes bfd handle the PLTREL24 relocation thingie. I needed it
> > to make glibc-CVS/sysdeps/powerpc/powerpc64/elf/start.S assemble. I just
> > did a cut & paste from elf32-ppc.c, hopefully it's sane.
>
> Hi Elliot,
>   PLTREL24 isn't correct for powerpc64.  The powerpc64 plt doesn't
> contain code so there is no need for a branch to the plt.  I suspect
> you're using the wrong assembler when trying to compile glibc.

If that were true, the patch wouldn't fix the problem ('make install' is
most definitely installing /opt/ppc64-foo/bin/powerpc64-linux-as, not
/usr/bin/as or anything else on my path).

It's could just be me on crack playing with glibc when the ppc64 merge
isn't complete - the preprocessed start.s and the command that produced it
are both attached for you to judge.

-- Elliot
"Do not trust the horse, Trojans! Whatever it is, I fear the Greeks, even
though they bring gifts."

-------------- next part --------------
A non-text attachment was scrubbed...
Name: build-start.sh
Type: application/x-sh
Size: 1304 bytes
Desc: 
Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20020919/4cdffa46/attachment.sh 
-------------- next part --------------
# 1 "../sysdeps/powerpc/powerpc64/elf/start.S"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "../include/libc-symbols.h" 1
# 56 "../include/libc-symbols.h"
# 1 "/usr/src/libc/build-libc/config.h" 1
# 57 "../include/libc-symbols.h" 2
# 2 "<command line>" 2
# 1 "../sysdeps/powerpc/powerpc64/elf/start.S"
# 20 "../sysdeps/powerpc/powerpc64/elf/start.S"
# 1 "../sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h" 1
# 25 "../sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h"
# 1 "../sysdeps/unix/powerpc/sysdep.h" 1
# 19 "../sysdeps/unix/powerpc/sysdep.h"
# 1 "../sysdeps/unix/sysdep.h" 1
# 19 "../sysdeps/unix/sysdep.h"
# 1 "../sysdeps/generic/sysdep.h" 1
# 20 "../sysdeps/unix/sysdep.h" 2

# 1 "../sysdeps/unix/sysv/linux/sys/syscall.h" 1
# 25 "../sysdeps/unix/sysv/linux/sys/syscall.h"
# 1 "/usr/src/linux-2.4.19/include/asm/unistd.h" 1 3
# 26 "../sysdeps/unix/sysv/linux/sys/syscall.h" 2
# 22 "../sysdeps/unix/sysdep.h" 2
# 20 "../sysdeps/unix/powerpc/sysdep.h" 2
# 1 "../sysdeps/powerpc/sysdep.h" 1
# 21 "../sysdeps/unix/powerpc/sysdep.h" 2
# 26 "../sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h" 2
# 21 "../sysdeps/powerpc/powerpc64/elf/start.S" 2
# 1 "../sysdeps/generic/bp-sym.h" 1
# 22 "../sysdeps/powerpc/powerpc64/elf/start.S" 2


        .section ".rodata"
        .align 3
        .weak _init
        .weak _fini
        .weak ._init
        .weak ._fini
.Lstart_addresses:
        .quad 0

        .quad main
        .quad _init
        .quad _fini

        .size .Lstart_addresses,.-.Lstart_addresses

        .section ".toc","aw"
.L01:
        .tc .Lstart_addresses[TC],.Lstart_addresses
        .section ".text"
.globl _start; .type _start, at function; .align 2; _start:

        mr 9,1

        clrrdi 1,1,4
        li 0,0
        stdu 1,-128(1)
        mtlr 0
        std 0,0(1)



        ld 8,.L01(2)


        b __libc_start_main at plt

.size _start,.-_start


        .section ".data"
        .globl __data_start
__data_start:
.weak data_start ; data_start = __data_start ; .weak .data_start ; .data_start = .__data_start


More information about the Linuxppc64-dev mailing list