public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: <gcc-patches@gcc.gnu.org>
Cc: <richard.earnshaw@arm.com>, <james.greenhalgh@arm.com>,
	<marcus.shawcroft@arm.com>
Subject: Avoid assembler warnings from AArch64 constructor/destructor priorities
Date: Thu, 28 Sep 2017 12:31:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.20.1709281230570.19741@digraph.polyomino.org.uk> (raw)

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.  OK to
commit?

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.

Index: gcc/config/aarch64/aarch64.c
===================================================================
--- gcc/config/aarch64/aarch64.c	(revision 253248)
+++ gcc/config/aarch64/aarch64.c	(working copy)
@@ -6095,7 +6095,7 @@ aarch64_elf_asm_constructor (rtx symbol, int prior
          -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 priori
          -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);

-- 
Joseph S. Myers
joseph@codesourcery.com

             reply	other threads:[~2017-09-28 12:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-28 12:31 Joseph Myers [this message]
2017-09-28 13:01 ` Richard Earnshaw (lists)
2018-02-01 16:38 ` Kyrill Tkachov
2018-02-01 17:26   ` Joseph Myers
2018-02-02 15:14     ` Kyrill Tkachov
2018-07-17 11:09       ` Kyrill Tkachov
2018-07-17 12:24         ` Richard Earnshaw (lists)
2018-07-17 12:23 ` Richard Earnshaw (lists)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1709281230570.19741@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=james.greenhalgh@arm.com \
    --cc=marcus.shawcroft@arm.com \
    --cc=richard.earnshaw@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).