From 43e3871a327b8e2ff57e16b46d5bc44beb430d91 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sat, 23 Nov 2024 14:22:24 -0800 Subject: [ELF] Make section member orders consistent SectionBase, InputSectionBase, InputSection, MergeInputSection, and OutputSection have different member orders. Make them consistent and adopt the order similar to the raw Elf64_Shdr. --- lld/ELF/InputFiles.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lld/ELF/InputFiles.cpp') diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index 3a0ae43b813f..b89faa57985c 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -903,9 +903,9 @@ void ObjFile::initializeSections(bool ignoreComdats, // simply handle such sections as non-mergeable ones. Degrading like this // is acceptable because section merging is optional. if (auto *ms = dyn_cast(s)) { - s = makeThreadLocal( - ms->file, ms->flags, ms->type, ms->addralign, - ms->contentMaybeDecompress(), ms->name); + s = makeThreadLocal(ms->file, ms->name, ms->type, + ms->flags, ms->addralign, 0, + ms->contentMaybeDecompress()); sections[info] = s; } @@ -1849,8 +1849,9 @@ void BitcodeFile::postParse() { void BinaryFile::parse() { ArrayRef data = arrayRefFromStringRef(mb.getBuffer()); - auto *section = make(this, SHF_ALLOC | SHF_WRITE, SHT_PROGBITS, - 8, data, ".data"); + auto *section = + make(this, ".data", SHT_PROGBITS, SHF_ALLOC | SHF_WRITE, + /*addralign=*/8, /*entsize=*/0, data); sections.push_back(section); // For each input file foo that is embedded to a result as a binary -- cgit v1.2.3