Skip to content

Commit 1db7d2a

Browse files
committed
[ELF] Add missing static decl on several helpers; NFC
1 parent e90d552 commit 1db7d2a

File tree

1 file changed

+11
-11
lines changed
  • llvm/include/llvm/Object

1 file changed

+11
-11
lines changed

llvm/include/llvm/Object/ELF.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ template <class T> struct DataRegion {
127127
};
128128

129129
template <class ELFT>
130-
std::string getSecIndexForError(const ELFFile<ELFT> &Obj,
131-
const typename ELFT::Shdr &Sec) {
130+
static std::string getSecIndexForError(const ELFFile<ELFT> &Obj,
131+
const typename ELFT::Shdr &Sec) {
132132
auto TableOrErr = Obj.sections();
133133
if (TableOrErr)
134134
return "[index " + std::to_string(&Sec - &TableOrErr->front()) + "]";
@@ -151,8 +151,8 @@ static std::string describe(const ELFFile<ELFT> &Obj,
151151
}
152152

153153
template <class ELFT>
154-
std::string getPhdrIndexForError(const ELFFile<ELFT> &Obj,
155-
const typename ELFT::Phdr &Phdr) {
154+
static std::string getPhdrIndexForError(const ELFFile<ELFT> &Obj,
155+
const typename ELFT::Phdr &Phdr) {
156156
auto Headers = Obj.program_headers();
157157
if (Headers)
158158
return ("[index " + Twine(&Phdr - &Headers->front()) + "]").str();
@@ -166,8 +166,8 @@ static inline Error defaultWarningHandler(const Twine &Msg) {
166166
}
167167

168168
template <class ELFT>
169-
bool checkSectionOffsets(const typename ELFT::Phdr &Phdr,
170-
const typename ELFT::Shdr &Sec) {
169+
static bool checkSectionOffsets(const typename ELFT::Phdr &Phdr,
170+
const typename ELFT::Shdr &Sec) {
171171
// SHT_NOBITS sections don't need to have an offset inside the segment.
172172
if (Sec.sh_type == ELF::SHT_NOBITS)
173173
return true;
@@ -184,8 +184,8 @@ bool checkSectionOffsets(const typename ELFT::Phdr &Phdr,
184184
// Check that an allocatable section belongs to a virtual address
185185
// space of a segment.
186186
template <class ELFT>
187-
bool checkSectionVMA(const typename ELFT::Phdr &Phdr,
188-
const typename ELFT::Shdr &Sec) {
187+
static bool checkSectionVMA(const typename ELFT::Phdr &Phdr,
188+
const typename ELFT::Shdr &Sec) {
189189
if (!(Sec.sh_flags & ELF::SHF_ALLOC))
190190
return true;
191191

@@ -203,16 +203,16 @@ bool checkSectionVMA(const typename ELFT::Phdr &Phdr,
203203
}
204204

205205
template <class ELFT>
206-
bool isSectionInSegment(const typename ELFT::Phdr &Phdr,
207-
const typename ELFT::Shdr &Sec) {
206+
static bool isSectionInSegment(const typename ELFT::Phdr &Phdr,
207+
const typename ELFT::Shdr &Sec) {
208208
return checkSectionOffsets<ELFT>(Phdr, Sec) &&
209209
checkSectionVMA<ELFT>(Phdr, Sec);
210210
}
211211

212212
// HdrHandler is called once with the number of relocations and whether the
213213
// relocations have addends. EntryHandler is called once per decoded relocation.
214214
template <bool Is64>
215-
Error decodeCrel(
215+
static Error decodeCrel(
216216
ArrayRef<uint8_t> Content,
217217
function_ref<void(uint64_t /*relocation count*/, bool /*explicit addends*/)>
218218
HdrHandler,

0 commit comments

Comments
 (0)