[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v2 1/3] xen/ELF: Fix ELF32 PRI formatters
It is rude to hide width formatting inside a PRI* macro, doubly so when it's only in one bitness of the macro. However its fully buggy when all the users use %#"PRI because then it expands to the common trap of %#08x which does not do what the author intends. Switch the ELF PRI formatters to use plain integer PRI's, and move the width formatting to those callers where it matters. No practical change. Fixes: 7597fabca76e ("livepatch: Include sizes when an mismatch occurs") Fixes: 380b229634f8 ("xsplice: Implement payload loading") Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> --- CC: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> CC: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx> CC: Stefano Stabellini <sstabellini@xxxxxxxxxx> CC: Julien Grall <julien@xxxxxxx> CC: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx> CC: Bertrand Marquis <bertrand.marquis@xxxxxxx> CC: Jan Beulich <JBeulich@xxxxxxxx> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx> CC: Wei Liu <wl@xxxxxxx> --- xen/common/livepatch_elf.c | 6 +++--- xen/include/xen/elfstructs.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/common/livepatch_elf.c b/xen/common/livepatch_elf.c index 45d73912a3cd..d37a7af84be6 100644 --- a/xen/common/livepatch_elf.c +++ b/xen/common/livepatch_elf.c @@ -310,12 +310,12 @@ int livepatch_elf_resolve_symbols(struct livepatch_elf *elf) break; } } - dprintk(XENLOG_DEBUG, LIVEPATCH "%s: Undefined symbol resolved: %s => %#"PRIxElfAddr"\n", + dprintk(XENLOG_DEBUG, LIVEPATCH "%s: Undefined symbol resolved: %s => 0x%08"PRIxElfAddr"\n", elf->name, elf->sym[i].name, st_value); break; case SHN_ABS: - dprintk(XENLOG_DEBUG, LIVEPATCH "%s: Absolute symbol: %s => %#"PRIxElfAddr"\n", + dprintk(XENLOG_DEBUG, LIVEPATCH "%s: Absolute symbol: %s => 0x%08"PRIxElfAddr"\n", elf->name, elf->sym[i].name, sym->st_value); break; @@ -344,7 +344,7 @@ int livepatch_elf_resolve_symbols(struct livepatch_elf *elf) st_value += (unsigned long)elf->sec[idx].load_addr; if ( elf->sym[i].name ) - dprintk(XENLOG_DEBUG, LIVEPATCH "%s: Symbol resolved: %s => %#"PRIxElfAddr" (%s)\n", + dprintk(XENLOG_DEBUG, LIVEPATCH "%s: Symbol resolved: %s => 0x%08"PRIxElfAddr" (%s)\n", elf->name, elf->sym[i].name, st_value, elf->sec[idx].name); } diff --git a/xen/include/xen/elfstructs.h b/xen/include/xen/elfstructs.h index 06e6f87c3d80..3124469faeb4 100644 --- a/xen/include/xen/elfstructs.h +++ b/xen/include/xen/elfstructs.h @@ -561,8 +561,8 @@ typedef struct { #endif #if defined(ELFSIZE) && (ELFSIZE == 32) -#define PRIxElfAddr "08x" -#define PRIuElfWord "8u" +#define PRIxElfAddr PRIx32 +#define PRIuElfWord PRIu32 #define Elf_Ehdr Elf32_Ehdr #define Elf_Phdr Elf32_Phdr -- 2.30.2
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |