public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: "Fāng-ruì Sòng" <maskray@google.com>
Cc: Fangrui Song via Libc-alpha <libc-alpha@sourceware.org>
Subject: Re: [PATCH] Set the retain attribute on _elf_set_element if CC supports [BZ #27492]
Date: Mon, 15 Mar 2021 09:13:41 +0100	[thread overview]
Message-ID: <87zgz4ygui.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <CAFP8O3LMfkUS0M_pAkr2822SJ2gStWSThQsdNeLEeb8a2h7vSA@mail.gmail.com> (=?utf-8?B?IkbEgW5nLXJ1w6wgU8OybmciJ3M=?= message of "Mon, 15 Mar 2021 00:45:23 -0700")

* Fāng-ruì Sòng:

>> It's probably simpler to define a new macro, like
>> ELEMENT_SECTION_ATTRIBUTES, and use that unconditionally, perhaps like
>> this?
>>
>> #ifndef __ASSEMBLER__
>> # if defined (__has_attribute) && __has_attribute (retain)
>> #  define ELEMENT_SECTION_ATTRIBUTES used, retain
>> # else
>> #  define ELEMENT_SECTION_ATTRIBUTES used
>> # endif
>> #endif
>
> `#ifdef __has_attribute` should be fine without #ifndef __ASSEMBLER__ ?

ELEMENT_SECTION_ATTRIBUTES is not useful to the assembler, and checking
for __ASSEMBLER__ on the outer level makes it simpler to define the
no-retain case.

>> Have you checked that __has_attribute (retain) is only true on GCC if
>> the underlying linker has retain support and the attribute does not
>> produce a warning?
>
> There is a GCC bug. I've reported
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99587

If this isn't fixed in GCC, we'll need a configure check because we want
to keep building with -Werror=attributes.

Thank,s
Florian


  reply	other threads:[~2021-03-15  8:13 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15  1:10 Fangrui Song
2021-03-15  7:28 ` Florian Weimer
2021-03-15  7:45   ` Fāng-ruì Sòng
2021-03-15  8:13     ` Florian Weimer [this message]
2021-03-22  4:00       ` [PATCH v2] " Fangrui Song
2021-03-22  4:24         ` H.J. Lu
2021-03-22  4:40           ` Fangrui Song
2021-03-22 20:28             ` H.J. Lu
2021-03-23  4:14               ` Fangrui Song
2021-03-29 23:11                 ` H.J. Lu
2021-03-29 23:24                   ` [PATCH v3] " Fangrui Song
2021-03-30 18:17                     ` H.J. Lu
2021-03-30 19:17                       ` Fāng-ruì Sòng
2021-03-30 19:30                         ` H.J. Lu
2021-03-31  4:34                           ` Fāng-ruì Sòng
2021-03-31 16:17                             ` H.J. Lu
2021-03-31 18:09                               ` Fāng-ruì Sòng
2021-03-31 18:57                                 ` H.J. Lu
2021-03-31 19:39                                   ` [PATCH v4] " Fangrui Song
2021-03-31 23:38                                     ` H.J. Lu
2021-04-01  0:02                                       ` Fangrui Song
2021-04-01  1:00                                         ` H.J. Lu
2021-04-01  1:06                                           ` [PATCH v5] " Fangrui Song
2021-04-01 12:52                                             ` H.J. Lu
2021-04-02  3:23                                               ` Fangrui Song
2021-04-02 14:14                                                 ` H.J. Lu
2021-04-02 17:09                                                   ` Fangrui Song
2021-04-02 17:33                                                     ` H.J. Lu
2021-04-03 18:02                                                   ` Fangrui Song
2021-04-03 20:47                                                     ` H.J. Lu
2021-04-03 21:57                                                       ` Fangrui Song
2021-04-05  1:55                                                         ` H.J. Lu
2021-04-05 18:17                                                           ` Fangrui Song
2021-04-05 20:35                                                             ` H.J. Lu
2021-04-05 21:03                                                               ` Fangrui Song
2021-04-05 21:58                                                                 ` H.J. Lu
2021-04-06 21:46                                                                   ` Fangrui Song
2021-04-09 22:36                                                                     ` Fāng-ruì Sòng
2021-04-16  3:51                                                                       ` Fāng-ruì Sòng
2021-04-16 13:00                                                                     ` H.J. Lu

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=87zgz4ygui.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=maskray@google.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).