[all-commits] [llvm/llvm-project] 40b076: [lld-macho] Fix crash: ObjC category merge + relat...

alx32 via All-commits all-commits at lists.llvm.org
Sun Sep 1 01:04:37 PDT 2024


  Branch: refs/heads/release/19.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 40b076410194df3783b0c9cefa9f018fb190bdff
      https://github.com/llvm/llvm-project/commit/40b076410194df3783b0c9cefa9f018fb190bdff
  Author: alx32 <103613512+alx32 at users.noreply.github.com>
  Date:   2024-09-01 (Sun, 01 Sep 2024)

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

  Log Message:
  -----------
  [lld-macho] Fix crash: ObjC category merge + relative method lists (#104081)

A crash was happening when both ObjC Category Merging and Relative
method lists were enabled.

ObjC Category Merging creates new data sections and adds them by calling
`addInputSection`. `addInputSection` uses the symbols within the added
section to determine which container to actually add the section to.

The issue is that ObjC Category merging is calling `addInputSection`
before actually adding the relevant symbols the the added section. This
causes `addInputSection` to add the `InputSection` to the wrong
container, eventually resulting in a crash.

To fix this, we ensure that ObjC Category Merging calls
`addInputSection` only after the symbols have been added to the
`InputSection`.

(cherry picked from commit 0df91893efc752a76c7bbe6b063d66c8a2fa0d55)



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list