Skip to contentSkip to conversation

kexec: Fix printed symbol value

PATCH Applied Geoff Levand 2 participants 2 messages Jun 22, 2009 – Jun 23, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kexec: Fix printed symbol value

Move the print statement so that the variable
value has been assigned before its value is
printed.

---
index 74c4b35..1d3e22c 100644

kexec/kexec-elf-rel.c +3 -3
@@ -402,13 +402,13 @@ int elf_rel_load(struct mem_ehdr *ehdr, struct kexec_info *info,
 			else {
 				sec_base = ehdr->e_shdr[sym.st_shndx].sh_addr;
 			}
+			value = sym.st_value;
+			value += sec_base;
+			value += rel.r_addend;
 #ifdef DEBUG
 			fprintf(stderr, "sym: %s value: %lx addr: %lx\n",
 				name, value, address);
 #endif
-			value = sym.st_value;
-			value += sec_base;
-			value += rel.r_addend;
 			machine_apply_elf_rel(ehdr, rel.r_type,
 				(void *)location, address, value);
 		}

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec