Skip to content

Commit 0c7c1d4

Browse files
committed
fixup! [Object, ELF] Implement PN_XNUM extension for program headers
1 parent e58255a commit 0c7c1d4

File tree

1 file changed

+5
-3
lines changed
  • llvm/include/llvm/Object

1 file changed

+5
-3
lines changed

llvm/include/llvm/Object/ELF.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,21 +291,21 @@ class ELFFile {
291291
public:
292292
Expected<uint32_t> getPhNum() const {
293293
if (!RealPhNum) {
294-
if (Error E = readShdrZero())
294+
if (Error E = const_cast<ELFFile<ELFT> *>(this)->readShdrZero())
295295
return std::move(E);
296296
}
297297
return *RealPhNum;
298298
}
299299
Expected<uint32_t> getShNum() const {
300300
if (!RealShNum) {
301-
if (Error E = readShdrZero())
301+
if (Error E = const_cast<ELFFile<ELFT> *>(this)->readShdrZero())
302302
return std::move(E);
303303
}
304304
return *RealShNum;
305305
}
306306
Expected<uint32_t> getShStrNdx() const {
307307
if (!RealShStrNdx) {
308-
if (Error E = readShdrZero())
308+
if (Error E = const_cast<ELFFile<ELFT> *>(this)->readShdrZero())
309309
return std::move(E);
310310
}
311311
return *RealShStrNdx;
@@ -947,6 +947,8 @@ template <class ELFT> Error ELFFile<ELFT>::readShdrZero() {
947947
RealShNum = Header.e_shnum;
948948
RealShStrNdx = Header.e_shstrndx;
949949
}
950+
951+
return Error::success();
950952
}
951953

952954
template <class ELFT>

0 commit comments

Comments
 (0)