aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCObjectFileInfo.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-04-03 03:13:19 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-04-03 03:13:19 +0000
commitb9b7ae0c78d1b2f7a2b90656511c76c9d736c160 (patch)
tree06045d3769d72a4e0398e848394ff4922b2b5171 /llvm/lib/MC/MCObjectFileInfo.cpp
parent9c0f0af54f6da0f65424958b2cba28869a1636ce (diff)
downloadllvm-b9b7ae0c78d1b2f7a2b90656511c76c9d736c160.zip
llvm-b9b7ae0c78d1b2f7a2b90656511c76c9d736c160.tar.gz
llvm-b9b7ae0c78d1b2f7a2b90656511c76c9d736c160.tar.bz2
Fix the fde encoding used by mips to match gas.
This finally fixes the encoding. The patch also * Removes eh-frame.ll. It was an unnecessary .ll to .o test that was checking the wrong value. * Merge fde-reloc.s and eh-frame.s into a single test, since the only difference was the run lines. * Don't blindly test the content of the entire .eh_frame section. It makes it hard to anyone actually fixing a bug and hitting a difference in a binary blob. Instead, use a CHECK for each field and document what is being checked. llvm-svn: 178615
Diffstat (limited to 'llvm/lib/MC/MCObjectFileInfo.cpp')
-rw-r--r--llvm/lib/MC/MCObjectFileInfo.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp
index 0d32ad4..d19e79a 100644
--- a/llvm/lib/MC/MCObjectFileInfo.cpp
+++ b/llvm/lib/MC/MCObjectFileInfo.cpp
@@ -223,10 +223,13 @@ void MCObjectFileInfo::InitMachOMCObjectFileInfo(Triple T) {
}
void MCObjectFileInfo::InitELFMCObjectFileInfo(Triple T) {
- if (T.getArch() != Triple::mips &&
- T.getArch() != Triple::mipsel &&
- T.getArch() != Triple::mips64 &&
- T.getArch() != Triple::mips64el )
+ if (T.getArch() == Triple::mips ||
+ T.getArch() == Triple::mipsel)
+ FDECFIEncoding = dwarf::DW_EH_PE_sdata4;
+ else if (T.getArch() == Triple::mips64 ||
+ T.getArch() == Triple::mips64el)
+ FDECFIEncoding = dwarf::DW_EH_PE_sdata8;
+ else
FDECFIEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
if (T.getArch() == Triple::x86) {