@@ -1517,32 +1517,42 @@ ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl §ion_headers,
1517
1517
I != section_headers.end (); ++I)
1518
1518
{
1519
1519
static ConstString g_sect_name_gnu_debuglink (" .gnu_debuglink" );
1520
- const ELFSectionHeaderInfo &header = *I;
1521
- const uint64_t section_size = header .sh_type == SHT_NOBITS ? 0 : header .sh_size ;
1520
+ const ELFSectionHeaderInfo &sheader = *I;
1521
+ const uint64_t section_size = sheader .sh_type == SHT_NOBITS ? 0 : sheader .sh_size ;
1522
1522
ConstString name (shstr_data.PeekCStr (I->sh_name ));
1523
1523
1524
1524
I->section_name = name;
1525
1525
1526
1526
if (arch_spec.GetMachine () == llvm::Triple::mips || arch_spec.GetMachine () == llvm::Triple::mipsel
1527
1527
|| arch_spec.GetMachine () == llvm::Triple::mips64 || arch_spec.GetMachine () == llvm::Triple::mips64el)
1528
1528
{
1529
- if (header.sh_type == SHT_MIPS_ABIFLAGS)
1529
+ uint32_t arch_flags = arch_spec.GetFlags ();
1530
+ DataExtractor data;
1531
+ if (sheader.sh_type == SHT_MIPS_ABIFLAGS)
1530
1532
{
1531
- DataExtractor data;
1532
- if (section_size && (data.SetData (object_data, header .sh_offset , section_size) == section_size))
1533
+
1534
+ if (section_size && (data.SetData (object_data, sheader .sh_offset , section_size) == section_size))
1533
1535
{
1534
1536
lldb::offset_t ase_offset = 12 ; // MIPS ABI Flags Version: 0
1535
- uint32_t arch_flags = arch_spec.GetFlags ();
1536
1537
arch_flags |= data.GetU32 (&ase_offset);
1537
- arch_spec.SetFlags (arch_flags);
1538
1538
}
1539
1539
}
1540
+ // Settings appropriate ArchSpec ABI Flags
1541
+ if (header.e_flags & llvm::ELF::EF_MIPS_ABI2)
1542
+ {
1543
+ arch_flags |= lldb_private::ArchSpec::eMIPSABI_N32;
1544
+ }
1545
+ else if (header.e_flags & llvm::ELF::EF_MIPS_ABI_O32)
1546
+ {
1547
+ arch_flags |= lldb_private::ArchSpec::eMIPSABI_O32;
1548
+ }
1549
+ arch_spec.SetFlags (arch_flags);
1540
1550
}
1541
1551
1542
1552
if (name == g_sect_name_gnu_debuglink)
1543
1553
{
1544
1554
DataExtractor data;
1545
- if (section_size && (data.SetData (object_data, header .sh_offset , section_size) == section_size))
1555
+ if (section_size && (data.SetData (object_data, sheader .sh_offset , section_size) == section_size))
1546
1556
{
1547
1557
lldb::offset_t gnu_debuglink_offset = 0 ;
1548
1558
gnu_debuglink_file = data.GetCStr (&gnu_debuglink_offset);
@@ -1552,7 +1562,7 @@ ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl §ion_headers,
1552
1562
}
1553
1563
1554
1564
// Process ELF note section entries.
1555
- bool is_note_header = (header .sh_type == SHT_NOTE);
1565
+ bool is_note_header = (sheader .sh_type == SHT_NOTE);
1556
1566
1557
1567
// The section header ".note.android.ident" is stored as a
1558
1568
// PROGBITS type header but it is actually a note header.
@@ -1564,7 +1574,7 @@ ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl §ion_headers,
1564
1574
{
1565
1575
// Allow notes to refine module info.
1566
1576
DataExtractor data;
1567
- if (section_size && (data.SetData (object_data, header .sh_offset , section_size) == section_size))
1577
+ if (section_size && (data.SetData (object_data, sheader .sh_offset , section_size) == section_size))
1568
1578
{
1569
1579
Error error = RefineModuleDetailsFromNote (data, arch_spec, uuid);
1570
1580
if (error.Fail ())
0 commit comments