summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tools/kamek.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/kamek.py b/tools/kamek.py
index 43b4556..534eac8 100644
--- a/tools/kamek.py
+++ b/tools/kamek.py
@@ -189,16 +189,17 @@ class DyLinkCreator(object):
sym_id = entry['r_info_sym']
try:
- sym_value = sym_values[sym_id]
+ sym_value, sym_name = sym_values[sym_id]
except KeyError:
sym = sym_section.get_symbol(sym_id)
sym_value = sym.entry['st_value']
- sym_values[sym_id] = sym_value
+ sym_name = sym.name
+ sym_values[sym_id] = (sym_value, sym_name)
#print hex(sym_value)
- self.add_reloc(entry['r_info_type'], entry['r_offset'], sym_value+entry['r_addend'])
+ self.add_reloc(entry['r_info_type'], entry['r_offset'], sym_value+entry['r_addend'], sym_name)
- def add_reloc(self, reltype, addr, target):
+ def add_reloc(self, reltype, addr, target, name="UNKNOWN NAME"):
if reltype not in self.VALID_RELOCS:
raise ValueError('Unknown/unsupported rel type: %d (%x => %x)' % (reltype, addr, target))
@@ -208,6 +209,8 @@ class DyLinkCreator(object):
target_id = len(self._targets)
self._target_lookups[target] = target_id
self._targets.append(target)
+ if target <= 0:
+ print("Warning: The following reloc (%x) points to %d: Is this right? %s" % (addr, target, name))
self._relocs.append((reltype, addr, target_id))