@@ -127,8 +127,8 @@ template <class T> struct DataRegion {
127
127
};
128
128
129
129
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) {
132
132
auto TableOrErr = Obj.sections ();
133
133
if (TableOrErr)
134
134
return " [index " + std::to_string (&Sec - &TableOrErr->front ()) + " ]" ;
@@ -151,8 +151,8 @@ static std::string describe(const ELFFile<ELFT> &Obj,
151
151
}
152
152
153
153
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) {
156
156
auto Headers = Obj.program_headers ();
157
157
if (Headers)
158
158
return (" [index " + Twine (&Phdr - &Headers->front ()) + " ]" ).str ();
@@ -166,8 +166,8 @@ static inline Error defaultWarningHandler(const Twine &Msg) {
166
166
}
167
167
168
168
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) {
171
171
// SHT_NOBITS sections don't need to have an offset inside the segment.
172
172
if (Sec.sh_type == ELF::SHT_NOBITS)
173
173
return true ;
@@ -184,8 +184,8 @@ bool checkSectionOffsets(const typename ELFT::Phdr &Phdr,
184
184
// Check that an allocatable section belongs to a virtual address
185
185
// space of a segment.
186
186
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) {
189
189
if (!(Sec.sh_flags & ELF::SHF_ALLOC))
190
190
return true ;
191
191
@@ -203,16 +203,16 @@ bool checkSectionVMA(const typename ELFT::Phdr &Phdr,
203
203
}
204
204
205
205
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) {
208
208
return checkSectionOffsets<ELFT>(Phdr, Sec) &&
209
209
checkSectionVMA<ELFT>(Phdr, Sec);
210
210
}
211
211
212
212
// HdrHandler is called once with the number of relocations and whether the
213
213
// relocations have addends. EntryHandler is called once per decoded relocation.
214
214
template <bool Is64>
215
- Error decodeCrel (
215
+ static Error decodeCrel (
216
216
ArrayRef<uint8_t > Content,
217
217
function_ref<void (uint64_t /* relocation count*/ , bool /* explicit addends*/ )>
218
218
HdrHandler,
0 commit comments