summaryrefslogtreecommitdiffstats
path: root/python/clippy
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:56:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:56:25 +0000
commit289582b3dcbeb23328325d224c7db7de66a3a55f (patch)
tree989c36d57aab945c36e34c952f438746ce18b3bd /python/clippy
parentReleasing progress-linux version 10.0.1-0.1~progress7.99u1. (diff)
downloadfrr-289582b3dcbeb23328325d224c7db7de66a3a55f.tar.xz
frr-289582b3dcbeb23328325d224c7db7de66a3a55f.zip
Merging upstream version 10.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'python/clippy')
-rw-r--r--python/clippy/__init__.py1
-rw-r--r--python/clippy/elf.py11
2 files changed, 11 insertions, 1 deletions
diff --git a/python/clippy/__init__.py b/python/clippy/__init__.py
index 60119fb..668724a 100644
--- a/python/clippy/__init__.py
+++ b/python/clippy/__init__.py
@@ -20,6 +20,7 @@ from _clippy import (
CMD_ATTR_HIDDEN,
CMD_ATTR_DEPRECATED,
CMD_ATTR_NOSH,
+ elf_notes,
)
diff --git a/python/clippy/elf.py b/python/clippy/elf.py
index cc442ee..fd34842 100644
--- a/python/clippy/elf.py
+++ b/python/clippy/elf.py
@@ -458,7 +458,16 @@ class ELFSubset(object):
- `this[123:str]` - extract until null byte. The slice stop value is
the `str` type (or, technically, `unicode`.)
"""
- return self._obj[k]
+ if k.start < getattr(self._obj, "len", float("+Inf")):
+ return self._obj[k]
+
+ real_sect = self._elffile.get_section_addr(self._obj.sh_addr + k.start)
+ offs = self._obj.sh_addr - real_sect.sh_addr
+ if k.stop is str:
+ new_k = slice(k.start + offs, str)
+ else:
+ new_k = slice(k.start + offs, k.stop + offs)
+ return real_sect[new_k]
def getreloc(self, offset):
"""