[lld] r190723 - [PECOFF] Fix atom default alignment.
Rui Ueyama
ruiu at google.com
Fri Sep 13 13:53:11 PDT 2013
Author: ruiu
Date: Fri Sep 13 15:53:11 2013
New Revision: 190723
URL: http://llvm.org/viewvc/llvm-project?rev=190723&view=rev
Log:
[PECOFF] Fix atom default alignment.
Alignment(1) does not mean that the atom should be aligned on a 1 byte
boundary but on a 2^1 boundary. So, atoms without any specific alignment
requirements should have Alignment(0).
Modified:
lld/trunk/lib/ReaderWriter/PECOFF/Atoms.h
Modified: lld/trunk/lib/ReaderWriter/PECOFF/Atoms.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/Atoms.h?rev=190723&r1=190722&r2=190723&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/Atoms.h (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/Atoms.h Fri Sep 13 15:53:11 2013
@@ -100,7 +100,7 @@ public:
virtual StringRef name() const { return _name; }
virtual Interposable interposable() const { return interposeNo; }
virtual Merge merge() const { return mergeNo; }
- virtual Alignment alignment() const { return Alignment(1); }
+ virtual Alignment alignment() const { return Alignment(0); }
virtual SectionChoice sectionChoice() const { return sectionBasedOnContent; }
virtual StringRef customSectionName() const { return ""; }
virtual SectionPosition sectionPosition() const { return sectionPositionAny; }
@@ -152,7 +152,7 @@ public:
ContentPermissions perms, uint64_t ordinal)
: COFFBaseDefinedAtom(file, name, Kind::File), _sectionName(sectionName),
_scope(scope), _contentType(contentType), _permissions(perms),
- _ordinal(ordinal), _alignment(1) {}
+ _ordinal(ordinal), _alignment(0) {}
static bool classof(const COFFBaseDefinedAtom *atom) {
return atom->getKind() == Kind::File;
@@ -222,7 +222,7 @@ class COFFLinkerInternalAtom : public CO
public:
virtual uint64_t ordinal() const { return 0; }
virtual Scope scope() const { return scopeGlobal; }
- virtual Alignment alignment() const { return Alignment(1); }
+ virtual Alignment alignment() const { return Alignment(0); }
virtual uint64_t size() const { return _data.size(); }
virtual ArrayRef<uint8_t> rawContent() const { return _data; }
More information about the llvm-commits
mailing list