Index: usr.sbin/kldxref/Makefile =================================================================== --- usr.sbin/kldxref/Makefile +++ usr.sbin/kldxref/Makefile @@ -6,7 +6,7 @@ WARNS?= 2 -.if exists(ef_${MACHINE_CPUARCH}.c) && ${MACHINE_ARCH} != "powerpc64" +.if exists(ef_${MACHINE_CPUARCH}.c) SRCS+= ef_${MACHINE_CPUARCH}.c .else SRCS+= ef_nop.c Index: usr.sbin/kldxref/ef_powerpc.c =================================================================== --- usr.sbin/kldxref/ef_powerpc.c +++ usr.sbin/kldxref/ef_powerpc.c @@ -34,10 +34,17 @@ #include #include +#include #include #include "ef.h" +#ifdef __powerpc64__ +#define PRI_ELF_SIZE PRIu64 +#else +#define PRI_ELF_SIZE PRIu32 +#endif + /* * Apply relocations to the values obtained from the file. `relbase' is the * target relocation address of the section, and `dataoff/len' is the region @@ -63,11 +70,11 @@ return (0); switch (rtype) { - case R_PPC_RELATIVE: /* word32 B + A */ + case R_PPC_RELATIVE: /* word32|doubleword64 B + A */ *where = relbase + addend; break; default: - warnx("unhandled relocation type %u", rtype); + warnx("unhandled relocation type %" PRI_ELF_SIZE, rtype); } return (0); }