This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Community source repository for glibc add-on ports branch, master, updated. glibc-2.13-30-g7006319


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Community source repository for glibc add-on ports".

The branch, master has been updated
       via  70063199c3d35faa725ae23b19a3c2470ff86414 (commit)
      from  04c46a1ce78ebc099f6ad9791653369cdef3c9cd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc-ports.git;a=commitdiff;h=70063199c3d35faa725ae23b19a3c2470ff86414

commit 70063199c3d35faa725ae23b19a3c2470ff86414
Author: Richard Sandiford <richard.sandiford@linaro.org>
Date:   Tue Apr 26 21:00:46 2011 +0000

    Support for R_ARM_IRELATIVE relocations.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 9db4a34..4c1207a 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,10 @@
+2011-04-26  Richard Sandiford  <richard.sandiford@linaro.org>
+
+	* sysdeps/arm/dl-machine.h (elf_machine_rel): Handle STT_GNU_IFUNC
+	and R_ARM_IRELATIVE.
+	(elf_machine_rela): Likewise.
+	* sysdeps/arm/dl-irel.h: New file.
+
 2011-04-11  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/arm/dl-tls.h (TLS_DTV_UNALLOCATED): Define.
diff --git a/sysdeps/arm/dl-irel.h b/sysdeps/arm/dl-irel.h
new file mode 100644
index 0000000..735e0a3
--- /dev/null
+++ b/sysdeps/arm/dl-irel.h
@@ -0,0 +1,45 @@
+/* Machine-dependent ELF indirect relocation inline functions.
+   ARM version.
+   Copyright (C) 2009, 2010 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 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _DL_IREL_H
+#define _DL_IREL_H
+
+#include <stdio.h>
+#include <unistd.h>
+
+#define ELF_MACHINE_IREL	1
+
+static inline void
+__attribute ((always_inline))
+elf_irel (const Elf32_Rel *reloc)
+{
+  Elf32_Addr *const reloc_addr = (void *) reloc->r_offset;
+  const unsigned long int r_type = ELF32_R_TYPE (reloc->r_info);
+
+  if (__builtin_expect (r_type == R_ARM_IRELATIVE, 1))
+    {
+      Elf32_Addr value = ((Elf32_Addr (*) (void)) (*reloc_addr)) ();
+      *reloc_addr = value;
+    }
+  else
+    __libc_fatal ("unexpected reloc type in static binary");
+}
+
+#endif /* dl-irel.h */
diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h
index 9929f76..b5d477b 100644
--- a/sysdeps/arm/dl-machine.h
+++ b/sysdeps/arm/dl-machine.h
@@ -374,6 +374,12 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
       struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
       Elf32_Addr value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
 
+      if (sym != NULL
+	  && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
+			       0)
+	  && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1))
+	value = ((Elf32_Addr (*) (void)) value) ();
+
       switch (r_type)
 	{
 	case R_ARM_COPY:
@@ -487,7 +493,8 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
 	     *reloc_addr = value;
 	  }
 	  break;
-#if defined USE_TLS && !defined RTLD_BOOTSTRAP
+#if !defined RTLD_BOOTSTRAP
+#if defined USE_TLS
 	case R_ARM_TLS_DTPMOD32:
 	  /* Get the information from the link map returned by the
 	     resolv function.  */
@@ -508,6 +515,12 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
 	    }
 	  break;
 #endif
+	case R_ARM_IRELATIVE:
+	  value = map->l_addr + *reloc_addr;
+	  value = ((Elf32_Addr (*) (void)) value) ();
+	  *reloc_addr = value;
+	  break;
+#endif
 	default:
 	  _dl_reloc_bad_type (map, r_type, 0);
 	  break;
@@ -537,6 +550,12 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
       struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
       Elf32_Addr value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
 
+      if (sym != NULL
+	  && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
+			       0)
+	  && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1))
+	value = ((Elf32_Addr (*) (void)) value) ();
+
       switch (r_type)
 	{
 #  ifndef RESOLVE_CONFLICT_FIND_MAP
@@ -588,7 +607,8 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
 	     *reloc_addr = value;
 	  }
 	  break;
-#if defined USE_TLS && !defined RTLD_BOOTSTRAP
+#if !defined RTLD_BOOTSTRAP
+#if defined USE_TLS
 	case R_ARM_TLS_DTPMOD32:
 	  /* Get the information from the link map returned by the
 	     resolv function.  */
@@ -609,6 +629,12 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
 	    }
 	  break;
 #endif
+	case R_ARM_IRELATIVE:
+	  value = map->l_addr + *reloc_addr;
+	  value = ((Elf32_Addr (*) (void)) value) ();
+	  *reloc_addr = value;
+	  break;
+#endif
 	default:
 	  _dl_reloc_bad_type (map, r_type, 0);
 	  break;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog.arm                                     |    7 +++
 sysdeps/{alpha/fpu/fesetround.c => arm/dl-irel.h} |   46 +++++++++++----------
 sysdeps/arm/dl-machine.h                          |   30 +++++++++++++-
 3 files changed, 59 insertions(+), 24 deletions(-)
 copy sysdeps/{alpha/fpu/fesetround.c => arm/dl-irel.h} (57%)


hooks/post-receive
-- 
Community source repository for glibc add-on ports


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]