From: Florian Weimer <fweimer@redhat.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: binutils@sourceware.org
Subject: Re: Named local symbols in the ELF dynamic symbol table
Date: Wed, 14 Dec 2022 22:53:09 +0100 [thread overview]
Message-ID: <877cytlkje.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <CAMe9rOo7DYZw_g2Mb01OfoQ_tnXR1ZRdCrCQupB1pP65PWQwkw@mail.gmail.com> (H. J. Lu's message of "Wed, 14 Dec 2022 13:44:57 -0800")
* H. J. Lu:
> On Tue, Dec 6, 2022 at 9:11 AM Florian Weimer via Binutils
> <binutils@sourceware.org> wrote:
>>
>> The symbol table of /lib/ld-linux-ia64.so.2 starts like this:
>>
>> Symbol table [ 3] '.dynsym' contains 65 entries:
>> 33 local symbols String table: [ 4] '.dynstr'
>> Num: Value Size Type Bind Vis Ndx Name
>> 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UNDEF
>> 1: 00000000000318c0 160 FUNC LOCAL DEFAULT 10 _dl_error_free
>> 2: 00000000000234c0 16 FUNC LOCAL DEFAULT 10 __GI__dl_debug_state
>> 3: 0000000000029f80 368 FUNC LOCAL DEFAULT 10 _dl_tls_get_addr_soft
>> 4: 000000000002be00 1728 FUNC LOCAL DEFAULT 10 _dl_open
>> 5: 0000000000001550 64 FUNC LOCAL DEFAULT 10 _start
>> 6: 0000000000031540 784 FUNC LOCAL DEFAULT 10 _dl_runtime_profile
>> 7: 0000000000031440 208 FUNC LOCAL DEFAULT 10 _dl_runtime_resolve
>> 8: 00000000000312c0 384 FUNC LOCAL DEFAULT 10 _dl_close
>> 9: 0000000000018240 10720 FUNC LOCAL DEFAULT 10 _dl_lookup_symbol_x
>> 10: 000000000003ab40 80 FUNC LOCAL DEFAULT 10 _rtld_catch_error
>>
>> The interesting aspect is that these symbols are named, but are not
>> covered by the GNU_HASH table (because they are local).
>>
>> Is there a way to get the same effect on other targets? I want to
>> preserve the names of the functions that IFUNC resolvers return,
>> eventually improving diagnostics around IFUNC resolution. It would best
>> if I wouldn't have to bloat the entire symbol table for that.
>>
>
> Are you interested in R_X86_64_IRELATIVE symbols or something
> else?
Not particularly. For ld.so --list-diagnostics, I want to iterate
through .dynsym, call all IFUNC resolvers, and report the results (for
libc, libm, libmvec at least). To make the IFUNC resolver *result* more
meaningful, I want to map back the addresses to symbols like
__memmove_avx_unaligned_erms, but at the same time, I do not want to
make the symbol name __memmove_avx_unaligned_erms available for symbol
binding. A local symbol in .dynsym would be a good fit here.
We can do this for IRELATIVE relocations, too, but it might be less
beneficial.
Thanks,
Florian
prev parent reply other threads:[~2022-12-14 21:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 17:11 Florian Weimer
2022-12-08 13:19 ` Nick Clifton
2022-12-09 17:34 ` Florian Weimer
2022-12-14 15:31 ` Nick Clifton
2022-12-14 20:05 ` Fangrui Song
2022-12-14 21:44 ` H.J. Lu
2022-12-14 21:53 ` Florian Weimer [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=877cytlkje.fsf@oldenburg.str.redhat.com \
--to=fweimer@redhat.com \
--cc=binutils@sourceware.org \
--cc=hjl.tools@gmail.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).