Python: mark add_relocation return value as reference
Makes the return value from the PE::Binary add_relocation method an internal reference.
Without this, the object returned by add_relocation is a copy of the one held by Binary, so modifications to that object are independent.
This is similar to #1106
Test case:
import lief
b = lief.PE.Binary(lief.PE.PE_TYPE.PE32)
r = lief.PE.Relocation()
s = b.add_relocation(r)
assert r is not s
assert list(b.relocations)[0] is s
Python: mark add_relocation return value as reference Makes the return value from the PE::Binary add_relocation method an internal reference.
Without this, the object returned by
add_relocation
is a copy of the one held byBinary
, so modifications to that object are independent.This is similar to #1106
Test case: