[RFC] dl-string.h: define _dl_strchr and _dl_strstr if not IS_IN_rtld

Submitted by Zheng Junling on March 31, 2015, 12:26 p.m.


Message ID 1427804771-8262-1-git-send-email-zhengjunling@huawei.com
State New
Headers show

Commit Message

Zheng Junling March 31, 2015, 12:26 p.m.
We should define _dl_strchr and _dl_strstr when not defining IS_IN_rtld.
Otherwise, if someone use _dl_strchr or _dl_strstr in the ldso/ldso/dl-
elf.c, libdl.a will lack the declaration of '_dl_strchr' or '_dl_strstr',
and there will be an compiling error like the following:

  dl-elf.c:156: undefined reference to `_dl_strchr'

So, add the definition of _dl_strchr and _dl_strstr.

Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
 ldso/include/dl-string.h | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/ldso/include/dl-string.h b/ldso/include/dl-string.h
index aacad10..14ae617 100644
--- a/ldso/include/dl-string.h
+++ b/ldso/include/dl-string.h
@@ -204,7 +204,9 @@  static __always_inline char * _dl_get_last_path_component(char *path)
 # define _dl_strcat strcat
 # define _dl_strcpy strcpy
 # define _dl_strcmp strcmp
+# define _dl_strchr strchr
 # define _dl_strrchr strrchr
+# define _dl_strstr strstr
 # define _dl_memcpy memcpy
 # define _dl_memcmp memcmp
 # define _dl_memset memset