summaryrefslogtreecommitdiff
path: root/bfd/elf32-i860.c
diff options
context:
space:
mode:
authorJason Eckhardt <jle@rice.edu>2000-08-21 23:26:19 +0000
committerJason Eckhardt <jle@rice.edu>2000-08-21 23:26:19 +0000
commitc26b87fc09c67eeaeaa3e027f15e2187b7dd5108 (patch)
tree6f3346b98aa7f3f20a0415642a9655784c6fb299 /bfd/elf32-i860.c
parent2aa9c9b1a1766027d6e5723797277d9775ebf2bb (diff)
downloadgdb-c26b87fc09c67eeaeaa3e027f15e2187b7dd5108.tar.gz
2000-08-21 Jason Eckhardt <jle@cygnus.com>
bfd: * elf32-i860.c (elf32_i860_relocate_pc16): Just write the immediate field with the newly relocated value instead of adding it to the existing immediate field. (elf32_i860_relocate_splitn): Likewise. (elf32_i860_relocate_highadj): Likewise. gas: * config/tc-i860.c (md_apply_fix3): Do not insert the immediate if the fixup resulted in a relocation.
Diffstat (limited to 'bfd/elf32-i860.c')
-rw-r--r--bfd/elf32-i860.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/bfd/elf32-i860.c b/bfd/elf32-i860.c
index bc100933acc..08c2e16bd2e 100644
--- a/bfd/elf32-i860.c
+++ b/bfd/elf32-i860.c
@@ -709,20 +709,15 @@ elf32_i860_relocate_splitn (input_bfd, rello, contents, value)
bfd_byte *contents;
bfd_vma value;
{
- bfd_vma insn, t;
+ bfd_vma insn;
reloc_howto_type *howto;
howto = lookup_howto (ELF32_R_TYPE (rello->r_info));
insn = bfd_get_32 (input_bfd, contents + rello->r_offset);
- /* Remove encode bits and intervening bits. Then concatenate the
- two fields into one 16-bit quantity. */
- t = (insn & howto->src_mask);
- t = ((t >> 5) & 0xf8) | (t & 0x7ff);
-
/* Relocate. */
- value += (rello->r_addend + t);
+ value += rello->r_addend;
- /* Separate the fields and re-insert. */
+ /* Separate the fields and insert. */
value = (((value & 0xf8) << 5) | (value & 0x7ff)) & howto->dst_mask;
insn = (insn & ~howto->dst_mask) | value;
@@ -742,7 +737,7 @@ elf32_i860_relocate_pc16 (input_bfd, input_section, rello, contents, value)
bfd_byte *contents;
bfd_vma value;
{
- bfd_vma insn, t;
+ bfd_vma insn;
reloc_howto_type *howto;
howto = lookup_howto (ELF32_R_TYPE (rello->r_info));
insn = bfd_get_32 (input_bfd, contents + rello->r_offset);
@@ -752,15 +747,10 @@ elf32_i860_relocate_pc16 (input_bfd, input_section, rello, contents, value)
+ input_section->output_offset);
value -= rello->r_offset;
- /* Remove encode bits and intervening bits. Then concatenate the
- two fields into one 16-bit quantity. */
- t = (insn & howto->src_mask);
- t = ((t >> 5) & 0xf8) | (t & 0x7ff);
-
/* Relocate. */
- value += (rello->r_addend + t);
+ value += rello->r_addend;
- /* Separate the fields and re-insert. */
+ /* Separate the fields and insert. */
value = (((value & 0xf8) << 5) | (value & 0x7ff)) & howto->dst_mask;
insn = (insn & ~howto->dst_mask) | value;
@@ -785,7 +775,6 @@ elf32_i860_relocate_highadj (input_bfd, rel, contents, value)
value += ((rel->r_addend & 0x8000) << 1);
value += rel->r_addend;
value = ((value >> 16) & 0xffff);
- value = (value + (insn & 0xffff)) & 0xffff;
insn = (insn & 0xffff0000) | value;