diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h --- a/lld/ELF/InputSection.h +++ b/lld/ELF/InputSection.h @@ -134,6 +134,10 @@ // and shrinking a section. unsigned bytesDropped = 0; + // Whether the section needs to be padded with a NOP filler due to + // deleteFallThruJmpInsn. + bool nopFiller = false; + void drop_back(uint64_t num) { bytesDropped += num; } void push_back(uint64_t num) { @@ -210,17 +214,13 @@ // The native ELF reloc data type is not very convenient to handle. // So we convert ELF reloc records to our own records in Relocations.cpp. // This vector contains such "cooked" relocations. - std::vector relocations; - - // Indicates that this section needs to be padded with a NOP filler if set to - // true. - bool nopFiller = false; + SmallVector relocations; // These are modifiers to jump instructions that are necessary when basic // block sections are enabled. Basic block sections creates opportunities to // relax jump instructions at basic block boundaries after reordering the // basic blocks. - std::vector jumpInstrMods; + SmallVector jumpInstrMods; // A function compiled with -fsplit-stack calling a function // compiled without -fsplit-stack needs its prologue adjusted. Find @@ -390,6 +390,8 @@ template void copyShtGroup(uint8_t *buf); }; +static_assert(sizeof(InputSection) <= 184, "InputSection is too big"); + inline bool isDebugSection(const InputSectionBase &sec) { return sec.name.startswith(".debug") || sec.name.startswith(".zdebug"); }