qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [COMMIT 9fdca5a] Use correct byteswap routine for elf_not


From: Anthony Liguori
Subject: [Qemu-commits] [COMMIT 9fdca5a] Use correct byteswap routine for elf_note
Date: Sat, 18 Jul 2009 09:21:38 -0000

From: malc <address@hidden>

All elf64_note structure members are Elf64_Word (which is 32bit value)
hence using bswaptls to byteswap it on 64bit platforms is incorrect.

Signed-off-by: malc <address@hidden>

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 12d2598..63d0ae4 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -798,9 +798,9 @@ static int elf_core_dump(int, const CPUState *);
 #ifdef BSWAP_NEEDED
 static void bswap_note(struct elf_note *en)
 {
-    bswaptls(&en->n_namesz);
-    bswaptls(&en->n_descsz);
-    bswaptls(&en->n_type);
+    bswap32s(&en->n_namesz);
+    bswap32s(&en->n_descsz);
+    bswap32s(&en->n_type);
 }
 #endif /* BSWAP_NEEDED */
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]