From: Fangrui Song <i@maskray.me>
To: Alan Modra <amodra@gmail.com>
Cc: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>,
binutils@sourceware.org, Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v2 0/6] gas: Add support for LLVM addrsig and addrsig_sym.
Date: Thu, 30 Jun 2022 13:59:41 -0700 [thread overview]
Message-ID: <DS7PR12MB57653FC84F73677F0FE14F17CBBA9@DS7PR12MB5765.namprd12.prod.outlook.com> (raw)
In-Reply-To: <Yru/el5Ceb1asYJC@squeak.grove.modra.org>
On Tue, Jun 28, 2022 at 7:56 PM Alan Modra <amodra@gmail.com> wrote:
>
> On Wed, Jun 29, 2022 at 10:27:17AM +0900, Tatsuyuki Ishi wrote:
> > You're right. It seems that the way I numbered the symbols wasn't
> > quite right. I'll get it fixed by the next revision.
>
> It isn't going to be easy. The problem is that elf symbol ordering is
> done by bfd/elf.c:elf_map_symbols, which isn't called until there is
> some file output triggering _bfd_elf_compute_section_file_positions.
> So you can't fill out .llvm_addrsig until quite late, but you need its
> size earlier for layout. Exact sizing isn't going to be possible due
> to uleb128 ecoding of symbol index. You can likely get a reasonable
> upper bound.
There has been some discussion on .llvm_addrsig recently:
https://discourse.llvm.org/t/problems-with-mach-o-address-significance-table-generation/63392
Will switching to the relocation-based encoding look like a good idea
for objcopy and ld -r operability?
We can consider replacing the current uleb128 encoding (usually one
byte for one symbol) with a SHT_REL relocation (16 bytes for
Elf64_Rel)
r_offset = 0
r_info = ELF64_R_INFO(sym_idx, R_*_NONE)
I'll do some experiments.
prev parent reply other threads:[~2022-06-30 21:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-23 15:13 Tatsuyuki Ishi
2022-06-23 15:13 ` [PATCH v2 1/6] elf: Add definition for SHT_LLVM_ADDRSIG Tatsuyuki Ishi
2022-06-23 15:13 ` [PATCH v2 2/6] bfd: Output SH_LINK to .symtab " Tatsuyuki Ishi
2022-06-23 15:13 ` [PATCH v2 3/6] objcopy: Remove SHT_LLVM_ADDRSIG sections by default Tatsuyuki Ishi
2022-06-23 15:40 ` Jan Beulich
2022-06-24 5:28 ` Tatsuyuki Ishi
2022-06-23 15:13 ` [PATCH v2 4/6] ld: Discard LLVM_ADDRSIG sections Tatsuyuki Ishi
2022-06-23 15:13 ` [PATCH v2 5/6] gas: Add support for LLVM addrsig and addrsig_sym directives on ELF Tatsuyuki Ishi
2022-06-23 15:13 ` [PATCH v2 6/6] gas: Add basic test for addrsig Tatsuyuki Ishi
2022-06-28 9:20 ` [PATCH v2 0/6] gas: Add support for LLVM addrsig and addrsig_sym Alan Modra
2022-06-29 1:27 ` Tatsuyuki Ishi
2022-06-29 2:56 ` Alan Modra
2022-06-30 20:59 ` Fangrui Song [this message]
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=DS7PR12MB57653FC84F73677F0FE14F17CBBA9@DS7PR12MB5765.namprd12.prod.outlook.com \
--to=i@maskray.me \
--cc=amodra@gmail.com \
--cc=binutils@sourceware.org \
--cc=ishitatsuyuki@gmail.com \
--cc=jbeulich@suse.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).