Internal assembler error

Nick Clifton nickc@redhat.com
Thu Jan 25 12:26:00 GMT 2001


Hi Axel,

: Here is my most possible reduced file raising this:
: ------------------------------------------------------------
: PushRegs: .macro mysp 
:            movem.l %d2-%d7/%a2-%a6,-(mysp) 
:           .endm
: 
: _init:
: PushRegs   %sp                  
: ------------------------------------------------------------
: 
: this is the output it yields:
: ------------------------------------------------------------
: GNU assembler version 2.10.1 (m68k-elf) using BFD version 2.10.1
: a.s: Assembler messages:
: a.s:6: Error: Negative of non-absolute symbol mysp
: a.s:6: Internal error, aborting at ../../src/binutils/gas/config/tc-m68k.c
:  line 844 in tc_gen_reloc
: Please report this bug.
: ------------------------------------------------------------
: 
: Okay, reported it :o)

Thanks for reporting this.  It turns out that the abort is unnecessary
since a relevant error message has already been generated.

In case you are interested the error occurs because you are missing a
backslash in the macro definition:

            movem.l %d2-%d7/%a2-%a6,-(\mysp)

This should work as desired.

The patch below removes the abort and fixes a couple of compile time
warning messages.  I will check it into the repository shortly.

Cheers
	Nick

2001-01-25  Nick Clifton  <nickc@redhat.com>

	* config/tc-m68k.c (tc_gen_reloc): Do not abort if tcbit is
	still set.  Issue an error message instead.
	(md_estimate_size_before_relax): Delete unused variable
	'buffer_address'.  Fixup parentheses around if statement.
	

Index: config/tc-m68k.c
===================================================================
RCS file: /cvs/src//src/gas/config/tc-m68k.c,v
retrieving revision 1.16
diff -p -r1.16 tc-m68k.c
*** tc-m68k.c	2001/01/14 18:54:06	1.16
--- tc-m68k.c	2001/01/25 20:24:18
*************** tc_gen_reloc (section, fixp)
*** 874,881 ****
    arelent *reloc;
    bfd_reloc_code_real_type code;
  
    if (fixp->fx_tcbit)
!     abort ();
  
    if (fixp->fx_r_type != BFD_RELOC_NONE)
      {
--- 874,891 ----
    arelent *reloc;
    bfd_reloc_code_real_type code;
  
+   /* If the tcbit is set, then this was a fixup of a negative value
+      that was never resolved.  We do not have a reloc to handle this,
+      so just return.  We assume that other code will have detected this
+      situation and produced a helpful error message, so we just tell the
+      user that the reloc cannot be produced.  */
    if (fixp->fx_tcbit)
!     {
!       if (fixp->fx_addsy)
! 	as_bad (_("Unable to produce reloc against symbol '%s'"),
! 		S_GET_NAME (fixp->fx_addsy));
!       return NULL;
!     }
  
    if (fixp->fx_r_type != BFD_RELOC_NONE)
      {
*************** md_estimate_size_before_relax (fragP, se
*** 4564,4570 ****
       segT segment;
  {
    int old_fix;
-   register char *buffer_address = fragP->fr_fix + fragP->fr_literal;
  
    old_fix = fragP->fr_fix;
  
--- 4574,4579 ----
*************** md_estimate_size_before_relax (fragP, se
*** 4652,4659 ****
      case TAB (DBCCLBR, SZ_UNDEF):
      case TAB (DBCCABSJ, SZ_UNDEF):
        {
! 	if (S_GET_SEGMENT (fragP->fr_symbol) == segment
! 	    && relaxable_symbol (fragP->fr_symbol)
  	    || flag_short_refs)
  	  {
  	    fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT);
--- 4661,4668 ----
      case TAB (DBCCLBR, SZ_UNDEF):
      case TAB (DBCCABSJ, SZ_UNDEF):
        {
! 	if ((S_GET_SEGMENT (fragP->fr_symbol) == segment
! 	     && relaxable_symbol (fragP->fr_symbol))
  	    || flag_short_refs)
  	  {
  	    fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT);


More information about the Binutils mailing list