[PATCH] D85317: [XCOFF] Adjust .rename and .tc directive emission sequence
Jason Liu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 5 08:17:20 PDT 2020
jasonliu created this revision.
jasonliu added reviewers: daltenty, Xiangling_L, DiggerLin, hubert.reinterpretcast.
Herald added subscribers: llvm-commits, kbarton, hiraditya, nemanjai.
Herald added a project: LLVM.
jasonliu requested review of this revision.
Herald added a subscriber: wuzish.
AIX assembler does not generate correct relocation when `.rename` appear between tc entry label and .tc directive.
So only emit .rename after .tc directive is emitted.
https://reviews.llvm.org/D85317
Files:
llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
llvm/test/CodeGen/PowerPC/aix-xcoff-symbol-rename.ll
Index: llvm/test/CodeGen/PowerPC/aix-xcoff-symbol-rename.ll
===================================================================
--- llvm/test/CodeGen/PowerPC/aix-xcoff-symbol-rename.ll
+++ llvm/test/CodeGen/PowerPC/aix-xcoff-symbol-rename.ll
@@ -90,8 +90,8 @@
; ASM-NEXT: .extern _Renamed..40f_o[DS]
; ASM-NEXT: .toc
; ASM-NEXT: L..C0:
-; ASM-NEXT: .rename _Renamed..40f_o[TC],"f at o"
; ASM-NEXT: .tc _Renamed..40f_o[TC],_Renamed..40f_o[DS]
+; ASM-NEXT: .rename _Renamed..40f_o[TC],"f at o"
; OBJ: Disassembly of section .text:
; OBJ-EMPTY:
Index: llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
===================================================================
--- llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
+++ llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
@@ -124,9 +124,9 @@
MCSymbolXCOFF *TCSym =
cast<MCSymbolXCOFF>(Streamer.getContext().getOrCreateSymbol(
XSym->getSymbolTableName() + "[TC]"));
+ OS << "\t.tc " << TCSym->getName() << "," << XSym->getName() << '\n';
if (TCSym->hasRename())
Streamer.emitXCOFFRenameDirective(TCSym, TCSym->getSymbolTableName());
- OS << "\t.tc " << TCSym->getName() << "," << XSym->getName() << '\n';
return;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85317.283250.patch
Type: text/x-patch
Size: 1285 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200805/cd16f815/attachment.bin>
More information about the llvm-commits
mailing list