WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] hvmloader: Simplify 32bit-bios relocator.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] hvmloader: Simplify 32bit-bios relocator.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 15 Mar 2007 05:30:22 -0700
Delivery-date: Thu, 15 Mar 2007 05:30:48 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1173955086 0
# Node ID 5bc5ed857cc6dd7a60442a52f10a35fa16c6fa89
# Parent  aa6914c527e107deba0bcc5c9c89525814085d61
hvmloader: Simplify 32bit-bios relocator.
Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxx>
---
 tools/firmware/hvmloader/32bitbios_support.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff -r aa6914c527e1 -r 5bc5ed857cc6 
tools/firmware/hvmloader/32bitbios_support.c
--- a/tools/firmware/hvmloader/32bitbios_support.c      Thu Mar 15 10:36:10 
2007 +0000
+++ b/tools/firmware/hvmloader/32bitbios_support.c      Thu Mar 15 10:38:06 
2007 +0000
@@ -45,22 +45,21 @@ static int relocate_elf(unsigned char *e
         return -1;
     }
 
-    for (i = 0; i < ehdr->e_shnum; i++) {
-        if (!(shdr[i]).sh_flags & SHF_ALLOC) {
-            shdr[i].sh_addr = 0;
-            continue;
-        }
+    for (i = 0; i < ehdr->e_shnum; i++)
         shdr[i].sh_addr = (Elf32_Addr)&elfarray[shdr[i].sh_offset];
-    }
 
     for (i = 0; i < ehdr->e_shnum; i++) {
-        if (shdr[i].sh_type == SHT_REL && shdr[i].sh_addr != 0) {
+        if (shdr[i].sh_type == SHT_REL) {
             Elf32_Shdr *targetsec = (Elf32_Shdr *)&(shdr[shdr[i].sh_info]);
             Elf32_Shdr *symtabsec = (Elf32_Shdr *)&(shdr[shdr[i].sh_link]);
             Elf32_Sym  *syms      = (Elf32_Sym *)symtabsec->sh_addr;
             Elf32_Rel  *rels      = (Elf32_Rel *)shdr[i].sh_addr;
             unsigned char *code   = (unsigned char *)targetsec->sh_addr;
             int j;
+
+            /* must not have been stripped */
+            if (shdr[i].sh_size == 0)
+                return -6;
 
             for (j = 0; j < shdr[i].sh_size / sizeof(Elf32_Rel); j++) {
                 int idx           = ELF32_R_SYM(rels[j].r_info);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] hvmloader: Simplify 32bit-bios relocator., Xen patchbot-unstable <=