aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2001-08-31 22:43:55 +0000
committerJeff Law <law@redhat.com>2001-08-31 22:43:55 +0000
commit3c1ba8a308d2b42dee2b91f8bedfd0fae6f9fa7f (patch)
tree03e6814effb14b4bea77cab7e15314af385ba769 /gas/config
parent6140b3b903cb5f99180280ecb0e22b1e0a49daa3 (diff)
downloadgdb-3c1ba8a308d2b42dee2b91f8bedfd0fae6f9fa7f.zip
gdb-3c1ba8a308d2b42dee2b91f8bedfd0fae6f9fa7f.tar.gz
gdb-3c1ba8a308d2b42dee2b91f8bedfd0fae6f9fa7f.tar.bz2
* config/tc-h8300.c (build_bytes): For OBJ_ELF, make relocation's
offset match H8 ELF spec. (md_section_align): Alternate implementation for BFD_ASSEMBLER. (md_apply_fix): Fix argument and return types for BFD_ASSEMBLER.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-h8300.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/gas/config/tc-h8300.c b/gas/config/tc-h8300.c
index 19ec6df..f4f5063 100644
--- a/gas/config/tc-h8300.c
+++ b/gas/config/tc-h8300.c
@@ -1140,6 +1140,16 @@ build_bytes (this_try, operand)
}
else if (x & ABSJMP)
{
+ int where = 0;
+
+#ifdef OBJ_ELF
+ /* To be compatible with the proposed H8 ELF format, we
+ want the relocation's offset to point to the first byte
+ that will be modified, not to the start of the instruction. */
+ where += 1;
+
+
+#endif
/* This jmp may be a jump or a branch. */
check_operand (operand + i, Hmode ? 0xffffff : 0xffff, "@");
@@ -1152,7 +1162,7 @@ build_bytes (this_try, operand)
operand[i].exp.X_add_number =
((operand[i].exp.X_add_number & 0xffff) ^ 0x8000) - 0x8000;
fix_new_exp (frag_now,
- output - frag_now->fr_literal,
+ output - frag_now->fr_literal + where,
4,
&operand[i].exp,
0,
@@ -1458,21 +1468,43 @@ md_convert_frag (headers, seg, fragP)
abort ();
}
+#ifdef BFD_ASSEMBLER
+valueT
+md_section_align (segment, size)
+ segT segment;
+ valueT size;
+{
+ int align = bfd_get_section_alignment (stdoutput, segment);
+ return ((size + (1 << align) - 1) & (-1 << align));
+}
+#else
valueT
md_section_align (seg, size)
segT seg;
valueT size;
{
return ((size + (1 << section_alignment[(int) seg]) - 1)
- & (-1 << section_alignment[(int) seg]));
+ & (-1 << section_alignment[(int) seg]));
}
+#endif
+
+#ifdef BFD_ASSEMBLER
+int
+md_apply_fix (fixP, valp)
+ fixS *fixP;
+ valueT *valp;
+#else
void
md_apply_fix (fixP, val)
fixS *fixP;
long val;
+#endif
{
char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;
+#ifdef BFD_ASSEMBLER
+ long val = *valp;
+#endif
switch (fixP->fx_size)
{