Minor H8 gas fix
law@redhat.com
law@redhat.com
Tue Sep 4 18:59:00 GMT 2001
Taking the difference of two undefined symbols was not giving an error. This
patch fixes that little problem.
* tc-h8300.c (tc_gen_reloc): Give an error if we try to take the
address of two symbols in different sections.
Index: tc-h8300.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gas/config/tc-h8300.c,v
retrieving revision 1.79
diff -c -3 -p -r1.79 tc-h8300.c
*** tc-h8300.c 2001/08/31 22:39:59 1.79
--- tc-h8300.c 2001/09/05 01:58:02
*************** tc_gen_reloc (section, fixp)
*** 1623,1628 ****
--- 1623,1639 ----
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);
More information about the Binutils
mailing list