[PATCH] Fix Android MIPS exception personality encoding.

Daniel Sanders daniel.sanders at imgtec.com
Thu May 22 03:22:35 PDT 2014


My background is in C and Embedded-C compilers so my knowledge of things like CFI is rather limited at the moment and I don't think I'm suitable to review this patch. Hopefully someone who knows this area better will also take a look.

Bearing that in mind, a couple things look a bit odd to me. I've put the comments inline.

================
Comment at: lib/MC/MCObjectFileInfo.cpp:328
@@ +327,3 @@
+      // MIPS devices.
+      PersonalityEncoding = dwarf::DW_EH_PE_indirect;
+    }
----------------
I'm fairly sure that the if-statement should be testing for RelocM == Reloc::PIC_ rather than Android.

I'm not so sure what the correct PersonalityEncoding is but DW_EH_PE_indirect by itself seems odd. I see that all the other targets are combining DW_EH_PE_indirect with DW_EH_PE_pcrel and one of the data size values. If this is the right thing to do for MIPS then it removes the need for the change to getCFIPersonalitySymbol(). However, it's possible that it should be combining DW_EH_PE_indirect with DW_EH_PE_absptr.

http://reviews.llvm.org/D3828






More information about the llvm-commits mailing list