aboutsummaryrefslogtreecommitdiff
path: root/ltrace-elf.c
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2012-10-31 03:27:05 +0100
committerPetr Machata <pmachata@redhat.com>2012-10-31 03:27:05 +0100
commit6db61f509eb7537ca64873b0c8c1955e2293db9f (patch)
treeaa64b8e3f2ef0758a3deb209e561374e5c7ee87e /ltrace-elf.c
parent1c79025768a4403e016cc59d7f41b266e868c9e6 (diff)
downloadltrace-6db61f509eb7537ca64873b0c8c1955e2293db9f.tar.gz
Publish default_elf_add_plt_entry
Diffstat (limited to 'ltrace-elf.c')
-rw-r--r--ltrace-elf.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ltrace-elf.c b/ltrace-elf.c
index bdb6220..f4a58a5 100644
--- a/ltrace-elf.c
+++ b/ltrace-elf.c
@@ -63,13 +63,16 @@ arch_elf_destroy(struct ltelf *lte)
}
#endif
-static int
+int
default_elf_add_plt_entry(struct Process *proc, struct ltelf *lte,
const char *a_name, GElf_Rela *rela, size_t ndx,
struct library_symbol **ret)
{
char *name = strdup(a_name);
if (name == NULL) {
+ fail_message:
+ fprintf(stderr, "Couldn't create symbol for PLT entry: %s\n",
+ strerror(errno));
fail:
free(name);
return -1;
@@ -79,7 +82,7 @@ default_elf_add_plt_entry(struct Process *proc, struct ltelf *lte,
struct library_symbol *libsym = malloc(sizeof(*libsym));
if (libsym == NULL)
- goto fail;
+ goto fail_message;
/* XXX The double cast should be removed when
* arch_addr_t becomes integral type. */