printf ("%02hhx%02hhx%02hhx%02hhx ",
cp[inner], cp[inner + 1], cp[inner + 2],
cp[inner + 3]);
- fputc_unlocked (' ', stdout);
+ fputc (' ', stdout);
for (size_t inner = 0; inner < 16; ++inner)
- fputc_unlocked (isascii (cp[inner]) && isprint (cp[inner])
+ fputc (isascii (cp[inner]) && isprint (cp[inner])
? cp[inner] : '.', stdout);
- fputc_unlocked ('\n', stdout);
+ fputc ('\n', stdout);
}
printf (" %04zx ", cnt);
for (inner = 2 * (16 - inner) + (16 - inner + 3) / 4 + 1; inner > 0;
--inner)
- fputc_unlocked (' ', stdout);
+ fputc (' ', stdout);
for (inner = 0; inner < remaining; ++inner)
- fputc_unlocked (isascii (cp[inner]) && isprint (cp[inner])
+ fputc (isascii (cp[inner]) && isprint (cp[inner])
? cp[inner] : '.', stdout);
- fputc_unlocked ('\n', stdout);
+ fputc ('\n', stdout);
- fputc_unlocked ('\n', stdout);
+ fputc ('\n', stdout);
}
}
printf ("%8" PRIx64 ": ", (uint64_t) info->addr);
if (info->bytes_color != NULL)
- fputs_unlocked (info->bytes_color, stdout);
+ fputs (info->bytes_color, stdout);
size_t cnt;
for (cnt = 0; cnt < (size_t) MIN (info->cur - info->last_end, 8); ++cnt)
printf (" %02" PRIx8, info->last_end[cnt]);
if (info->bytes_color != NULL)
- fputs_unlocked (color_off, stdout);
+ fputs (color_off, stdout);
printf ("%*s %.*s\n",
(int) (8 - cnt) * 3 + 1, "", (int) buflen, buf);
printf ("%8" PRIx64 ": ", (uint64_t) info->addr);
if (info->bytes_color != NULL)
- fputs_unlocked (info->bytes_color, stdout);
+ fputs (info->bytes_color, stdout);
for (; cnt < (size_t) (info->cur - info->last_end); ++cnt)
printf (" %02" PRIx8, info->last_end[cnt]);
if (info->bytes_color != NULL)
- fputs_unlocked (color_off, stdout);
- putchar_unlocked ('\n');
+ fputs (color_off, stdout);
+ putchar ('\n');
info->addr += info->cur - info->last_end - 8;
}
static void
print_ehdr (Ebl *ebl, GElf_Ehdr *ehdr)
{
- fputs_unlocked (_("ELF Header:\n Magic: "), stdout);
+ fputs (_("ELF Header:\n Magic: "), stdout);
for (size_t cnt = 0; cnt < EI_NIDENT; ++cnt)
printf (" %02hhx", ehdr->e_ident[cnt]);
printf (_(" ABI Version: %hhd\n"),
ehdr->e_ident[EI_ABIVERSION]);
- fputs_unlocked (_(" Type: "), stdout);
+ fputs (_(" Type: "), stdout);
print_file_type (ehdr->e_type);
const char *machine = dwelf_elf_e_machine_string (ehdr->e_machine);
printf (_(" (%" PRIu32 " in [0].sh_info)"),
(uint32_t) shdr->sh_info);
else
- fputs_unlocked (_(" ([0] not available)"), stdout);
+ fputs (_(" ([0] not available)"), stdout);
}
- fputc_unlocked ('\n', stdout);
+ fputc ('\n', stdout);
printf (_(" Size of section header entries: %" PRId16 " %s\n"),
ehdr->e_shentsize, _("(bytes)"));
printf (_(" (%" PRIu32 " in [0].sh_size)"),
(uint32_t) shdr->sh_size);
else
- fputs_unlocked (_(" ([0] not available)"), stdout);
+ fputs (_(" ([0] not available)"), stdout);
}
- fputc_unlocked ('\n', stdout);
+ fputc ('\n', stdout);
if (unlikely (ehdr->e_shstrndx == SHN_XINDEX))
{
}
}
- fputc_unlocked ('\n', stdout);
+ fputc ('\n', stdout);
}
&& shdr->sh_addr >= relro_from
&& shdr->sh_addr + shdr->sh_size <= relro_to)
{
- fputs_unlocked (" [RELRO:", stdout);
+ fputs (" [RELRO:", stdout);
in_relro = true;
}
else if (has_relro && in_relro && shdr->sh_addr >= relro_to)
{
- fputs_unlocked ("]", stdout);
+ fputs ("]", stdout);
in_relro = false;
}
else if (has_relro && in_relro
&& shdr->sh_addr + shdr->sh_size > relro_to)
- fputs_unlocked ("] <RELRO:", stdout);
+ fputs ("] <RELRO:", stdout);
else if (phdr->p_type == PT_LOAD && (phdr->p_flags & PF_W) == 0)
{
if (!in_ro)
{
- fputs_unlocked (" [RO:", stdout);
+ fputs (" [RO:", stdout);
in_ro = true;
}
}
{
if ((phdr2->p_flags & PF_W) == 0 && !in_ro)
{
- fputs_unlocked (" [RO:", stdout);
+ fputs (" [RO:", stdout);
in_ro = true;
}
else if ((phdr2->p_flags & PF_W) != 0 && in_ro)
{
- fputs_unlocked ("]", stdout);
+ fputs ("]", stdout);
in_ro = false;
}
}
if (has_relro && in_relro
&& shdr->sh_addr + shdr->sh_size > relro_to)
{
- fputs_unlocked (">", stdout);
+ fputs (">", stdout);
in_relro = false;
}
}
}
if (in_relro || in_ro)
- fputs_unlocked ("]", stdout);
+ fputs ("]", stdout);
/* Finish the line. */
- fputc_unlocked ('\n', stdout);
+ fputc ('\n', stdout);
}
}
if (d_val & flags[cnt].mask)
{
if (!first)
- putchar_unlocked (' ');
- fputs_unlocked (flags[cnt].str, stdout);
+ putchar (' ');
+ fputs (flags[cnt].str, stdout);
d_val &= ~flags[cnt].mask;
first = false;
}
if (d_val != 0)
{
if (!first)
- putchar_unlocked (' ');
+ putchar (' ');
printf ("%#0*" PRIx64, class == ELFCLASS32 ? 10 : 18, d_val);
}
- putchar_unlocked ('\n');
+ putchar ('\n');
}
phdr->p_offset);
}
- fputs_unlocked (_(" Type Value\n"), stdout);
+ fputs (_(" Type Value\n"), stdout);
/* if --use-dynamic option is enabled,
use the string table to get the related library info. */
case DT_BIND_NOW:
case DT_TEXTREL:
/* No further output. */
- fputc_unlocked ('\n', stdout);
+ fputc ('\n', stdout);
break;
case DT_NEEDED:
elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
shdr->sh_offset,
nentries);
- fputs_unlocked (class == ELFCLASS32
+ fputs (class == ELFCLASS32
? _("\
Offset Type Value Name\n")
: _("\
elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
shdr->sh_offset,
nentries);
- fputs_unlocked (class == ELFCLASS32
+ fputs (class == ELFCLASS32
? _("\
Offset Type Value Addend Name\n")
: _("\
}
}
- putchar_unlocked ('\n');
+ putchar ('\n');
}
}
(unsigned int) shdr->sh_link,
elf_strptr (ebl->elf, shstrndx, glink->sh_name));
- fputs_unlocked (class == ELFCLASS32
+ fputs (class == ELFCLASS32
? _("\
Num: Value Size Type Bind Vis Ndx Name\n")
: _("\
{
ssize_t n;
case 0:
- fputs_unlocked (_(" 0 *local* "),
+ fputs (_(" 0 *local* "),
stdout);
break;
case 1:
- fputs_unlocked (_(" 1 *global* "),
+ fputs (_(" 1 *global* "),
stdout);
break;
break;
}
}
- putchar_unlocked ('\n');
+ putchar ('\n');
}
uint64_t success = 0;
/* xgettext:no-c-format */
- fputs_unlocked (_("\
+ fputs (_("\
Length Number % of total Coverage\n"), stdout);
printf (_(" 0 %6" PRIu32 " %5.1f%%\n"),
counts[0], (counts[0] * 100.0) / nbucket);
if (unlikely (*p++ != 'A'))
return;
- fputs_unlocked (_(" Owner Size\n"), stdout);
+ fputs (_(" Owner Size\n"), stdout);
/* Loop over the sections. */
while (left (data, p) >= 4)
if (w & 0x70)
{
if (w != fde_encoding)
- fputc_unlocked (' ', stdout);
+ fputc (' ', stdout);
w = print_relinfo (w);
}
{
get_uleb128 (u128, linep, lineendp);
if (n != standard_opcode_lengths[opcode])
- putc_unlocked (',', stdout);
+ fputc (',', stdout);
printf (" %u", u128);
}
\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
elf_ndxscn (scn), section_name (ebl, shdr),
(uint64_t) shdr->sh_offset);
- putc_unlocked ('\n', stdout);
+ fputc ('\n', stdout);
/* There is no function in libdw to iterate over the raw content of
the section but it is easy enough to do. */
\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
elf_ndxscn (scn), section_name (ebl, shdr),
(uint64_t) shdr->sh_offset);
- putc_unlocked ('\n', stdout);
+ fputc ('\n', stdout);
/* Get the source file information for all CUs. Uses same
datastructure as macinfo. But uses offset field to directly
goto invalid_data;
args--;
if (args > 0)
- putchar_unlocked (',');
+ putchar (',');
}
}
else
printf (_(" no arguments."));
- putchar_unlocked ('\n');
+ putchar ('\n');
}
}
- putchar_unlocked ('\n');
+ putchar ('\n');
int level = 1;
if (readp + 1 > readendp)
if (args > 0)
printf (", ");
}
- putchar_unlocked ('\n');
+ putchar ('\n');
}
if (readp + 1 > readendp)
goto invalid_data;
opcode = *readp++;
if (opcode == 0)
- putchar_unlocked ('\n');
+ putchar ('\n');
}
}
}
/* +4 because of the 4 byte header of the section. */
(uint64_t) shdr->sh_offset + 4 + eh_frame_ptr);
- putchar_unlocked ('\n');
+ putchar ('\n');
}
uint64_t fde_count = 0;
else if (ar_disp != 0)
puts (" -> ???");
else
- putchar_unlocked ('\n');
+ putchar ('\n');
++u;
}
while (readp < action_table_end);
nregloc == 0 ? nhdr->n_descsz : 0,
items, nitems);
if (colno != 0)
- putchar_unlocked ('\n');
+ putchar ('\n');
colno = handle_core_registers (ebl, ebl->elf, desc + regs_offset,
reglocs, nregloc);
if (colno != 0)
- putchar_unlocked ('\n');
+ putchar ('\n');
}
static void
handle_notes_data (Ebl *ebl, const GElf_Ehdr *ehdr,
GElf_Off start, Elf_Data *data)
{
- fputs_unlocked (_(" Owner Data size Type\n"), stdout);
+ fputs (_(" Owner Data size Type\n"), stdout);
if (data == NULL)
goto bad_note;
/* We found a match. */
if (unlikely (fname != NULL))
{
- fputs_unlocked (fname, stdout);
- fputs_unlocked (": ", stdout);
+ fputs (fname, stdout);
+ fputs (": ", stdout);
}
if (unlikely (radix != radix_none))
if (unlikely (*unprinted != NULL))
{
- fputs_unlocked (*unprinted, stdout);
+ fputs (*unprinted, stdout);
free (*unprinted);
*unprinted = NULL;
}
assume the file data is encoded in UCS-2/UTF-16 or
UCS-4/UTF-32 respectively we could convert the string.
But there is no such guarantee. */
- fwrite_unlocked (start, 1, buf - start, stdout);
- putc_unlocked ('\n', stdout);
+ fwrite (start, 1, buf - start, stdout);
+ fputc ('\n', stdout);
}
start = ++buf;
/* We found a match. */
if (likely (fname != NULL))
{
- fputs_unlocked (fname, stdout);
- fputs_unlocked (": ", stdout);
+ fputs (fname, stdout);
+ fputs (": ", stdout);
}
if (likely (radix != radix_none))
if (unlikely (*unprinted != NULL))
{
- fputs_unlocked (*unprinted, stdout);
+ fputs (*unprinted, stdout);
free (*unprinted);
*unprinted = NULL;
}
- fwrite_unlocked (start, 1, buf - start, stdout);
- putc_unlocked ('\n', stdout);
+ fwrite (start, 1, buf - start, stdout);
+ fputc ('\n', stdout);
}
start = ++buf;