This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


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

Re: More problems with MIPS gas relocations


"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)?

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...


> 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.


> 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.)

I/We've got patches which enable it the rest of the way on MIPS ELF,
and am planning to submit them when I have time.


chris


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