This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PLT / non-PIC executable support for MIPS


On Sun, Mar 28, 2010 at 03:46:04PM +0000, Joseph S. Myers wrote:
> On Wed, 1 Oct 2008, Daniel Jacobowitz wrote:
> 
> > +/* Allow ABIVERSION == 1, meaning PLTs and copy relocations are
> > +   required.  */
> > +#define VALID_ELF_ABIVERSION(ver)	(ver == 0 || ver == 2)
> > +#define VALID_ELF_OSABI(osabi)		(osabi == ELFOSABI_SYSV)
> > +#define VALID_ELF_HEADER(hdr,exp,size) \
> > +  memcmp (hdr,exp,size-2) == 0 \
> > +  && VALID_ELF_OSABI (hdr[EI_OSABI]) \
> > +  && VALID_ELF_ABIVERSION (hdr[EI_ABIVERSION])
> 
> I am looking at updating this code and the corresponding ARM code for the 
> recent libc-abis changes in libc.  I don't follow how the comparison ver 
> == 2 works with allowing ABIVERSION == 1.

I don't either.  It may be that at some point, the abiversion value
was going to be 2, and I failed to update it.  This was wrong by the
very first public posting.

> If there is indeed a target-specific ABIVERSION value for MIPS, then ports 
> needs its own libc-abis file.  Is there something I don't follow about how 
> the above matches, or is in fact the static linker never generating the 
> value 1 (which it does seem to have code to generate) in any context for 
> which the above code is active?

I suspect that VALID_ELF_HEADER is not used for the executable.  The
linker only sets it for the executable, since shared libraries don't
use PLTs or copy relocs.  Either that, or it's only used for the
executable if ld.so was invoked directly (but if that were the case, I
think we'd have noticed a problem by now).

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]