This is the mail archive of the binutils@sourceware.org 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]

PATCH: Prevent h8300 targeted gas from aborting on .quad pseudo-ops


Hi Guys,

  The h8300 port of gas can run into an abort if it is asked to apply
  a fixup for an 8-byte value.  eg:

  	.section .debug_line
	.4byte		0xffffffff
	.quad		bar - foo
       foo:
       bar:

  I am applying the patch below so that an error message is generated
  instead.

Cheers
  Nick

gas/ChangeLog
2007-09-19  Nick Clifton  <nickc@redhat.com>

	* config/tc-h8300.c (md_apply_fix): Do not abort or handle 8 byte
	fixups.

Index: gas/config/tc-h8300.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-h8300.c,v
retrieving revision 1.54
diff -c -3 -p -r1.54 tc-h8300.c
*** gas/config/tc-h8300.c	3 Jul 2007 11:01:04 -0000	1.54
--- gas/config/tc-h8300.c	19 Sep 2007 15:22:03 -0000
*************** md_apply_fix (fixS *fixP, valueT *valP, 
*** 2129,2134 ****
--- 2129,2141 ----
        *buf++ = (val >> 8);
        *buf++ = val;
        break;
+     case 8:
+       /* This can arise when the .quad or .8byte pseudo-ops are used.
+ 	 Returning here (without setting fx_done) will cause the code
+ 	 to attempt to generate a reloc which will then fail with the
+ 	 slightly more helpful error message: "Cannot represent
+ 	 relocation type BFD_RELOC_64".  */
+       return;
      default:
        abort ();
      }


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