From: Mark Wielaard Date: Fri, 9 Jul 2010 22:26:37 +0000 (+0200) Subject: Fix usymbols.exp test for 32-on-64 (again). PR11722. X-Git-Tag: release-1.3~52 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=6bc671114948b95f6eafaf62790f5a4a7c3ab350;p=systemtap.git Fix usymbols.exp test for 32-on-64 (again). PR11722. Bug introduced by commit 82ea0c. Add a comment why we need the same "chopping" of addr in both _stp_umod_lookup and _stp_kallsyms_lookup. * runtime/sym.c (_stp_kallsyms_lookup): Detect long used as 32bit address. --- diff --git a/runtime/sym.c b/runtime/sym.c index db58181bc..895ec8c4d 100644 --- a/runtime/sym.c +++ b/runtime/sym.c @@ -163,6 +163,13 @@ static const char *_stp_kallsyms_lookup(unsigned long addr, { unsigned long vm_start = 0; unsigned long vm_end = 0; +#ifdef CONFIG_COMPAT + /* Handle 32bit signed values in 64bit longs, chop off top bits. + _stp_umod_lookup does the same, but we need it here for the + binary search on addr below. */ + if (test_tsk_thread_flag(task, TIF_32BIT)) + addr &= ((compat_ulong_t) ~0); +#endif m = _stp_umod_lookup(addr, task, modname, &vm_start, &vm_end); if (m) {