[all-commits] [llvm/llvm-project] d51557: [lld-macho][reland] Add support for N_INDR symbols

Jez Ng via All-commits all-commits at lists.llvm.org
Thu Sep 15 19:57:42 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d515575714b60b2f2b01fcf3cfc6a380b44a6cee
      https://github.com/llvm/llvm-project/commit/d515575714b60b2f2b01fcf3cfc6a380b44a6cee
  Author: Jez Ng <jezng at fb.com>
  Date:   2022-09-15 (Thu, 15 Sep 2022)

  Changed paths:
    M lld/MachO/Driver.cpp
    M lld/MachO/InputFiles.cpp
    M lld/MachO/InputFiles.h
    M lld/MachO/SymbolTable.cpp
    M lld/MachO/SymbolTable.h
    M lld/MachO/Symbols.h
    M lld/docs/MachO/ld64-vs-lld.rst
    A lld/test/MachO/alias-option.s
    A lld/test/MachO/alias-symbols.s
    R lld/test/MachO/aliases.s

  Log Message:
  -----------
  [lld-macho][reland] Add support for N_INDR symbols

This is similar to the `-alias` CLI option, but it gives finer-grained
control in that it allows the aliased symbols to be treated as private
externs.

While working on this, I realized that our `-alias` handling did not
cover the cases where the aliased symbol is a common or dylib symbol,
nor the case where we have an undefined that gets treated specially and
converted to a defined later on. My N_INDR handling neglects this too
for now; I've added checks and TODO messages for these.

`N_INDR` symbols cropped up as part of our attempt to link swift-stdlib.

Reviewed By: #lld-macho, thakis, thevinster

Differential Revision: https://reviews.llvm.org/D133825




More information about the All-commits mailing list