[lld] r234284 - ELF: Minimum alignment value is 1, not 0. NFC.
Rui Ueyama
ruiu at google.com
Mon Apr 6 20:44:26 PDT 2015
Author: ruiu
Date: Mon Apr 6 22:44:26 2015
New Revision: 234284
URL: http://llvm.org/viewvc/llvm-project?rev=234284&view=rev
Log:
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.
Modified:
lld/trunk/lib/ReaderWriter/ELF/Chunk.h
lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h
lld/trunk/lib/ReaderWriter/ELF/SegmentChunks.h
Modified: lld/trunk/lib/ReaderWriter/ELF/Chunk.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Chunk.h?rev=234284&r1=234283&r2=234284&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Chunk.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Chunk.h Mon Apr 6 22:44:26 2015
@@ -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;
Modified: lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h?rev=234284&r1=234283&r2=234284&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h Mon Apr 6 22:44:26 2015
@@ -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;
Modified: lld/trunk/lib/ReaderWriter/ELF/SegmentChunks.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/SegmentChunks.h?rev=234284&r1=234283&r2=234284&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/SegmentChunks.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/SegmentChunks.h Mon Apr 6 22:44:26 2015
@@ -317,7 +317,7 @@ Segment<ELFT>::Segment(const ELFLinkingC
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();
}
More information about the llvm-commits
mailing list