]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix powerpc gas abort on invalid instruction fixups
authorAlan Modra <amodra@gmail.com>
Wed, 11 Mar 2015 07:23:50 +0000 (17:53 +1030)
committerAlan Modra <amodra@gmail.com>
Fri, 10 Jul 2015 10:27:30 +0000 (19:57 +0930)
* config/tc-ppc.c (md_assemble): Don't abort on 8 byte insn fixups.
(md_apply_fix): Report an error on data-only fixups used with insns.

gas/ChangeLog
gas/config/tc-ppc.c

index 8aea85258a5f42c4b7e78456aed3e185dbb10d78..68f5b7bf894e4ca9b67cb284b88bc735b4b10a0c 100644 (file)
@@ -1,3 +1,10 @@
+2015-07-10  Alan Modra  <amodra@gmail.com>
+
+       Apply from master
+       2015-03-11  Alan Modra  <amodra@gmail.com>
+       * config/tc-ppc.c (md_assemble): Don't abort on 8 byte insn fixups.
+       (md_apply_fix): Report an error on data-only fixups used with insns.
+
 2015-06-19  Nick Clifton  <nickc@redhat.com>
 
        PR gas/18541
index 189a22baf541e490383146318ee5064ca8370b3b..13d8dba31915b7348e21fd6153af40158ef78163 100644 (file)
@@ -3431,9 +3431,6 @@ md_assemble (char *str)
          size = bfd_get_reloc_size (reloc_howto);
          offset = target_big_endian ? (insn_length - size) : 0;
 
-         if (size < 1 || size > 4)
-           abort ();
-
          fixP = fix_new_exp (frag_now,
                              f - frag_now->fr_literal + offset,
                              size,
@@ -6774,6 +6771,29 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg)
          break;
 #endif
 
+       case BFD_RELOC_VTABLE_INHERIT:
+       case BFD_RELOC_VTABLE_ENTRY:
+       case BFD_RELOC_PPC_DTPMOD:
+       case BFD_RELOC_PPC_TPREL:
+       case BFD_RELOC_PPC_DTPREL:
+       case BFD_RELOC_PPC_COPY:
+       case BFD_RELOC_PPC_GLOB_DAT:
+       case BFD_RELOC_32_PLT_PCREL:
+       case BFD_RELOC_PPC_EMB_NADDR32:
+       case BFD_RELOC_PPC64_TOC:
+       case BFD_RELOC_CTOR:
+       case BFD_RELOC_32:
+       case BFD_RELOC_32_PCREL:
+       case BFD_RELOC_RVA:
+       case BFD_RELOC_64:
+       case BFD_RELOC_64_PCREL:
+       case BFD_RELOC_PPC64_ADDR64_LOCAL:
+         as_bad_where (fixP->fx_file, fixP->fx_line,
+                       _("%s unsupported as instruction fixup"),
+                       bfd_get_reloc_code_name (fixP->fx_r_type));
+         fixP->fx_done = 1;
+         return;
+
        default:
          break;
        }