mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-23 03:29:47 +08:00
PR gas/14255
* config/tc-avr.h (TC_VALIDATE_FIX): Mark symbol used by reloc. Don't skip fixups with fx_subsy non-NULL. * config/tc-avr.c (tc_gen_reloc): Don't specially handle fixups with fx_subsy non-NULL.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2013-02-06 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
PR gas/14255
|
||||||
|
* config/tc-avr.h (TC_VALIDATE_FIX): Mark symbol used by reloc.
|
||||||
|
Don't skip fixups with fx_subsy non-NULL.
|
||||||
|
* config/tc-avr.c (tc_gen_reloc): Don't specially handle fixups
|
||||||
|
with fx_subsy non-NULL.
|
||||||
|
|
||||||
2013-02-04 H.J. Lu <hongjiu.lu@intel.com>
|
2013-02-04 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* doc/c-metag.texi: Add "@c man" markers.
|
* doc/c-metag.texi: Add "@c man" markers.
|
||||||
|
@ -1386,29 +1386,9 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED,
|
|||||||
{
|
{
|
||||||
arelent *reloc;
|
arelent *reloc;
|
||||||
|
|
||||||
if (fixp->fx_addsy && fixp->fx_subsy)
|
if (fixp->fx_subsy != NULL)
|
||||||
{
|
{
|
||||||
long value = 0;
|
as_bad_where (fixp->fx_file, fixp->fx_line, _("expression too complex"));
|
||||||
|
|
||||||
if ((S_GET_SEGMENT (fixp->fx_addsy) != S_GET_SEGMENT (fixp->fx_subsy))
|
|
||||||
|| S_GET_SEGMENT (fixp->fx_addsy) == undefined_section)
|
|
||||||
{
|
|
||||||
as_bad_where (fixp->fx_file, fixp->fx_line,
|
|
||||||
"Difference of symbols in different sections is not supported");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* We are dealing with two symbols defined in the same section.
|
|
||||||
Let us fix-up them here. */
|
|
||||||
value += S_GET_VALUE (fixp->fx_addsy);
|
|
||||||
value -= S_GET_VALUE (fixp->fx_subsy);
|
|
||||||
|
|
||||||
/* When fx_addsy and fx_subsy both are zero, md_apply_fix
|
|
||||||
only takes it's second operands for the fixup value. */
|
|
||||||
fixp->fx_addsy = NULL;
|
|
||||||
fixp->fx_subsy = NULL;
|
|
||||||
md_apply_fix (fixp, (valueT *) &value, NULL);
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,9 +125,9 @@ extern long md_pcrel_from_section (struct fix *, segT);
|
|||||||
/* We don't want gas to fixup the following program memory related relocations.
|
/* We don't want gas to fixup the following program memory related relocations.
|
||||||
We will need them in case that we want to do linker relaxation.
|
We will need them in case that we want to do linker relaxation.
|
||||||
We could in principle keep these fixups in gas when not relaxing.
|
We could in principle keep these fixups in gas when not relaxing.
|
||||||
However, there is no serious performance penilty when making the linker
|
However, there is no serious performance penalty when making the linker
|
||||||
make the fixup work. Check also that fx_addsy is not NULL, in order to make
|
make the fixup work. Check also that fx_addsy is not NULL, in order to make
|
||||||
sure that the fixup refers to some sort of lable. */
|
sure that the fixup refers to some sort of label. */
|
||||||
#define TC_VALIDATE_FIX(FIXP,SEG,SKIP) \
|
#define TC_VALIDATE_FIX(FIXP,SEG,SKIP) \
|
||||||
if ( (FIXP->fx_r_type == BFD_RELOC_AVR_7_PCREL \
|
if ( (FIXP->fx_r_type == BFD_RELOC_AVR_7_PCREL \
|
||||||
|| FIXP->fx_r_type == BFD_RELOC_AVR_13_PCREL \
|
|| FIXP->fx_r_type == BFD_RELOC_AVR_13_PCREL \
|
||||||
@ -143,8 +143,10 @@ extern long md_pcrel_from_section (struct fix *, segT);
|
|||||||
|| FIXP->fx_r_type == BFD_RELOC_AVR_8_HI \
|
|| FIXP->fx_r_type == BFD_RELOC_AVR_8_HI \
|
||||||
|| FIXP->fx_r_type == BFD_RELOC_AVR_8_HLO \
|
|| FIXP->fx_r_type == BFD_RELOC_AVR_8_HLO \
|
||||||
|| FIXP->fx_r_type == BFD_RELOC_AVR_16_PM) \
|
|| FIXP->fx_r_type == BFD_RELOC_AVR_16_PM) \
|
||||||
&& (FIXP->fx_addsy)) \
|
&& FIXP->fx_addsy != NULL \
|
||||||
|
&& FIXP->fx_subsy == NULL) \
|
||||||
{ \
|
{ \
|
||||||
|
symbol_mark_used_in_reloc (FIXP->fx_addsy); \
|
||||||
goto SKIP; \
|
goto SKIP; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user