[all-commits] [llvm/llvm-project] 453102: [lld-macho][re-land] Warn on method name collision...

Jez Ng via All-commits all-commits at lists.llvm.org
Thu Mar 30 11:34:00 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 453102a028a29a8b4010ce7e94be3ca83fd60807
      https://github.com/llvm/llvm-project/commit/453102a028a29a8b4010ce7e94be3ca83fd60807
  Author: Jez Ng <jezng at fb.com>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    M lld/MachO/Driver.cpp
    M lld/MachO/InputFiles.cpp
    M lld/MachO/InputSection.cpp
    M lld/MachO/InputSection.h
    A lld/MachO/Layout.h
    M lld/MachO/ObjC.cpp
    M lld/MachO/ObjC.h
    M lld/MachO/Relocations.cpp
    M lld/MachO/Relocations.h
    M lld/MachO/UnwindInfoSection.cpp
    A lld/test/MachO/Inputs/MacOSX.sdk/usr/lib/libobjc.tbd
    A lld/test/MachO/objc-category-conflicts.s
    M lld/test/MachO/objc-imageinfo.s

  Log Message:
  -----------
  [lld-macho][re-land] Warn on method name collisions from category definitions

This implements ld64's checks for duplicate method names in categories &
classes.

In addition, this sets us up for implementing Obj-C category merging.
This diff handles the most of the parsing work; what's left is rewriting
those category / class structures.

Numbers for chromium_framework:

             base           diff           difference (95% CI)
  sys_time   2.182 ± 0.027  2.200 ± 0.047  [  -0.2% ..   +1.8%]
  user_time  6.451 ± 0.034  6.479 ± 0.062  [  -0.0% ..   +0.9%]
  wall_time  6.841 ± 0.048  6.885 ± 0.105  [  -0.1% ..   +1.4%]
  samples    33             22

Fixes https://github.com/llvm/llvm-project/issues/54912.

Issues seen with the previous land will be fixed in the next commit.

Reviewed By: #lld-macho, thevinster, oontvoo

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


  Commit: 96d087512ea7aa9e81b11665933a14854df96a89
      https://github.com/llvm/llvm-project/commit/96d087512ea7aa9e81b11665933a14854df96a89
  Author: Jez Ng <jezng at fb.com>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    M lld/MachO/ObjC.cpp
    M lld/test/MachO/objc-category-conflicts.s

  Log Message:
  -----------
  [lld-macho][objc] Don't crash when rodata isn't statically linked

We were previously assuming that to hold, but it appears that `swiftc`
may generate classes that link against `__objc_empty_cache` for their
rodata pointer.

This should allow us to re-land {D142916} (as a stack).

Reviewed By: #lld-macho, oontvoo

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


  Commit: 3c787d5a254e73a84b5013a85c199f9da0adb975
      https://github.com/llvm/llvm-project/commit/3c787d5a254e73a84b5013a85c199f9da0adb975
  Author: Jez Ng <jezng at fb.com>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    M lld/MachO/ObjC.cpp
    M lld/test/MachO/objc-category-conflicts.s

  Log Message:
  -----------
  [lld-macho] Don't emit spurious dupe method warnings for +load methods

+load methods are static initializers and treated specially by the
runtime: all +load methods for a class & its categories are called when
loading that class, unlike regular methods where only one definition
will get called per message. Thus, there is no need to check for
duplicates.

Reviewed By: #lld-macho, oontvoo

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


Compare: https://github.com/llvm/llvm-project/compare/3fbc6fd4931f...3c787d5a254e


More information about the All-commits mailing list