[PATCH] D79864: [PowerPC] Add linker opt for PC Relative GOT indirect accesses

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 13:19:23 PDT 2020


efriedma added a comment.

Current approach seems fine.



================
Comment at: llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp:110
+          printInstruction(MI, Address, O);
+          O << "\n";
+          O << SymbolName;
----------------
stefanp wrote:
> nemanjai wrote:
> > Is there not something like `printLabel()` and `printRelocDirective()` for this? It seems odd to be manually printing it like this.
> > If there isn't that's fine, just seems odd.
> Yes it is a bit funny.
> There is a standard way to print the label:
> ```
> SymExpr->print(O, &MAI);
> ```
> The problem is that if I do it that I way I get this:
> ```
> .Lpcrel3@<<invalid>>
> ```
> I have the `MCSymbolRefExpr::VK_PPC_PCREL_OPT` there because I need it internally but I don't want it printed.
There's a method MCSymbol::print


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

https://reviews.llvm.org/D79864





More information about the llvm-commits mailing list