diff options
author | Maryam Moghadas <34670902+maryammo@users.noreply.github.com> | 2023-12-08 15:03:11 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-08 15:03:11 -0500 |
commit | 8f6f5ec77615e2ae137d0b1e306abbac6f7fc0e8 (patch) | |
tree | da788d79818f71be87318306b3ceb9cf720da69d /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
parent | e8dbed097a41cc911b90cc40aa7d9509a1555df7 (diff) | |
download | llvm-8f6f5ec77615e2ae137d0b1e306abbac6f7fc0e8.zip llvm-8f6f5ec77615e2ae137d0b1e306abbac6f7fc0e8.tar.gz llvm-8f6f5ec77615e2ae137d0b1e306abbac6f7fc0e8.tar.bz2 |
[PowerPC] Move __ehinfo TOC entries to the end of the TOC section (#73586)
On AIX, the __ehinfo toc-entry is never referenced directly using
instructions, therefore we can allocate them with the TE storage mapping
class to move them to the end of TOC.
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 143a495..16cc83b 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -2310,8 +2310,10 @@ bool TargetLoweringObjectFileXCOFF::ShouldSetSSPCanaryBitInTB( MCSymbol * TargetLoweringObjectFileXCOFF::getEHInfoTableSymbol(const MachineFunction *MF) { - return MF->getMMI().getContext().getOrCreateSymbol( + MCSymbol *EHInfoSym = MF->getMMI().getContext().getOrCreateSymbol( "__ehinfo." + Twine(MF->getFunctionNumber())); + cast<MCSymbolXCOFF>(EHInfoSym)->setEHInfo(); + return EHInfoSym; } MCSymbol * @@ -2644,12 +2646,16 @@ MCSection *TargetLoweringObjectFileXCOFF::getSectionForFunctionDescriptor( MCSection *TargetLoweringObjectFileXCOFF::getSectionForTOCEntry( const MCSymbol *Sym, const TargetMachine &TM) const { // Use TE storage-mapping class when large code model is enabled so that - // the chance of needing -bbigtoc is decreased. + // the chance of needing -bbigtoc is decreased. Also, the toc-entry for + // EH info is never referenced directly using instructions so it can be + // allocated with TE storage-mapping class. return getContext().getXCOFFSection( cast<MCSymbolXCOFF>(Sym)->getSymbolTableName(), SectionKind::getData(), - XCOFF::CsectProperties( - TM.getCodeModel() == CodeModel::Large ? XCOFF::XMC_TE : XCOFF::XMC_TC, - XCOFF::XTY_SD)); + XCOFF::CsectProperties((TM.getCodeModel() == CodeModel::Large || + cast<MCSymbolXCOFF>(Sym)->isEHInfo()) + ? XCOFF::XMC_TE + : XCOFF::XMC_TC, + XCOFF::XTY_SD)); } MCSection *TargetLoweringObjectFileXCOFF::getSectionForLSDA( |