[all-commits] [llvm/llvm-project] 53eb7f: [lld-macho] Support binding dysyms to any section

Jez Ng via All-commits all-commits at lists.llvm.org
Thu Jul 2 21:21:41 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 53eb7fda51f27b1b098fd6d5c9385948e891e800
      https://github.com/llvm/llvm-project/commit/53eb7fda51f27b1b098fd6d5c9385948e891e800
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-07-02 (Thu, 02 Jul 2020)

  Changed paths:
    M lld/MachO/Arch/X86_64.cpp
    M lld/MachO/SyntheticSections.cpp
    M lld/MachO/SyntheticSections.h
    M lld/MachO/Target.h
    M lld/MachO/Writer.cpp
    M lld/test/MachO/dylink.s

  Log Message:
  -----------
  [lld-macho] Support binding dysyms to any section

Previously, we only supported binding dysyms to the GOT. This
diff adds support for binding them to any arbitrary section. C++
programs appear to use this, I believe for vtables and type_info.

This diff also makes our bind opcode encoding a bit smarter -- we now
encode just the differences between bindings, which will make things
more compact.

I was initially concerned about the performance overhead of iterating
over these relocations, but it turns out that the number of such
relocations is small. A quick analysis of my llvm-project build
directory showed that < 1.3% out of ~7M relocations are RELOC_UNSIGNED
bindings to symbols (including both dynamic and static symbols).

Reviewed By: #lld-macho, smeenai

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




More information about the All-commits mailing list