[all-commits] [llvm/llvm-project] e26328: [lld-macho] Implement weak binding for branch relo...

Jez Ng via All-commits all-commits at lists.llvm.org
Thu Aug 27 17:44:48 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e263287c797f7d143cf2f38e2df1d5fcee94f9b0
      https://github.com/llvm/llvm-project/commit/e263287c797f7d143cf2f38e2df1d5fcee94f9b0
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-08-27 (Thu, 27 Aug 2020)

  Changed paths:
    M lld/MachO/Arch/X86_64.cpp
    M lld/MachO/Symbols.h
    M lld/MachO/SyntheticSections.cpp
    M lld/MachO/SyntheticSections.h
    M lld/MachO/Target.h
    M lld/MachO/Writer.cpp
    M lld/test/MachO/weak-binding.s
    M lld/test/MachO/weak-definition-order.s

  Log Message:
  -----------
  [lld-macho] Implement weak binding for branch relocations

Since there is no "weak lazy" lookup, function calls to weak symbols are
always non-lazily bound. We emit both regular non-lazy bindings as well
as weak bindings, in order that the weak bindings may overwrite the
non-lazy bindings if an appropriate symbol is found at runtime. However,
the bound addresses will still be written (non-lazily) into the
LazyPointerSection.

Reviewed By: #lld-macho, smeenai

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


  Commit: 3da2130e45a4bd61df09bcdb15ec07e9fc71747c
      https://github.com/llvm/llvm-project/commit/3da2130e45a4bd61df09bcdb15ec07e9fc71747c
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-08-27 (Thu, 27 Aug 2020)

  Changed paths:
    M lld/MachO/SyntheticSections.cpp
    M lld/MachO/SyntheticSections.h
    M lld/MachO/Writer.cpp
    A lld/test/MachO/weak-header-flags.s

  Log Message:
  -----------
  [lld-macho] Emit the right header flags for weak bindings/symbols

Reviewed By: #lld-macho, smeenai

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


  Commit: 2a38dba7dd4d3360908e93c326fbef6a7465346e
      https://github.com/llvm/llvm-project/commit/2a38dba7dd4d3360908e93c326fbef6a7465346e
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-08-27 (Thu, 27 Aug 2020)

  Changed paths:
    M lld/MachO/SymbolTable.cpp
    M lld/MachO/Symbols.h
    M lld/MachO/SyntheticSections.cpp
    M lld/MachO/SyntheticSections.h
    M lld/MachO/Writer.cpp
    A lld/test/MachO/nonweak-definition-override.s
    M lld/test/MachO/weak-header-flags.s

  Log Message:
  -----------
  [lld-macho] Emit binding opcodes for defined symbols that override weak dysyms

These opcodes tell dyld to coalesce the overridden weak dysyms to this
particular symbol definition.

Reviewed By: #lld-macho, smeenai

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


  Commit: 7083363c05abe4afd8af8d6bacdd79c9cf10585b
      https://github.com/llvm/llvm-project/commit/7083363c05abe4afd8af8d6bacdd79c9cf10585b
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-08-27 (Thu, 27 Aug 2020)

  Changed paths:
    M lld/MachO/Arch/X86_64.cpp
    M lld/test/MachO/local-got.s
    A lld/test/MachO/x86-64-reloc-got-load.s

  Log Message:
  -----------
  [lld-macho] Implement GOT_LOAD relaxation

We can have GOT_LOAD relocations that reference `__dso_handle`.
However, our binding opcode encoder doesn't support binding to the DSOHandle
symbol. Instead of adding support for that, I decided it would be cleaner to
implement GOT_LOAD relaxation since `__dso_handle`'s location is always
statically known.

Reviewed By: #lld-macho, smeenai

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


  Commit: 0407197711f1004b79e3d7250f0612f67100e640
      https://github.com/llvm/llvm-project/commit/0407197711f1004b79e3d7250f0612f67100e640
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-08-27 (Thu, 27 Aug 2020)

  Changed paths:
    M lld/MachO/Symbols.h
    M lld/test/MachO/dso-handle.s

  Log Message:
  -----------
  [lld-macho] Support GOT relocations to __dso_handle

Found such a relocation while testing some real world programs.

Reviewed By: #lld-macho, smeenai

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


  Commit: ccbacdded4563baa5f016b1d084cde6c5876bf3e
      https://github.com/llvm/llvm-project/commit/ccbacdded4563baa5f016b1d084cde6c5876bf3e
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-08-27 (Thu, 27 Aug 2020)

  Changed paths:
    M lld/MachO/Arch/X86_64.cpp
    M lld/MachO/SyntheticSections.cpp
    M lld/MachO/SyntheticSections.h
    M lld/test/MachO/weak-binding.s

  Log Message:
  -----------
  [lld-macho] Weak locals should be relaxed too

Reviewed By: #lld-macho, smeenai

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


  Commit: ae8fa1d8a6cae1be0d069ded12e7980f398f877e
      https://github.com/llvm/llvm-project/commit/ae8fa1d8a6cae1be0d069ded12e7980f398f877e
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-08-27 (Thu, 27 Aug 2020)

  Changed paths:
    M lld/MachO/SyntheticSections.cpp
    M lld/MachO/SyntheticSections.h

  Log Message:
  -----------
  [lld-macho][NFC] Define isHidden() in LinkEditSection

Since it's always true

Reviewed By: #lld-macho, smeenai

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


Compare: https://github.com/llvm/llvm-project/compare/7f717b6d1f65...ae8fa1d8a6ca


More information about the All-commits mailing list