mirror of
https://github.com/lief-project/LIEF
synced 2026-06-08 15:30:44 +00:00
Add relocation in the Abstract layer
The abstracted attributes are: * Address: virtual address where the relocation occurs * Size: size in bits of the relocation See: LIEF::Relocation / lief.Relocation and abstract_reader Resolve: #53
This commit is contained in:
@@ -29,16 +29,11 @@ using setter_t = void (Relocation::*)(T);
|
||||
|
||||
void init_ELF_Relocation_class(py::module& m) {
|
||||
// Relocation object
|
||||
py::class_<Relocation>(m, "Relocation")
|
||||
py::class_<Relocation, LIEF::Relocation>(m, "Relocation")
|
||||
.def(py::init<>())
|
||||
.def(py::init<uint64_t, uint32_t, int64_t, bool>(),
|
||||
"address"_a, "type"_a = 0, "addend"_a = 0, "is_rela"_a = false)
|
||||
|
||||
.def_property("address",
|
||||
static_cast<getter_t<uint64_t>>(&Relocation::address),
|
||||
static_cast<setter_t<uint64_t>>(&Relocation::address),
|
||||
"Address (or offset) of the relocation")
|
||||
|
||||
.def_property("addend",
|
||||
static_cast<getter_t<int64_t>>(&Relocation::addend),
|
||||
static_cast<setter_t<int64_t>>(&Relocation::addend),
|
||||
@@ -75,11 +70,6 @@ void init_ELF_Relocation_class(py::module& m) {
|
||||
static_cast<getter_t<bool>>(&Relocation::is_rel),
|
||||
"``True`` if the relocation doesn't use the :attr:`~lief.ELF.Relocation.addend` proprety")
|
||||
|
||||
.def_property_readonly("size",
|
||||
static_cast<getter_t<uint32_t>>(&Relocation::size),
|
||||
"Size in **bits** of the value patched by the relocation")
|
||||
|
||||
|
||||
.def("__eq__", &Relocation::operator==)
|
||||
.def("__ne__", &Relocation::operator!=)
|
||||
.def("__hash__",
|
||||
|
||||
Reference in New Issue
Block a user