[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2 1/3] xen/ELF: Fix ELF32 PRI formatters
On 17.04.2023 14:13, Andrew Cooper wrote: > --- 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", I don't see what's wrong with using %# here (and below); I also don't see what value it has to zero-pad to 8 digits when the printed value either is far below 4G (when representing just a section offset) or likely far above (when representing a real address on 64-bit). But once again I'll leave judging to the maintainers. > 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 This part certainly Acked-by: Jan Beulich <jbeulich@xxxxxxxx> Jan
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |