From 3ccc0d1e4743689989df0f5305705d31f80a2c6c Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 20 Jul 2014 12:09:06 -0700 Subject: [PATCH] Don't count strings as text in module info. --- Core/ELF/ElfReader.cpp | 2 +- Core/ELF/ElfTypes.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Core/ELF/ElfReader.cpp b/Core/ELF/ElfReader.cpp index 5f6da544d4..1542e65dfc 100644 --- a/Core/ELF/ElfReader.cpp +++ b/Core/ELF/ElfReader.cpp @@ -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; } } diff --git a/Core/ELF/ElfTypes.h b/Core/ELF/ElfTypes.h index dbd39c5009..79dec51fb9 100644 --- a/Core/ELF/ElfTypes.h +++ b/Core/ELF/ElfTypes.h @@ -148,6 +148,8 @@ enum ElfSectionFlags SHF_WRITE =0x1, SHF_ALLOC =0x2, SHF_EXECINSTR =0x4, + SHF_MERGE =0x10, + SHF_STRINGS =0x20, SHF_MASKPROC =0xF0000000, };