diff options
author | Sagar Thakur <sagar.thakur@imgtec.com> | 2016-05-11 13:08:29 +0000 |
---|---|---|
committer | Sagar Thakur <sagar.thakur@imgtec.com> | 2016-05-11 13:08:29 +0000 |
commit | 477eb42f854aaed920abae58f9dd4a9e7d66aad8 (patch) | |
tree | 66d2dd90ba9c2c0ff8e1f4f6555b3c304c251a04 /lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | |
parent | 10e6cefd8221dda2dd977c38ff7abdf2a507d981 (diff) | |
download | bcm5719-llvm-477eb42f854aaed920abae58f9dd4a9e7d66aad8.tar.gz bcm5719-llvm-477eb42f854aaed920abae58f9dd4a9e7d66aad8.zip |
[LLDB][MIPS] Setting appropriate ArchSpec::m_flags based on ABI
Patch by Nitesh Jain.
Summary: The ArchSpec::m_flags will be set based on ELF flag ABI.
Reviewers: ovyalov, clayborg
Subscribers: lldb-commits, mohit.bhakkad, sagar, jaydeep, bhushan
Differential: D18858
llvm-svn: 269181
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index a8bbda13aa3..fe299b17f59 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -1697,8 +1697,7 @@ ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl §ion_headers, I->section_name = name; - if (arch_spec.GetMachine() == llvm::Triple::mips || arch_spec.GetMachine() == llvm::Triple::mipsel - || arch_spec.GetMachine() == llvm::Triple::mips64 || arch_spec.GetMachine() == llvm::Triple::mips64el) + if (arch_spec.IsMIPS()) { uint32_t arch_flags = arch_spec.GetFlags (); DataExtractor data; @@ -1712,13 +1711,27 @@ ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl §ion_headers, } } // Settings appropriate ArchSpec ABI Flags - if (header.e_flags & llvm::ELF::EF_MIPS_ABI2) + switch(header.e_flags & llvm::ELF::EF_MIPS_ABI) { - arch_flags |= lldb_private::ArchSpec::eMIPSABI_N32; - } - else if (header.e_flags & llvm::ELF::EF_MIPS_ABI_O32) - { - arch_flags |= lldb_private::ArchSpec::eMIPSABI_O32; + case llvm::ELF::EF_MIPS_ABI_O32: + arch_flags |= lldb_private::ArchSpec::eMIPSABI_O32; + break; + case EF_MIPS_ABI_O64: + arch_flags |= lldb_private::ArchSpec::eMIPSABI_O64; + break; + case EF_MIPS_ABI_EABI32: + arch_flags |= lldb_private::ArchSpec::eMIPSABI_EABI32; + break; + case EF_MIPS_ABI_EABI64: + arch_flags |= lldb_private::ArchSpec::eMIPSABI_EABI64; + break; + default: + // ABI Mask doesn't cover N32 and N64 ABI. + if (header.e_ident[EI_CLASS] == llvm::ELF::ELFCLASS64) + arch_flags |= lldb_private::ArchSpec::eMIPSABI_N64; + else if (header.e_flags && llvm::ELF::EF_MIPS_ABI2) + arch_flags |= lldb_private::ArchSpec::eMIPSABI_N32; + break; } arch_spec.SetFlags (arch_flags); } |