summaryrefslogtreecommitdiff
path: root/ldso/include
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-09-19 01:29:11 +0000
committerMike Frysinger <vapier@gentoo.org>2006-09-19 01:29:11 +0000
commit996be4d2f17f10979c591575dcff12e502c4a87e (patch)
treef864d9d937a62efa6625a22601e9e9e067a6e82a /ldso/include
parent7f9010b2d3df3716c67fc00a0f1ec3c5fd127311 (diff)
merge some more FDPIC related fixes from Bernd Schmidt
Diffstat (limited to 'ldso/include')
-rw-r--r--ldso/include/dl-defs.h12
-rw-r--r--ldso/include/dl-hash.h2
2 files changed, 13 insertions, 1 deletions
diff --git a/ldso/include/dl-defs.h b/ldso/include/dl-defs.h
index 932f6ac53..d0c61d44e 100644
--- a/ldso/include/dl-defs.h
+++ b/ldso/include/dl-defs.h
@@ -140,4 +140,16 @@ typedef struct {
&& (!(TFROM) || (TFROM)->loadaddr < (TPNT)->loadaddr))
#endif
+/* On some platforms, computing a pointer to function is more
+ expensive than calling a function at a given address, so this
+ alternative is provided. The function signature must be given
+ within parentheses, as in a type cast. */
+#ifndef DL_ADDR_TO_FUNC_PTR
+# define DL_ADDR_TO_FUNC_PTR(ADDR, LOADADDR) (ADDR)
+#endif
+#ifndef DL_CALL_FUNC_AT_ADDR
+# define DL_CALL_FUNC_AT_ADDR(ADDR, LOADADDR, SIGNATURE, ...) \
+ ((*SIGNATURE DL_ADDR_TO_FUNC_PTR ((ADDR), (LOADADDR)))(__VA_ARGS__))
+#endif
+
#endif /* _LD_DEFS_H */
diff --git a/ldso/include/dl-hash.h b/ldso/include/dl-hash.h
index 8f30688d1..c21094020 100644
--- a/ldso/include/dl-hash.h
+++ b/ldso/include/dl-hash.h
@@ -28,7 +28,7 @@ struct dyn_elf {
struct elf_resolve {
/* These entries must be in this order to be compatible with the interface used
by gdb to obtain the list of symbols. */
- DL_LOADADDR_TYPE loadaddr; /* Base address shared object is loaded at. */
+ DL_LOADADDR_TYPE loadaddr; /* Base address shared object is loaded at. */
char *libname; /* Absolute file name object was found in. */
ElfW(Dyn) *dynamic_addr; /* Dynamic section of the shared object. */
struct elf_resolve * next;