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]
Other format: [Raw text]

Re: mips branches broken between 2002-09-05 and 2002-09-06


On Mon, Sep 09, 2002 at 11:53:59PM -0700, cgd@broadcom.com wrote:
> Between 2002-09-05 00:00GMT and 2002-09-06 00:00GMT, mips branches to
> global symbols in the same file were broken.  I think this is probably
> fallout from the big reloc rewrite,

There's a good chance that I broke it.  Sorry, but this sort of
cleanup is bound to have fallout.  The whole idea was to remove
fudges, and the mips backend in particular has a lot!  A whole lot
more fudges will go when/if I get around to tackling
bfd_install_relocation.

> which IIRC explicitly didn't
> include all of the changes necessary for MIPS.

Well, it's more the case that the MIPS backend wasn't changed as much as
some others to make use of the new infrastructure.  I didn't attempt
to define MD_APPLY_SYM to zero and remove the fudges in md_apply_fix3
that subtract off the sym value.  You, or some other mips maintainer,
should probably look at doing that.

> anyway, the new tests below all pass as of 2002-09-05.  as of
> 2002-09-06, the branch-misc-2 tests fail.
> 
> As a result of the changes in that time period:
> 
> 	(a) branches to global symbols (in the same file) are now
>         relocated against the actual target symbols,

I believe that is correct.  For ELF shared libraries, ld.so must be
able to override global symbols.  So that, for example, a call to a
global "foo" in the current file may in fact end up going to a totally
different shared library.  The same goes for variables.  Now, you may
argue that the MIPS ABI only supports symbol overriding when a call is
via the plt, which would be a reasonable argument, but I'd raised the
issue of branches to global syms on the mailing list and got no
response.  I guess your email is the response I was after, except that
I'd like people to think about what really is the correct behaviour,
rather than just reporting that some part of a testsuite fails.

> 	(b) I suspect as a result of (a) and mishandling the offset in
> 	the instructions, the the instructions/relocs in the .o files
> 	are likely incorrect, and
> 
> 	(c) as a result, the offsets in the final link end up being
> 	incorrect.

Obviously, if a final link fails I need to help you in fixing it..
Also, I'm fairly certain that we can restore the old mips backend
behaviour regarding global syms if that is correct.

> It seems that as part of the changes during approximately that time
> period, as well, a few of the MIPS tests had their labels made
> non-global (presumably to avoid test failures due to the
> relocated-related changes),

Yes, I did that, and for the reason you gave.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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