mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-18 16:53:50 +08:00
* write.c: White space fixes.
(fixup_segment): Move symbol_mri_common_p adjustments.. (write_relocs): ..and symbol_equated_reloc_p adjustments.. (adjust_reloc_syms): ..to here.
This commit is contained in:
@ -1,3 +1,10 @@
|
||||
2007-02-17 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* write.c: White space fixes.
|
||||
(fixup_segment): Move symbol_mri_common_p adjustments..
|
||||
(write_relocs): ..and symbol_equated_reloc_p adjustments..
|
||||
(adjust_reloc_syms): ..to here.
|
||||
|
||||
2007-02-16 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* subsegs.c (subseg_change, subseg_get): Use xcalloc rather than
|
||||
|
57
gas/write.c
57
gas/write.c
@ -661,17 +661,21 @@ adjust_reloc_syms (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
|
||||
/* If this symbol is equated to an undefined or common symbol,
|
||||
convert the fixup to being against that symbol. */
|
||||
if (symbol_equated_reloc_p (sym)
|
||||
while (symbol_equated_reloc_p (sym)
|
||||
|| S_IS_WEAKREFR (sym))
|
||||
{
|
||||
symbolS *newsym = symbol_get_value_expression (sym)->X_add_symbol;
|
||||
if (sym == newsym)
|
||||
break;
|
||||
fixp->fx_offset += symbol_get_value_expression (sym)->X_add_number;
|
||||
sym = symbol_get_value_expression (sym)->X_add_symbol;
|
||||
fixp->fx_addsy = sym;
|
||||
fixp->fx_addsy = newsym;
|
||||
sym = newsym;
|
||||
}
|
||||
|
||||
if (symbol_mri_common_p (sym))
|
||||
{
|
||||
/* These symbols are handled specially in fixup_segment. */
|
||||
fixp->fx_offset += S_GET_VALUE (sym);
|
||||
fixp->fx_addsy = symbol_get_value_expression (sym)->X_add_symbol;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -808,15 +812,6 @@ fixup_segment (fixS *fixP, segT this_segment)
|
||||
#endif
|
||||
add_number = fixP->fx_offset;
|
||||
|
||||
if (fixP->fx_addsy != NULL
|
||||
&& symbol_mri_common_p (fixP->fx_addsy))
|
||||
{
|
||||
add_number += S_GET_VALUE (fixP->fx_addsy);
|
||||
fixP->fx_offset = add_number;
|
||||
fixP->fx_addsy
|
||||
= symbol_get_value_expression (fixP->fx_addsy)->X_add_symbol;
|
||||
}
|
||||
|
||||
if (fixP->fx_addsy != NULL)
|
||||
add_symbol_segment = S_GET_SEGMENT (fixP->fx_addsy);
|
||||
|
||||
@ -1030,24 +1025,6 @@ write_relocs (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
|
||||
continue;
|
||||
}
|
||||
|
||||
/* If this is an undefined symbol which was equated to another
|
||||
symbol, then generate the reloc against the latter symbol
|
||||
rather than the former. */
|
||||
sym = fixp->fx_addsy;
|
||||
while (symbol_equated_reloc_p (sym))
|
||||
{
|
||||
symbolS *n;
|
||||
|
||||
/* We must avoid looping, as that can occur with a badly
|
||||
written program. */
|
||||
n = symbol_get_value_expression (sym)->X_add_symbol;
|
||||
if (n == sym)
|
||||
break;
|
||||
fixp->fx_offset += symbol_get_value_expression (sym)->X_add_number;
|
||||
sym = n;
|
||||
}
|
||||
fixp->fx_addsy = sym;
|
||||
|
||||
reloc = tc_gen_reloc (sec, fixp);
|
||||
if (!reloc)
|
||||
{
|
||||
@ -1103,24 +1080,6 @@ write_relocs (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
|
||||
continue;
|
||||
}
|
||||
|
||||
/* If this is an undefined symbol which was equated to another
|
||||
symbol, then generate the reloc against the latter symbol
|
||||
rather than the former. */
|
||||
sym = fixp->fx_addsy;
|
||||
while (symbol_equated_reloc_p (sym))
|
||||
{
|
||||
symbolS *n;
|
||||
|
||||
/* We must avoid looping, as that can occur with a badly
|
||||
written program. */
|
||||
n = symbol_get_value_expression (sym)->X_add_symbol;
|
||||
if (n == sym)
|
||||
break;
|
||||
fixp->fx_offset += symbol_get_value_expression (sym)->X_add_number;
|
||||
sym = n;
|
||||
}
|
||||
fixp->fx_addsy = sym;
|
||||
|
||||
reloc = tc_gen_reloc (sec, fixp);
|
||||
|
||||
for (j = 0; reloc[j]; j++)
|
||||
|
Reference in New Issue
Block a user