Skip to content

Commit 8c7e687

Browse files
dlav-scyuxuanchen1997
authored andcommitted
[lldb] SHT_NOBITS sections type (#99044)
Summary: .sbss section was recognized as eSectionTypeOther, but has to be eSectionTypeZeroFill. Fixed tests for RISCV target: TestClassLoadingViaMemberTypedef.TestCase TestClassTemplateNonTypeParameterPack.TestCaseClassTemplateNonTypeParameterPack TestThreadSelectionBug.TestThreadSelectionBug lldbsuite.test.lldbtest.TestOffsetof lldbsuite.test.lldbtest.TestOffsetofCpp TestTargetDumpTypeSystem.TestCase TestCPP11EnumTypes.CPP11EnumTypesTestCase TestCppIsTypeComplete.TestCase TestExprCrash.ExprCrashTestCase TestDebugIndexCache.DebugIndexCacheTestcase Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60251404
1 parent d08bc0f commit 8c7e687

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1696,7 +1696,6 @@ static SectionType GetSectionTypeFromName(llvm::StringRef Name) {
16961696
return llvm::StringSwitch<SectionType>(Name)
16971697
.Case(".ARM.exidx", eSectionTypeARMexidx)
16981698
.Case(".ARM.extab", eSectionTypeARMextab)
1699-
.Cases(".bss", ".tbss", eSectionTypeZeroFill)
17001699
.Case(".ctf", eSectionTypeDebug)
17011700
.Cases(".data", ".tdata", eSectionTypeData)
17021701
.Case(".eh_frame", eSectionTypeEHFrame)
@@ -1713,6 +1712,10 @@ SectionType ObjectFileELF::GetSectionType(const ELFSectionHeaderInfo &H) const {
17131712
if (H.sh_flags & SHF_EXECINSTR)
17141713
return eSectionTypeCode;
17151714
break;
1715+
case SHT_NOBITS:
1716+
if (H.sh_flags & SHF_ALLOC)
1717+
return eSectionTypeZeroFill;
1718+
break;
17161719
case SHT_SYMTAB:
17171720
return eSectionTypeELFSymbolTable;
17181721
case SHT_DYNSYM:

0 commit comments

Comments
 (0)