From 5c6029e5c0afae4758af285e8a6bcac43ea24fe7 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 26 Aug 2001 22:26:38 +0000 Subject: [PATCH] (elf_machine_lookup_noplt_p, elf_machine_lookup_noexec_p): Remove. (elf_machine_type_class): Define. --- sysdeps/alpha/dl-machine.h | 14 +++++++------- sysdeps/arm/dl-machine.h | 14 +++++++------- sysdeps/cris/dl-machine.h | 14 +++++++------- sysdeps/hppa/dl-machine.h | 16 ++++++++-------- sysdeps/m68k/dl-machine.h | 14 +++++++------- sysdeps/mips/dl-machine.h | 3 +-- sysdeps/mips/mips64/dl-machine.h | 3 +-- 7 files changed, 38 insertions(+), 40 deletions(-) diff --git a/sysdeps/alpha/dl-machine.h b/sysdeps/alpha/dl-machine.h index 37e8136..64cca5c 100644 --- a/sysdeps/alpha/dl-machine.h +++ b/sysdeps/alpha/dl-machine.h @@ -351,13 +351,13 @@ $fixup_stack: #define RTLD_START_SPECIAL_INIT /* nothing */ #endif -/* Nonzero iff TYPE describes relocation of a PLT entry, so - PLT entries should not be allowed to define the value. */ -#define elf_machine_lookup_noplt_p(type) ((type) == R_ALPHA_JMP_SLOT) - -/* Nonzero iff TYPE should not be allowed to resolve to one of - the main executable's symbols, as for a COPY reloc, which we don't use. */ -#define elf_machine_lookup_noexec_p(type) (0) +/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so + PLT entries should not be allowed to define the value. + ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one + of the main executable's symbols, as for a COPY reloc, which we don't + use. */ +#define elf_machine_type_class(type) \ + (((type) == R_ALPHA_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */ #define ELF_MACHINE_JMP_SLOT R_ALPHA_JMP_SLOT diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h index 7dfed99..2a4ce9f 100644 --- a/sysdeps/arm/dl-machine.h +++ b/sysdeps/arm/dl-machine.h @@ -323,13 +323,13 @@ _dl_start_user: .previous\n\ "); -/* Nonzero iff TYPE should not be allowed to resolve to one of - the main executable's symbols, as for a COPY reloc. */ -#define elf_machine_lookup_noexec_p(type) ((type) == R_ARM_COPY) - -/* Nonzero iff TYPE describes relocation of a PLT entry, so - PLT entries should not be allowed to define the value. */ -#define elf_machine_lookup_noplt_p(type) ((type) == R_ARM_JUMP_SLOT) +/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so + PLT entries should not be allowed to define the value. + ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one + of the main executable's symbols, as for a COPY reloc. */ +#define elf_machine_type_class(type) \ + ((((type) == R_ARM_JUMP_SLOT) * ELF_RTYPE_CLASS_PLT) \ + | (((type) == R_ARM_COPY) * ELF_RTYPE_CLASS_COPY)) /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */ #define ELF_MACHINE_JMP_SLOT R_ARM_JUMP_SLOT diff --git a/sysdeps/cris/dl-machine.h b/sysdeps/cris/dl-machine.h index ce8dfc6..e4778e3 100644 --- a/sysdeps/cris/dl-machine.h +++ b/sysdeps/cris/dl-machine.h @@ -228,13 +228,13 @@ _dl_start_user: .size _dl_start_user, . - _dl_start_user .previous"); -/* Nonzero iff TYPE describes a relocation that should - skip the executable when looking up the symbol value. */ -#define elf_machine_lookup_noexec_p(type) ((type) == R_CRIS_COPY) - -/* Nonzero iff TYPE describes relocation of a PLT entry, so - PLT entries should not be allowed to define the value. */ -#define elf_machine_lookup_noplt_p(type) ((type) == R_CRIS_JUMP_SLOT) +/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so + PLT entries should not be allowed to define the value. + ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one + of the main executable's symbols, as for a COPY reloc. */ +#define elf_machine_type_class(type) \ + ((((type) == R_CRIS_JUMP_SLOT) * ELF_RTYPE_CLASS_PLT) \ + | (((type) == R_CRIS_COPY) * ELF_RTYPE_CLASS_COPY)) /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */ #define ELF_MACHINE_JMP_SLOT R_CRIS_JUMP_SLOT diff --git a/sysdeps/hppa/dl-machine.h b/sysdeps/hppa/dl-machine.h index 15e1c85..d13f15b 100644 --- a/sysdeps/hppa/dl-machine.h +++ b/sysdeps/hppa/dl-machine.h @@ -454,14 +454,14 @@ asm ( \ #endif -/* Nonzero iff TYPE describes a relocation that should - skip the executable when looking up the symbol value. */ -#define elf_machine_lookup_noexec_p(type) ((type) == R_PARISC_COPY) - -/* Nonzero iff TYPE describes relocation of a PLT entry, so - PLT entries should not be allowed to define the value. */ -#define elf_machine_lookup_noplt_p(type) ((type) == R_PARISC_IPLT \ - || (type) == R_PARISC_EPLT) +/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so + PLT entries should not be allowed to define the value. + ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one + of the main executable's symbols, as for a COPY reloc. */ +#define elf_machine_type_class(type) \ + ((((type) == R_PARISC_IPLT || (type) == R_PARISC_EPLT) \ + * ELF_RTYPE_CLASS_PLT) \ + | (((type) == R_PARISC_COPY) * ELF_RTYPE_CLASS_COPY)) /* Used by ld.so for ... something ... */ #define ELF_MACHINE_JMP_SLOT R_PARISC_IPLT diff --git a/sysdeps/m68k/dl-machine.h b/sysdeps/m68k/dl-machine.h index b0e2927..d9c8194 100644 --- a/sysdeps/m68k/dl-machine.h +++ b/sysdeps/m68k/dl-machine.h @@ -189,13 +189,13 @@ _dl_start_user: .size _dl_start_user, . - _dl_start_user .previous"); -/* Nonzero iff TYPE describes a relocation that should - skip the executable when looking up the symbol value. */ -#define elf_machine_lookup_noexec_p(type) ((type) == R_68K_COPY) - -/* Nonzero iff TYPE describes relocation of a PLT entry, so - PLT entries should not be allowed to define the value. */ -#define elf_machine_lookup_noplt_p(type) ((type) == R_68K_JMP_SLOT) +/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so + PLT entries should not be allowed to define the value. + ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one + of the main executable's symbols, as for a COPY reloc. */ +#define elf_machine_type_class(type) \ + ((((type) == R_68K_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \ + | (((type) == R_68K_COPY) * ELF_RTYPE_CLASS_COPY)) /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */ #define ELF_MACHINE_JMP_SLOT R_68K_JMP_SLOT diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h index 878e27d..cb3fc1c 100644 --- a/sysdeps/mips/dl-machine.h +++ b/sysdeps/mips/dl-machine.h @@ -54,8 +54,7 @@ This makes no sense on MIPS but we have to define this to R_MIPS_REL32 to avoid the asserts in dl-lookup.c from blowing. */ #define ELF_MACHINE_JMP_SLOT R_MIPS_REL32 -#define elf_machine_lookup_noplt_p(type) (1) -#define elf_machine_lookup_noexec_p(type) (0) +#define elf_machine_type_class(type) ELF_RTYPE_CLASS_PLT /* Translate a processor specific dynamic tag to the index in l_info array. */ diff --git a/sysdeps/mips/mips64/dl-machine.h b/sysdeps/mips/mips64/dl-machine.h index eda94c2..34a8161 100644 --- a/sysdeps/mips/mips64/dl-machine.h +++ b/sysdeps/mips/mips64/dl-machine.h @@ -45,8 +45,7 @@ This makes no sense on MIPS but we have to define this to R_MIPS_REL32 to avoid the asserts in dl-lookup.c from blowing. */ #define ELF_MACHINE_JMP_SLOT R_MIPS_REL32 -#define elf_machine_lookup_noplt_p(type) (1) -#define elf_machine_lookup_noexec_p(type) (0) +#define elf_machine_type_class(type) ELF_RTYPE_CLASS_PLT /* Translate a processor specific dynamic tag to the index in l_info array. */ -- 2.7.4