aboutsummaryrefslogtreecommitdiff
path: root/bfd/coff-a29k.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1993-11-19 19:51:52 +0000
committerIan Lance Taylor <ian@airs.com>1993-11-19 19:51:52 +0000
commit533af0314f016b893b80fb2e8325e7fe5826e416 (patch)
tree8ae1fe410b26afc7a2642d8664b0e95c99de3e65 /bfd/coff-a29k.c
parenta1bff336ec023f608e12ff211cbab2419d91a2d3 (diff)
downloadgdb-533af0314f016b893b80fb2e8325e7fe5826e416.zip
gdb-533af0314f016b893b80fb2e8325e7fe5826e416.tar.gz
gdb-533af0314f016b893b80fb2e8325e7fe5826e416.tar.bz2
* coff-a29k.c (a29k_reloc): For R_IREL, don't left shift
signed_value before sign extending it. Don't subtract out reloc_entry->address. This makes it compatible with what gas is generating. Fixes PR 3790.
Diffstat (limited to 'bfd/coff-a29k.c')
-rw-r--r--bfd/coff-a29k.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bfd/coff-a29k.c b/bfd/coff-a29k.c
index 3092479..ef41bdb 100644
--- a/bfd/coff-a29k.c
+++ b/bfd/coff-a29k.c
@@ -117,8 +117,9 @@ DEFUN(a29k_reloc,(abfd, reloc_entry, symbol_in, data, input_section, output_bfd)
case R_IREL:
insn = bfd_get_32(abfd, hit_data);
/* Take the value in the field and sign extend it */
- signed_value = EXTRACT_HWORD(insn) << 2;
+ signed_value = EXTRACT_HWORD(insn);
signed_value = SIGN_EXTEND_HWORD(signed_value);
+ signed_value <<= 2;
signed_value += sym_value + reloc_entry->addend;
if ((signed_value&~0x3ffff) == 0)
{ /* Absolute jmp/call */
@@ -129,9 +130,8 @@ DEFUN(a29k_reloc,(abfd, reloc_entry, symbol_in, data, input_section, output_bfd)
{
/* Relative jmp/call, so subtract from the value the
address of the place we're coming from */
- signed_value -= reloc_entry->address +
- input_section->output_section->vma +
- input_section->output_offset;
+ signed_value -= (input_section->output_section->vma
+ + input_section->output_offset);
if (signed_value>0x1ffff || signed_value<-0x20000)
return(bfd_reloc_outofrange);
}