This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [hjl@valinux.com: Re: An ELF/PPC patch for ld/testsuite]
- To: hjl at valinux dot com
- Subject: Re: [hjl@valinux.com: Re: An ELF/PPC patch for ld/testsuite]
- From: Geoff Keating <geoffk at cygnus dot com>
- Date: Thu, 19 Oct 2000 12:43:12 -0700
- CC: binutils at sources dot redhat dot com
- References: <20001019093528.B607@valinux.com>
> Date: Thu, 19 Oct 2000 09:35:28 -0700
> From: "H . J . Lu" <hjl@valinux.com>
> > How hard is it to fix elf32-ppc properly?
> >
>
> According to Geoffrey, they are not supposed to work under
> ELF/PPC.
To be precise, given the sequence of operations the testsuite makes,
the dynamic linker should always produce an error.
The basic restriction on powerpc is that in non-PIC code, no branch
can span more than 2^26 bytes. The testcases manage to hit this in
various ways:
- by creating a non-PIC shared object with a load offset which causes
it to be loaded at 0x10000, and having that shared object branch to
the application which is loaded at 0x10000000. ld.so assumes that
if you try to control your application's memory map, you know what
you are doing.
- by creating a non-PIC shared object without a load offset, which
causes it to be loaded just under the application at
0x0FFFsomething, and having it branch to an undefined weak symbol
which means location 0. non-PIC code using undefined weak symbols
is not supported on powerpc because it can't work.
The other restriction is a generic ELF one, which is that non-PIC
applications cannot reliably reference undefined weak symbols. The
symbols will sometimes appear to be zero and sometimes not.
--
- Geoffrey Keating <geoffk@cygnus.com>