aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2001-04-24 15:22:25 +0000
committerNick Clifton <nickc@redhat.com>2001-04-24 15:22:25 +0000
commit6840198f93340023b478d4df838efb37b9b27998 (patch)
treef456409a1dcc4b56504c63543d007a08d8649371 /bfd
parentb3baf5d0a8293b5f823c0d7848494507edb373fb (diff)
downloadfsf-binutils-gdb-6840198f93340023b478d4df838efb37b9b27998.zip
fsf-binutils-gdb-6840198f93340023b478d4df838efb37b9b27998.tar.gz
fsf-binutils-gdb-6840198f93340023b478d4df838efb37b9b27998.tar.bz2
z8k fixes
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/coff-z8k.c103
-rw-r--r--bfd/po/bfd.pot10
3 files changed, 113 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 098b95f..9a55ee0 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2001-04-24 Christian Groessler <cpg@aladdin.de>
+
+ * coff-z8k.c (extra_case): added handler for R_DISP7, R_CALLR
+ and R_REL16 reloc types; accept odd values for R_REL16 type
+
2001-04-24 Johan Rydberg <jrydberg@opencores.org>
* cpu-openrisc.c: New file.
diff --git a/bfd/coff-z8k.c b/bfd/coff-z8k.c
index cfbdbdd..2e5da48 100644
--- a/bfd/coff-z8k.c
+++ b/bfd/coff-z8k.c
@@ -49,10 +49,23 @@ HOWTO (R_IMM8, 0, 1, 8, false, 0,
complain_overflow_bitfield, 0, "r_imm8", true, 0x000000ff, 0x000000ff,
false);
+static reloc_howto_type r_rel16 =
+HOWTO (R_REL16, 0, 1, 16, false, 0,
+ complain_overflow_bitfield, 0, "r_rel16", true, 0x0000ffff, 0x0000ffff,
+ true);
+
static reloc_howto_type r_jr =
HOWTO (R_JR, 0, 1, 8, true, 0, complain_overflow_signed, 0,
"r_jr", true, 0, 0, true);
+static reloc_howto_type r_disp7 =
+HOWTO (R_DISP7, 0, 1, 7, true, 0, complain_overflow_bitfield, 0,
+ "r_disp7", true, 0, 0, true);
+
+static reloc_howto_type r_callr =
+HOWTO (R_CALLR, 0, 1, 12, true, 0, complain_overflow_signed, 0,
+ "r_callr", true, 0xfff, 0xfff, true);
+
/* Turn a howto into a reloc number */
static int
@@ -97,6 +110,15 @@ rtype2howto (internal, dst)
case R_JR:
internal->howto = &r_jr;
break;
+ case R_DISP7:
+ internal->howto = &r_disp7;
+ break;
+ case R_CALLR:
+ internal->howto = &r_callr;
+ break;
+ case R_REL16:
+ internal->howto = &r_rel16;
+ break;
case R_IMM32:
internal->howto = &r_imm32;
break;
@@ -215,6 +237,87 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
(*src_ptr)++;
break;
}
+
+ case R_DISP7:
+ {
+ bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
+ input_section);
+ bfd_vma dot = (link_order->offset
+ + *dst_ptr
+ + input_section->output_section->vma);
+ int gap = dst - dot - 1;/* -1 since were in the odd byte of the
+ word and the pc's been incremented */
+
+ if (gap & 1)
+ abort ();
+ gap /= 2;
+
+ if (gap > 0 || gap < -128)
+ {
+ if (! ((*link_info->callbacks->reloc_overflow)
+ (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+ reloc->howto->name, reloc->addend, input_section->owner,
+ input_section, reloc->address)))
+ abort ();
+ }
+ bfd_put_8 (in_abfd,
+ (bfd_get_8 ( in_abfd, data + *dst_ptr) & 0x80) + (-gap & 0x7f),
+ data + *dst_ptr);
+ (*dst_ptr)++;
+ (*src_ptr)++;
+ break;
+ }
+
+ case R_CALLR:
+ {
+ bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
+ input_section);
+ bfd_vma dot = (link_order->offset
+ + *dst_ptr
+ + input_section->output_section->vma);
+ int gap = dst - dot - 2;
+
+ if (gap & 1)
+ abort ();
+ gap /= 2;
+ if (gap > 8191 || gap < -8192)
+ {
+ if (! ((*link_info->callbacks->reloc_overflow)
+ (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+ reloc->howto->name, reloc->addend, input_section->owner,
+ input_section, reloc->address)))
+ abort ();
+ }
+ bfd_put_16 (in_abfd,
+ (bfd_get_16 ( in_abfd, data + *dst_ptr) & 0xf000) | (-gap & 0x0fff),
+ data + *dst_ptr);
+ (*dst_ptr) += 2;
+ (*src_ptr) += 2;
+ break;
+ }
+
+ case R_REL16:
+ {
+ bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
+ input_section);
+ bfd_vma dot = (link_order->offset
+ + *dst_ptr
+ + input_section->output_section->vma);
+ int gap = dst - dot - 2;
+
+ if (gap > 32767 || gap < -32768)
+ {
+ if (! ((*link_info->callbacks->reloc_overflow)
+ (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+ reloc->howto->name, reloc->addend, input_section->owner,
+ input_section, reloc->address)))
+ abort ();
+ }
+ bfd_put_16 (in_abfd,gap,data + *dst_ptr);
+ (*dst_ptr) += 2;
+ (*src_ptr) += 2;
+ break;
+ }
default:
abort ();
}
diff --git a/bfd/po/bfd.pot b/bfd/po/bfd.pot
index 1331060..a07beac 100644
--- a/bfd/po/bfd.pot
+++ b/bfd/po/bfd.pot
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2001-04-24 16:35+0100\n"
+"POT-Creation-Date: 2001-04-24 17:11+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -564,13 +564,13 @@ msgstr ""
#: elf-m10200.c:451 elf-m10300.c:663 elf32-arm.h:1939 elf32-avr.c:842
#: elf32-cris.c:1335 elf32-d10v.c:478 elf32-fr30.c:648 elf32-i860.c:1049
-#: elf32-m32r.c:1266 elf32-openrisc.c:448 elf32-v850.c:1681
+#: elf32-m32r.c:1266 elf32-openrisc.c:449 elf32-v850.c:1681
msgid "internal error: out of range error"
msgstr ""
#: elf-m10200.c:455 elf-m10300.c:667 elf32-arm.h:1943 elf32-avr.c:846
#: elf32-cris.c:1339 elf32-d10v.c:482 elf32-fr30.c:652 elf32-i860.c:1053
-#: elf32-m32r.c:1270 elf32-mips.c:7046 elf32-openrisc.c:452 elf32-v850.c:1685
+#: elf32-m32r.c:1270 elf32-mips.c:7046 elf32-openrisc.c:453 elf32-v850.c:1685
msgid "internal error: unsupported relocation error"
msgstr ""
@@ -581,7 +581,7 @@ msgstr ""
#: elf-m10200.c:463 elf-m10300.c:675 elf32-arm.h:1951 elf32-avr.c:854
#: elf32-cris.c:1347 elf32-d10v.c:490 elf32-fr30.c:660 elf32-i860.c:1061
-#: elf32-m32r.c:1278 elf32-openrisc.c:460 elf32-v850.c:1705
+#: elf32-m32r.c:1278 elf32-openrisc.c:461 elf32-v850.c:1705
msgid "internal error: unknown error"
msgstr ""
@@ -736,7 +736,7 @@ msgid "<Unrecognised flag bits set>"
msgstr ""
#: elf32-avr.c:850 elf32-cris.c:1343 elf32-fr30.c:656 elf32-i860.c:1057
-#: elf32-openrisc.c:456 elf32-v850.c:1689
+#: elf32-openrisc.c:457 elf32-v850.c:1689
msgid "internal error: dangerous relocation"
msgstr ""