[PATCH] D149817: [llvm-objdump][X86] Add @plt symbols for .plt.got

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 23:12:08 PDT 2023

MaskRay added a comment.

In D149817#4342333 <https://reviews.llvm.org/D149817#4342333>, @bd1976llvm wrote:

> Thanks for working on this and sorry for the lack of response.
> Generally looks good, LGTM from me.
> I'm happy with the missing corner case for x86-32, given that you mentioned that it is extremely unlikely to occur. Do the GNU tools support that corner case? If they have gone to the trouble to support it I'm wondering if they have a use-case that hasn't occurred to us?
> In the description, I think we should have a link to the optimisation in the PS ABI documents in addition to your blog entry.
> I wonder if the LLDB folks are aware of this? Might be worth informing them?
> I have mentioned a few improvements that seemed worthwhile to me. Feel free to ignore these if they are not helpful.

Thanks for the review! Sorry for the shameless plug. The official psABI mentions combining JUMP_SLOT and GLOB_DAT, but doesn't say anything about `.plt.got`, or the fact that `.got.plt` can be omitted...

With `int main() {}` `gcc x.c -o x -z now -fuse-ld=bfd -m32`, we don't get `.got.plt`. If we add a libc function call, a regular PLT will be needed. To omit `.got.plt` again, we need to take the address of the libc function call.
This is why I said that the corner case nearly never happens in the wild.

Thanks for mentioning lldb. This gives me a motivation to study how it performs symbolization...

  rG LLVM Github Monorepo



More information about the llvm-commits mailing list