This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH' RFA] fix generation of MIPS -membedded-pic jumps
At Wed, 13 Feb 2002 14:59:58 -0500, Daniel Jacobowitz wrote:
> On Tue, Feb 12, 2002 at 03:44:21PM -0800, cgd@broadcom.com wrote:
> > I want this for both the trunk and the branch; this is the last thing
> > keeping -membedded-pic from working for ELF in the stock binutils
> > sources.
>
> OK for branch if it's OK for trunk...
Eric gave me the OK off-list, but neither of us are happy with it.
So, I'm going to take one more crack at it from a different angle
(basically, make H.J.'s original patch not apply if embedded-pic).
I've checked in the part of the change which reorganizes
mips_need_elf_addend_fixup, though, to both the branch and trunk.
(If the change i'm attempting wins, i'll need that anyway.)
For sanity's sake, I made sure the resulting binutils still compiled
&& passed make check, but didn't re-do the full check-gcc since this
was a safe subset of the previous. 8-)
The exact patch checked in is below.
cgd
===================================================================
2002-02-13 Chris Demetriou <cgd@broadcom.com>
* config/tc-mips.c (mips_need_elf_addend_fixup): Restructure into
a sequence of indpendent 'if' statements for easier debugging
and future modification.
Index: config/tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.107
diff -u -r1.107 tc-mips.c
--- tc-mips.c 2002/02/08 22:25:36 1.107
+++ tc-mips.c 2002/02/14 07:25:54
@@ -10404,17 +10404,21 @@
mips_need_elf_addend_fixup (fixP)
fixS *fixP;
{
- return (S_GET_OTHER (fixP->fx_addsy) == STO_MIPS16
- || ((S_IS_WEAK (fixP->fx_addsy)
- || S_IS_EXTERN (fixP->fx_addsy))
- && !S_IS_COMMON (fixP->fx_addsy))
- || (symbol_used_in_reloc_p (fixP->fx_addsy)
- && (((bfd_get_section_flags (stdoutput,
- S_GET_SEGMENT (fixP->fx_addsy))
- & SEC_LINK_ONCE) != 0)
- || !strncmp (segment_name (S_GET_SEGMENT (fixP->fx_addsy)),
- ".gnu.linkonce",
- sizeof (".gnu.linkonce") - 1))));
+ if (S_GET_OTHER (fixP->fx_addsy) == STO_MIPS16)
+ return 1;
+ if ((S_IS_WEAK (fixP->fx_addsy)
+ || S_IS_EXTERN (fixP->fx_addsy))
+ && !S_IS_COMMON (fixP->fx_addsy))
+ return 1;
+ if (symbol_used_in_reloc_p (fixP->fx_addsy)
+ && (((bfd_get_section_flags (stdoutput,
+ S_GET_SEGMENT (fixP->fx_addsy))
+ & SEC_LINK_ONCE) != 0)
+ || !strncmp (segment_name (S_GET_SEGMENT (fixP->fx_addsy)),
+ ".gnu.linkonce",
+ sizeof (".gnu.linkonce") - 1)))
+ return 1;
+ return 0;
}
#endif