]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR26489, ASAN: ppc64_elf_size_stubs elf64-ppc.c:13389
authorAlan Modra <amodra@gmail.com>
Mon, 24 Aug 2020 16:25:38 +0000 (01:55 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 28 Jan 2021 01:21:12 +0000 (11:51 +1030)
Stub sections are inserted after sec_info is sized, so have higher ids.
Test flags that will exclude stub sections before looking at the
sec_info array.

PR 26489
* elf64-ppc.c (ppc64_elf_size_stubs): Test code_sec->has_toc_reloc
and code_sec->makes_toc_func_call before sec_info[code_sec->id].

(cherry picked from commit 918dc783deadc206691dcc20bf8aa6c807c10244)

bfd/ChangeLog
bfd/elf64-ppc.c

index 8615b08cc56ff66e856a7e56651131dae6cf1f4f..4d94806609c790c74d25fbe14bdfbf54dc76283c 100644 (file)
@@ -1,6 +1,11 @@
 2021-01-28  Alan Modra  <amodra@gmail.com>
 
        Apply from master
+       2020-08-25  Alan Modra  <amodra@gmail.com>
+       PR 26489
+       * elf64-ppc.c (ppc64_elf_size_stubs): Test code_sec->has_toc_reloc
+       and code_sec->makes_toc_func_call before sec_info[code_sec->id].
+
        2020-08-25  Alan Modra  <amodra@gmail.com>
        PR 26492
        * elf64-ppc.c (ppc_hash_table): Test is_elf_hash_table before
index aef161c029fb4ed8fb898fa1e103f5040cb56d4b..f1bce4a70381f8ab6281e1572b017229d23aadbd 100644 (file)
@@ -13504,10 +13504,10 @@ ppc64_elf_size_stubs (struct bfd_link_info *info)
                         fact a call needing a TOC adjustment.  */
                      if ((code_sec != NULL
                           && code_sec->output_section != NULL
-                          && (htab->sec_info[code_sec->id].toc_off
-                              != htab->sec_info[section->id].toc_off)
                           && (code_sec->has_toc_reloc
-                              || code_sec->makes_toc_func_call))
+                              || code_sec->makes_toc_func_call)
+                          && (htab->sec_info[code_sec->id].toc_off
+                              != htab->sec_info[section->id].toc_off))
                          || (((hash ? hash->elf.other : sym->st_other)
                               & STO_PPC64_LOCAL_MASK)
                              == 1 << STO_PPC64_LOCAL_BIT))