From 1e0617da2eb0efbd0626cb3761f1183b1df114b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 26 Aug 2010 13:49:14 +0000 Subject: [PATCH] * dladdr() apparently should work on any symbol, not just functions. This closes bug #6491. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38373 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/libroot/posix/dlfcn.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/system/libroot/posix/dlfcn.c b/src/system/libroot/posix/dlfcn.c index 4f6f328d79..7d34f20f2a 100644 --- a/src/system/libroot/posix/dlfcn.c +++ b/src/system/libroot/posix/dlfcn.c @@ -1,6 +1,6 @@ /* * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de. - * Copyright 2003-2008, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2003-2010, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. * * Copyright 2002, Manuel J. Petit. All rights reserved. @@ -107,9 +107,7 @@ dladdr(void *addr, Dl_info *info) while (get_nth_image_symbol(imageInfo.id, symIndex, curSymName, &symNameLength, &symType, &symLocation) == B_OK) { // check if symbol is the nearest until now - if (symType == B_SYMBOL_TYPE_TEXT - && symLocation <= addr - && symLocation >= info->dli_saddr) { + if (symLocation <= addr && symLocation >= info->dli_saddr) { strlcpy(symName, curSymName, NAME_MAX); info->dli_saddr = symLocation;