Commit bab3d969 authored by Laurent Dufour's avatar Laurent Dufour Committed by Pavel Emelyanov

piegen: prefix piegen's output

Add prefix to the piegen's error and debug output to avoid confusion and
fix few debug lines.
Signed-off-by: 's avatarLaurent Dufour <ldufour@linux.vnet.ibm.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 93f0d6ce
......@@ -79,7 +79,8 @@ int handle_elf(void *mem, size_t size)
s64 toc_offset = 0;
#endif
pr_debug("Header\n------------\n");
pr_debug("Header\n");
pr_debug("------------\n");
pr_debug("\ttype 0x%x machine 0x%x version 0x%x\n",
(unsigned)hdr->e_type, (unsigned)hdr->e_machine, (unsigned)hdr->e_version);
......@@ -108,7 +109,8 @@ int handle_elf(void *mem, size_t size)
ptr_func_exit(secstrings_hdr);
ptr_func_exit(secstrings);
pr_debug("Sections\n------------\n");
pr_debug("Sections\n");
pr_debug("------------\n");
for (i = 0; i < hdr->e_shnum; i++) {
Shdr_t *sh = mem + hdr->e_shoff + hdr->e_shentsize * i;
ptr_func_exit(sh);
......@@ -140,7 +142,8 @@ int handle_elf(void *mem, size_t size)
goto err;
}
pr_debug("Symbols\n------------\n");
pr_debug("Symbols\n");
pr_debug("------------\n");
strtab_hdr = sec_hdrs[symtab_hdr->sh_link];
ptr_func_exit(strtab_hdr);
......@@ -198,7 +201,8 @@ int handle_elf(void *mem, size_t size)
pr_out("static __maybe_unused elf_reloc_t %s[] = {\n", opts.var_name);
pr_debug("Relocations\n------------\n");
pr_debug("Relocations\n");
pr_debug("------------\n");
for (i = 0; i < hdr->e_shnum; i++) {
Shdr_t *sh = sec_hdrs[i];
Shdr_t *sh_rel;
......
......@@ -27,9 +27,9 @@ extern int handle_elf_ppc64(void *mem, size_t size);
#define pr_out(fmt, ...) fprintf(fout, fmt, ##__VA_ARGS__)
#define pr_debug(fmt, ...) printf(fmt, ##__VA_ARGS__)
#define pr_debug(fmt, ...) printf("%s: "fmt, opts.stream_name, ##__VA_ARGS__)
#define pr_err(fmt, ...) fprintf(stderr, "Error (%s:%d): "fmt, __FILE__, __LINE__, ##__VA_ARGS__)
#define pr_perror(fmt, ...) fprintf(stderr, "Error (%s:%d): "fmt "%m\n", __FILE__, __LINE__, ##__VA_ARGS__)
#define pr_err(fmt, ...) fprintf(stderr, "%s: Error (%s:%d): "fmt, opts.stream_name, __FILE__, __LINE__, ##__VA_ARGS__)
#define pr_perror(fmt, ...) fprintf(stderr, "%s: Error (%s:%d): "fmt "%m\n", opts.stream_name, __FILE__, __LINE__, ##__VA_ARGS__)
#endif /* __ELFTIL_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment