[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r10054 - in /fsf/trunk/libc: ChangeLog elf/dl-load.c libc-abis scripts/gen-libc-abis sysdeps/unix/sysv/linux/ldsodefs.h



Author: eglibc
Date: Wed Mar 17 00:02:48 2010
New Revision: 10054

Log:
Import glibc-mainline for 2010-03-17

Added:
    fsf/trunk/libc/libc-abis
    fsf/trunk/libc/scripts/gen-libc-abis
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/elf/dl-load.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/ldsodefs.h

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Wed Mar 17 00:02:48 2010
@@ -1,3 +1,18 @@
+2010-03-16  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* elf/dl-load.c (VALID_ELF_ABIVERSION): Add additional osabi parameter.
+	Not used here.
+	(open_verify): Modify for extended VALID_ELF_ABIVERSION macro
+	interface.
+	* sysdeps/unix/sysv/linux/ldsodefs.h (VALID_ELF_ABIVERSION): Add
+	additional osabi parameter.  Only acceept nonzero ABI versions if osabi
+	is Linux.
+	Fix includes.
+	(expected2): Don't explicitly initialize EI_ABIVERSION byte.
+
+	* sysdeps/unix/sysv/linux/ldsodefs.h (VALID_ELF_ABIVERSION): Update
+	definition to follow generic code.
+
 2010-03-15  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* posix/getconf.c: Update copyright year.

Modified: fsf/trunk/libc/elf/dl-load.c
==============================================================================
--- fsf/trunk/libc/elf/dl-load.c (original)
+++ fsf/trunk/libc/elf/dl-load.c Wed Mar 17 00:02:48 2010
@@ -1569,7 +1569,7 @@
 #ifndef VALID_ELF_HEADER
 # define VALID_ELF_HEADER(hdr,exp,size)	(memcmp (hdr, exp, size) == 0)
 # define VALID_ELF_OSABI(osabi)		(osabi == ELFOSABI_SYSV)
-# define VALID_ELF_ABIVERSION(ver)	(ver < LIBC_ABI_MAX)
+# define VALID_ELF_ABIVERSION(osabi,ver) (ver == 0)
 #elif defined MORE_ELF_HEADER_DATA
   MORE_ELF_HEADER_DATA;
 #endif
@@ -1656,7 +1656,8 @@
       /* See whether the ELF header is what we expect.  */
       if (__builtin_expect (! VALID_ELF_HEADER (ehdr->e_ident, expected,
 						EI_ABIVERSION)
-			    || !VALID_ELF_ABIVERSION (ehdr->e_ident[EI_ABIVERSION]),
+			    || !VALID_ELF_ABIVERSION (ehdr->e_ident[EI_OSABI],
+						      ehdr->e_ident[EI_ABIVERSION]),
 			    0))
 	{
 	  /* Something is wrong.  */
@@ -1697,7 +1698,8 @@
 	     allowed here.  */
 	  else if (!VALID_ELF_OSABI (ehdr->e_ident[EI_OSABI]))
 	    errstring = N_("ELF file OS ABI invalid");
-	  else if (!VALID_ELF_ABIVERSION (ehdr->e_ident[EI_ABIVERSION]))
+	  else if (!VALID_ELF_ABIVERSION (ehdr->e_ident[EI_OSABI],
+					  ehdr->e_ident[EI_ABIVERSION]))
 	    errstring = N_("ELF file ABI version invalid");
 	  else
 	    /* Otherwise we don't know what went wrong.  */

Added: fsf/trunk/libc/libc-abis
==============================================================================
--- fsf/trunk/libc/libc-abis (added)
+++ fsf/trunk/libc/libc-abis Wed Mar 17 00:02:48 2010
@@ -1,0 +1,44 @@
+# Definition of features which introduce new libc ABI versions.  This
+# file is used to create a header file with definitions for the various
+# versions.  The static linker will encode in the EI_ABIVERSION field in
+# the e_ident array in the ELF program header the required ABI version.
+# This is not a bitmask.  The maximum ABI version required must be
+# encoded.
+#
+# Adding new features should always happen by appending new lines.  Never
+# add entries in the middle or where they seem "logical".  Once a version
+# is assigned to a feature it must not change again.  Since some features
+# are conditionally added this can only ever be done securely without much
+# risk is by adding at the end.
+#
+# The following lines have one of two formats:
+#
+#	SYMBOL
+# With just a symbol on the line this is the name of a feature which
+# is architecture independent.
+#
+#	SYMBOL	PLATFORM
+# Using this form architecture (and platform) dependent features can be
+# specified.  The PLATFORM name can use the wildcards available in
+# the Bourne shell's case expression.
+#
+# Note that the same symbol can be used using different platform triples.
+# They don't have to be in the same order relative to other entries.  This
+# can happen if the feature is implemented for different architectures
+# at different times.
+#
+# This file is parsed by a script which produces a header file containing
+# a single enum definition.  An extra symbol is added as entry zero to
+# specify the default ABI with number 0 and an artificial last entry is
+# added to allow computing the maximum ABI version for the platform.
+#
+# Feature Name	Configuration
+# ------------	-------------
+#
+# Unique symbol definitions for C++.
+# Architecture independent, all ELF targets (== all targets)
+UNIQUE
+#
+# Indirect PLT relocations.  Architecture dependent.
+IFUNC		x86_64-*-linux*
+IFUNC		i?86-*-linux*

Added: fsf/trunk/libc/scripts/gen-libc-abis
==============================================================================
--- fsf/trunk/libc/scripts/gen-libc-abis (added)
+++ fsf/trunk/libc/scripts/gen-libc-abis Wed Mar 17 00:02:48 2010
@@ -1,0 +1,26 @@
+#! /bin/sh
+triple="$1"
+
+printf "#ifndef _LIBC_ABIS_H\n#define _LIBC_ABIS_H 1\n\n"
+printf "enum\n{\n  LIBC_ABI_DEFAULT = 0,\n"
+
+while read s t; do
+  if test "$s" = "#" || test -z "$s"; then continue; fi
+  if test -z "$t"; then
+    printf "  LIBC_ABI_%s,\n" "$s"
+    features="$features $s"
+  else
+    case "$triple" in
+      $t) printf "  LIBC_ABI_%s,\n" "$s"
+	  features="$features $s" ;;
+       *) ;;
+    esac
+  fi
+done
+
+printf "  LIBC_ABI_MAX\n};\n"
+printf "\n#endif\n"
+
+if test -n "$features"; then
+  printf "#define LIBC_ABIS_STRING \"libc ABIs:%s\\\\n\"\n" "$features"
+fi

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/ldsodefs.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/ldsodefs.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/ldsodefs.h Wed Mar 17 00:02:48 2010
@@ -1,5 +1,5 @@
 /* Run-time dynamic linker data structures for loaded ELF shared objects.
-   Copyright (C) 2001, 2002, 2003, 2006, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003, 2006, 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
@@ -19,6 +19,7 @@
 
 #ifndef	_LDSODEFS_H
 
+#include <libc-abis.h>
 #include <kernel-features.h>
 
 /* Get the real definitions.  */
@@ -58,7 +59,8 @@
 					 || memcmp (hdr, expected2, size) == 0)
 #define VALID_ELF_OSABI(osabi)		(osabi == ELFOSABI_SYSV \
 					 || osabi == ELFOSABI_LINUX)
-#define VALID_ELF_ABIVERSION(ver)	(ver == 0)
+#define VALID_ELF_ABIVERSION(osabi,ver) \
+  (ver == 0 || (osabi == ELFOSABI_LINUX && ver < LIBC_ABI_MAX))
 #define MORE_ELF_HEADER_DATA \
   static const unsigned char expected2[EI_PAD] =	\
   {							\
@@ -69,8 +71,7 @@
     [EI_CLASS] = ELFW(CLASS),				\
     [EI_DATA] = byteorder,				\
     [EI_VERSION] = EV_CURRENT,				\
-    [EI_OSABI] = ELFOSABI_LINUX,			\
-    [EI_ABIVERSION] = 0					\
+    [EI_OSABI] = ELFOSABI_LINUX				\
   }
 
 #endif /* ldsodefs.h */