diff --git a/lib/libkldelf/ef.c b/lib/libkldelf/ef.c --- a/lib/libkldelf/ef.c +++ b/lib/libkldelf/ef.c @@ -97,13 +97,13 @@ { if ((phdr->p_flags & PF_W) == 0) { - printf("text=0x%jx ", (uintmax_t)phdr->p_filesz); + warnx("text=0x%jx ", (uintmax_t)phdr->p_filesz); } else { - printf("data=0x%jx", (uintmax_t)phdr->p_filesz); + warnx("data=0x%jx", (uintmax_t)phdr->p_filesz); if (phdr->p_filesz < phdr->p_memsz) - printf("+0x%jx", + warnx("+0x%jx", (uintmax_t)(phdr->p_memsz - phdr->p_filesz)); - printf(" "); + warnx(" "); } } @@ -612,7 +612,7 @@ } } if (verbose > 1) - printf("\n"); + warnx("\n"); if (phdyn == NULL) { warnx("Skipping %s: not dynamically-linked", ef->ef_name); diff --git a/lib/libkldelf/ef_obj.c b/lib/libkldelf/ef_obj.c --- a/lib/libkldelf/ef_obj.c +++ b/lib/libkldelf/ef_obj.c @@ -345,20 +345,20 @@ if ((ef->nprogtab != 0 && ef->progtab == NULL) || (ef->nrel != 0 && ef->reltab == NULL) || (ef->nrela != 0 && ef->relatab == NULL)) { - printf("malloc failed\n"); + warnx("malloc failed\n"); error = ENOMEM; goto out; } if (elf_read_symbols(efile, symtabindex, &ef->ddbsymcnt, &ef->ddbsymtab) != 0) { - printf("elf_read_symbols failed\n"); + warnx("elf_read_symbols failed\n"); goto out; } if (elf_read_string_table(efile, &shdr[symstrindex], &ef->ddbstrcnt, &ef->ddbstrtab) != 0) { - printf("elf_read_string_table failed\n"); + warnx("elf_read_string_table failed\n"); goto out; } @@ -367,7 +367,7 @@ shdr[hdr->e_shstrndx].sh_type == SHT_STRTAB) { if (elf_read_string_table(efile, &shdr[hdr->e_shstrndx], &ef->shstrcnt, &ef->shstrtab) != 0) { - printf("elf_read_string_table failed\n"); + warnx("elf_read_string_table failed\n"); goto out; } } @@ -413,7 +413,7 @@ ef->reltab[rl].sec = shdr[i].sh_info; if (elf_read_rel(efile, i, &ef->reltab[rl].nrel, &ef->reltab[rl].rel) != 0) { - printf("elf_read_rel failed\n"); + warnx("elf_read_rel failed\n"); goto out; } rl++; @@ -422,7 +422,7 @@ ef->relatab[ra].sec = shdr[i].sh_info; if (elf_read_rela(efile, i, &ef->relatab[ra].nrela, &ef->relatab[ra].rela) != 0) { - printf("elf_read_rela failed\n"); + warnx("elf_read_rela failed\n"); goto out; } ra++;