summaryrefslogtreecommitdiff
path: root/addr2line.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-26 00:02:24 (GMT)
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-26 00:02:24 (GMT)
commit537623e43de8b5659e011a7418b23bfd56645b20 (patch)
tree30791aaa63abb1379be2edad6a1526f0efc0fa85 /addr2line.c
parent3bd0fd118d11767a1a5d37320372a39802b4b206 (diff)
don't write _start as is; use dlsym
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'addr2line.c')
-rw-r--r--addr2line.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/addr2line.c b/addr2line.c
index 0b48278..755de06 100644
--- a/addr2line.c
+++ b/addr2line.c
@@ -640,9 +640,10 @@ rb_dump_backtrace_with_lines(int num_traces, void **traces, char **syms)
intptr_t main_fbase;
char *main_path;
{
- extern void _start(void); /* a function in the main executalbe */
Dl_info info;
- dladdr(_start, &info);
+ void *handle = dlopen(NULL, RTLD_LAZY);
+ void *sym = dlsym(handle, "_start");
+ dladdr(sym, &info);
main_fbase = (intptr_t)info.dli_fbase;
}
{