This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] audit: put the correct st_value in pltexit callback
- From: Jiri Olsa <jolsa at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Fri, 21 Jan 2011 17:21:55 +0100
- Subject: [PATCH] audit: put the correct st_value in pltexit callback
hi,
the ElfW(Sym) param in the PLT entry callback gives
different st_value than the same symbol in adjacent
PLT exit callback.
AFAICS the st_value in PLT exit callback is just missing
the library base to be added. Attached patch fixes the issue
for me, but I'm not sure I haven't missed anything..
I need to uniquely identify the symbols among the
PLT entry/exit calls.. other than by the name comparison.
The function symbol address looks appropriate for this.
thanks,
jirka
---
elf/dl-runtime.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/elf/dl-runtime.c b/elf/dl-runtime.c
index 6847eda..6db126d 100644
--- a/elf/dl-runtime.c
+++ b/elf/dl-runtime.c
@@ -443,9 +443,12 @@ _dl_call_pltexit (struct link_map *l, ElfW(Word) reloc_arg,
ElfW(Sym) *defsym = ((ElfW(Sym) *) D_PTR (reloc_result->bound,
l_info[DT_SYMTAB])
+ reloc_result->boundndx);
+ DL_FIXUP_VALUE_TYPE *resultp = &reloc_result->addr;
+ DL_FIXUP_VALUE_TYPE value = *resultp;
/* Set up the sym parameter. */
ElfW(Sym) sym = *defsym;
+ sym.st_value = DL_FIXUP_VALUE_ADDR (value);
/* Get the symbol name. */
const char *strtab = (const void *) D_PTR (reloc_result->bound,