Commit 9fdca5aa5d966b0f66daeba91de59ce560fbc3a0
1 parent
3efa9a67
Use correct byteswap routine for elf_note
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 <av1474@comtv.ru>
Showing
1 changed file
with
3 additions
and
3 deletions
linux-user/elfload.c
@@ -798,9 +798,9 @@ static int elf_core_dump(int, const CPUState *); | @@ -798,9 +798,9 @@ static int elf_core_dump(int, const CPUState *); | ||
798 | #ifdef BSWAP_NEEDED | 798 | #ifdef BSWAP_NEEDED |
799 | static void bswap_note(struct elf_note *en) | 799 | static void bswap_note(struct elf_note *en) |
800 | { | 800 | { |
801 | - bswaptls(&en->n_namesz); | ||
802 | - bswaptls(&en->n_descsz); | ||
803 | - bswaptls(&en->n_type); | 801 | + bswap32s(&en->n_namesz); |
802 | + bswap32s(&en->n_descsz); | ||
803 | + bswap32s(&en->n_type); | ||
804 | } | 804 | } |
805 | #endif /* BSWAP_NEEDED */ | 805 | #endif /* BSWAP_NEEDED */ |
806 | 806 |