public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Fangrui Song <i@maskray.me>
To: Alan Modra <amodra@gmail.com>
Cc: Cary Coutant <ccoutant@gmail.com>,
	"H.J. Lu" <hjl.tools@gmail.com>, Michael Matz <matz@suse.de>,
	Florian Weimer <fweimer@redhat.com>,
	Szabolcs Nagy <szabolcs.nagy@arm.com>,
	"binutils@sourceware.org" <binutils@sourceware.org>,
	Fangrui Song <maskray@google.com>
Subject: Re: [PATCH] Allow direct access relocations referencing a protected function symbol
Date: Tue, 15 Jun 2021 21:42:17 -0700	[thread overview]
Message-ID: <20210616044217.6coujfcfpvz2de5h@gmail.com> (raw)
In-Reply-To: <YMl1yQGLs7wjNK6T@bubble.grove.modra.org>

On 2021-06-16, Alan Modra wrote:
>On Mon, Jun 14, 2021 at 08:19:32PM -0700, Fangrui Song wrote:
>> On 2021-06-15, Alan Modra wrote:
>> > On Mon, Jun 14, 2021 at 10:43:36AM -0700, Fangrui Song wrote:
>> > > I shall add a note that this patch will restore the behavior before late
>> > > 2015 or early 2016.
>> >
>> > Also add a note that the patch you posted is incorrect.
>>
>> Only the description needs an update. The code is correct.
>
>How would you respond if I submitted a patch to lld that you could see
>was wrong, but I kept arrogantly claiming was correct?
>
>-- 
>Alan Modra
>Australia Development Lab, IBM

If you have found a mistake, please point out the mistake. No euphemism or
sarcasm is needed.

I said "Treat protected function symbols local to the component like hidden/internal visibilities."
That is certainly not my invention of the semantics of STV_PROTECTED.
Multiple people agreed on this. https://groups.google.com/g/generic-abi/c/waK1dGiUGvM/m/7Uid2HH4IQAJ
(which I have linked to previously)

Solaris ld agrees with this (from the dump of the generic-abi discussion).
gold agrees with this: https://sourceware.org/bugzilla/show_bug.cgi?id=19823#c1


I have heard multiple folks said "protected symbols are broken."
Why?  As-is,

__attribute__((visibility("protected"))) void *foo () {
   return (void *)foo;
}

gcc -fpic -shared b.c -fuse-ld=bfd b.c  is broken.

The code generation does have inferior optimization in certain places but they
are not correctness issues.

My intention was to fix the ld problem. I have answered that there is no
compatibility issue.

  reply	other threads:[~2021-06-16  4:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-13 21:54 Fangrui Song
2021-06-14 13:20 ` Alan Modra
2021-06-14 14:03   ` Michael Matz
2021-06-14 14:48     ` H.J. Lu
2021-06-14 17:43       ` Fangrui Song
2021-06-15  2:46         ` Alan Modra
2021-06-15  3:19           ` Fangrui Song
2021-06-16  3:53             ` Alan Modra
2021-06-16  4:42               ` Fangrui Song [this message]
2021-06-16  6:31                 ` Alan Modra
2021-06-16  8:11                   ` Fangrui Song
2021-06-16 14:06                     ` Michael Matz
2021-06-17  2:59                     ` Alan Modra
2021-06-17  4:24                       ` Fangrui Song
2021-06-17 17:25                         ` H.J. Lu
2021-06-17 17:51                           ` Fangrui Song
2021-06-18  1:54                           ` Alan Modra
2021-06-18  2:41                             ` 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=20210616044217.6coujfcfpvz2de5h@gmail.com \
    --to=i@maskray.me \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=ccoutant@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=hjl.tools@gmail.com \
    --cc=maskray@google.com \
    --cc=matz@suse.de \
    --cc=szabolcs.nagy@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).