[all-commits] [llvm/llvm-project] 29575a: [MachO] Preserve weak linkage for aliases (#198148)

syhhyl via All-commits all-commits at lists.llvm.org
Wed Jul 22 05:26:17 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 29575a3460b43132c7d973b502830897b02874a9
      https://github.com/llvm/llvm-project/commit/29575a3460b43132c7d973b502830897b02874a9
  Author: syhhyl <syhhyl926 at 126.com>
  Date:   2026-07-22 (Wed, 22 Jul 2026)

  Changed paths:
    M llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    M llvm/lib/MC/MachObjectWriter.cpp
    A llvm/test/CodeGen/AArch64/macho-weak-alias.ll

  Log Message:
  -----------
  [MachO] Preserve weak linkage for aliases (#198148)

Mach-O aliases with weak or linkonce linkage were emitted as weak
references, which is appropriate for undefined references but not for
alias definitions. Emit Mach-O aliases through the same linkage path as
other global definitions so weak aliases get .weak_definition.

When writing aliased symbols, keep the aliasee flags and include the
alias symbol's own flags so N_WEAK_DEF is preserved in the Mach-O n_desc
field.

Fixes #111321

#196047 was closed as a duplicate of #111321.



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