Skip to content

Commit

Permalink
Use DT_PLTRELSZ if present
Browse files Browse the repository at this point in the history
  • Loading branch information
rhelmot committed Apr 22, 2024
1 parent f0d0bb2 commit c8f6aae
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cle/backends/elf/elf.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,8 @@ def __register_dyn(self, seg_readelf):
rela_tag = "DT_" + self.rela_type
relsz_tag = rela_tag + "SZ"
if rela_tag in self._dynamic:
if "DT_PLTRELSZ" in self._dynamic:
relsz_tag = "DT_PLTRELSZ"
reloffset = AT.from_lva(self._dynamic[rela_tag], self).to_rva()
if relsz_tag not in self._dynamic:
raise CLEInvalidBinaryError(f"Dynamic section contains {rela_tag} but not {relsz_tag}")
Expand Down

0 comments on commit c8f6aae

Please sign in to comment.