From 996be4d2f17f10979c591575dcff12e502c4a87e Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 19 Sep 2006 01:29:11 +0000 Subject: merge some more FDPIC related fixes from Bernd Schmidt --- ldso/include/dl-defs.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ldso/include/dl-defs.h') 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 */ -- cgit v1.2.3