mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-01 18:32:32 +08:00
2000-10-31 Eric Christopher <echristo@cygnus.com>
* config/tc-mn10300.c (md_apply_fix3): Use valuep if fully resolved or pc-relative, else use fx_offset.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2000-10-31 Eric Christopher <echristo@redhat.com>
|
||||||
|
|
||||||
|
* config/tc-mn10300.c (md_apply_fix3): Use valuep if fully resolved
|
||||||
|
or pc-relative, else use fx_offset.
|
||||||
|
|
||||||
2000-10-31 Jim Wilson <wilson@redhat.com>
|
2000-10-31 Jim Wilson <wilson@redhat.com>
|
||||||
|
|
||||||
* config/tc-ia64.c (struct md): New field tag_fixups.
|
* config/tc-ia64.c (struct md): New field tag_fixups.
|
||||||
|
@ -1912,11 +1912,12 @@ md_pcrel_from (fixp)
|
|||||||
int
|
int
|
||||||
md_apply_fix3 (fixp, valuep, seg)
|
md_apply_fix3 (fixp, valuep, seg)
|
||||||
fixS *fixp;
|
fixS *fixp;
|
||||||
valueT *valuep ATTRIBUTE_UNUSED;
|
valueT *valuep;
|
||||||
segT seg;
|
segT seg;
|
||||||
{
|
{
|
||||||
char *fixpos = fixp->fx_where + fixp->fx_frag->fr_literal;
|
char *fixpos = fixp->fx_where + fixp->fx_frag->fr_literal;
|
||||||
int size = 0;
|
int size = 0;
|
||||||
|
int value;
|
||||||
|
|
||||||
assert (fixp->fx_r_type < BFD_RELOC_UNUSED);
|
assert (fixp->fx_r_type < BFD_RELOC_UNUSED);
|
||||||
|
|
||||||
@ -1924,6 +1925,23 @@ md_apply_fix3 (fixp, valuep, seg)
|
|||||||
if (seg->flags & SEC_ALLOC)
|
if (seg->flags & SEC_ALLOC)
|
||||||
abort ();
|
abort ();
|
||||||
|
|
||||||
|
/* The value we are passed in *valuep includes the symbol values.
|
||||||
|
Since we are using BFD_ASSEMBLER, if we are doing this relocation
|
||||||
|
the code in write.c is going to call bfd_install_relocation, which
|
||||||
|
is also going to use the symbol value. That means that if the
|
||||||
|
reloc is fully resolved we want to use *valuep since
|
||||||
|
bfd_install_relocation is not being used.
|
||||||
|
|
||||||
|
However, if the reloc is not fully resolved we do not want to use
|
||||||
|
*valuep, and must use fx_offset instead. However, if the reloc
|
||||||
|
is PC relative, we do want to use *valuep since it includes the
|
||||||
|
result of md_pcrel_from. */
|
||||||
|
if (fixp->fx_addsy == (symbolS *) NULL || fixp->fx_pcrel)
|
||||||
|
value = *valuep;
|
||||||
|
else
|
||||||
|
value = fixp->fx_offset;
|
||||||
|
|
||||||
|
|
||||||
/* If the fix is relative to a symbol which is not defined, or not
|
/* If the fix is relative to a symbol which is not defined, or not
|
||||||
in the same segment as the fix, we cannot resolve it here. */
|
in the same segment as the fix, we cannot resolve it here. */
|
||||||
if (fixp->fx_addsy != NULL
|
if (fixp->fx_addsy != NULL
|
||||||
@ -1959,7 +1977,7 @@ md_apply_fix3 (fixp, valuep, seg)
|
|||||||
_("Bad relocation fixup type (%d)"), fixp->fx_r_type);
|
_("Bad relocation fixup type (%d)"), fixp->fx_r_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
md_number_to_chars (fixpos, fixp->fx_offset, size);
|
md_number_to_chars (fixpos, value, size);
|
||||||
|
|
||||||
fixp->fx_done = 1;
|
fixp->fx_done = 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user