[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r7899 - in /fsf/trunk/libc: ChangeLog elf/dl-load.c sysdeps/unix/sysv/linux/ldsodefs.h
- To: commits@xxxxxxxxxx
- Subject: [commits] r7899 - in /fsf/trunk/libc: ChangeLog elf/dl-load.c sysdeps/unix/sysv/linux/ldsodefs.h
- From: eglibc@xxxxxxxxxx
- Date: Wed, 11 Feb 2009 08:05:18 -0000
Author: eglibc
Date: Wed Feb 11 00:05:17 2009
New Revision: 7899
Log:
Import glibc-mainline for 2009-02-11
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 Feb 11 00:05:17 2009
@@ -1,3 +1,11 @@
+2009-02-10 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ * elf/dl-load.c (open_verify): In case VALID_ELF_HEADER is
+ defined, allow additional data to be added using the optional
+ MORE_ELF_HEADER_DATA macro.
+ * sysdeps/unix/sysv/linux/ldsodefs.h (VALID_ELF_HEADER,
+ VALID_ELF_OSABI, VALID_ELF_ABIVERSION, MORE_ELF_HEADER_DATA): Define.
+
2009-02-08 Ulrich Drepper <drepper@xxxxxxxxxx>
* include/atomic.h: Define catomic_and if not already defined.
Modified: fsf/trunk/libc/elf/dl-load.c
==============================================================================
--- fsf/trunk/libc/elf/dl-load.c (original)
+++ fsf/trunk/libc/elf/dl-load.c Wed Feb 11 00:05:17 2009
@@ -1,5 +1,5 @@
/* Map in a shared object's segments from the file.
- Copyright (C) 1995-2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1995-2005, 2006, 2007, 2009 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
@@ -1574,6 +1574,8 @@
# 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 == 0)
+#elif defined MORE_ELF_HEADER_DATA
+ MORE_ELF_HEADER_DATA;
#endif
static const unsigned char expected[EI_PAD] =
{
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 Feb 11 00:05:17 2009
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2006, 2009 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
@@ -53,4 +53,24 @@
# define HAVE_AUX_PAGESIZE
#endif
+/* Accept binaries which identify the binary as using Linux extensions. */
+#define VALID_ELF_HEADER(hdr,exp,size) (memcmp (hdr, exp, size) == 0 \
+ || memcmp (hdr, expected2, size) == 0)
+#define VALID_ELF_OSABI(osabi) (osabi == ELFOSABI_SYSV \
+ || osabi == ELFOSABI_LINUX)
+#define VALID_ELF_ABIVERSION(ver) (ver == 0)
+#define MORE_ELF_HEADER_DATA \
+ static const unsigned char expected2[EI_PAD] = \
+ { \
+ [EI_MAG0] = ELFMAG0, \
+ [EI_MAG1] = ELFMAG1, \
+ [EI_MAG2] = ELFMAG2, \
+ [EI_MAG3] = ELFMAG3, \
+ [EI_CLASS] = ELFW(CLASS), \
+ [EI_DATA] = byteorder, \
+ [EI_VERSION] = EV_CURRENT, \
+ [EI_OSABI] = ELFOSABI_LINUX, \
+ [EI_ABIVERSION] = 0 \
+ }
+
#endif /* ldsodefs.h */