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

Jez Ng via All-commits all-commits at lists.llvm.org
Thu Sep 15 05:36:01 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5b8da10b87f7009c06215449e4a9c61dab91697a
      https://github.com/llvm/llvm-project/commit/5b8da10b87f7009c06215449e4a9c61dab91697a
  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] 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