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
This commit is contained in:
Rui Ueyama 2015-04-07 03:44:26 +00:00
parent 51870d16e4
commit 752a8c3e55
3 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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();
}