mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-20 10:24:12 +00:00
Only produce the eh_frame section if we have at least one personality function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130692 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -54,25 +54,27 @@ void DwarfCFIException::EndModule() {
|
|||||||
|
|
||||||
const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
|
const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
|
||||||
|
|
||||||
if (!TLOF.isFunctionEHFrameSymbolPrivate()) {
|
|
||||||
// This is a temporary hack to keep sections in the same order they
|
|
||||||
// were before. This lets us produce bit identical outputs while
|
|
||||||
// transitioning to CFI.
|
|
||||||
Asm->OutStreamer.SwitchSection(TLOF.getEHFrameSection());
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned PerEncoding = TLOF.getPersonalityEncoding();
|
unsigned PerEncoding = TLOF.getPersonalityEncoding();
|
||||||
|
|
||||||
if ((PerEncoding & 0x70) != dwarf::DW_EH_PE_pcrel)
|
if ((PerEncoding & 0x70) != dwarf::DW_EH_PE_pcrel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Emit references to all used personality functions
|
// Emit references to all used personality functions
|
||||||
|
bool AtLeastOne = false;
|
||||||
const std::vector<const Function*> &Personalities = MMI->getPersonalities();
|
const std::vector<const Function*> &Personalities = MMI->getPersonalities();
|
||||||
for (size_t i = 0, e = Personalities.size(); i != e; ++i) {
|
for (size_t i = 0, e = Personalities.size(); i != e; ++i) {
|
||||||
if (!Personalities[i])
|
if (!Personalities[i])
|
||||||
continue;
|
continue;
|
||||||
MCSymbol *Sym = Asm->Mang->getSymbol(Personalities[i]);
|
MCSymbol *Sym = Asm->Mang->getSymbol(Personalities[i]);
|
||||||
TLOF.emitPersonalityValue(Asm->OutStreamer, Asm->TM, Sym);
|
TLOF.emitPersonalityValue(Asm->OutStreamer, Asm->TM, Sym);
|
||||||
|
AtLeastOne = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AtLeastOne && !TLOF.isFunctionEHFrameSymbolPrivate()) {
|
||||||
|
// This is a temporary hack to keep sections in the same order they
|
||||||
|
// were before. This lets us produce bit identical outputs while
|
||||||
|
// transitioning to CFI.
|
||||||
|
Asm->OutStreamer.SwitchSection(TLOF.getEHFrameSection());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user