This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: More problems with MIPS gas relocations
On Wed, Jul 25, 2001 at 11:20:59AM -0700, cgd@broadcom.com wrote:
> "H . J . Lu" <hjl@lucon.org> writes:
> > On Wed, Jul 25, 2001 at 08:45:45AM -0700, cgd@broadcom.com wrote:
> > > 001-06-08 H.J. Lu <hjl@gnu.org>
> > >
> > > * config/tc-mips.c (md_apply_fix): Don't adjust common
> > > extern/weak symbols for ELF.
> > > (md_estimate_size_before_relax): Treat weak like extern for
> > > ELF.
> > > (mips_fix_adjustable): Don't adjust extern/weak symbols for
> > > ELF.
> > >
> > > fails to work. namely, PC-relative branches generated with
> > > -membedded-pic (on mips-elf, mips64-elf, etc.). For reference & later
> > > discussion, i've included the entire contents of that patch at the
> > > bottom of this message.
> >
> > Those patches are needed for the SVR4 MIPS ABI. Without it, you won't
> > be able to override a global definition in a DSO.
>
> I don't disagree with that.
>
> However, are you _sure_ that the changes to
> md_estimate_size_before_relax() and mips_fix_adjustable() are correct
> (and don't clobber non-elf targets)?
Why should my changes clobber non-elf targets? I thought they were
protected by
#ifdef OBJ_ELF
....
#endif
Did I miss something?
>
> In particular, I don't see how you could have added the thing you did
> to mips_fix_adjustable() given the code that's already there, and have
> the new code, the old code, and the description you gave all be
> correct...
I won't count on the old code for correctness :-).
>
>
> > If there is no DSO
> > involved, those patches may not be needed. But other other hand, the
> > linker should be able to do the right thing during the final link.
>
> And it does, modulo the seemingly-incorrect value that's left in the
> instruction.
>
Did Ricard's patch fix it?
>
> > I
> > don't use -membedded-pic and I have no idea what it does.
>
> It's a way of generating PIC code for embedded use.
>
> It's not currently fully supported on MIPS ELF, though it was
> apparently supported at one time in ECOFF. (Based on test results, it
> seems broken there now, though.)
If the -membedded-pic is not compatible with the SVR4 MIPS ABI, I
don't know how you can get it to work without creating a new BFD
target for it.
H.J.