diff options
Diffstat (limited to 'ldso/include')
-rw-r--r-- | ldso/include/dl-elf.h | 9 | ||||
-rw-r--r-- | ldso/include/ld_elf.h | 9 | ||||
-rw-r--r-- | ldso/include/ldso.h | 15 |
3 files changed, 33 insertions, 0 deletions
diff --git a/ldso/include/dl-elf.h b/ldso/include/dl-elf.h index 7ae1591c2..4a1488432 100644 --- a/ldso/include/dl-elf.h +++ b/ldso/include/dl-elf.h @@ -77,11 +77,20 @@ extern int _dl_linux_resolve(void); */ #ifdef ELF_USES_RELOCA # define ELF_RELOC ElfW(Rela) +# define DT_RELOC_TABLE_ADDR DT_RELA +# define DT_RELOC_TABLE_SIZE DT_RELASZ +# define UNSUPPORTED_RELOC_TYPE DT_REL +# define UNSUPPORTED_RELOC_STR "REL" #else # define ELF_RELOC ElfW(Rel) +# define DT_RELOC_TABLE_ADDR DT_REL +# define DT_RELOC_TABLE_SIZE DT_RELSZ +# define UNSUPPORTED_RELOC_TYPE DT_RELA +# define UNSUPPORTED_RELOC_STR "RELA" #endif + /* Convert between the Linux flags for page protections and the ones specified in the ELF standard. */ #define LXFLAGS(X) ( (((X) & PF_R) ? PROT_READ : 0) | \ diff --git a/ldso/include/ld_elf.h b/ldso/include/ld_elf.h index 7ae1591c2..4a1488432 100644 --- a/ldso/include/ld_elf.h +++ b/ldso/include/ld_elf.h @@ -77,11 +77,20 @@ extern int _dl_linux_resolve(void); */ #ifdef ELF_USES_RELOCA # define ELF_RELOC ElfW(Rela) +# define DT_RELOC_TABLE_ADDR DT_RELA +# define DT_RELOC_TABLE_SIZE DT_RELASZ +# define UNSUPPORTED_RELOC_TYPE DT_REL +# define UNSUPPORTED_RELOC_STR "REL" #else # define ELF_RELOC ElfW(Rel) +# define DT_RELOC_TABLE_ADDR DT_REL +# define DT_RELOC_TABLE_SIZE DT_RELSZ +# define UNSUPPORTED_RELOC_TYPE DT_RELA +# define UNSUPPORTED_RELOC_STR "RELA" #endif + /* Convert between the Linux flags for page protections and the ones specified in the ELF standard. */ #define LXFLAGS(X) ( (((X) & PF_R) ? PROT_READ : 0) | \ diff --git a/ldso/include/ldso.h b/ldso/include/ldso.h index 81ae78d2b..621236fdf 100644 --- a/ldso/include/ldso.h +++ b/ldso/include/ldso.h @@ -15,3 +15,18 @@ # define PAGE_SHIFT 12 # define PAGE_SIZE (1UL << PAGE_SHIFT) #endif + +/* Prepare for the case that `__builtin_expect' is not available. */ +#if __GNUC__ == 2 && __GNUC_MINOR__ < 96 +#define __builtin_expect(x, expected_value) (x) +#endif +#ifndef likely +# define likely(x) __builtin_expect((!!(x)),1) +#endif +#ifndef unlikely +# define unlikely(x) __builtin_expect((!!(x)),0) +#endif +#ifndef __LINUX_COMPILER_H +#define __LINUX_COMPILER_H +#endif + |