diff options
author | Wilco Dijkstra <wilco.dijkstra@arm.com> | 2025-01-02 18:35:28 +0000 |
---|---|---|
committer | Wilco Dijkstra <wilco.dijkstra@arm.com> | 2025-02-24 14:19:19 +0000 |
commit | 0a021727bc4c122cd5accbb9ee69a5e82460a442 (patch) | |
tree | 7489089425fb1851c39c113b741d11cf7c879c4d | |
parent | eb7ac024d9e5ac71f6c9695703c3db6b05744b86 (diff) | |
download | glibc-0a021727bc4c122cd5accbb9ee69a5e82460a442.zip glibc-0a021727bc4c122cd5accbb9ee69a5e82460a442.tar.gz glibc-0a021727bc4c122cd5accbb9ee69a5e82460a442.tar.bz2 |
AArch64: Remove AARCH64_R macro
Remove AArch64_R relocation macro.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-rw-r--r-- | elf/elf.h | 13 | ||||
-rw-r--r-- | sysdeps/aarch64/dl-irel.h | 2 | ||||
-rw-r--r-- | sysdeps/aarch64/dl-machine.h | 32 | ||||
-rw-r--r-- | sysdeps/aarch64/sysdep.h | 2 |
4 files changed, 16 insertions, 33 deletions
@@ -2906,19 +2906,6 @@ enum #define R_AARCH64_NONE 0 /* No relocation. */ -/* ILP32 AArch64 relocs. */ -#define R_AARCH64_P32_ABS32 1 /* Direct 32 bit. */ -#define R_AARCH64_P32_COPY 180 /* Copy symbol at runtime. */ -#define R_AARCH64_P32_GLOB_DAT 181 /* Create GOT entry. */ -#define R_AARCH64_P32_JUMP_SLOT 182 /* Create PLT entry. */ -#define R_AARCH64_P32_RELATIVE 183 /* Adjust by program base. */ -#define R_AARCH64_P32_TLS_DTPMOD 184 /* Module number, 32 bit. */ -#define R_AARCH64_P32_TLS_DTPREL 185 /* Module-relative offset, 32 bit. */ -#define R_AARCH64_P32_TLS_TPREL 186 /* TP-relative offset, 32 bit. */ -#define R_AARCH64_P32_TLSDESC 187 /* TLS Descriptor. */ -#define R_AARCH64_P32_IRELATIVE 188 /* STT_GNU_IFUNC relocation. */ - -/* LP64 AArch64 relocs. */ #define R_AARCH64_ABS64 257 /* Direct 64 bit. */ #define R_AARCH64_ABS32 258 /* Direct 32 bit. */ #define R_AARCH64_ABS16 259 /* Direct 16-bit. */ diff --git a/sysdeps/aarch64/dl-irel.h b/sysdeps/aarch64/dl-irel.h index e157290..ae402bc 100644 --- a/sysdeps/aarch64/dl-irel.h +++ b/sysdeps/aarch64/dl-irel.h @@ -48,7 +48,7 @@ elf_irela (const ElfW(Rela) *reloc) ElfW(Addr) *const reloc_addr = (void *) reloc->r_offset; const unsigned long int r_type = ELFW(R_TYPE) (reloc->r_info); - if (__glibc_likely (r_type == AARCH64_R(IRELATIVE))) + if (__glibc_likely (r_type == R_AARCH64_IRELATIVE)) { ElfW(Addr) value = elf_ifunc_invoke (reloc->r_addend); *reloc_addr = value; diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h index bb8f8a9..022642a 100644 --- a/sysdeps/aarch64/dl-machine.h +++ b/sysdeps/aarch64/dl-machine.h @@ -118,7 +118,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[], (type) == R_AARCH64_TLSDESC) * ELF_RTYPE_CLASS_PLT) \ | (((type) == R_AARCH64_COPY) * ELF_RTYPE_CLASS_COPY)) -#define ELF_MACHINE_JMP_SLOT AARCH64_R(JUMP_SLOT) +#define ELF_MACHINE_JMP_SLOT R_AARCH64_JUMP_SLOT #define DL_PLATFORM_INIT dl_platform_init () @@ -174,7 +174,7 @@ elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[], ElfW(Addr) *const reloc_addr = reloc_addr_arg; const unsigned int r_type = ELFW (R_TYPE) (reloc->r_info); - if (__builtin_expect (r_type == AARCH64_R(RELATIVE), 0)) + if (__builtin_expect (r_type == R_AARCH64_RELATIVE, 0)) *reloc_addr = map->l_addr + reloc->r_addend; else if (__builtin_expect (r_type == R_AARCH64_NONE, 0)) return; @@ -195,19 +195,17 @@ elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[], switch (r_type) { - case AARCH64_R(GLOB_DAT): - case AARCH64_R(JUMP_SLOT): + case R_AARCH64_GLOB_DAT: + case R_AARCH64_JUMP_SLOT: *reloc_addr = value + reloc->r_addend; break; # ifndef RTLD_BOOTSTRAP - case AARCH64_R(ABS32): -# ifdef __LP64__ - case AARCH64_R(ABS64): -# endif + case R_AARCH64_ABS32: + case R_AARCH64_ABS64: *reloc_addr = value + reloc->r_addend; break; - case AARCH64_R(COPY): + case R_AARCH64_COPY: if (sym == NULL) break; @@ -226,7 +224,7 @@ elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[], ? sym->st_size : refsym->st_size); break; - case AARCH64_R(TLSDESC): + case R_AARCH64_TLSDESC: { struct tlsdesc volatile *td = (struct tlsdesc volatile *)reloc_addr; @@ -257,19 +255,19 @@ elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[], break; } - case AARCH64_R(TLS_DTPMOD): + case R_AARCH64_TLS_DTPMOD: if (sym_map != NULL) { *reloc_addr = sym_map->l_tls_modid; } break; - case AARCH64_R(TLS_DTPREL): + case R_AARCH64_TLS_DTPREL: if (sym) *reloc_addr = sym->st_value + reloc->r_addend; break; - case AARCH64_R(TLS_TPREL): + case R_AARCH64_TLS_TPREL: if (sym) { CHECK_STATIC_TLS (map, sym_map); @@ -278,7 +276,7 @@ elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[], } break; - case AARCH64_R(IRELATIVE): + case R_AARCH64_IRELATIVE: value = map->l_addr + reloc->r_addend; if (__glibc_likely (!skip_ifunc)) value = elf_ifunc_invoke (value); @@ -313,7 +311,7 @@ elf_machine_lazy_rel (struct link_map *map, struct r_scope_elem *scope[], ElfW(Addr) *const reloc_addr = (void *) (l_addr + reloc->r_offset); const unsigned int r_type = ELFW (R_TYPE) (reloc->r_info); /* Check for unexpected PLT reloc type. */ - if (__builtin_expect (r_type == AARCH64_R(JUMP_SLOT), 1)) + if (__builtin_expect (r_type == R_AARCH64_JUMP_SLOT, 1)) { if (__glibc_unlikely (map->l_info[DT_AARCH64 (VARIANT_PCS)] != NULL)) { @@ -343,7 +341,7 @@ elf_machine_lazy_rel (struct link_map *map, struct r_scope_elem *scope[], else *reloc_addr = map->l_mach.plt; } - else if (__builtin_expect (r_type == AARCH64_R(TLSDESC), 1)) + else if (__builtin_expect (r_type == R_AARCH64_TLSDESC, 1)) { const Elf_Symndx symndx = ELFW (R_SYM) (reloc->r_info); const ElfW (Sym) *symtab = (const void *)D_PTR (map, l_info[DT_SYMTAB]); @@ -362,7 +360,7 @@ elf_machine_lazy_rel (struct link_map *map, struct r_scope_elem *scope[], elf_machine_rela (map, scope, reloc, sym, version, reloc_addr, skip_ifunc); } - else if (__glibc_unlikely (r_type == AARCH64_R(IRELATIVE))) + else if (__glibc_unlikely (r_type == R_AARCH64_IRELATIVE)) { ElfW(Addr) value = map->l_addr + reloc->r_addend; if (__glibc_likely (!skip_ifunc)) diff --git a/sysdeps/aarch64/sysdep.h b/sysdeps/aarch64/sysdep.h index 3ca0040..9424115 100644 --- a/sysdeps/aarch64/sysdep.h +++ b/sysdeps/aarch64/sysdep.h @@ -21,8 +21,6 @@ #include <sysdeps/generic/sysdep.h> -# define AARCH64_R(NAME) R_AARCH64_ ## NAME - #ifndef __ASSEMBLER__ /* Strip pointer authentication code from pointer p. */ static inline void * |