Print this page
12399 kobj printf functions should be checked
*** 20,29 ****
--- 20,31 ----
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2020 Joyent, Inc.
*/
/*
* x86 relocation code.
*/
*** 156,166 ****
return (-1);
}
if ((rtype > R_AMD64_NUM) || IS_TLS_INS(rtype)) {
_kobj_printf(ops, "krtld: invalid relocation type %d",
rtype);
! _kobj_printf(ops, " at 0x%llx:", off);
_kobj_printf(ops, " file=%s\n", mp->filename);
err = 1;
continue;
}
--- 158,168 ----
return (-1);
}
if ((rtype > R_AMD64_NUM) || IS_TLS_INS(rtype)) {
_kobj_printf(ops, "krtld: invalid relocation type %d",
rtype);
! _kobj_printf(ops, " at 0x%lx:", off);
_kobj_printf(ops, " file=%s\n", mp->filename);
err = 1;
continue;
}
*** 177,188 ****
Sym * symp;
symp = (Sym *)
(mp->symtbl+(stndx * mp->symhdr->sh_entsize));
_kobj_printf(ops, "krtld:\t%s",
conv_reloc_amd64_type(rtype));
! _kobj_printf(ops, "\t0x%8llx", off);
! _kobj_printf(ops, " 0x%8llx", addend);
_kobj_printf(ops, " %s\n",
(const char *)mp->strings + symp->st_name);
}
#endif
--- 179,190 ----
Sym * symp;
symp = (Sym *)
(mp->symtbl+(stndx * mp->symhdr->sh_entsize));
_kobj_printf(ops, "krtld:\t%s",
conv_reloc_amd64_type(rtype));
! _kobj_printf(ops, "\t0x%8lx", off);
! _kobj_printf(ops, " %8lld", (longlong_t)addend);
_kobj_printf(ops, " %s\n",
(const char *)mp->strings + symp->st_name);
}
#endif
*** 252,263 ****
if (IS_PC_RELATIVE(rtype))
value -= off;
#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);
}
#endif
if (do_reloc_krtld(rtype, (unsigned char *)off, &value,
(const char *)mp->strings + symref->st_name,
--- 254,265 ----
if (IS_PC_RELATIVE(rtype))
value -= off;
#ifdef KOBJ_DEBUG
if (kobj_debug & D_RELOCATIONS) {
! _kobj_printf(ops, "krtld:\t\t\t\t0x%8lx", off);
! _kobj_printf(ops, " 0x%8lx\n", value);
}
#endif
if (do_reloc_krtld(rtype, (unsigned char *)off, &value,
(const char *)mp->strings + symref->st_name,