public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: Rainer Orth <ro@cebitec.uni-bielefeld.de>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Jakub Jelinek <jakub@redhat.com>,
		"H.J. Lu" <hjl.tools@gmail.com>
Subject: Re: [i386] Support .lbss etc. sections with Solaris as (PR target/59407)
Date: Fri, 18 Mar 2016 08:31:00 -0000	[thread overview]
Message-ID: <CAFULd4bSbS0b5xsSFD2ABqobd2otnPAMh3C7u4CSD5__34+NZg@mail.gmail.com> (raw)
In-Reply-To: <ydd4mc4hgo5.fsf@CeBiTec.Uni-Bielefeld.DE>

On Thu, Mar 17, 2016 at 11:40 PM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
> gcc.target/i386/pr58218.c currently FAILs on 64-bit Solaris/x86 with the
> native assembler:
>
> FAIL: gcc.target/i386/pr58218.c (test for excess errors)
>
> Excess errors:
> Assembler: pr58218.c
>         "/var/tmp//cciHFIO7.s", line 3 : Section attributes do not match
>
>         .section        .lbss,"aw",@nobits
>
> It turns out x86_64 large sections need to marked with a 'h' section
> flag for as.  gas implicitly sets SHF_AMD64_LARGE based on section
> names, but also accepts an 'l' for the same purpose.
>
> The following patch fixes this by using the SECTION_MACH_DEP section
> flag to mark large sections and emit the right flag in
> default_elf_asm_named_section.
>
> Given this comment in output.h
>
> #define SECTION_MACH_DEP 0x4000000      /* subsequent bits reserved for target */
>
> handling only a single SECTION_MACH_DEP can be considered a hack.
> Currently, only one user of SECTION_MACH_DEP (avr) uses more than one
> section flag, so maybe I can get away with this for now.
>
> A full solution would split out the part of
> default_elf_asm_named_section that emits the flags into a new
> default_elf_asm_section_flags which prints the flag string to a stream,
> invoking it either via a macro than be overridden or perhaps a target
> hook (which seems not fully right either since those are object file
> format agnostic and this is just a small part of emitting ELF named
> sections).
>
> The patch has been bootstrapped without regressions on
> i386-pc-solaris2.12 (with both as and gas) and x86_64-pc-linux-gnu.
> This is not a regression, so this may have to wait for GCC 7 stage 1.
>
> Ok for mainline now or then?

I'd rather leave this and subsequent patch for gcc-7 at this point.
The patch touches middle-end, and from the explanation above, it looks
that some discussion with middle-end maintainers (relevant people
CC'd) and their approval  is still needed.

Uros.

> Thanks.
>         Rainer
>
>
> 2016-03-15  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>
>         PR target/59407
>         * config/i386/i386.c (SECTION_LARGE): Define.
>         (x86_64_elf_select_section): Set it for large data/bss sections.
>         Only clear SECTION_WRITE for .lrodata.
>         (x86_64_elf_section_type_flags): Set SECTION_LARGE for large
>         data/bss sections.
>         * config/i386/sol2.h (MACH_DEP_SECTION_ASM_FLAG): Define.
>         * varasm.c (default_elf_asm_named_section): Grow flagchars.
>         [MACH_DEP_SECTION_ASM_FLAG] Emit MACH_DEP_SECTION_ASM_FLAG for
>         SECTION_MACH_DEP.
>         * doc/tm.texi.in (Sections, MACH_DEP_SECTION_ASM_FLAG): Describe.
>         * doc/tm.texi: Regenerate.
>
>
>
> --
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University
>

  reply	other threads:[~2016-03-18  8:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-17 22:44 Rainer Orth
2016-03-18  8:31 ` Uros Bizjak [this message]
2016-03-21 12:43   ` Rainer Orth
2016-04-18  9:15   ` Rainer Orth

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=CAFULd4bSbS0b5xsSFD2ABqobd2otnPAMh3C7u4CSD5__34+NZg@mail.gmail.com \
    --to=ubizjak@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=jakub@redhat.com \
    --cc=ro@cebitec.uni-bielefeld.de \
    /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).