aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-mn10300.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1996-11-25 15:54:43 +0000
committerJeff Law <law@redhat.com>1996-11-25 15:54:43 +0000
commit0671e7f6c6efbcc1d072bba751d75c18e4562ecd (patch)
treef46e57cb50621dd68c2e043ded3c8ebdc190546e /gas/config/tc-mn10300.c
parentb016565b0cd8d6d9713b7fb3c6c80104d7672cde (diff)
downloadgdb-0671e7f6c6efbcc1d072bba751d75c18e4562ecd.zip
gdb-0671e7f6c6efbcc1d072bba751d75c18e4562ecd.tar.gz
gdb-0671e7f6c6efbcc1d072bba751d75c18e4562ecd.tar.bz2
* config/tc-mn10300.c (md_assemble): Correctly determine the
correct location and type for each relocation. (md_pcrel_from): Simplify. Last week's reloc work.
Diffstat (limited to 'gas/config/tc-mn10300.c')
-rw-r--r--gas/config/tc-mn10300.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c
index 5e0e901..bc6a746 100644
--- a/gas/config/tc-mn10300.c
+++ b/gas/config/tc-mn10300.c
@@ -846,15 +846,16 @@ keep_going:
|| ((insn >> 16) & 0xffff) == 0xfe02))
size -= 1;
- /* Determine offset from start of this insn to insert the
- reloc. Except for a few exceptions we insert the reloc
- at the tail of the instruction. */
offset = size - reloc_size / 8;
/* Choose a proper BFD relocation type. */
if (pcrel)
{
- if (reloc_size == 32)
+ if (size == 6)
+ reloc = BFD_RELOC_MN10300_32_PCREL;
+ else if (size == 4)
+ reloc = BFD_RELOC_MN10300_16_PCREL;
+ else if (reloc_size == 32)
reloc = BFD_RELOC_32_PCREL;
else if (reloc_size == 16)
reloc = BFD_RELOC_16_PCREL;
@@ -866,9 +867,9 @@ keep_going:
else
{
if (reloc_size == 32)
- reloc = BFD_RELOC_32;
+ reloc = BFD_RELOC_MN10300_32B;
else if (reloc_size == 16)
- reloc = BFD_RELOC_16;
+ reloc = BFD_RELOC_MN10300_16B;
else if (reloc_size == 8)
reloc = BFD_RELOC_8;
else
@@ -928,12 +929,15 @@ long
md_pcrel_from (fixp)
fixS *fixp;
{
+ return fixp->fx_frag->fr_address;
+#if 0
if (fixp->fx_addsy != (symbolS *) NULL && ! S_IS_DEFINED (fixp->fx_addsy))
{
/* The symbol is undefined. Let the linker figure it out. */
return 0;
}
return fixp->fx_frag->fr_address + fixp->fx_where;
+#endif
}
int