]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/generic/dl-machine.h
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / generic / dl-machine.h
index a23f17803485a4989281ec1e01d88f5b409b98bc..90c55ebee05041bfe37dea78e4495491fd8ec3fd 100644 (file)
@@ -1,21 +1,20 @@
 /* Machine-dependent ELF dynamic relocation inline functions.  Stub version.
-   Copyright (C) 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1995-2020 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
 
 #define ELF_MACHINE_NAME "stub"
 
 #include <link.h>
 
 
-/* Return nonzero iff E_MACHINE is compatible with the running host.  */
+/* Return nonzero iff ELF header is compatible with the running host.  */
 static inline int
-elf_machine_matches_host (Elf32_Half e_machine)
+elf_machine_matches_host (const Elf32_Ehdr *ehdr)
 {
-  switch (e_machine)
+  switch (ehdr->e_machine)
     {
     default:
       return 0;
@@ -52,10 +51,11 @@ elf_machine_load_address (void)
 
 /* Fixup a PLT entry to bounce directly to the function at VALUE.  */
 
-static inline Elf32_Addr
+static inline ElfW(Addr)
 elf_machine_fixup_plt (struct link_map *map, lookup_t t,
-                      const Elf32_Rel *reloc,
-                      Elf32_Addr *reloc_addr, Elf32_Addr value)
+                      const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
+                      const ElfW(Rel) *reloc,
+                      ElfW(Addr) *reloc_addr, ElfW(Addr) value)
 {
   return *reloc_addr = value;
 }
@@ -64,7 +64,8 @@ elf_machine_fixup_plt (struct link_map *map, lookup_t t,
    LOADADDR is the load address of the object; INFO is an array indexed
    by DT_* of the .dynamic section info.  */
 
-static inline void
+auto inline void
+__attribute__ ((always_inline))
 elf_machine_rel (Elf32_Addr loadaddr, Elf32_Dyn *info[DT_NUM],
                 const Elf32_Rel *reloc, const Elf32_Sym *sym,
                 Elf32_Addr (*resolve) (const Elf32_Sym **ref,
@@ -87,7 +88,8 @@ elf_machine_rel (Elf32_Addr loadaddr, Elf32_Dyn *info[DT_NUM],
 }
 
 
-static inline Elf32_Addr
+auto inline Elf32_Addr
+__attribute__ ((always_inline))
 elf_machine_rela (Elf32_Addr loadaddr, Elf32_Dyn *info[DT_NUM],
                  const Elf32_Rel *reloc, const Elf32_Sym *sym,
                  Elf32_Addr (*resolve) (const Elf32_Sym **ref,
@@ -95,15 +97,10 @@ elf_machine_rela (Elf32_Addr loadaddr, Elf32_Dyn *info[DT_NUM],
                                         int noplt))
 {
   _dl_signal_error (0, "Elf32_Rela relocation requested -- unused on "
-                   ELF_MACHINE_NAME);
+                   NULL, ELF_MACHINE_NAME);
 }
 
 
-/* Nonzero iff TYPE describes relocation of a PLT entry, so
-   PLT entries should not be allowed to define the value.  */
-#define elf_machine_pltrel_p(type) ((type) == R_???_JMP_SLOT)
-
-
 /* Set up the loaded object described by L so its unrelocated PLT
    entries will jump to the on-demand fixup code in dl-runtime.c.  */