Avoid assembler warnings from AArch64 constructor/destructor priorities.
authorJoseph Myers <joseph@codesourcery.com>
Thu, 28 Sep 2017 13:08:28 +0000 (14:08 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Thu, 28 Sep 2017 13:08:28 +0000 (14:08 +0100)
Many GCC tests fail for AArch64 with current binutils because of
assembler warnings of the form "Warning: ignoring incorrect section
type for .init_array.00100".  The same issue was fixed for ARM in
r247015 by using SECTION_NOTYPE when creating those sections; this
patch applies the same fix to AArch64.

Tested with no regressions with cross to aarch64-linux-gnu.

* config/aarch64/aarch64.c (aarch64_elf_asm_constructor)
(aarch64_elf_asm_destructor): Pass SECTION_NOTYPE to get_section
when creating .init_array and .fini_array sections with priority
specified.

From-SVN: r253252

gcc/ChangeLog
gcc/config/aarch64/aarch64.c

index 71b1408496a48d88d07ebf960863b7a3e295f018..718f0426368db8eb37144fe7903b6125576b0104 100644 (file)
@@ -1,3 +1,10 @@
+2017-09-28  Joseph Myers  <joseph@codesourcery.com>
+
+       * config/aarch64/aarch64.c (aarch64_elf_asm_constructor)
+       (aarch64_elf_asm_destructor): Pass SECTION_NOTYPE to get_section
+       when creating .init_array and .fini_array sections with priority
+       specified.
+
 2017-09-27  Christophe Lyon  <christophe.lyon@linaro.org>
 
        PR target/71727
index 4c411df12ce00018a47e9086bb21ea6e950e3bf1..23f5afff95a312138e0090125a4be8b5cdb59090 100644 (file)
@@ -6095,7 +6095,7 @@ aarch64_elf_asm_constructor (rtx symbol, int priority)
          -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);
+      s = get_section (buf, SECTION_WRITE | SECTION_NOTYPE, NULL);
       switch_to_section (s);
       assemble_align (POINTER_SIZE);
       assemble_aligned_integer (POINTER_BYTES, symbol);
@@ -6115,7 +6115,7 @@ aarch64_elf_asm_destructor (rtx symbol, int priority)
          -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);
+      s = get_section (buf, SECTION_WRITE | SECTION_NOTYPE, NULL);
       switch_to_section (s);
       assemble_align (POINTER_SIZE);
       assemble_aligned_integer (POINTER_BYTES, symbol);