]> git.alrj.org Git - bold.git/blobdiff - Bold/elf.py
Add support for R_X86_64_32S relocation type.
[bold.git] / Bold / elf.py
index b439451a3abc102d19b33448d1784455d733074f..1d73ec7175c5db71dc12f2fbcb8b9f7932818787 100644 (file)
@@ -1,5 +1,4 @@
 # -*- coding: utf-8 -*-
-
 # kate: space-indent on; indent-width 2; mixedindent off; indent-mode python;
 
 # Copyright (C) 2009 Amand 'alrj' Tihon <amand.tihon@alrj.org>
@@ -7,8 +6,8 @@
 # This file is part of bold, the Byte Optimized Linker.
 #
 # You can redistribute this file and/or modify it under the terms of the
-# GNU Lesser General Public License as published by the Free Software
-# Foundation, version 2.1.
+# GNU General Public License as published by the Free Software Foundation,
+# either version 3 of the License or (at your option) any later version.
 
 
 from BinArray import BinArray
@@ -20,6 +19,7 @@ import struct
 def nested_property(c):
   return property(**c())
 
+
 #--------------------------------------------------------------------------
 #  Elf
 #--------------------------------------------------------------------------
@@ -152,6 +152,9 @@ class Elf64(object):
         elif reloc.r_type == R_X86_64_32:
           format = "<I" # Direct 32 bit zero extended
           target_value = sym_address + reloc.r_addend
+        elif reloc.r_type == R_X86_64_32S:
+          format = "<i" # Direct 32 bit sign extended
+          target_value = sym_address + reloc.r_addend
         elif reloc.r_type == R_X86_64_PC16:
           format = "<h" # 16 bit sign extended pc relative
           target_value = sym_address + reloc.r_addend - pc_address