summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorCarmelo Amoroso <carmelo.amoroso@st.com>2008-11-18 12:48:13 +0000
committerCarmelo Amoroso <carmelo.amoroso@st.com>2008-11-18 12:48:13 +0000
commit827c5f1b826b916a533c082e558fc7c6fc38de6d (patch)
tree8f4c4e4626d41801ececf13b9f06488e6ae98cb9 /ldso
parent933df87e4e9a8d7f6901dd0417b0006c5b132439 (diff)
Move _dl_iterate_phdr into libc.so.0 and libc.a (as glibc does).
Currently we have an implementation in ld.so and libdl.a. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'ldso')
-rw-r--r--ldso/ldso/dl-elf.c26
-rw-r--r--ldso/ldso/dl-hash.c8
-rw-r--r--ldso/ldso/dl-symbols.c21
-rw-r--r--ldso/ldso/ldso.c1
4 files changed, 22 insertions, 34 deletions
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index d22eccc8d..61bf6eb9d 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -928,29 +928,3 @@ void _dl_parse_dynamic_info(ElfW(Dyn) *dpnt, unsigned long dynamic_info[],
{
__dl_parse_dynamic_info(dpnt, dynamic_info, debug_addr, load_off);
}
-
-/* we want this in ldso.so and libdl.a but nowhere else */
-#ifdef __USE_GNU
-#if defined IS_IN_rtld || (defined IS_IN_libdl && ! defined SHARED)
-extern __typeof(dl_iterate_phdr) __dl_iterate_phdr;
-int
-__dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info, size_t size, void *data), void *data)
-{
- struct elf_resolve *l;
- struct dl_phdr_info info;
- int ret = 0;
-
- for (l = _dl_loaded_modules; l != NULL; l = l->next) {
- info.dlpi_addr = l->loadaddr;
- info.dlpi_name = l->libname;
- info.dlpi_phdr = l->ppnt;
- info.dlpi_phnum = l->n_phent;
- ret = callback (&info, sizeof (struct dl_phdr_info), data);
- if (ret)
- break;
- }
- return ret;
-}
-strong_alias(__dl_iterate_phdr, dl_iterate_phdr)
-#endif
-#endif
diff --git a/ldso/ldso/dl-hash.c b/ldso/ldso/dl-hash.c
index 2a393353b..b44bd3a4b 100644
--- a/ldso/ldso/dl-hash.c
+++ b/ldso/ldso/dl-hash.c
@@ -32,14 +32,6 @@
/* Various symbol table handling functions, including symbol lookup */
-
-/*
- * This is the start of the linked list that describes all of the files present
- * in the system with pointers to all of the symbol, string, and hash tables,
- * as well as all of the other good stuff in the binary.
- */
-struct elf_resolve *_dl_loaded_modules = NULL;
-
/*
* This is the list of modules that are loaded when the image is first
* started. As we add more via dlopen, they get added into other
diff --git a/ldso/ldso/dl-symbols.c b/ldso/ldso/dl-symbols.c
new file mode 100644
index 000000000..e5c00211a
--- /dev/null
+++ b/ldso/ldso/dl-symbols.c
@@ -0,0 +1,21 @@
+/*
+ * This contains all symbols shared between
+ * dynamic linker ld.so and into static libc
+ *
+ * Copyright (c) 2008 STMicroelectronics Ltd
+ * Author: Carmelo Amoroso <carmelo.amoroso@st.com>
+ *
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ *
+ */
+
+/*
+ * This is the start of the linked list that describes all of the files present
+ * in the system with pointers to all of the symbol, string, and hash tables,
+ * as well as all of the other good stuff in the binary.
+ */
+#include <ldso.h>
+
+struct elf_resolve *_dl_loaded_modules = NULL;
+
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index 46cc91c63..28f434147 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -67,6 +67,7 @@ int _dl_debug_file = 2;
unsigned long attribute_hidden _dl_skip_args = 0;
const char *_dl_progname = UCLIBC_LDSO; /* The name of the executable being run */
#include "dl-startup.c"
+#include "dl-symbols.c"
#include "dl-array.c"
/* Forward function declarations */
static int _dl_suid_ok(void);