diff --git a/lld/wasm/InputChunks.h b/lld/wasm/InputChunks.h --- a/lld/wasm/InputChunks.h +++ b/lld/wasm/InputChunks.h @@ -85,7 +85,6 @@ OutputSection *outputSec = nullptr; uint32_t comdat = UINT32_MAX; uint32_t inputSectionOffset = 0; - llvm::Align alignment; uint32_t flags; // Only applies to data segments. @@ -106,11 +105,14 @@ // Signals the chunk was discarded by COMDAT handling. unsigned discarded : 1; + + llvm::Align alignment; + protected: InputChunk(ObjFile *f, Kind k, StringRef name, uint32_t alignment = 0, uint32_t flags = 0) - : name(name), file(f), alignment(1ULL << alignment), flags(flags), - sectionKind(k), live(!config->gcSections), discarded(false) {} + : name(name), file(f), flags(flags), + sectionKind(k), live(!config->gcSections), discarded(false), alignment(1ULL << alignment) {} ArrayRef data() const { return rawData; } uint64_t getTombstone() const; diff --git a/lld/wasm/OutputSegment.h b/lld/wasm/OutputSegment.h --- a/lld/wasm/OutputSegment.h +++ b/lld/wasm/OutputSegment.h @@ -33,14 +33,14 @@ bool isTLS() const { return name == ".tdata"; } StringRef name; - bool isBss = false; uint32_t index = 0; uint32_t linkingFlags = 0; uint32_t initFlags = 0; uint32_t sectionOffset = 0; - llvm::Align alignment; uint64_t startVA = 0; std::vector inputSegments; + bool isBss = false; + llvm::Align alignment; // Sum of the size of the all the input segments uint32_t size = 0;