diff options
author | Logan Chien <tzuhsiang.chien@gmail.com> | 2014-05-30 16:48:56 +0000 |
---|---|---|
committer | Logan Chien <tzuhsiang.chien@gmail.com> | 2014-05-30 16:48:56 +0000 |
commit | c002981084fc63573b6538415461af1783e5dc55 (patch) | |
tree | 44f2d1aeb24f9d895f50c9792503aa9a29a8d11b /llvm/lib/MC/MCObjectFileInfo.cpp | |
parent | b3a706870021df81ca678400746ed44d20b74f49 (diff) | |
download | bcm5719-llvm-c002981084fc63573b6538415461af1783e5dc55.tar.gz bcm5719-llvm-c002981084fc63573b6538415461af1783e5dc55.zip |
Fix MIPS exception personality encoding.
For MIPS, we have to encode the personality routine with
an indirect pointer to absptr; otherwise, some link warning
warning will be raised, and the program might crash in some
early MIPS Android device.
llvm-svn: 209907
Diffstat (limited to 'llvm/lib/MC/MCObjectFileInfo.cpp')
-rw-r--r-- | llvm/lib/MC/MCObjectFileInfo.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp index 9d413afe5db..2a9bf6ade90 100644 --- a/llvm/lib/MC/MCObjectFileInfo.cpp +++ b/llvm/lib/MC/MCObjectFileInfo.cpp @@ -321,6 +321,13 @@ void MCObjectFileInfo::InitELFMCObjectFileInfo(Triple T) { TTypeEncoding = dwarf::DW_EH_PE_absptr; } break; + case Triple::mips: + case Triple::mipsel: + // MIPS uses indirect pointer to refer personality functions, so that the + // eh_frame section can be read-only. DW.ref.personality will be generated + // for relocation. + PersonalityEncoding = dwarf::DW_EH_PE_indirect; + break; case Triple::ppc64: case Triple::ppc64le: PersonalityEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | |