Skip to content

Commit a5af621

Browse files
committed
[ELF] Make SyntheticSection parameter order match InputSection
And rename `/*alignment=*/` to `/*addralign=*/`
1 parent d4bed61 commit a5af621

File tree

7 files changed

+81
-80
lines changed

7 files changed

+81
-80
lines changed

lld/ELF/AArch64ErrataFix.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,8 @@ class elf::Patch843419Section final : public SyntheticSection {
393393
};
394394

395395
Patch843419Section::Patch843419Section(Ctx &ctx, InputSection *p, uint64_t off)
396-
: SyntheticSection(ctx, SHF_ALLOC | SHF_EXECINSTR, SHT_PROGBITS, 4,
397-
".text.patch"),
396+
: SyntheticSection(ctx, ".text.patch", SHT_PROGBITS,
397+
SHF_ALLOC | SHF_EXECINSTR, 4),
398398
patchee(p), patcheeOffset(off) {
399399
this->parent = p->getParent();
400400
patchSym = addSyntheticLocal(

lld/ELF/ARMErrataFix.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ static bool is32bitBranch(uint32_t instr) {
136136

137137
Patch657417Section::Patch657417Section(Ctx &ctx, InputSection *p, uint64_t off,
138138
uint32_t instr, bool isARM)
139-
: SyntheticSection(ctx, SHF_ALLOC | SHF_EXECINSTR, SHT_PROGBITS, 4,
140-
".text.patch"),
139+
: SyntheticSection(ctx, ".text.patch", SHT_PROGBITS,
140+
SHF_ALLOC | SHF_EXECINSTR, 4),
141141
patchee(p), patcheeOffset(off), instr(instr), isARM(isARM) {
142142
parent = p->getParent();
143143
patchSym = addSyntheticLocal(

lld/ELF/Arch/ARM.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,9 +1331,9 @@ void elf::processArmCmseSymbols(Ctx &ctx) {
13311331
}
13321332

13331333
ArmCmseSGSection::ArmCmseSGSection(Ctx &ctx)
1334-
: SyntheticSection(ctx, llvm::ELF::SHF_ALLOC | llvm::ELF::SHF_EXECINSTR,
1335-
llvm::ELF::SHT_PROGBITS,
1336-
/*alignment=*/32, ".gnu.sgstubs") {
1334+
: SyntheticSection(ctx, ".gnu.sgstubs", SHT_PROGBITS,
1335+
SHF_ALLOC | SHF_EXECINSTR,
1336+
/*addralign=*/32) {
13371337
entsize = ACLESESYM_SIZE;
13381338
// The range of addresses used in the CMSE import library should be fixed.
13391339
for (auto &[_, sym] : ctx.symtab->cmseImportLib) {

lld/ELF/Arch/RISCV.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ namespace {
10451045
class RISCVAttributesSection final : public SyntheticSection {
10461046
public:
10471047
RISCVAttributesSection(Ctx &ctx)
1048-
: SyntheticSection(ctx, 0, SHT_RISCV_ATTRIBUTES, 1, ".riscv.attributes") {
1048+
: SyntheticSection(ctx, ".riscv.attributes", SHT_RISCV_ATTRIBUTES, 0, 1) {
10491049
}
10501050

10511051
size_t getSize() const override { return size; }

lld/ELF/InputSection.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,8 @@ static_assert(sizeof(InputSection) <= 160, "InputSection is too big");
472472
class SyntheticSection : public InputSection {
473473
public:
474474
Ctx &ctx;
475-
SyntheticSection(Ctx &ctx, uint64_t flags, uint32_t type, uint32_t addralign,
476-
StringRef name)
475+
SyntheticSection(Ctx &ctx, StringRef name, uint32_t type, uint64_t flags,
476+
uint32_t addralign)
477477
: InputSection(ctx.internalFile, name, type, flags, addralign,
478478
/*entsize=*/0, {}, InputSectionBase::Synthetic),
479479
ctx(ctx) {}

0 commit comments

Comments
 (0)