diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2017-01-30 10:19:18 +0000 |
---|---|---|
committer | Yvan Roux <yvan.roux@linaro.org> | 2017-01-30 13:43:39 +0000 |
commit | 2b185a9d862869294261d2f46d64ed740f8d8435 (patch) | |
tree | 6b42f06588fccc49dbd2e9a4d46d34ae387ddd2c /gcc | |
parent | 8922226a4e4b1a7f05cfedcecc09a2c50047340c (diff) |
gcc/
Backport from trunk r244828.
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.
Change-Id: I22482fe29e558254616a97aeddd6b39c48718a85
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index c2bf18c1689..354207dd790 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -5464,7 +5464,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); @@ -5481,7 +5484,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); |