diff options
author | Petr Machata <pmachata@redhat.com> | 2012-12-05 17:07:21 +0100 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2012-12-05 17:07:21 +0100 |
commit | 0965420dfd1f4167609c4b3bbee5dc0277423897 (patch) | |
tree | 1f9e25261e6a1cc4aa8d5dc1bbb745842f0d8341 /ltrace-elf.c | |
parent | 6fa43fd3a14de6f70043f37361eb2e15d672b436 (diff) | |
download | ltrace-0965420dfd1f4167609c4b3bbee5dc0277423897.tar.gz |
Don't mangle static symbol names internally
Instead, write the @soname bit separately. I'm not sure why this was done
like that in the first place. I may have cut'n'pasted this from RHEL
patches for dlopen support, where these sorts of hacks were necessary.
Diffstat (limited to 'ltrace-elf.c')
-rw-r--r-- | ltrace-elf.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/ltrace-elf.c b/ltrace-elf.c index f4a58a5..c571d2a 100644 --- a/ltrace-elf.c +++ b/ltrace-elf.c @@ -647,7 +647,6 @@ populate_this_symtab(struct Process *proc, const char *filename, secflags[i] = shdr.sh_flags; } - size_t lib_len = strlen(lib->soname); for (i = 0; i < size; ++i) { GElf_Sym sym; if (gelf_getsym(symtab, i, &sym) == NULL) { @@ -717,20 +716,13 @@ populate_this_symtab(struct Process *proc, const char *filename, char *full_name; int own_full_name = 1; - if (lib->type != LT_LIBTYPE_MAIN) { - full_name = malloc(strlen(name) + 1 + lib_len + 1); + if (name_copy == NULL) { + full_name = strdup(name); if (full_name == NULL) goto fail; - sprintf(full_name, "%s@%s", name, lib->soname); } else { - if (name_copy == NULL) { - full_name = strdup(name); - if (full_name == NULL) - goto fail; - } else { - full_name = name_copy; - own_full_name = 0; - } + full_name = name_copy; + own_full_name = 0; } /* Look whether we already have a symbol for this |