• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisiond830549dba59f4e11412fd6dc18b7b1d4c6cf557 (tree)
Zeit2018-02-02 21:16:40
AutorAlan Modra <amodra@gmai...>
CommiterAlan Modra

Log Message

PowerPC64, don't relocate nops

This fixes a "bug" in that nops emitted as part of code optimization
were being relocated. As it happens the relocation value was always
zero so the nop wasn't changed. Whew! I've also moved the use of
"howto" later since I was caught out in some recent code changes with
the howto not matching r_type.

* elf64-ppc.c (ppc64_elf_relocate_section): Don't relocate nops
emitted for toc sequence optimization. Set and use "howto" later.

Ändern Zusammenfassung

Diff

--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
1+2018-02-02 Alan Modra <amodra@gmail.com>
2+
3+ * elf64-ppc.c (ppc64_elf_relocate_section): Don't relocate nops
4+ emitted for toc sequence optimization. Set and use "howto" later.
5+
16 2018-02-01 Simon Marchi <simon.marchi@ericsson.com>
27
38 * elf64-ppc.c (ppc64_elf_archive_symbol_lookup): Avoid pointer
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -15067,7 +15067,6 @@ ppc64_elf_relocate_section (bfd *output_bfd,
1506715067 /* Multi-instruction sequences that access the TOC can be
1506815068 optimized, eg. addis ra,r2,0; addi rb,ra,x;
1506915069 to nop; addi rb,r2,x; */
15070- howto = ppc64_elf_howto_table[(int) r_type];
1507115070 switch (r_type)
1507215071 {
1507315072 default:
@@ -15099,6 +15098,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
1509915098 {
1510015099 bfd_byte *p = contents + (rel->r_offset & ~3);
1510115100 bfd_put_32 (input_bfd, NOP, p);
15101+ goto copy_reloc;
1510215102 }
1510315103 break;
1510415104
@@ -15140,9 +15140,13 @@ ppc64_elf_relocate_section (bfd *output_bfd,
1514015140 /* xgettext:c-format */
1514115141 info->callbacks->minfo
1514215142 (_("%H: warning: %s unexpected insn %#x.\n"),
15143- input_bfd, input_section, rel->r_offset, howto->name, insn);
15143+ input_bfd, input_section, rel->r_offset,
15144+ ppc64_elf_howto_table[r_type]->name, insn);
1514415145 else
15145- bfd_put_32 (input_bfd, NOP, p);
15146+ {
15147+ bfd_put_32 (input_bfd, NOP, p);
15148+ goto copy_reloc;
15149+ }
1514615150 }
1514715151 break;
1514815152
@@ -15240,7 +15244,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
1524015244 /* xgettext:c-format */
1524115245 (_("%H: error: %s not a multiple of %u\n"),
1524215246 input_bfd, input_section, rel->r_offset,
15243- howto->name,
15247+ ppc64_elf_howto_table[r_type]->name,
1524415248 mask + 1);
1524515249 bfd_set_error (bfd_error_bad_value);
1524615250 ret = FALSE;
@@ -15252,6 +15256,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
1525215256 /* Dynamic relocs are not propagated for SEC_DEBUGGING sections
1525315257 because such sections are not SEC_ALLOC and thus ld.so will
1525415258 not process them. */
15259+ howto = ppc64_elf_howto_table[(int) r_type];
1525515260 if (unresolved_reloc
1525615261 && !((input_section->flags & SEC_DEBUGGING) != 0
1525715262 && h->elf.def_dynamic)