From c4912c2414eceebef5c30bd504cb5c33c39d1c19 Mon Sep 17 00:00:00 2001 From: nickc Date: Sat, 20 Dec 2003 08:01:46 +0000 Subject: [PATCH] (md_apply_fix3): Handle the case where a .byte directive generates a pc-relative relocation. --- gas/ChangeLog | 5 +++++ gas/config/tc-ppc.c | 17 +++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 512b58c24b..dc47f4d0d1 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2003-12-20 Nick Clifton + + * config/tc-ppc.c (md_apply_fix3): Handle the case where a + .byte directive generates a pc-relative relocation. + 2003-12-19 Nick Clifton Andreas Schwab diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index f4cf419370..86daea0a36 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -5899,10 +5899,19 @@ md_apply_fix3 (fixP, valP, seg) case BFD_RELOC_8: if (fixP->fx_pcrel) - abort (); - - md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, - value, 1); + { + /* This can occur if there is a bug in the input assembler, eg: + ".byte - ." */ + 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: -- 2.11.0