From 37b66c0b1a2156a43fb813499326230639ba2773 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 8 Jun 2017 12:52:42 -0700 Subject: ld.so: Consolidate 2 strtouls into _dl_strtoul [BZ #21528] There are 2 minimal strtoul implementations in ld.so: 1. __strtoul_internal in elf/dl-minimal.c. 2. tunables_strtoul in elf/dl-tunables.c. This patch adds _dl_strtoul to replace them. Tested builds with and without --enable-tunables. [BZ #21528] * elf/dl-minimal.c (__strtoul_internal): Removed. (strtoul): Likewise. * elf/dl-misc.c (_dl_strtoul): New function. * elf/dl-tunables.c (tunables_strtoul): Removed. (tunable_initialize): Replace tunables_strtoul with _dl_strtoul. * elf/rtld.c (process_envvars): Likewise. * sysdeps/unix/sysv/linux/dl-librecon.h (_dl_osversion_init): Likewise. * sysdeps/generic/ldsodefs.h (_dl_strtoul): New prototype. --- sysdeps/generic/ldsodefs.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sysdeps/generic/ldsodefs.h') diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index 695ac24..4508365 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -254,6 +254,10 @@ extern int _dl_name_match_p (const char *__name, const struct link_map *__map) extern unsigned long int _dl_higher_prime_number (unsigned long int n) internal_function attribute_hidden; +/* A stripped down strtoul-like implementation. */ +uint64_t internal_function _dl_strtoul (const char *, char **) + internal_function attribute_hidden; + /* Function used as argument for `_dl_receive_error' function. The arguments are the error code, error string, and the objname the error occurred in. */ -- cgit v1.1