[all-commits] [llvm/llvm-project] 6be467: [ELF] Consistently use gotEntrySize for GOT entrie...

Jessica Clarke via All-commits all-commits at lists.llvm.org
Tue Jun 3 17:31:10 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6be4670dfb902fe98d8b3f7935a6397ee96660e0
      https://github.com/llvm/llvm-project/commit/6be4670dfb902fe98d8b3f7935a6397ee96660e0
  Author: Jessica Clarke <jrtc27 at jrtc27.com>
  Date:   2025-06-04 (Wed, 04 Jun 2025)

  Changed paths:
    M lld/ELF/SyntheticSections.cpp

  Log Message:
  -----------
  [ELF] Consistently use gotEntrySize for GOT entries (#142064)

d62413452fc6 ("[lld][X86] Restore gotEntrySize.") (re-)introduced
gotEntrySize and used it for various GOT calculations, but was not
exhaustive (nor consistent; Symbol::getGotOffset was modified but not
GotSection::finalizeContents, so we undercompute the size, on top of
computing the wrong offsets for TLS), and since then even more uses have
been added that use wordsize instead of gotEntrySize (presumably due to
looking at the existing incorrect ones).

This doesn't really matter upstream, as the only architecture where the
two differ is X32, and from looking at the code it's not properly
supported (e.g. TLS relaxation assumes LP64 sequences), but downstream
in CHERI LLVM it does matter, as CHERI's pointers are more than just an
integer address (a machine word).

Note this ignores the special MipsGotSection; on MIPS, wordsize and
gotEntrySize are the same, CHERI-MIPS is no longer something we support
downstream and even when we did we didn't reuse that implementation.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list