Grang, Mandeep Singh via llvm-dev
2017-Apr-05 20:35 UTC
[llvm-dev] Difference in EHType between ARM and AArch64
Joerg, Referring to your patch https://reviews.llvm.org/rL291172. / switch (MAI->getExceptionHandlingType()) {// // case ExceptionHandling::SjLj:// // case ExceptionHandling::DwarfCFI:// // case ExceptionHandling::ARM:// //*isCFIMoveForDebugging = true;*// //*if (MAI->getExceptionHandlingType() != ExceptionHandling::DwarfCFI)*/*/ /**/ break;/*/ // for (auto &F: M.getFunctionList()) {// // // If the module contains any function with unwind data,// // // .eh_frame has to be emitted.// // // Ignore functions that won't get emitted.// // if (!F.isDeclarationForLinker() && F.needsUnwindTableEntry()) {// //*isCFIMoveForDebugging = false;*// // break;// // }// / The ExceptionHandlingType for AArch64 is ExceptionHandling::DwarfCFI whereas for ARM it is ExceptionHandling::ARM. As a result, the behavior of the .cfi_sections differs for ARM vs AArch64. Due to this, my test which checks for .cfi_sections and .debug_frame passes for ARM but fails for AArch64. Could you please clarify, why the behavior for handling .cfi_sections needs to be different between ARM and AArch64? --Mandeep -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170405/141ac1ad/attachment.html>
Renato Golin via llvm-dev
2017-Apr-06 09:22 UTC
[llvm-dev] Difference in EHType between ARM and AArch64
On 5 April 2017 at 21:35, Grang, Mandeep Singh via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Could you please clarify, why the behavior for handling .cfi_sections needs > to be different between ARM and AArch64?Hi Mandeep, Many years ago, ARM devised a specially crafted exception handling system tuned for code size and embedded targets, which was the whole point of their hardware designs. This was called the EHABI. AArch64 was never meant to be an embedded architecture (ARMv8M is still AArch32), and the complexity added by having a completely different exception handling just wasn't worth the trouble. For that reason, AArch64 follows the Dwarf EH while AArch32 follows the EHABI. cheers, --renato
Grang, Mandeep Singh via llvm-dev
2017-Apr-06 21:39 UTC
[llvm-dev] Difference in EHType between ARM and AArch64
Thanks for your explanation Renato. So I guess with Joerg's patch which changes emitting .cfi_sections, my AArch64 test is now "supposed" to fail. --Mandeep On 4/6/2017 2:22 AM, Renato Golin wrote:> On 5 April 2017 at 21:35, Grang, Mandeep Singh via llvm-dev > <llvm-dev at lists.llvm.org> wrote: >> Could you please clarify, why the behavior for handling .cfi_sections needs >> to be different between ARM and AArch64? > Hi Mandeep, > > Many years ago, ARM devised a specially crafted exception handling > system tuned for code size and embedded targets, which was the whole > point of their hardware designs. This was called the EHABI. > > AArch64 was never meant to be an embedded architecture (ARMv8M is > still AArch32), and the complexity added by having a completely > different exception handling just wasn't worth the trouble. > > For that reason, AArch64 follows the Dwarf EH while AArch32 follows the EHABI. > > cheers, > --renato