Do not attempt to fixup relocs relative to weak symbols

This commit is contained in:
Nick Clifton
1999-11-06 14:05:24 +00:00
parent dd33dc0f45
commit d6c497c760
2 changed files with 28 additions and 18 deletions

View File

@ -1,3 +1,10 @@
1999-11-06 Nick Clifton <nickc@cygnus.com>
* config/tc-v850.c (v850_force_relocation): Force relocation
for weak symbols.
(v850_pcrel_from_selection): Do not compute a pcrel offset if
the symbol is weak.
1999-11-05 Michael Meissner <meissner@cygnus.com>
* expr.h (operatorT): Increase machine dependent operators to 16.

View File

@ -2290,15 +2290,13 @@ v850_pcrel_from_section (fixp, section)
segT section;
{
/* If the symbol is undefined, or in a section other than our own,
or it is weak (in which case it may well be in another section,
then let the linker figure it out. */
if (fixp->fx_addsy != (symbolS *) NULL
&& (! S_IS_DEFINED (fixp->fx_addsy)
|| S_IS_WEAK (fixp->fx_addsy)
|| (S_GET_SEGMENT (fixp->fx_addsy) != section)))
{
/* The symbol is undefined/not in our section.
Let the linker figure it out. */
return 0;
}
return fixp->fx_frag->fr_address + fixp->fx_where;
}
@ -2442,19 +2440,21 @@ cons_fix_new_v850 (frag, where, size, exp)
else
fix_new (frag, where, size, NULL, 0, 0, hold_cons_reloc);
}
boolean
v850_fix_adjustable (fixP)
fixS * fixP;
{
if (fixP->fx_addsy == NULL)
return 1;
/* Prevent all adjustments to global symbols. */
if (S_IS_EXTERN (fixP->fx_addsy))
return 0;
if (S_IS_WEAK (fixP->fx_addsy))
return 0;
/* Don't adjust function names */
if (S_IS_FUNCTION (fixP->fx_addsy))
return 0;
@ -2468,11 +2468,14 @@ v850_fix_adjustable (fixP)
}
int
v850_force_relocation (fixp)
struct fix *fixp;
v850_force_relocation (fixP)
struct fix * fixP;
{
if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
|| fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
if (fixP->fx_addsy && S_IS_WEAK (fixP->fx_addsy))
return 1;
if ( fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT
|| fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
return 1;
return 0;