aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Tobler <andreast@gcc.gnu.org>2017-01-23 20:35:50 +0100
committerAndreas Tobler <andreast@gcc.gnu.org>2017-01-23 20:35:50 +0100
commit53d190c120b3e98f54ed3093d22a72bdf87d690b (patch)
treeec451f4f46e888a583ffd35d833148960d200cb2
parentb0147ac2e62c3ed744d55fc5d009c4ef7a8ef651 (diff)
downloadgcc-53d190c120b3e98f54ed3093d22a72bdf87d690b.zip
gcc-53d190c120b3e98f54ed3093d22a72bdf87d690b.tar.gz
gcc-53d190c120b3e98f54ed3093d22a72bdf87d690b.tar.bz2
aarch64.c (aarch64_elf_asm_constructor): Increase size of buf.
2017-01-23 Andreas Tobler <andreast@gcc.gnu.org> * config/aarch64/aarch64.c (aarch64_elf_asm_constructor): Increase size of buf. (aarch64_elf_asm_destructor): Likewise. From-SVN: r244828
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/aarch64/aarch64.c10
2 files changed, 14 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 320298f..29d5574 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2017-01-23 Andreas Tobler <andreast@gcc.gnu.org>
+
+ * config/aarch64/aarch64.c (aarch64_elf_asm_constructor): Increase
+ size of buf.
+ (aarch64_elf_asm_destructor): Likewise.
+
2017-01-23 Bernd Schmidt <bschmidt@redhat.com>
PR rtl-optimization/78634
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index c3992d8..4607a35 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -5787,7 +5787,10 @@ aarch64_elf_asm_constructor (rtx symbol, int priority)
else
{
section *s;
- char buf[18];
+ /* While priority is known to be in range [0, 65535], so 18 bytes
+ would be enough, the compiler might not know that. To avoid
+ -Wformat-truncation false positive, use a larger size. */
+ char buf[23];
snprintf (buf, sizeof (buf), ".init_array.%.5u", priority);
s = get_section (buf, SECTION_WRITE, NULL);
switch_to_section (s);
@@ -5804,7 +5807,10 @@ aarch64_elf_asm_destructor (rtx symbol, int priority)
else
{
section *s;
- char buf[18];
+ /* While priority is known to be in range [0, 65535], so 18 bytes
+ would be enough, the compiler might not know that. To avoid
+ -Wformat-truncation false positive, use a larger size. */
+ char buf[23];
snprintf (buf, sizeof (buf), ".fini_array.%.5u", priority);
s = get_section (buf, SECTION_WRITE, NULL);
switch_to_section (s);