summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2004-09-17 15:57:21 +0000
committerJoakim Tjernlund <joakim.tjernlund@transmode.se>2004-09-17 15:57:21 +0000
commit2e3a6e76fcc56433a09b700985714393de02da5e (patch)
tree7db6a060f18a22dbaa437d9cb054c1b902decf90 /ldso
parenta3a7dae80ec792b0f5984ee7643fcdbf4663564f (diff)
Added back dl_iterate_phdr in ldso(with some small changes).
Someone needs to test if it works to build and run gcj.
Diffstat (limited to 'ldso')
-rw-r--r--ldso/ldso/dl-elf.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index e11cb0d92..c58ca5dfb 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -894,4 +894,26 @@ char *_dl_strdup(const char *string)
_dl_strcpy(retval, string);
return retval;
}
-
+#ifdef __USE_GNU
+#if ! defined LIBDL || (! defined PIC && ! defined __PIC__)
+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