]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
bfd/ELF/PPC: make ppc_build_one_stub()'s stub_str[] static
authorJan Beulich <jbeulich@suse.com>
Fri, 15 Aug 2025 10:21:24 +0000 (12:21 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 15 Aug 2025 10:21:24 +0000 (12:21 +0200)
There's no reason to have the compiler materialize objects onto the
stack.

In fact we can save some space and a level of indirection (and hence
relocation entries in the final binary) by converting to an array of
char[12] or larger. Pick char[16] for easier / faster calculations.

bfd/elf64-ppc.c

index 78680630c6ed3b4eb7ad1af3a21af8e4c5c9f582..2cacc9e27a2156a7a8a063f165ff79098daba360 100644 (file)
@@ -12226,9 +12226,9 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
       struct elf_link_hash_entry *h;
       size_t len1, len2;
       char *name;
-      const char *const stub_str[] = { "long_branch",
-                                      "plt_branch",
-                                      "plt_call" };
+      static const char stub_str[][16] = { "long_branch",
+                                          "plt_branch",
+                                          "plt_call" };
 
       len1 = strlen (stub_str[stub_entry->type.main - 1]);
       len2 = strlen (stub_entry->root.string);