[all-commits] [llvm/llvm-project] f083f6: [lld-macho][nfc] Remove TODO regarding addends

Jez Ng via All-commits all-commits at lists.llvm.org
Mon Mar 1 09:30:37 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f083f652c3fdc97e0bda278fee8354a0cf7ff551
      https://github.com/llvm/llvm-project/commit/f083f652c3fdc97e0bda278fee8354a0cf7ff551
  Author: Jez Ng <jezng at fb.com>
  Date:   2021-03-01 (Mon, 01 Mar 2021)

  Changed paths:
    M lld/MachO/InputFiles.cpp

  Log Message:
  -----------
  [lld-macho][nfc] Remove TODO regarding addends

There was initially some concern around the correct handling of pcrel
section relocations with r_length != 2. But it looks like there are no such
relocations in practice -- x86_64's pcrel section relocs all have r_length == 2,
and ARM64 doesn't even have pcrel section relocs. So we can replace the TODO
with an assert.

Reviewed By: #lld-macho, thakis

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


  Commit: 415c0cd698a8f0784172d19d542a3b525d1bb9b0
      https://github.com/llvm/llvm-project/commit/415c0cd698a8f0784172d19d542a3b525d1bb9b0
  Author: Jez Ng <jezng at fb.com>
  Date:   2021-03-01 (Mon, 01 Mar 2021)

  Changed paths:
    M clang/lib/Driver/ToolChain.cpp
    R clang/test/Driver/Inputs/lld/ld64.lld.darwinnew
    A clang/test/Driver/Inputs/lld/ld64.lld.darwinold
    M clang/test/Driver/darwin-ld-demangle-lld.c
    M clang/test/Driver/darwin-ld-platform-version-ios.c
    M clang/test/Driver/darwin-ld-platform-version-macos.c
    M clang/test/Driver/darwin-ld-platform-version-tvos.c
    M clang/test/Driver/darwin-ld-platform-version-watchos.c
    M lld/test/MachO/invalid/stub-link.s
    M lld/test/MachO/lit.local.cfg
    M lld/test/MachO/search-paths-darwin.test
    M lld/test/MachO/syslibroot.test
    M lld/test/darwin/cmdline-lto_library.objtxt
    M lld/test/darwin/cmdline-objc_gc.objtxt
    M lld/test/darwin/cmdline-objc_gc_compaction.objtxt
    M lld/test/darwin/cmdline-objc_gc_only.objtxt
    M lld/test/darwin/native-and-mach-o.objtxt
    M lld/test/mach-o/Inputs/swift-version-1.yaml
    M lld/test/mach-o/Inputs/wrong-arch-error.yaml
    M lld/test/mach-o/PIE.yaml
    M lld/test/mach-o/align_text.yaml
    M lld/test/mach-o/arm-interworking-movw.yaml
    M lld/test/mach-o/arm-interworking.yaml
    M lld/test/mach-o/arm-shims.yaml
    M lld/test/mach-o/arm-subsections-via-symbols.yaml
    M lld/test/mach-o/arm64-reloc-negDelta32-fixup.yaml
    M lld/test/mach-o/arm64-relocs-errors-delta64-offset.yaml
    M lld/test/mach-o/arm64-section-order.yaml
    M lld/test/mach-o/bind-opcodes.yaml
    M lld/test/mach-o/cstring-sections.yaml
    M lld/test/mach-o/data-in-code-load-command.yaml
    M lld/test/mach-o/data-only-dylib.yaml
    M lld/test/mach-o/dead-strip-globals.yaml
    M lld/test/mach-o/debug-syms.yaml
    M lld/test/mach-o/demangle.yaml
    M lld/test/mach-o/dependency_info.yaml
    M lld/test/mach-o/do-not-emit-unwind-fde-arm64.yaml
    M lld/test/mach-o/dso_handle.yaml
    M lld/test/mach-o/dylib-install-names.yaml
    M lld/test/mach-o/eh-frame-relocs-arm64.yaml
    M lld/test/mach-o/empty-sections.yaml
    M lld/test/mach-o/error-simulator-vs-macosx.yaml
    M lld/test/mach-o/exe-offsets.yaml
    M lld/test/mach-o/exe-segment-overlap.yaml
    M lld/test/mach-o/executable-exports.yaml
    M lld/test/mach-o/export-trie-order.yaml
    M lld/test/mach-o/exported_symbols_list-dylib.yaml
    M lld/test/mach-o/exported_symbols_list-obj.yaml
    M lld/test/mach-o/exported_symbols_list-undef.yaml
    M lld/test/mach-o/fat-archive.yaml
    M lld/test/mach-o/filelist.yaml
    M lld/test/mach-o/flat_namespace_undef_error.yaml
    M lld/test/mach-o/flat_namespace_undef_suppress.yaml
    M lld/test/mach-o/force_load-dylib.yaml
    M lld/test/mach-o/force_load-x86_64.yaml
    M lld/test/mach-o/framework-user-paths.yaml
    M lld/test/mach-o/function-starts-load-command.yaml
    M lld/test/mach-o/gcc_except_tab-got-arm64.yaml
    M lld/test/mach-o/got-order.yaml
    M lld/test/mach-o/hello-world-arm64.yaml
    M lld/test/mach-o/hello-world-armv6.yaml
    M lld/test/mach-o/hello-world-armv7.yaml
    M lld/test/mach-o/hello-world-x86.yaml
    M lld/test/mach-o/hello-world-x86_64.yaml
    M lld/test/mach-o/image-base.yaml
    M lld/test/mach-o/infer-arch.yaml
    M lld/test/mach-o/interposing-section.yaml
    M lld/test/mach-o/keep_private_externs.yaml
    M lld/test/mach-o/lazy-bind-x86_64.yaml
    M lld/test/mach-o/lc_segment_filesize.yaml
    M lld/test/mach-o/lib-search-paths.yaml
    M lld/test/mach-o/library-order.yaml
    M lld/test/mach-o/library-rescan.yaml
    M lld/test/mach-o/libresolve-bizarre-root-override.yaml
    M lld/test/mach-o/libresolve-multiple-syslibroots.yaml
    M lld/test/mach-o/libresolve-one-syslibroot.yaml
    M lld/test/mach-o/libresolve-simple.yaml
    M lld/test/mach-o/libresolve-user-paths.yaml
    M lld/test/mach-o/libresolve-z.yaml
    M lld/test/mach-o/load-commands-size.yaml
    M lld/test/mach-o/mach_header-cpusubtype.yaml
    M lld/test/mach-o/mh_bundle_header.yaml
    M lld/test/mach-o/mh_dylib_header.yaml
    M lld/test/mach-o/objc-category-list-atom.yaml
    M lld/test/mach-o/objc-image-info-host-vs-simulator.yaml
    M lld/test/mach-o/objc-image-info-invalid-size.yaml
    M lld/test/mach-o/objc-image-info-invalid-version.yaml
    M lld/test/mach-o/objc-image-info-mismatched-swift-version.yaml
    M lld/test/mach-o/objc-image-info-pass-output.yaml
    M lld/test/mach-o/objc-image-info-simulator-vs-host.yaml
    M lld/test/mach-o/objc-image-info-unsupported-gc.yaml
    M lld/test/mach-o/objc_export_list.yaml
    M lld/test/mach-o/order_file-basic.yaml
    M lld/test/mach-o/parse-aliases.yaml
    M lld/test/mach-o/parse-arm-relocs.yaml
    M lld/test/mach-o/parse-cfstring32.yaml
    M lld/test/mach-o/parse-cfstring64.yaml
    M lld/test/mach-o/parse-compact-unwind32.yaml
    M lld/test/mach-o/parse-compact-unwind64.yaml
    M lld/test/mach-o/parse-data-in-code-armv7.yaml
    M lld/test/mach-o/parse-data-in-code-x86.yaml
    M lld/test/mach-o/parse-data-relocs-arm64.yaml
    M lld/test/mach-o/parse-data-relocs-x86_64.yaml
    M lld/test/mach-o/parse-data.yaml
    M lld/test/mach-o/parse-eh-frame-relocs-x86_64.yaml
    M lld/test/mach-o/parse-eh-frame-x86-anon.yaml
    M lld/test/mach-o/parse-eh-frame-x86-labeled.yaml
    M lld/test/mach-o/parse-eh-frame.yaml
    M lld/test/mach-o/parse-function.yaml
    M lld/test/mach-o/parse-initializers32.yaml
    M lld/test/mach-o/parse-initializers64.yaml
    M lld/test/mach-o/parse-literals-error.yaml
    M lld/test/mach-o/parse-literals.yaml
    M lld/test/mach-o/parse-non-lazy-pointers.yaml
    M lld/test/mach-o/parse-relocs-x86.yaml
    M lld/test/mach-o/parse-section-no-symbol.yaml
    M lld/test/mach-o/parse-tentative-defs.yaml
    M lld/test/mach-o/parse-text-relocs-arm64.yaml
    M lld/test/mach-o/parse-text-relocs-x86_64.yaml
    M lld/test/mach-o/parse-tlv-relocs-x86-64.yaml
    M lld/test/mach-o/re-exported-dylib-ordinal.yaml
    M lld/test/mach-o/rpath.yaml
    M lld/test/mach-o/run-tlv-pass-x86-64.yaml
    M lld/test/mach-o/sdk-version-error.yaml
    M lld/test/mach-o/sectalign.yaml
    M lld/test/mach-o/sectattrs.yaml
    M lld/test/mach-o/sectcreate.yaml
    M lld/test/mach-o/seg-protection-arm64.yaml
    M lld/test/mach-o/seg-protection-x86_64.yaml
    M lld/test/mach-o/source-version.yaml
    M lld/test/mach-o/stack-size.yaml
    M lld/test/mach-o/string-table.yaml
    M lld/test/mach-o/stub-link.s
    M lld/test/mach-o/subsections-via-symbols-default.yaml
    M lld/test/mach-o/twolevel_namespace_undef_dynamic_lookup.yaml
    M lld/test/mach-o/twolevel_namespace_undef_warning_suppress.yaml
    M lld/test/mach-o/unwind-info-simple-arm64.yaml
    M lld/test/mach-o/unwind-info-simple-x86_64.yaml
    M lld/test/mach-o/upward-dylib-load-command.yaml
    M lld/test/mach-o/upward-dylib-paths.yaml
    M lld/test/mach-o/usage.yaml
    M lld/test/mach-o/use-dylib.yaml
    M lld/test/mach-o/use-simple-dylib.yaml
    M lld/test/mach-o/version-min-load-command-object.yaml
    M lld/test/mach-o/version-min-load-command.yaml
    M lld/test/mach-o/write-final-sections.yaml
    M lld/test/mach-o/wrong-arch-error.yaml
    M lld/tools/lld/CMakeLists.txt
    M lld/tools/lld/lld.cpp
    M llvm/utils/gn/build/BUILD.gn
    M llvm/utils/gn/secondary/lld/tools/lld/BUILD.gn

  Log Message:
  -----------
  [lld-macho] Switch default to new Darwin backend

The new Darwin backend for LLD is now able to link reasonably large
real-world programs on x86_64. For instance, we have achieved
self-hosting for the X86_64 target, where all LLD tests pass when
building lld with itself on macOS. As such, we would like to make it the
default back-end.

The new port is now named `ld64.lld`, and the old port remains
accessible as `ld64.lld.darwinold`

This [annoucement email][1] has some context. (But note that, unlike
what the email says, we are no longer doing this as part of the LLVM 12
branch cut -- instead we will go into LLVM 13.)

Numerous mechanical test changes were required to make this change; in
the interest of creating something that's reviewable on Phabricator,
I've split out the boring changes into a separate diff (D95905). I plan to
merge its contents with those in this diff before landing.

(@gkm made the original draft of this diff, and he has agreed to let me
take over.)

[1]: https://lists.llvm.org/pipermail/llvm-dev/2021-January/147665.html

Reviewed By: #lld-macho, thakis

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


Compare: https://github.com/llvm/llvm-project/compare/776be16ba053...415c0cd698a8


More information about the All-commits mailing list