[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
Tue Jun 25 08:06:50 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()) ||
----------------
HsiangKai wrote:
> edward-jones wrote:
> > 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.
> Thank you for your information. I have fixed the bug. Please help me to review it and verify the solution. Thanks.
Yep, this all works for me now. Looks good!


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