public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Phil Blundell <pb@pbcl.net>
To: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH 4/5] arm: Remove RELA support
Date: Wed, 3 Aug 2022 21:59:38 +0200	[thread overview]
Message-ID: <YurTqq9HRB0tpJPu@pbcl.net> (raw)
In-Reply-To: <6e10bcc6-86c1-3fee-f8cf-a681ff00239f@linaro.org>

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))

  reply	other threads:[~2022-08-03 19:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02 14:59 [PATCH 0/5] More features cleanups Adhemerval Zanella
2022-08-02 14:59 ` [PATCH 1/5] Remove missing LD_LIBRARY_VERSION usages Adhemerval Zanella
2022-08-02 15:11   ` Andreas Schwab
2022-08-02 14:59 ` [PATCH 2/5] Assume only FLAG_ELF_LIBC6 suport Adhemerval Zanella
2023-12-07 13:14   ` Alexander Monakov
2023-12-07 14:40     ` Adhemerval Zanella Netto
2022-08-02 14:59 ` [PATCH 3/5] Remove ldd libc4 support Adhemerval Zanella
2022-08-02 23:35   ` H.J. Lu
2022-08-02 14:59 ` [PATCH 4/5] arm: Remove RELA support Adhemerval Zanella
2022-08-03 18:31   ` Adhemerval Zanella Netto
2022-08-03 19:59     ` Phil Blundell [this message]
2022-08-02 14:59 ` [PATCH 5/5] i386: " Adhemerval Zanella
2022-08-02 15:13   ` H.J. Lu
2022-08-04  0:45     ` Fangrui Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YurTqq9HRB0tpJPu@pbcl.net \
    --to=pb@pbcl.net \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).