Fix division in calculation function for 'R_ARM_CALL' (#196)
authorDmitry Koltunov <koltunov@ispras.ru>
Wed, 5 Sep 2018 22:00:34 +0000 (01:00 +0300)
committerEli Bendersky <eliben@users.noreply.github.com>
Wed, 5 Sep 2018 22:00:34 +0000 (15:00 -0700)
elftools/elf/relocation.py

index 59b67500b7c3715502f3466fc3a5ef256aa44c89..e245df43ae96e912bf60a651dc38da7abdd3fb54 100644 (file)
@@ -220,7 +220,7 @@ class RelocationHandler(object):
         return sym_value + addend - offset
 
     def _arm_reloc_calc_sym_plus_value_pcrel(value, sym_value, offset, addend=0):
-        return sym_value / 4 + value - offset / 4
+        return sym_value // 4 + value - offset // 4
 
     _RELOCATION_RECIPES_ARM = {
         ENUM_RELOC_TYPE_ARM['R_ARM_ABS32']: _RELOCATION_RECIPE_TYPE(