From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from pbcl.net (pbcl.net [IPv6:2a01:4f8:c2c:5794::1]) by sourceware.org (Postfix) with ESMTPS id 236453858C39 for ; Wed, 3 Aug 2022 19:59:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 236453858C39 Received: from pb by pbcl.net with local (Exim 4.94.2) (envelope-from ) id 1oJKWo-0020Me-F9; Wed, 03 Aug 2022 21:59:38 +0200 Date: Wed, 3 Aug 2022 21:59:38 +0200 From: Phil Blundell To: Adhemerval Zanella Netto Cc: libc-alpha@sourceware.org Subject: Re: [PATCH 4/5] arm: Remove RELA support Message-ID: References: <20220802145905.2789733-1-adhemerval.zanella@linaro.org> <20220802145905.2789733-5-adhemerval.zanella@linaro.org> <6e10bcc6-86c1-3fee-f8cf-a681ff00239f@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6e10bcc6-86c1-3fee-f8cf-a681ff00239f@linaro.org> X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_STOCKGEN, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2022 19:59:42 -0000 Agreed, this looks ok. Phil On Wed, Aug 03, 2022 at 03:31:25PM -0300, Adhemerval Zanella Netto via Libc-alpha wrote: > Since i386 was approved, it does not make sense to keep arm as the unique architecture > with lingering RELA support for prelink. I will commit this shortly if no one opposes > it. > > On 02/08/22 11:59, Adhemerval Zanella wrote: > > Now that prelink is not support, there is no need to keep supporting > > rela for non bootstrap. > > --- > > sysdeps/arm/dl-machine-rel.h | 7 +-- > > sysdeps/arm/dl-machine.h | 100 ----------------------------------- > > 2 files changed, 1 insertion(+), 106 deletions(-) > > > > diff --git a/sysdeps/arm/dl-machine-rel.h b/sysdeps/arm/dl-machine-rel.h > > index 999967931b..9dfaf718f2 100644 > > --- a/sysdeps/arm/dl-machine-rel.h > > +++ b/sysdeps/arm/dl-machine-rel.h > > @@ -19,13 +19,8 @@ > > #ifndef _DL_MACHINE_REL_H > > #define _DL_MACHINE_REL_H > > > > -/* ARM never uses Elf32_Rela relocations for the dynamic linker. > > - Prelinked libraries may use Elf32_Rela though. */ > > -#define ELF_MACHINE_NO_RELA defined RTLD_BOOTSTRAP > > +#define ELF_MACHINE_NO_RELA 1 > > #define ELF_MACHINE_NO_REL 0 > > - > > -/* ARM never uses Elf32_Rela relocations for the dynamic linker. > > - Prelinked libraries may use Elf32_Rela though. */ > > #define ELF_MACHINE_PLT_REL 1 > > > > #define PLTREL ElfW(Rel) > > diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h > > index 6a422713bd..4e78d8fb0e 100644 > > --- a/sysdeps/arm/dl-machine.h > > +++ b/sysdeps/arm/dl-machine.h > > @@ -447,96 +447,6 @@ elf_machine_rel (struct link_map *map, struct r_scope_elem *scope[], > > } > > } > > > > -# ifndef RTLD_BOOTSTRAP > > -static inline void > > -__attribute__ ((always_inline)) > > -elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[], > > - const Elf32_Rela *reloc, const Elf32_Sym *sym, > > - const struct r_found_version *version, > > - void *const reloc_addr_arg, int skip_ifunc) > > -{ > > - Elf32_Addr *const reloc_addr = reloc_addr_arg; > > - const unsigned int r_type = ELF32_R_TYPE (reloc->r_info); > > - > > - if (__builtin_expect (r_type == R_ARM_RELATIVE, 0)) > > - *reloc_addr = map->l_addr + reloc->r_addend; > > - else if (__builtin_expect (r_type == R_ARM_NONE, 0)) > > - return; > > - else > > - { > > - const Elf32_Sym *const refsym = sym; > > - struct link_map *sym_map = RESOLVE_MAP (map, scope, &sym, version, r_type); > > - Elf32_Addr value = SYMBOL_ADDRESS (sym_map, sym, true); > > - > > - if (sym != NULL > > - && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0) > > - && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1) > > - && __builtin_expect (!skip_ifunc, 1)) > > - value = elf_ifunc_invoke (value); > > - > > - switch (r_type) > > - { > > - /* Not needed for dl-conflict.c. */ > > - case R_ARM_COPY: > > - if (sym == NULL) > > - /* This can happen in trace mode if an object could not be > > - found. */ > > - break; > > - if (sym->st_size > refsym->st_size > > - || (GLRO(dl_verbose) && sym->st_size < refsym->st_size)) > > - { > > - const char *strtab; > > - > > - strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]); > > - _dl_error_printf ("\ > > -%s: Symbol `%s' has different size in shared object, consider re-linking\n", > > - RTLD_PROGNAME, strtab + refsym->st_name); > > - } > > - memcpy (reloc_addr_arg, (void *) value, > > - MIN (sym->st_size, refsym->st_size)); > > - break; > > - case R_ARM_GLOB_DAT: > > - case R_ARM_JUMP_SLOT: > > - case R_ARM_ABS32: > > - *reloc_addr = value + reloc->r_addend; > > - break; > > - case R_ARM_PC24: > > - relocate_pc24 (map, value, reloc_addr, reloc->r_addend); > > - break; > > -#if !defined RTLD_BOOTSTRAP > > - case R_ARM_TLS_DTPMOD32: > > - /* Get the information from the link map returned by the > > - resolv function. */ > > - if (sym_map != NULL) > > - *reloc_addr = sym_map->l_tls_modid; > > - break; > > - > > - case R_ARM_TLS_DTPOFF32: > > - *reloc_addr = (sym == NULL ? 0 : sym->st_value) + reloc->r_addend; > > - break; > > - > > - case R_ARM_TLS_TPOFF32: > > - if (sym != NULL) > > - { > > - CHECK_STATIC_TLS (map, sym_map); > > - *reloc_addr = (sym->st_value + sym_map->l_tls_offset > > - + reloc->r_addend); > > - } > > - break; > > - case R_ARM_IRELATIVE: > > - value = map->l_addr + reloc->r_addend; > > - if (__glibc_likely (!skip_ifunc)) > > - value = ((Elf32_Addr (*) (int)) value) (GLRO(dl_hwcap)); > > - *reloc_addr = value; > > - break; > > -#endif > > - default: > > - _dl_reloc_bad_type (map, r_type, 0); > > - break; > > - } > > - } > > -} > > -# endif > > > > static inline void > > __attribute__ ((always_inline)) > > @@ -547,16 +457,6 @@ elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rel *reloc, > > *reloc_addr += l_addr; > > } > > > > -# ifndef RTLD_BOOTSTRAP > > -static inline void > > -__attribute__ ((always_inline)) > > -elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc, > > - void *const reloc_addr_arg) > > -{ > > - Elf32_Addr *const reloc_addr = reloc_addr_arg; > > - *reloc_addr = l_addr + reloc->r_addend; > > -} > > -# endif > > > > static inline void > > __attribute__ ((always_inline))