summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-04-07 03:44:26 +0000
committerRui Ueyama <ruiu@google.com>2015-04-07 03:44:26 +0000
commit752a8c3e5574b39c4f5f943c1ca7e5cbaf8f67bb (patch)
treee16ffb03e210f47a71cb9389ca055513f52bdcb8
parent51870d16e4663a79cf8ebf6b2d860c2695b3d091 (diff)
downloadbcm5719-llvm-752a8c3e5574b39c4f5f943c1ca7e5cbaf8f67bb.tar.gz
bcm5719-llvm-752a8c3e5574b39c4f5f943c1ca7e5cbaf8f67bb.zip
ELF: Minimum alignment value is 1, not 0. NFC.
Maybe we can interpret alignment 0 as "don't care", but for consistency, it's good to set 1 instead of 0 where we allow any alignments. llvm-svn: 234284
-rw-r--r--lld/lib/ReaderWriter/ELF/Chunk.h2
-rw-r--r--lld/lib/ReaderWriter/ELF/SectionChunks.h2
-rw-r--r--lld/lib/ReaderWriter/ELF/SegmentChunks.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/lld/lib/ReaderWriter/ELF/Chunk.h b/lld/lib/ReaderWriter/ELF/Chunk.h
index 2e03ca826a0..f223b6c5416 100644
--- a/lld/lib/ReaderWriter/ELF/Chunk.h
+++ b/lld/lib/ReaderWriter/ELF/Chunk.h
@@ -98,7 +98,7 @@ protected:
const ELFLinkingContext &_ctx;
uint64_t _fsize = 0;
uint64_t _msize = 0;
- uint64_t _alignment = 0;
+ uint64_t _alignment = 1;
uint32_t _order = 0;
uint64_t _ordinal = 1;
uint64_t _start = 0;
diff --git a/lld/lib/ReaderWriter/ELF/SectionChunks.h b/lld/lib/ReaderWriter/ELF/SectionChunks.h
index e716faf8cbd..613858a39e1 100644
--- a/lld/lib/ReaderWriter/ELF/SectionChunks.h
+++ b/lld/lib/ReaderWriter/ELF/SectionChunks.h
@@ -530,7 +530,7 @@ private:
int64_t _shInfo = 0;
int64_t _entSize = 0;
int64_t _link = 0;
- uint64_t _alignment = 0;
+ uint64_t _alignment = 1;
int64_t _kind = 0;
int64_t _type = 0;
bool _isLoadableSection = false;
diff --git a/lld/lib/ReaderWriter/ELF/SegmentChunks.h b/lld/lib/ReaderWriter/ELF/SegmentChunks.h
index b0b071e61cd..cff9530b1b1 100644
--- a/lld/lib/ReaderWriter/ELF/SegmentChunks.h
+++ b/lld/lib/ReaderWriter/ELF/SegmentChunks.h
@@ -317,7 +317,7 @@ Segment<ELFT>::Segment(const ELFLinkingContext &ctx, StringRef name,
const typename TargetLayout<ELFT>::SegmentType type)
: Chunk<ELFT>(name, Chunk<ELFT>::Kind::ELFSegment, ctx), _segmentType(type),
_flags(0), _atomflags(0) {
- this->_alignment = 0;
+ this->_alignment = 1;
this->_fsize = 0;
_outputMagic = ctx.getOutputMagic();
}
OpenPOWER on IntegriCloud