diff --git a/sys/kern/kern_ctf.c b/sys/kern/kern_ctf.c index b525c274f9e0..1087406ff82e 100644 --- a/sys/kern/kern_ctf.c +++ b/sys/kern/kern_ctf.c @@ -144,9 +144,12 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc) * .SUNW_ctf section containing the CTF data. */ if (hdr->e_shstrndx == 0 || shdr[hdr->e_shstrndx].sh_type != SHT_STRTAB) { - printf("%s(%d): module %s e_shstrndx is %d, sh_type is %d\n", - __func__, __LINE__, lf->pathname, hdr->e_shstrndx, - shdr[hdr->e_shstrndx].sh_type); + if (bootverbose) { + printf( + "%s(%d): module %s e_shstrndx is %d, sh_type is %d\n", + __func__, __LINE__, lf->pathname, hdr->e_shstrndx, + shdr[hdr->e_shstrndx].sh_type); + } error = EFTYPE; goto out; } @@ -167,8 +170,10 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc) /* Check if the CTF section wasn't found. */ if (i >= hdr->e_shnum) { - printf("%s(%d): module %s has no .SUNW_ctf section\n", - __func__, __LINE__, lf->pathname); + if (bootverbose) { + printf("%s(%d): module %s has no .SUNW_ctf section\n", + __func__, __LINE__, lf->pathname); + } error = EFTYPE; goto out; } @@ -181,17 +186,21 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc) /* Check the CTF magic number. */ if (cth.cth_magic != CTF_MAGIC) { - printf("%s(%d): module %s has invalid format\n", - __func__, __LINE__, lf->pathname); + if (bootverbose) { + printf("%s(%d): module %s has invalid format\n", + __func__, __LINE__, lf->pathname); + } error = EFTYPE; goto out; } if (cth.cth_version != CTF_VERSION_2 && cth.cth_version != CTF_VERSION_3) { - printf( - "%s(%d): module %s CTF format has unsupported version %d\n", - __func__, __LINE__, lf->pathname, cth.cth_version); + if (bootverbose) { + printf( + "%s(%d): module %s CTF format has unsupported version %d\n", + __func__, __LINE__, lf->pathname, cth.cth_version); + } error = EFTYPE; goto out; } @@ -250,8 +259,10 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc) ret = uncompress(ctftab + sizeof(cth), &destlen, raw + sizeof(cth), shdr[i].sh_size - sizeof(cth)); if (ret != Z_OK) { - printf("%s(%d): zlib uncompress returned %d\n", - __func__, __LINE__, ret); + if (bootverbose) { + printf("%s(%d): zlib uncompress returned %d\n", + __func__, __LINE__, ret); + } error = EIO; goto out; }