[llvm] [MC][ELF] Fix printing group signature symbols. (PR #112543)

Ivan Kosarev via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 16 09:30:36 PDT 2024


kosarev wrote:

Caught downstream, yes. The comment for the `Group` field in `MCSectionELF.h` reads like the pointer can be null:
```
  /// The section group signature symbol (if not null) and a bool indicating
  /// whether this is a GRP_COMDAT group.
  const PointerIntPair<const MCSymbolELF *, 1, bool> Group;
```

There's also a guarding `if` for the pointer in `MCSectionELF` constructor:
```
  MCSectionELF(StringRef Name, unsigned type, unsigned flags,
...
        Group(group, IsComdat), LinkedToSym(LinkedToSym) {
    if (Group.getPointer())
      Group.getPointer()->setIsSignature();
  }
```

https://github.com/llvm/llvm-project/pull/112543


More information about the llvm-commits mailing list