[all-commits] [llvm/llvm-project] 6ad298: [lld-macho] Omit `__llvm_addrsig` metadata from th...

Daniel Bertalan via All-commits all-commits at lists.llvm.org
Tue Jul 16 15:41:57 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6ad2987a72392e9885e1186a34834041445e0a1e
      https://github.com/llvm/llvm-project/commit/6ad2987a72392e9885e1186a34834041445e0a1e
  Author: Daniel Bertalan <dani at danielbertalan.dev>
  Date:   2024-07-17 (Wed, 17 Jul 2024)

  Changed paths:
    M lld/MachO/Driver.cpp
    M lld/MachO/ObjC.cpp
    M lld/test/MachO/dead-strip.s
    M lld/test/MachO/icf-safe.ll

  Log Message:
  -----------
  [lld-macho] Omit `__llvm_addrsig` metadata from the output (#98913)

This section contains metadata that's only relevant for Identical Code
Folding at link time, we should not include it in the output.

We still treat it like a regular section during input file parsing (e.g.
create a `ConcatInputSection` for it), as we want its relocations to be
parsed. But it should not be passed to `addInputSection`, as that's what
assigns it to an `OutputSection` and adds it to the `inputSections`
vector which specifies the inputs to dead-stripping and relocation
scanning.

This fixes a "__DATA,__llvm_addrsig, offset 0: fixups overlap" error
when using `--icf=safe` alongside `-fixup_chains`. This occurs because
all `__llvm_addrsig` sections are 8 bytes large, and the relocations
which signify functions whose addresses are taken are all at offset 0.

This makes the fix in 5fa24ac2 ("Category Merger: add support for
addrsig references") obsolete, as we no longer try to resolve symbols
referenced in `__llvm_addrsig` when writing the output file. When we do
iterate its relocations in `markAddrSigSymbols`, we do not try to
resolve their addresses.



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