[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "bug" in GNU assembler.
From: |
Nick Clifton |
Subject: |
Re: "bug" in GNU assembler. |
Date: |
Fri, 19 Dec 2003 10:21:02 +0000 |
User-agent: |
Gnus/5.1001 (Gnus v5.10.1) Emacs/21.2 (gnu/linux) |
Hi Josh, Hi Geoff,
> doing the following:
>> .macro cstring string
>> .byte 0f-(.-1)
>> .byte "\string"
>> 1:
>> .endm
>> .data
>>
>> cstring "testing..."
> produces:
> {standard input}: Assembler messages:
> {standard input}:9: Internal error, aborting at config/tc-ppc.c line 5824 in
> md_apply_fix3
> Please report this bug.
>
> Note that in the macro I used a reference to label 0, and then accidentally
> defined label 1: instead (0: is never defined). So as I said, this isn't in
> any way a serious bug, but it said to report it, so I figured, "why not?"
Thanks very much for reporting this bug. The assembler should never
really generate an internal error, so it was very helpful that you
reported it.
Geoff - here is a proposed patch to fix the problem. Any objections
to my applying it ?
Cheers
Nick
2003-12-19 Nick Clifton <address@hidden>
* config/tc-ppc.c (md_apply_fix3): Handle the case where a
.byte directive generates a pc-relative relocation.
Index: gas/config/tc-ppc.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ppc.c,v
retrieving revision 1.85
diff -c -3 -p -r1.85 tc-ppc.c
*** gas/config/tc-ppc.c 10 Dec 2003 22:12:50 -0000 1.85
--- gas/config/tc-ppc.c 19 Dec 2003 10:24:22 -0000
*************** md_apply_fix3 (fixP, valP, seg)
*** 5899,5908 ****
case BFD_RELOC_8:
if (fixP->fx_pcrel)
! abort ();
!
! md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where,
! value, 1);
break;
case BFD_RELOC_24_PLT_PCREL:
--- 5899,5917 ----
case BFD_RELOC_8:
if (fixP->fx_pcrel)
! {
! /* This can occur if there is a bug in the input assembler, eg:
! ".byte <undefined_symbol> - ." */
! if (fixP->fx_addsy)
! as_bad (_("Unable to handle reference to symbol %s"),
! S_GET_NAME (fixP->fx_addsy));
! else
! as_bad (_("Unable to resolve expression"));
! fixP->fx_done = 1;
! }
! else
! md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where,
! value, 1);
break;
case BFD_RELOC_24_PLT_PCREL: