[PATCH] D61584: [DebugInfo] Some fields do not need relocations even relax is enabled.

Edward Jones via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 07:03:20 PDT 2019


edward-jones added inline comments.


================
Comment at: lib/MC/MCExpr.cpp:610
   if (Asm &&
-      (InSet || !Asm->getBackend().requiresDiffExpressionRelocations())) {
+      (InSet || (LHS_A && !LHS_A->getSymbol().getSection().hasInstructions()) ||
+       (LHS_B && !LHS_B->getSymbol().getSection().hasInstructions()) ||
----------------
I found a bug with these latest changes when compiling the following program:

```
func:
  .cfi_startproc
  .cfi_endproc
```

With the command:

`llvm-mc -filetype=obj tmp.s -o tmp.o -triple riscv32`

The calls to `...->getSymbol().getSection()` can trigger an assertion if the symbol is not defined in a section, which seems to happen in the above testcase.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61584/new/

https://reviews.llvm.org/D61584





More information about the llvm-commits mailing list