diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-08-26 22:28:16 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-08-26 22:28:16 +0000 |
commit | cf5a372ec12437bf79cb130c124ace1f62d97144 (patch) | |
tree | 972a8fc7bb3612407a0e5581028b9bf28c22cfde /sysdeps | |
parent | 107d41a9b2da96db479e9b52b0a81a9174229ff7 (diff) | |
download | glibc-cf5a372ec12437bf79cb130c124ace1f62d97144.zip glibc-cf5a372ec12437bf79cb130c124ace1f62d97144.tar.gz glibc-cf5a372ec12437bf79cb130c124ace1f62d97144.tar.bz2 |
Update.
2001-08-26 Jakub Jelinek <jakub@redhat.com>
* elf/dl-reloc.c (RESOLVE_MAP, RESOLVE): Use elf_machine_type_class
instead of elf_machine_lookup_noexec_p and elf_machine_lookup_noplt_p.
Pass type_class to _dl_lookup_*.
* elf/dl-lookup.c (_dl_lookup_symbol): Take type_clas parameter now.
Pass around just type_class instead of noexec, noplt pair.
(_dl_lookup_versioned_symbol): Likewise.
(_dl_lookup_symbol_skip): Pass around just type_class instead of
noexec, noplt pair.
(_dl_lookup_versioned_symbol_skip): Likewise.
(_dl_do_lookup, _dl_do_lookup_versioned): Likewise.
* elf/do-lookup.h (do_lookup): Likewise.
* include/link.h (struct link_map): Replace noexec and noplt fields
in l_lookup_cache with type_class field.
* sysdeps/generic/ldsodefs.h (ELF_RTYPE_CLASS_PLT,
ELF_RTYPE_CLASS_COPY): Define.
Adjust prototypes for _dl_lookup_symbol and
_dl_lookup_versioned_symbol.
* sysdeps/alpha/dl-machine.h (elf_machine_lookup_noplt_p,
elf_machine_lookup_noexec_p): Remove.
(elf_machine_type_class): Define.
* sysdeps/arm/dl-machine.h: Likewise.
* sysdeps/hppa/dl-machine.h: Likewise.
* sysdeps/cris/dl-machine.h: Likewise.
* sysdeps/i386/dl-machine.h: Likewise.
* sysdeps/ia64/dl-machine.h: Likewise.
* sysdeps/m68k/dl-machine.h: Likewise.
* sysdeps/mips/mips64/dl-machine.h: Likewise.
* sysdeps/mips/dl-machine.h: Likewise.
* sysdeps/powerpc/dl-machine.h: Likewise.
* sysdeps/sparc/sparc32/dl-machine.h: Likewise.
* sysdeps/sparc/sparc64/dl-machine.h: Likewise.
* sysdeps/sh/dl-machine.h: Likewise.
* sysdeps/s390/s390-32/dl-machine.h: Likewise.
* sysdeps/s390/s390-64/dl-machine.h: Likewise.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/alpha/dl-machine.h | 14 | ||||
-rw-r--r-- | sysdeps/arm/dl-machine.h | 14 | ||||
-rw-r--r-- | sysdeps/cris/dl-machine.h | 14 | ||||
-rw-r--r-- | sysdeps/generic/ldsodefs.h | 15 | ||||
-rw-r--r-- | sysdeps/hppa/dl-machine.h | 16 | ||||
-rw-r--r-- | sysdeps/i386/dl-machine.h | 16 | ||||
-rw-r--r-- | sysdeps/ia64/dl-machine.h | 14 | ||||
-rw-r--r-- | sysdeps/m68k/dl-machine.h | 14 | ||||
-rw-r--r-- | sysdeps/mips/dl-machine.h | 3 | ||||
-rw-r--r-- | sysdeps/mips/mips64/dl-machine.h | 3 | ||||
-rw-r--r-- | sysdeps/powerpc/dl-machine.h | 18 | ||||
-rw-r--r-- | sysdeps/s390/s390-32/dl-machine.h | 14 | ||||
-rw-r--r-- | sysdeps/s390/s390-64/dl-machine.h | 14 | ||||
-rw-r--r-- | sysdeps/sh/dl-machine.h | 14 | ||||
-rw-r--r-- | sysdeps/sparc/sparc32/dl-machine.h | 14 | ||||
-rw-r--r-- | sysdeps/sparc/sparc64/dl-machine.h | 14 |
16 files changed, 106 insertions, 105 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/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index 6d196c7..5947381 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -88,6 +88,13 @@ typedef ElfW(Addr) lookup_t; # define DL_STATIC_INIT(map) #endif +/* Reloc type classes as returned by elf_machine_type_class(). + ELF_RTYPE_CLASS_PLT means this reloc should not be satisfied by + some PLT symbol, ELF_RTYPE_CLASS_COPY means this reloc should not be + satisfied by any symbol in the executable. */ +#define ELF_RTYPE_CLASS_PLT 1 +#define ELF_RTYPE_CLASS_COPY 2 + /* For the version handling we need an array with only names and their hash values. */ struct r_found_version @@ -336,14 +343,12 @@ extern void _dl_setup_hash (struct link_map *map) internal_function; l_searchlist (i.e. the segment of the dependency tree starting at that object) is searched in turn. REFERENCE_NAME should name the object containing the reference; it is used in error messages. - RELOC_TYPE is a machine-dependent reloc type, which is passed to - the `elf_machine_lookup_*_p' macros in dl-machine.h to affect which - symbols can be chosen. */ + TYPE_CLASS describes the type of symbol we are looking for. */ extern lookup_t _dl_lookup_symbol (const char *undef, struct link_map *undef_map, const ElfW(Sym) **sym, struct r_scope_elem *symbol_scope[], - int reloc_type, int explicit) + int type_class, int explicit) internal_function; /* Lookup versioned symbol. */ @@ -352,7 +357,7 @@ extern lookup_t _dl_lookup_versioned_symbol (const char *undef, const ElfW(Sym) **sym, struct r_scope_elem *symbol_scope[], const struct r_found_version *version, - int reloc_type, int explicit) + int type_class, int explicit) internal_function; /* For handling RTLD_NEXT we must be able to skip shared objects. */ 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/i386/dl-machine.h b/sysdeps/i386/dl-machine.h index e7a1b10..bb3e89c 100644 --- a/sysdeps/i386/dl-machine.h +++ b/sysdeps/i386/dl-machine.h @@ -247,13 +247,13 @@ _dl_start_user:\n\ #define RTLD_START_SPECIAL_INIT /* nothing */ #endif -/* 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_386_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_386_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_386_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \ + | (((type) == R_386_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_386_JMP_SLOT @@ -371,8 +371,6 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, refsym->st_size)); break; default: - /* We add these checks in the version to relocate ld.so only - if we are still debugging. */ _dl_reloc_bad_type (map, r_type, 0); break; } diff --git a/sysdeps/ia64/dl-machine.h b/sysdeps/ia64/dl-machine.h index 99c022d..21e5615 100644 --- a/sysdeps/ia64/dl-machine.h +++ b/sysdeps/ia64/dl-machine.h @@ -434,14 +434,14 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) #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. */ +/* 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. */ /* ??? Ignore IPLTMSB for now. */ -#define elf_machine_lookup_noplt_p(type) ((type) == R_IA64_IPLTLSB) - -/* 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) +#define elf_machine_type_class(type) \ + (((type) == R_IA64_IPLTLSB) * ELF_RTYPE_CLASS_PLT) /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */ #define ELF_MACHINE_JMP_SLOT R_IA64_IPLTLSB 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. */ diff --git a/sysdeps/powerpc/dl-machine.h b/sysdeps/powerpc/dl-machine.h index 438629a..e8b5446 100644 --- a/sysdeps/powerpc/dl-machine.h +++ b/sysdeps/powerpc/dl-machine.h @@ -264,18 +264,18 @@ __elf_preferred_address(struct link_map *loader, size_t maplength, #define ELF_PREFERRED_ADDRESS(loader, maplength, mapstartpref) \ __elf_preferred_address (loader, maplength, mapstartpref) -/* 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_PPC_COPY) - -/* Nonzero iff TYPE describes relocation of a PLT entry, so - PLT entries should not be allowed to define the value. */ +/* 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. */ /* We never want to use a PLT entry as the destination of a reloc, when what is being relocated is a branch. This is partly for efficiency, but mostly so we avoid loops. */ -#define elf_machine_lookup_noplt_p(type) ((type) == R_PPC_REL24 || \ - (type) == R_PPC_ADDR24 || \ - (type) == R_PPC_JMP_SLOT) +#define elf_machine_type_class(type) \ + ((((type) == R_PPC_JMP_SLOT \ + || (type) == R_PPC_REL24 \ + || (type) == R_PPC_ADDR24) * ELF_RTYPE_CLASS_PLT) \ + | (((type) == R_PPC_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_PPC_JMP_SLOT diff --git a/sysdeps/s390/s390-32/dl-machine.h b/sysdeps/s390/s390-32/dl-machine.h index 8028f62..f72651f 100644 --- a/sysdeps/s390/s390-32/dl-machine.h +++ b/sysdeps/s390/s390-32/dl-machine.h @@ -304,13 +304,13 @@ _dl_start_user:\n\ #define RTLD_START_SPECIAL_INIT /* nothing */ #endif -/* 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_390_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_390_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_390_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \ + | (((type) == R_390_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_390_JMP_SLOT diff --git a/sysdeps/s390/s390-64/dl-machine.h b/sysdeps/s390/s390-64/dl-machine.h index dde72f1..e77017a 100644 --- a/sysdeps/s390/s390-64/dl-machine.h +++ b/sysdeps/s390/s390-64/dl-machine.h @@ -276,13 +276,13 @@ _dl_start_user:\n\ #define RTLD_START_SPECIAL_INIT /* nothing */ #endif -/* 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_390_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_390_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_390_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \ + | (((type) == R_390_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_390_JMP_SLOT diff --git a/sysdeps/sh/dl-machine.h b/sysdeps/sh/dl-machine.h index 6f3b31c..ee5bb9c 100644 --- a/sysdeps/sh/dl-machine.h +++ b/sysdeps/sh/dl-machine.h @@ -388,13 +388,13 @@ _dl_start_user:\n\ .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_SH_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_SH_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_SH_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \ + | (((type) == R_SH_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_SH_JMP_SLOT diff --git a/sysdeps/sparc/sparc32/dl-machine.h b/sysdeps/sparc/sparc32/dl-machine.h index 2ed14fc..8c36987 100644 --- a/sysdeps/sparc/sparc32/dl-machine.h +++ b/sysdeps/sparc/sparc32/dl-machine.h @@ -177,13 +177,13 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) TRAMPOLINE_TEMPLATE (_dl_runtime_profile, fixup); #endif -/* 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_SPARC_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_SPARC_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_SPARC_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \ + | (((type) == R_SPARC_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_SPARC_JMP_SLOT diff --git a/sysdeps/sparc/sparc64/dl-machine.h b/sysdeps/sparc/sparc64/dl-machine.h index a72cb89..431e38b 100644 --- a/sysdeps/sparc/sparc64/dl-machine.h +++ b/sysdeps/sparc/sparc64/dl-machine.h @@ -392,13 +392,13 @@ elf_machine_lazy_rel (struct link_map *map, #endif /* RESOLVE */ -/* 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_SPARC_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_SPARC_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_SPARC_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \ + | (((type) == R_SPARC_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_SPARC_JMP_SLOT |