aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2025-08-15 12:21:24 +0200
committerJan Beulich <jbeulich@suse.com>2025-08-15 12:21:24 +0200
commitb011ae9fef4192a2b8c108eeb80c9cf20e8746d5 (patch)
tree57edf023290b39663353948132b46f5a8acb245c
parent98e6d3f5bd4e7e3cbd2718151cc54692f6740b65 (diff)
downloadbinutils-b011ae9fef4192a2b8c108eeb80c9cf20e8746d5.zip
binutils-b011ae9fef4192a2b8c108eeb80c9cf20e8746d5.tar.gz
binutils-b011ae9fef4192a2b8c108eeb80c9cf20e8746d5.tar.bz2
bfd/ELF/PPC: make ppc_build_one_stub()'s stub_str[] static
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.
-rw-r--r--bfd/elf64-ppc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 7868063..2cacc9e 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -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);