summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2013-03-09 01:41:16 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2013-03-09 01:41:16 +0000
commit2d224509af6b7d66d6d8b32c2c7a48cd22576a33 (patch)
tree6995ec6ede655eb82c36746988abf2df3095e607
parent593eeb000ac528b9b8e1da3aa33dfc61337da62f (diff)
downloadbcm5719-llvm-2d224509af6b7d66d6d8b32c2c7a48cd22576a33.tar.gz
bcm5719-llvm-2d224509af6b7d66d6d8b32c2c7a48cd22576a33.zip
[Writer][ELF] Use correct data types for sizes. Fixes integer overflow bug.
This only happens when the section header count is > 1024. llvm-svn: 176747
-rw-r--r--lld/lib/ReaderWriter/ELF/HeaderChunks.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/lld/lib/ReaderWriter/ELF/HeaderChunks.h b/lld/lib/ReaderWriter/ELF/HeaderChunks.h
index 4c81b12d681..742f828e167 100644
--- a/lld/lib/ReaderWriter/ELF/HeaderChunks.h
+++ b/lld/lib/ReaderWriter/ELF/HeaderChunks.h
@@ -259,13 +259,13 @@ public:
void finalize() {}
- inline uint16_t fileSize() { return sizeof(Elf_Shdr) * _sectionInfo.size(); }
+ inline uint64_t fileSize() { return sizeof(Elf_Shdr) * _sectionInfo.size(); }
- inline int64_t entsize() {
+ inline uint64_t entsize() {
return sizeof(Elf_Shdr);
}
- inline int64_t numHeaders() {
+ inline uint64_t numHeaders() {
return _sectionInfo.size();
}
OpenPOWER on IntegriCloud