summaryrefslogtreecommitdiff
path: root/gas/config/tc-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
commitec94c7e674f964bcfd63c9f5097a0d13c96c84ea (patch)
tree0b2468fd2a638ee192529890ef4d14d2dc832455 /gas/config/tc-i860.c
parent977915eaaec1fa5fe0591871c084f6a9f37d1d17 (diff)
downloadbinutils-redhat-ec94c7e674f964bcfd63c9f5097a0d13c96c84ea.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 'gas/config/tc-i860.c')
-rw-r--r--gas/config/tc-i860.c80
1 files changed, 56 insertions, 24 deletions
diff --git a/gas/config/tc-i860.c b/gas/config/tc-i860.c
index 2255eeef2b..56cad24b3e 100644
--- a/gas/config/tc-i860.c
+++ b/gas/config/tc-i860.c
@@ -1298,10 +1298,15 @@ md_apply_fix3 (fix, valuep, seg)
fix->fx_r_type = obtain_reloc_for_imm16 (fix, &val);
/* Insert the immediate. */
- insn |= val & 0xffff;
- bfd_putl32 (insn, buf);
-
- fix->fx_done = (fix->fx_addsy == 0);
+ if (fix->fx_addsy)
+ fix->fx_done = 0;
+ else
+ {
+ insn |= val & 0xffff;
+ bfd_putl32 (insn, buf);
+ fix->fx_r_type = BFD_RELOC_NONE;
+ fix->fx_done = 1;
+ }
}
else if (fup & OP_IMM_U16)
{
@@ -1312,11 +1317,16 @@ md_apply_fix3 (fix, valuep, seg)
fix->fx_r_type = obtain_reloc_for_imm16 (fix, &val);
/* Insert the immediate. */
- insn |= val & 0x7ff;
- insn |= (val & 0xf800) << 5;
- bfd_putl32 (insn, buf);
-
- fix->fx_done = (fix->fx_addsy == 0);
+ if (fix->fx_addsy)
+ fix->fx_done = 0;
+ else
+ {
+ insn |= val & 0x7ff;
+ insn |= (val & 0xf800) << 5;
+ bfd_putl32 (insn, buf);
+ fix->fx_r_type = BFD_RELOC_NONE;
+ fix->fx_done = 1;
+ }
}
else if (fup & OP_IMM_BR16)
{
@@ -1327,12 +1337,19 @@ md_apply_fix3 (fix, valuep, seg)
val = val >> 2;
/* Insert the immediate. */
- insn |= (val & 0x7ff);
- insn |= ((val & 0xf800) << 5);
- bfd_putl32 (insn, buf);
-
- fix->fx_r_type = BFD_RELOC_860_PC16;
- fix->fx_done = (fix->fx_addsy == 0);
+ if (fix->fx_addsy)
+ {
+ fix->fx_done = 0;
+ fix->fx_r_type = BFD_RELOC_860_PC16;
+ }
+ else
+ {
+ insn |= (val & 0x7ff);
+ insn |= ((val & 0xf800) << 5);
+ bfd_putl32 (insn, buf);
+ fix->fx_r_type = BFD_RELOC_NONE;
+ fix->fx_done = 1;
+ }
}
else if (fup & OP_IMM_BR26)
{
@@ -1343,11 +1360,18 @@ md_apply_fix3 (fix, valuep, seg)
val >>= 2;
/* Insert the immediate. */
- insn |= (val & 0x3ffffff);
- bfd_putl32 (insn, buf);
-
- fix->fx_r_type = BFD_RELOC_860_PC26;
- fix->fx_done = (fix->fx_addsy == 0);
+ if (fix->fx_addsy)
+ {
+ fix->fx_r_type = BFD_RELOC_860_PC26;
+ fix->fx_done = 0;
+ }
+ else
+ {
+ insn |= (val & 0x3ffffff);
+ bfd_putl32 (insn, buf);
+ fix->fx_r_type = BFD_RELOC_NONE;
+ fix->fx_done = 1;
+ }
}
else if (fup != OP_NONE)
{
@@ -1359,10 +1383,18 @@ md_apply_fix3 (fix, valuep, seg)
{
/* I believe only fix-ups such as ".long .ep.main-main+0xc8000000"
reach here (???). */
- insn |= (val & 0xffffffff);
- bfd_putl32 (insn, buf);
- fix->fx_r_type = BFD_RELOC_32;
- fix->fx_done = (fix->fx_addsy == 0);
+ if (fix->fx_addsy)
+ {
+ fix->fx_r_type = BFD_RELOC_32;
+ fix->fx_done = 0;
+ }
+ else
+ {
+ insn |= (val & 0xffffffff);
+ bfd_putl32 (insn, buf);
+ fix->fx_r_type = BFD_RELOC_NONE;
+ fix->fx_done = 1;
+ }
}
/* Return value ignored. */