summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2020-04-01 17:11:01 +0300
committerToomas Soome <tsoome@me.com>2020-04-06 09:14:06 +0300
commit4859da614b562d26b86cd0961067070cb5ed350c (patch)
tree6ab41c736b7cb9690fb478eaf84d4ae8f34da84b
parent5f1360505f125e92a7fb558f30f3e14a1abab96b (diff)
downloadillumos-joyent-4859da614b562d26b86cd0961067070cb5ed350c.tar.gz
12461 krtld: printf format errors
Reviewed by: Gergő Doma <domag02@gmail.com> Reviewed by: John Levon <john.levon@joyent.com> Approved by: Robert Mustacchi <rm@fingolfin.org>
-rw-r--r--usr/src/uts/common/krtld/reloc.h6
-rw-r--r--usr/src/uts/sparc/krtld/kobj_reloc.c13
2 files changed, 10 insertions, 9 deletions
diff --git a/usr/src/uts/common/krtld/reloc.h b/usr/src/uts/common/krtld/reloc.h
index 4f0c576203..c269cf41bd 100644
--- a/usr/src/uts/common/krtld/reloc.h
+++ b/usr/src/uts/common/krtld/reloc.h
@@ -256,7 +256,7 @@ extern const char *conv_reloc_SPARC_type(Word);
_kobj_printf(ops, MSG_REL_PREGEN, CONV_RELOC_TYPE((rtype))); \
_kobj_printf(ops, MSG_REL_FILE, (file)); \
_kobj_printf(ops, MSG_REL_SYM, ((sym) ? (sym) : MSG_STR_UNKNOWN)); \
- _kobj_printf(ops, MSG_REL_NONALIGN, EC_OFF((off)))
+ _kobj_printf(ops, MSG_REL_NONALIGN, (u_longlong_t)EC_OFF((off)))
#define REL_ERR_UNNOBITS(lml, file, sym, rtype, nbits) \
_kobj_printf(ops, MSG_REL_PREGEN, CONV_RELOC_TYPE((rtype))); \
@@ -268,9 +268,9 @@ extern const char *conv_reloc_SPARC_type(Word);
_kobj_printf(ops, MSG_REL_PREGEN, CONV_RELOC_TYPE((rtype))); \
_kobj_printf(ops, MSG_REL_FILE, (file)); \
_kobj_printf(ops, MSG_REL_SYM, ((sym) ? (sym) : MSG_STR_UNKNOWN)); \
- _kobj_printf(ops, MSG_REL_VALUE, EC_XWORD((uvalue))); \
+ _kobj_printf(ops, MSG_REL_VALUE, (u_longlong_t)EC_XWORD((uvalue))); \
_kobj_printf(ops, MSG_REL_LOSEBITS, (int)(nbits)); \
- _kobj_printf(ops, MSG_REL_OFFSET, EC_NATPTR((off)))
+ _kobj_printf(ops, MSG_REL_OFFSET, (u_longlong_t)EC_NATPTR((off)))
#define REL_ERR_NOFIT(lml, file, sym, rtype, uvalue) \
_kobj_printf(ops, MSG_REL_PREGEN, CONV_RELOC_TYPE((rtype))); \
diff --git a/usr/src/uts/sparc/krtld/kobj_reloc.c b/usr/src/uts/sparc/krtld/kobj_reloc.c
index cc7df40d7c..2fea631bd1 100644
--- a/usr/src/uts/sparc/krtld/kobj_reloc.c
+++ b/usr/src/uts/sparc/krtld/kobj_reloc.c
@@ -207,7 +207,7 @@ do_relocate(struct module *mp, char *reltbl, int nreloc, int relocsize,
if ((rtype > R_SPARC_NUM) || IS_TLS_INS(rtype)) {
_kobj_printf(ops, "krtld: invalid relocation type %d",
rtype);
- _kobj_printf(ops, " at 0x%llx:", off);
+ _kobj_printf(ops, " at 0x%llx:", (u_longlong_t)off);
_kobj_printf(ops, " file=%s\n", mp->filename);
err = 1;
continue;
@@ -223,8 +223,8 @@ do_relocate(struct module *mp, char *reltbl, int nreloc, int relocsize,
(mp->symtbl+(stndx * mp->symhdr->sh_entsize));
_kobj_printf(ops, "krtld:\t%s",
conv_reloc_SPARC_type(rtype));
- _kobj_printf(ops, "\t0x%8llx", off);
- _kobj_printf(ops, " 0x%8llx", addend);
+ _kobj_printf(ops, "\t0x%8llx", (u_longlong_t)off);
+ _kobj_printf(ops, " 0x%8llx", (u_longlong_t)addend);
_kobj_printf(ops, " %s\n",
(const char *)mp->strings + symp->st_name);
}
@@ -309,8 +309,9 @@ do_relocate(struct module *mp, char *reltbl, int nreloc, int relocsize,
#ifdef KOBJ_DEBUG
if (kobj_debug & D_RELOCATIONS) {
- _kobj_printf(ops, "krtld:\t\t\t\t0x%8llx", off);
- _kobj_printf(ops, " 0x%8llx\n", value);
+ _kobj_printf(ops, "krtld:\t\t\t\t0x%8llx",
+ (u_longlong_t)off);
+ _kobj_printf(ops, " 0x%8llx\n", (u_longlong_t)value);
}
#endif
if (do_reloc_krtld(rtype, (unsigned char *)off, (Xword *)&value,
@@ -353,7 +354,7 @@ do_relocations(struct module *mp)
}
if (rshp->sh_info >= mp->hdr.e_shnum) {
_kobj_printf(ops, "do_relocations: %s ", mp->filename);
- _kobj_printf(ops, " sh_info out of range %lld\n", shn);
+ _kobj_printf(ops, " sh_info out of range %d\n", shn);
goto bad;
}
nreloc = rshp->sh_size / rshp->sh_entsize;