This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[MIPS patch RFA] don't crash on ".byte symbol"


code like:

	.byte symbol

would cause the assembler to abort at end of file (indicating file
name and number of last line of file).

not that you'd ever want to do that on mips, if you tried (e.g. via
accidental use of undefined cpp macro) the abort made it hard to find
the actual problem.


cgd
==============================================================================
[ gas/ChangeLog] 
2002-09-12  Chris Demetriou  <cgd@broadcom.com>

	* config/tc-mips.c (md_apply_fix3): Just return for BFD_RELOC_8.

[ gas/testsuite/ChangeLog ]
2002-09-12  Chris Demetriou  <cgd@broadcom.com>

	* gas/mips/baddata1.s: New file.
	* gas/mips/baddata1.l: New file.
	* gas/mips/mips.exp: Run new test.

Index: config/tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.162
diff -u -p -r1.162 tc-mips.c
--- config/tc-mips.c	5 Sep 2002 00:01:18 -0000	1.162
+++ config/tc-mips.c	13 Sep 2002 03:43:36 -0000
@@ -10643,6 +10643,10 @@ md_apply_fix3 (fixP, valP, seg)
   long insn;
   valueT value;
 
+  /* FIXME: Maybe just return for all reloc types not listed below?  */
+  if (fixP->fx_r_type == BFD_RELOC_8)
+      return;
+
   assert (fixP->fx_size == 4
 	  || fixP->fx_r_type == BFD_RELOC_16
 	  || fixP->fx_r_type == BFD_RELOC_32
Index: testsuite/gas/mips/baddata1.l
===================================================================
RCS file: testsuite/gas/mips/baddata1.l
diff -N testsuite/gas/mips/baddata1.l
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ testsuite/gas/mips/baddata1.l	13 Sep 2002 03:43:36 -0000
@@ -0,0 +1,3 @@
+.*: Assembler messages:
+.*:8: Error: Can not represent BFD_RELOC_8 relocation in this object file format
+.*:9: Error: Can not represent BFD_RELOC_8 relocation in this object file format
Index: testsuite/gas/mips/baddata1.s
===================================================================
RCS file: testsuite/gas/mips/baddata1.s
diff -N testsuite/gas/mips/baddata1.s
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ testsuite/gas/mips/baddata1.s	13 Sep 2002 03:43:36 -0000
@@ -0,0 +1,9 @@
+# Source file used to some bad data declarations.
+
+	.globl x
+
+	.data
+foo:
+	# no way these are going to hold the pointers.
+	.byte	x
+	.byte	x+1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]