summaryrefslogtreecommitdiffstats
path: root/gas/config/tc-h8300.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2001-09-05 02:01:08 +0000
committerJeff Law <law@redhat.com>2001-09-05 02:01:08 +0000
commitde342d07b98eff6da5067f59d7f67ba17aa63043 (patch)
tree9b7504ec9e9ad4b05038dba5b51e4c8ea606b710 /gas/config/tc-h8300.c
parent9ea0568f79a9a34409d6c8c3a48e17738628c88b (diff)
downloadppe42-binutils-de342d07b98eff6da5067f59d7f67ba17aa63043.tar.gz
ppe42-binutils-de342d07b98eff6da5067f59d7f67ba17aa63043.zip
* tc-h8300.c (tc_gen_reloc): Give an error if we try to take the
address of two symbols in different sections.
Diffstat (limited to 'gas/config/tc-h8300.c')
-rw-r--r--gas/config/tc-h8300.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gas/config/tc-h8300.c b/gas/config/tc-h8300.c
index f4f5063054..05c49dced9 100644
--- a/gas/config/tc-h8300.c
+++ b/gas/config/tc-h8300.c
@@ -1147,9 +1147,8 @@ build_bytes (this_try, operand)
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, "@");
@@ -1624,6 +1623,17 @@ tc_gen_reloc (section, fixp)
arelent *rel;
bfd_reloc_code_real_type r_type;
+ if (fixp->fx_addsy && fixp->fx_subsy)
+ {
+ if ((S_GET_SEGMENT (fixp->fx_addsy) != S_GET_SEGMENT (fixp->fx_subsy))
+ || S_GET_SEGMENT (fixp->fx_addsy) == undefined_section)
+ {
+ as_bad_where (fixp->fx_file, fixp->fx_line,
+ "Difference of symbols in different sections is not supported");
+ return NULL;
+ }
+ }
+
rel = (arelent *) xmalloc (sizeof (arelent));
rel->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
*rel->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
OpenPOWER on IntegriCloud