+2018-02-02 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_relocate_section): Don't relocate nops
+ emitted for toc sequence optimization. Set and use "howto" later.
+
2018-02-01 Simon Marchi <simon.marchi@ericsson.com>
* elf64-ppc.c (ppc64_elf_archive_symbol_lookup): Avoid pointer
/* Multi-instruction sequences that access the TOC can be
optimized, eg. addis ra,r2,0; addi rb,ra,x;
to nop; addi rb,r2,x; */
- howto = ppc64_elf_howto_table[(int) r_type];
switch (r_type)
{
default:
{
bfd_byte *p = contents + (rel->r_offset & ~3);
bfd_put_32 (input_bfd, NOP, p);
+ goto copy_reloc;
}
break;
/* xgettext:c-format */
info->callbacks->minfo
(_("%H: warning: %s unexpected insn %#x.\n"),
- input_bfd, input_section, rel->r_offset, howto->name, insn);
+ input_bfd, input_section, rel->r_offset,
+ ppc64_elf_howto_table[r_type]->name, insn);
else
- bfd_put_32 (input_bfd, NOP, p);
+ {
+ bfd_put_32 (input_bfd, NOP, p);
+ goto copy_reloc;
+ }
}
break;
/* xgettext:c-format */
(_("%H: error: %s not a multiple of %u\n"),
input_bfd, input_section, rel->r_offset,
- howto->name,
+ ppc64_elf_howto_table[r_type]->name,
mask + 1);
bfd_set_error (bfd_error_bad_value);
ret = FALSE;
/* Dynamic relocs are not propagated for SEC_DEBUGGING sections
because such sections are not SEC_ALLOC and thus ld.so will
not process them. */
+ howto = ppc64_elf_howto_table[(int) r_type];
if (unresolved_reloc
&& !((input_section->flags & SEC_DEBUGGING) != 0
&& h->elf.def_dynamic)