From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from wa4ehsobe003.messaging.microsoft.com ([216.32.181.13] helo=WA4EHSOBE003.bigfish.com) by bombadil.infradead.org with esmtps (Exim 4.69 #1 (Red Hat Linux)) id 1MIrhi-00062n-GM for kexec@lists.infradead.org; Mon, 22 Jun 2009 22:09:44 +0000 Message-ID: <4A4000F1.8040908@am.sony.com> Date: Mon, 22 Jun 2009 15:08:49 -0700 From: Geoff Levand MIME-Version: 1.0 Subject: [patch] kexec: Fix printed symbol value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: kexec-bounces@lists.infradead.org Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Simon Horman Cc: kexec@lists.infradead.org Move the print statement so that the variable value has been assigned before its value is printed. Signed-off-by: Geoff Levand --- 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); } _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec