Don't count strings as text in module info.

This commit is contained in:
Unknown W. Brackets 2014-07-20 12:09:06 -07:00
parent bf03e32027
commit 3ccc0d1e47
2 changed files with 3 additions and 1 deletions

View File

@ -598,7 +598,7 @@ SectionID ElfReader::GetSectionByName(const char *name, int firstSection)
u32 ElfReader::GetTotalTextSize() const {
u32 total = 0;
for (int i = 0; i < GetNumSections(); ++i) {
if (!(sections[i].sh_flags & SHF_WRITE) && (sections[i].sh_flags & SHF_ALLOC)) {
if (!(sections[i].sh_flags & SHF_WRITE) && (sections[i].sh_flags & SHF_ALLOC) && !(sections[i].sh_flags & SHF_STRINGS)) {
total += sections[i].sh_size;
}
}

View File

@ -148,6 +148,8 @@ enum ElfSectionFlags
SHF_WRITE =0x1,
SHF_ALLOC =0x2,
SHF_EXECINSTR =0x4,
SHF_MERGE =0x10,
SHF_STRINGS =0x20,
SHF_MASKPROC =0xF0000000,
};