Skip to contentSkip to conversation

arc: Add debug messages during relocation fixups

PATCH New Alexey Brodkin 1 participant 2 messages Aug 4, 2016 – Aug 5, 2016 Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arc: Add debug messages during relocation fixups

This might be useful to make sure relocation fixups really happen. And since this info gets printed only in DEBUG build it doesn't really hurt normal execution.

---
 arch/arc/lib/relocate.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arc/lib/relocate.c +7 -0
index 5c2c2d1..7709633 100644
@@ -37,6 +37,9 @@ int do_elf_reloc_fixups(void)
 	Elf32_Rela *re_src = (Elf32_Rela *)(&__rel_dyn_start);
 	Elf32_Rela *re_end = (Elf32_Rela *)(&__rel_dyn_end);
 
+	debug("Section .rela.dyn is located at %08x-%08x\n",
+	      (unsigned int)re_src, (unsigned int)re_end);
+
 	Elf32_Addr *offset_ptr_rom, *last_offset = NULL;
 	Elf32_Addr *offset_ptr_ram;
 
@@ -52,6 +55,10 @@ int do_elf_reloc_fixups(void)
 			offset_ptr_ram = (Elf32_Addr *)((ulong)offset_ptr_rom +
 							gd->reloc_off);
 
+			debug("Patching value @ %08x (relocated to %08x)\n",
+			      (unsigned int)offset_ptr_rom,
+			      (unsigned int)offset_ptr_ram);
+
 			/*
 			 * Use "memcpy" because target location might be
 			 * 16-bit aligned on ARC so we may need to read
Signature · 1 line
2.7.4
author Applied
#1 lore raw

PATCH 1/1 arc: Add debug messages during relocation fixups

Hi,

Quoted 5 lines · Alexey Brodkin

This might be useful to make sure relocation fixups really happen. And since this info gets printed only in DEBUG build it doesn't really hurt normal execution.

Applied,
Thanks!

-Alexey