[patch] kexec: Fix printed symbol value

Geoff Levand geoffrey.levand at am.sony.com
Mon Jun 22 18:08:49 EDT 2009


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

Signed-off-by: Geoff Levand <geoffrey.levand at am.sony.com>
---
index 74c4b35..1d3e22c 100644
--- a/kexec/kexec-elf-rel.c
+++ b/kexec/kexec-elf-rel.c
@@ -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);
 		}




More information about the kexec mailing list