diff options
| author | Fangrui Song <i@maskray.me> | 2024-11-23 14:22:24 -0800 |
|---|---|---|
| committer | Fangrui Song <i@maskray.me> | 2024-11-23 14:22:24 -0800 |
| commit | 43e3871a327b8e2ff57e16b46d5bc44beb430d91 (patch) | |
| tree | 7b8958c5a8bc69f26aec7310810e1f7bff89b5f3 /lld/ELF/InputFiles.cpp | |
| parent | 3cecf17065919da0a7fa9b38f37592e5462c2f85 (diff) | |
[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.
Diffstat (limited to 'lld/ELF/InputFiles.cpp')
| -rw-r--r-- | lld/ELF/InputFiles.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
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<ELFT>::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<MergeInputSection>(s)) { - s = makeThreadLocal<InputSection>( - ms->file, ms->flags, ms->type, ms->addralign, - ms->contentMaybeDecompress(), ms->name); + s = makeThreadLocal<InputSection>(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<uint8_t> data = arrayRefFromStringRef(mb.getBuffer()); - auto *section = make<InputSection>(this, SHF_ALLOC | SHF_WRITE, SHT_PROGBITS, - 8, data, ".data"); + auto *section = + make<InputSection>(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 |
