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].
+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
 
                         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))