public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Matthew Malcomson <Matthew.Malcomson@arm.com>
To: "binutils@sourceware.org" <binutils@sourceware.org>
Subject: Is `SYMBOL_REFERENCES_LOCAL` safe to call in `*check_relocs` hook?
Date: Mon, 27 Jun 2022 12:32:54 +0000	[thread overview]
Message-ID: <PAXPR08MB68486A858C73CABEA4A7B6B4E0B99@PAXPR08MB6848.eurprd08.prod.outlook.com> (raw)

Hello,

As the title mentions I want to call SYMBOL_REFERENCES_LOCAL​ at the time that the check_relocs​ hook is being called.
For context: the reason I'm curious is that the AArch64 backend determines whether to relax a TLS access sequence to local-exec based on whether the symbol is marked local (i.e. h == NULL​) or not rather than based on whether the symbol we access is in the executable or not.

I did a grep across the codebase and it seems there's only one place that we call SYMBOL_REFERENCES_LOCAL​ so early, and that's in the x86 backend.
However it's through a wrapper SYMBOL_REFERENCES_LOCAL_P​ which is implemented by a function that has a comment specifically mentioning being safe to call from check_relocs​, and that seems like it should increase suspicion rather than allay it.

If it's not, what is the problem?
(I assume something about the symbol not being fully set up, based on that same comment above the x86 function maybe something to do with version scripts?)

Thanks,
Matthew

             reply	other threads:[~2022-06-27 12:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27 12:32 Matthew Malcomson [this message]
2022-06-27 13:20 ` 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=PAXPR08MB68486A858C73CABEA4A7B6B4E0B99@PAXPR08MB6848.eurprd08.prod.outlook.com \
    --to=matthew.malcomson@arm.com \
    --cc=binutils@sourceware.org \
    /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).