This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Minor H8 gas fix
- To: binutils at sources dot redhat dot com
- Subject: Minor H8 gas fix
- From: law at redhat dot com
- Date: Tue, 04 Sep 2001 20:01:30 -0600
- Reply-to: law at redhat dot com
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);