[all-commits] [llvm/llvm-project] 95756e: MC: Rework .weakref

Fangrui Song via All-commits all-commits at lists.llvm.org
Sun May 25 21:10:18 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 95756e67c230c231c616a9aeabc2eea1e2831829
      https://github.com/llvm/llvm-project/commit/95756e67c230c231c616a9aeabc2eea1e2831829
  Author: Fangrui Song <i at maskray.me>
  Date:   2025-05-25 (Sun, 25 May 2025)

  Changed paths:
    M lld/test/ELF/amdgpu-relocs.s
    M llvm/include/llvm/MC/MCELFObjectWriter.h
    M llvm/include/llvm/MC/MCELFStreamer.h
    M llvm/include/llvm/MC/MCObjectStreamer.h
    M llvm/include/llvm/MC/MCSymbolELF.h
    M llvm/include/llvm/MC/MCWasmStreamer.h
    M llvm/lib/MC/ELFObjectWriter.cpp
    M llvm/lib/MC/MCELFStreamer.cpp
    M llvm/lib/MC/MCExpr.cpp
    M llvm/lib/MC/MCObjectStreamer.cpp
    M llvm/lib/MC/MCSymbolELF.cpp
    M llvm/lib/MC/MCWasmStreamer.cpp
    M llvm/lib/MC/WasmObjectWriter.cpp
    M llvm/test/MC/ELF/weakref.s

  Log Message:
  -----------
  MC: Rework .weakref

Use a variable symbol without any specifier instead of VK_WEAKREF.
Add code in ELFObjectWriter::executePostLayoutBinding to check
whether the target should be made an undefined weak symbol.

This change fixes several issues:

* Unreferenced `.weakref alias, target` no longer creates an undefined `target`.
* When `alias` is already defined, report an error instead of crashing.

.weakref is specific to ELF. llvm-ml has reused the VK_WEAKREF name for
a different concept. wasm incorrectly copied the ELF implementation.
Remove it.



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