diff --git a/cle/backends/elf/metaelf.py b/cle/backends/elf/metaelf.py index b1b5bd40..982d873d 100644 --- a/cle/backends/elf/metaelf.py +++ b/cle/backends/elf/metaelf.py @@ -149,7 +149,7 @@ def _load_plt(self): if ".plt.got" in self.sections_map: plt_secs = [self.sections_map[".plt.got"]] if ".MIPS.stubs" in self.sections_map: - plt_secs = [self.sections_map[".MIPS.stubs"]] + plt_secs.append(self.sections_map[".MIPS.stubs"]) if ".plt.sec" in self.sections_map: plt_secs.append(self.sections_map[".plt.sec"]) diff --git a/tests/test_plt.py b/tests/test_plt.py index 3afc6802..564d0cc8 100644 --- a/tests/test_plt.py +++ b/tests/test_plt.py @@ -26,7 +26,14 @@ def _check_plt_entries(self, filename): self.assertEqual(diffs, [4] * len(diffs)) return - # all our mips samples have no PLT, just resolver stubs + if filename == os.path.join("mips", "checkbyte"): + self.assertEqual( + ld.main_object.plt, + {"read": 0x4008C0, "puts": 0x4008D0, "__libc_start_main": 0x4008E0}, + ) + return + + # remaining mips samples have no PLT, just resolver stubs if filename.startswith("mips"): self.assertEqual(ld.main_object.plt, {}) return