http://llvm.org/bugs/show_bug.cgi?id=14723
Bug #: 14723
Summary: ELFObjectFile::isSectionZeroInit() checks the wrong
bits
Product: new-bugs
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: new bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
There's a test in ELFObjectFile::isSectionZeroInit() that seems bogus to me and
that fails to recognize a BSS section in my /bin/ls as zero-initialized.
I believe this change should fix the problem:
--- a/include/llvm/Object/ELF.h
+++ b/include/llvm/Object/ELF.h
@@ -1306,7 +1306,7 @@ error_code ELFObjectFile<target_endianness, is64Bits>
const Elf_Shdr *sec = reinterpret_cast<const Elf_Shdr *>(Sec.p);
// For ELF, all zero-init sections are virtual (that is, they occupy no
space
// in the object image) and vice versa.
- if (sec->sh_flags & ELF::SHT_NOBITS)
+ if (sec->sh_type == ELF::SHT_NOBITS)
Result = true;
else
Result = false;
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs