From 4f8f038060739eca4c5cb97bb067529be96658d2 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 25 Jan 2016 18:37:05 -0500 Subject: [PATCH] move static/stub version of dladdr out of dynlink.c --- src/ldso/dladdr.c | 9 +++++---- src/ldso/dynlink.c | 6 +----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/ldso/dladdr.c b/src/ldso/dladdr.c index 7ca718f4..659ab91e 100644 --- a/src/ldso/dladdr.c +++ b/src/ldso/dladdr.c @@ -1,9 +1,10 @@ #define _GNU_SOURCE #include +#include "libc.h" -int __dladdr(const void *, Dl_info *); - -int dladdr(const void *addr, Dl_info *info) +static int stub_dladdr(const void *addr, Dl_info *info) { - return __dladdr(addr, info); + return 0; } + +weak_alias(stub_dladdr, dladdr); diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c index 492c22a8..8d793f26 100644 --- a/src/ldso/dynlink.c +++ b/src/ldso/dynlink.c @@ -1823,7 +1823,7 @@ failed: return 0; } -int __dladdr(const void *addr, Dl_info *info) +int dladdr(const void *addr, Dl_info *info) { struct dso *p; Sym *sym, *bestsym; @@ -1928,10 +1928,6 @@ void *__dlsym(void *restrict p, const char *restrict s, void *restrict ra) error("Symbol not found: %s", s); return 0; } -int __dladdr (const void *addr, Dl_info *info) -{ - return 0; -} #endif int __dlinfo(void *dso, int req, void *res) -- 2.25.1