aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/hppa
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/hppa')
-rw-r--r--sysdeps/hppa/Versions1
-rw-r--r--sysdeps/hppa/dl-lookupcfg.h13
-rw-r--r--sysdeps/hppa/dl-machine.h4
-rw-r--r--sysdeps/hppa/dl-symaddr.c2
4 files changed, 19 insertions, 1 deletions
diff --git a/sysdeps/hppa/Versions b/sysdeps/hppa/Versions
index 0c447d9..c5f35d4 100644
--- a/sysdeps/hppa/Versions
+++ b/sysdeps/hppa/Versions
@@ -2,5 +2,6 @@ ld {
GLIBC_2.2 {
# hppa specific functions in the dynamic linker, but used by libc.so.
_dl_symbol_address; _dl_unmap; _dl_lookup_address;
+ _dl_function_address;
}
}
diff --git a/sysdeps/hppa/dl-lookupcfg.h b/sysdeps/hppa/dl-lookupcfg.h
index 4f5f899..118c4d0 100644
--- a/sysdeps/hppa/dl-lookupcfg.h
+++ b/sysdeps/hppa/dl-lookupcfg.h
@@ -34,3 +34,16 @@ Elf32_Addr _dl_lookup_address (const void *address);
void _dl_unmap (struct link_map *map);
#define DL_UNMAP(map) _dl_unmap (map)
+
+extern Elf32_Addr _dl_function_address (const struct link_map *map,
+ Elf32_Addr start);
+
+#define DL_FUNCTION_ADDRESS(map, addr) _dl_function_address (map, addr)
+
+/* The test for "addr & 2" below is to accomodate old binaries which
+ violated the ELF ABI by pointing DT_INIT and DT_FINI at a function
+ pointer. */
+#define DL_DT_INIT_ADDRESS(map, addr) \
+ ((Elf32_Addr)(addr) & 2 ? (addr) : DL_FUNCTION_ADDRESS (map, addr))
+#define DL_DT_FINI_ADDRESS(map, addr) \
+ ((Elf32_Addr)(addr) & 2 ? (addr) : DL_FUNCTION_ADDRESS (map, addr))
diff --git a/sysdeps/hppa/dl-machine.h b/sysdeps/hppa/dl-machine.h
index f8a8e7b..a3437b5 100644
--- a/sysdeps/hppa/dl-machine.h
+++ b/sysdeps/hppa/dl-machine.h
@@ -448,6 +448,10 @@ __dl_fini_plabel:
/* We only use RELA. */
#define ELF_MACHINE_NO_REL 1
+/* Return the address of the entry point. */
+#define ELF_MACHINE_START_ADDRESS(map, start) \
+ DL_FUNCTION_ADDRESS (map, start)
+
#endif /* !dl_machine_h */
/* These are only actually used where RESOLVE_MAP is defined, anyway. */
diff --git a/sysdeps/hppa/dl-symaddr.c b/sysdeps/hppa/dl-symaddr.c
index 038404a..49c1216 100644
--- a/sysdeps/hppa/dl-symaddr.c
+++ b/sysdeps/hppa/dl-symaddr.c
@@ -33,7 +33,7 @@ _dl_symbol_address (const struct link_map *map, const ElfW(Sym) *ref)
}
ElfW(Addr)
-_dl_start_address (const struct link_map *map, ElfW(Addr) start)
+_dl_function_address (const struct link_map *map, ElfW(Addr) start)
{
return __hppa_make_fptr (map, start, &__fptr_root, NULL);
}