rpms/elfutils/devel elfutils-0.137.tar.gz.sig, NONE, 1.1 .cvsignore, 1.43, 1.44 elfutils-portability.patch, 1.37, 1.38 elfutils-robustify.patch, 1.11, 1.12 elfutils.spec, 1.106, 1.107 sources, 1.47, 1.48

Roland McGrath roland at fedoraproject.org
Wed Aug 27 08:19:46 UTC 2008


Author: roland

Update of /cvs/pkgs/rpms/elfutils/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv31412

Modified Files:
	.cvsignore elfutils-portability.patch elfutils-robustify.patch 
	elfutils.spec sources 
Added Files:
	elfutils-0.137.tar.gz.sig 
Log Message:
Update to 0.137


--- NEW FILE elfutils-0.137.tar.gz.sig ---
ˆF
	Ú(Â:yÿDtW

Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/elfutils/devel/.cvsignore,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- .cvsignore	13 May 2008 00:35:53 -0000	1.43
+++ .cvsignore	27 Aug 2008 08:19:15 -0000	1.44
@@ -1 +1 @@
-elfutils-0.135.tar.gz
+elfutils-0.137.tar.gz

elfutils-portability.patch:

Index: elfutils-portability.patch
===================================================================
RCS file: /cvs/pkgs/rpms/elfutils/devel/elfutils-portability.patch,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- elfutils-portability.patch	13 May 2008 00:44:12 -0000	1.37
+++ elfutils-portability.patch	27 Aug 2008 08:19:15 -0000	1.38
@@ -1,6 +1,6 @@
 --- elfutils/backends/ChangeLog
 +++ elfutils/backends/ChangeLog
-@@ -296,6 +296,11 @@
+@@ -315,6 +315,11 @@
  	* sparc_init.c: Likewise.
  	* x86_64_init.c: Likewise.
  
@@ -12,7 +12,7 @@
  2005-11-19  Roland McGrath  <roland at redhat.com>
  
  	* ppc64_reloc.def: REL30 -> ADDR30.
-@@ -318,6 +323,9 @@
+@@ -337,6 +342,9 @@
  	* Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
  	(CLEANFILES): Add libebl_$(m).so.
  
@@ -46,11 +46,11 @@
  
 -
  i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c \
- 	    i386_retval.c i386_regs.c i386_auxv.c
+ 	    i386_retval.c i386_regs.c i386_auxv.c i386_syscall.c
  cpu_i386 = ../libcpu/libcpu_i386.a
 --- elfutils/backends/Makefile.in
 +++ elfutils/backends/Makefile.in
-@@ -153,6 +153,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -155,6 +155,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
  INSTALL_SCRIPT = @INSTALL_SCRIPT@
  INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  LDFLAGS = @LDFLAGS@
@@ -58,7 +58,7 @@
  LEX = @LEX@
  LEXLIB = @LEXLIB@
  LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-@@ -182,6 +183,7 @@ SHELL = @SHELL@
+@@ -184,6 +185,7 @@ SHELL = @SHELL@
  STRIP = @STRIP@
  USE_NLS = @USE_NLS@
  VERSION = @VERSION@
@@ -66,7 +66,7 @@
  XGETTEXT = @XGETTEXT@
  XGETTEXT_015 = @XGETTEXT_015@
  YACC = @YACC@
-@@ -237,9 +239,9 @@ target_alias = @target_alias@
+@@ -239,9 +241,9 @@ target_alias = @target_alias@
  top_builddir = @top_builddir@
  top_srcdir = @top_srcdir@
  @MUDFLAP_FALSE at AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
@@ -80,7 +80,7 @@
  	   -I$(top_srcdir)/lib -I..
 --- elfutils/ChangeLog
 +++ elfutils/ChangeLog
-@@ -30,6 +30,10 @@
+@@ -39,6 +39,10 @@
  	* configure.ac: Add dummy automake conditional to get dependencies
  	for non-generic linker right.  See src/Makefile.am.
  
@@ -91,7 +91,7 @@
  2005-11-18  Roland McGrath  <roland at redhat.com>
  
  	* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
-@@ -77,6 +81,17 @@
+@@ -86,6 +90,17 @@
  	* Makefile.am (all_SUBDIRS): Add libdwfl.
  	* configure.ac: Write libdwfl/Makefile.
  
@@ -129,7 +129,7 @@
  YACC = @YACC@
 --- elfutils/configure
 +++ elfutils/configure
-@@ -674,6 +674,8 @@ YFLAGS
+@@ -676,6 +676,8 @@ YFLAGS
  LEX
  LEX_OUTPUT_ROOT
  LEXLIB
@@ -138,7 +138,7 @@
  LOCALEDIR
  DATADIRNAME
  NATIVE_LD_TRUE
-@@ -3877,6 +3879,88 @@ echo "$as_me: error: gcc with C99 suppor
+@@ -3894,6 +3896,88 @@ echo "$as_me: error: gcc with C99 suppor
  fi
  
  
@@ -227,40 +227,38 @@
  LOCALEDIR=$datadir
  
  cat >>confdefs.h <<_ACEOF
-@@ -5621,10 +5705,10 @@ YFLAGS!$YFLAGS$ac_delim
+@@ -5646,8 +5730,8 @@ YFLAGS!$YFLAGS$ac_delim
  LEX!$LEX$ac_delim
  LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim
  LEXLIB!$LEXLIB$ac_delim
+-LOCALEDIR!$LOCALEDIR$ac_delim
+-DATADIRNAME!$DATADIRNAME$ac_delim
 +WEXTRA!$WEXTRA$ac_delim
 +LD_AS_NEEDED!$LD_AS_NEEDED$ac_delim
- LOCALEDIR!$LOCALEDIR$ac_delim
- DATADIRNAME!$DATADIRNAME$ac_delim
--NATIVE_LD_TRUE!$NATIVE_LD_TRUE$ac_delim
--NATIVE_LD_FALSE!$NATIVE_LD_FALSE$ac_delim
  _ACEOF
  
    if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
-@@ -5666,6 +5750,8 @@ _ACEOF
+@@ -5689,6 +5773,8 @@ _ACEOF
  ac_delim='%!_!# '
  for ac_last_try in false false false false false :; do
    cat >conf$$subs.sed <<_ACEOF
-+NATIVE_LD_TRUE!$NATIVE_LD_TRUE$ac_delim
-+NATIVE_LD_FALSE!$NATIVE_LD_FALSE$ac_delim
++LOCALEDIR!$LOCALEDIR$ac_delim
++DATADIRNAME!$DATADIRNAME$ac_delim
+ NATIVE_LD_TRUE!$NATIVE_LD_TRUE$ac_delim
+ NATIVE_LD_FALSE!$NATIVE_LD_FALSE$ac_delim
  base_cpu!$base_cpu$ac_delim
- NEVER_TRUE!$NEVER_TRUE$ac_delim
- NEVER_FALSE!$NEVER_FALSE$ac_delim
-@@ -5697,7 +5783,7 @@ LIBOBJS!$LIBOBJS$ac_delim
+@@ -5722,7 +5808,7 @@ LIBOBJS!$LIBOBJS$ac_delim
  LTLIBOBJS!$LTLIBOBJS$ac_delim
  _ACEOF
  
--  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 29; then
-+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 31; then
+-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 31; then
++  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 33; then
      break
    elif $ac_last_try; then
      { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
 --- elfutils/configure.ac
 +++ elfutils/configure.ac
-@@ -71,6 +71,34 @@ CFLAGS="$old_CFLAGS"])
+@@ -74,6 +74,34 @@ CFLAGS="$old_CFLAGS"])
  AS_IF([test "x$ac_cv_c99" != xyes],
        AC_MSG_ERROR([gcc with C99 support required]))
  
@@ -297,7 +295,7 @@
  AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR")
 --- elfutils/lib/ChangeLog
 +++ elfutils/lib/ChangeLog
-@@ -30,6 +30,11 @@
+@@ -41,6 +41,11 @@
  	* Makefile.am (libeu_a_SOURCES): Add it.
  	* system.h: Declare crc32_file.
  
@@ -477,7 +475,7 @@
  INCLUDES = -I$(srcdir) -I$(srcdir)/../lib -I$(srcdir)/../libelf \
 --- elfutils/libdw/ChangeLog
 +++ elfutils/libdw/ChangeLog
-@@ -490,6 +490,11 @@
+@@ -495,6 +495,11 @@
  
  2005-05-31  Roland McGrath  <roland at redhat.com>
  
@@ -541,7 +539,7 @@
  						       $(COMPILE)))
 --- elfutils/libdwfl/ChangeLog
 +++ elfutils/libdwfl/ChangeLog
-@@ -806,6 +806,11 @@
+@@ -885,6 +885,11 @@
  
  2005-07-21  Roland McGrath  <roland at redhat.com>
  
@@ -572,7 +570,7 @@
  VERSION = 1
 --- elfutils/libdwfl/Makefile.in
 +++ elfutils/libdwfl/Makefile.in
-@@ -129,6 +129,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -131,6 +131,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
  INSTALL_SCRIPT = @INSTALL_SCRIPT@
  INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  LDFLAGS = @LDFLAGS@
@@ -580,7 +578,7 @@
  LEX = @LEX@
  LEXLIB = @LEXLIB@
  LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-@@ -158,6 +159,7 @@ SHELL = @SHELL@
+@@ -160,6 +161,7 @@ SHELL = @SHELL@
  STRIP = @STRIP@
  USE_NLS = @USE_NLS@
  VERSION = 1
@@ -588,7 +586,7 @@
  XGETTEXT = @XGETTEXT@
  XGETTEXT_015 = @XGETTEXT_015@
  YACC = @YACC@
-@@ -213,9 +215,9 @@ target_alias = @target_alias@
+@@ -215,9 +217,9 @@ target_alias = @target_alias@
  top_builddir = @top_builddir@
  top_srcdir = @top_srcdir@
  @MUDFLAP_FALSE at AM_CFLAGS = -Wall -Werror -Wshadow -Wunused -Wformat=2 \
@@ -602,7 +600,7 @@
  
 --- elfutils/libebl/ChangeLog
 +++ elfutils/libebl/ChangeLog
-@@ -538,6 +538,11 @@
+@@ -554,6 +554,11 @@
  	* Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
  	tracking works right.
  
@@ -633,7 +631,7 @@
  INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
 --- elfutils/libebl/Makefile.in
 +++ elfutils/libebl/Makefile.in
-@@ -122,6 +122,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -123,6 +123,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
  INSTALL_SCRIPT = @INSTALL_SCRIPT@
  INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  LDFLAGS = @LDFLAGS@
@@ -641,7 +639,7 @@
  LEX = @LEX@
  LEXLIB = @LEXLIB@
  LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-@@ -151,6 +152,7 @@ SHELL = @SHELL@
+@@ -152,6 +153,7 @@ SHELL = @SHELL@
  STRIP = @STRIP@
  USE_NLS = @USE_NLS@
  VERSION = 1
@@ -649,7 +647,7 @@
  XGETTEXT = @XGETTEXT@
  XGETTEXT_015 = @XGETTEXT_015@
  YACC = @YACC@
-@@ -206,9 +208,9 @@ target_alias = @target_alias@
+@@ -207,9 +209,9 @@ target_alias = @target_alias@
  top_builddir = @top_builddir@
  top_srcdir = @top_srcdir@
  @MUDFLAP_FALSE at AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
@@ -663,7 +661,7 @@
  
 --- elfutils/libelf/ChangeLog
 +++ elfutils/libelf/ChangeLog
-@@ -359,6 +359,11 @@
+@@ -408,6 +408,11 @@
  	If section content hasn't been read yet, do it before looking for the
  	block size.  If no section data present, infer size of section header.
  
@@ -677,7 +675,7 @@
  	* elf.h: Update again.
 --- elfutils/libelf/common.h
 +++ elfutils/libelf/common.h
-@@ -159,7 +159,7 @@ libelf_release_all (Elf *elf)
+@@ -160,7 +160,7 @@ libelf_release_all (Elf *elf)
    (Var) = (sizeof (Var) == 1						      \
  	   ? (unsigned char) (Var)					      \
  	   : (sizeof (Var) == 2						      \
@@ -686,7 +684,7 @@
  	      : (sizeof (Var) == 4					      \
  		 ? bswap_32 (Var)					      \
  		 : bswap_64 (Var))))
-@@ -168,7 +168,7 @@ libelf_release_all (Elf *elf)
+@@ -169,7 +169,7 @@ libelf_release_all (Elf *elf)
    (Dst) = (sizeof (Var) == 1						      \
  	   ? (unsigned char) (Var)					      \
  	   : (sizeof (Var) == 2						      \
@@ -705,30 +703,18 @@
  if MUDFLAP
  AM_CFLAGS = -fmudflap
  else
-@@ -33,7 +34,10 @@ endif
+@@ -33,7 +34,7 @@ endif
  if BUILD_STATIC
  AM_CFLAGS += -fpic
  endif
 -AM_CFLAGS += -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 -std=gnu99 \
-+if BUILD_STATIC
-+AM_CFLAGS += -fpic
-+endif
 +AM_CFLAGS += -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \
  	     $($(*F)_CFLAGS)
  INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I..
  GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include)
 --- elfutils/libelf/Makefile.in
 +++ elfutils/libelf/Makefile.in
-@@ -34,7 +34,7 @@ PRE_UNINSTALL = :
- POST_UNINSTALL = :
- build_triplet = @build@
- host_triplet = @host@
-- at BUILD_STATIC_TRUE@am__append_1 = -fpic
-+ at BUILD_STATIC_TRUE@am__append_1 = -fpic -fpic
- @MUDFLAP_FALSE at noinst_PROGRAMS = $(am__EXEEXT_1)
- @MUDFLAP_TRUE at am_libelf_pic_a_OBJECTS =
- subdir = libelf
-@@ -170,6 +170,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -171,6 +171,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
  INSTALL_SCRIPT = @INSTALL_SCRIPT@
  INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  LDFLAGS = @LDFLAGS@
@@ -736,7 +722,7 @@
  LEX = @LEX@
  LEXLIB = @LEXLIB@
  LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-@@ -199,6 +200,7 @@ SHELL = @SHELL@
+@@ -200,6 +201,7 @@ SHELL = @SHELL@
  STRIP = @STRIP@
  USE_NLS = @USE_NLS@
  VERSION = 1
@@ -744,7 +730,7 @@
  XGETTEXT = @XGETTEXT@
  XGETTEXT_015 = @XGETTEXT_015@
  YACC = @YACC@
-@@ -254,10 +256,10 @@ target_alias = @target_alias@
+@@ -255,10 +257,10 @@ target_alias = @target_alias@
  top_builddir = @top_builddir@
  top_srcdir = @top_srcdir@
  @MUDFLAP_FALSE at AM_CFLAGS = $(am__append_1) -Wall -Wshadow -Werror \
@@ -795,7 +781,7 @@
  YACC = @YACC@
 --- elfutils/src/ChangeLog
 +++ elfutils/src/ChangeLog
-@@ -34,6 +34,11 @@
+@@ -61,6 +61,11 @@
  	that matches its PT_LOAD's p_flags &~ PF_W.  On sparc, PF_X really
  	is valid in RELRO.
  
@@ -807,7 +793,7 @@
  2008-02-29  Roland McGrath  <roland at redhat.com>
  
  	* readelf.c (print_attributes): Add a cast.
-@@ -285,6 +290,8 @@
+@@ -312,6 +317,8 @@
  
  	* readelf.c (hex_dump): Fix rounding error in whitespace calculation.
  
@@ -816,7 +802,7 @@
  2007-10-15  Roland McGrath  <roland at redhat.com>
  
  	* make-debug-archive.in: New file.
-@@ -724,6 +731,10 @@
+@@ -751,6 +758,10 @@
  	* elflint.c (valid_e_machine): Add EM_ALPHA.
  	Reported by Christian Aichinger <Greek0 at gmx.net>.
  
@@ -827,7 +813,7 @@
  2006-08-08  Ulrich Drepper  <drepper at redhat.com>
  
  	* elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
-@@ -800,6 +811,10 @@
+@@ -827,6 +838,10 @@
  	* Makefile.am: Add hacks to create dependency files for non-generic
  	linker.
  
@@ -838,7 +824,7 @@
  2006-06-12  Ulrich Drepper  <drepper at redhat.com>
  
  	* ldgeneric.c (ld_generic_generate_sections): Don't create .interp
-@@ -1148,6 +1163,11 @@
+@@ -1175,6 +1190,11 @@
  	* readelf.c (print_debug_loc_section): Fix indentation for larger
  	address size.
  
@@ -940,7 +926,7 @@
  size_LDADD = $(libelf) $(libeu) $(libmudflap)
 --- elfutils/src/readelf.c
 +++ elfutils/src/readelf.c
-@@ -6340,7 +6340,7 @@ dump_archive_index (Elf *elf, const char
+@@ -6419,7 +6419,7 @@ dump_archive_index (Elf *elf, const char
  	  if (unlikely (elf_rand (elf, as_off) == 0)
  	      || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
  			   == NULL))
@@ -1030,7 +1016,7 @@
  cannot set access and modification date of '%s'"), fname);
 --- elfutils/tests/ChangeLog
 +++ elfutils/tests/ChangeLog
-@@ -45,6 +45,8 @@
+@@ -51,6 +51,8 @@
  
  2008-01-21  Roland McGrath  <roland at redhat.com>
  
@@ -1039,7 +1025,7 @@
  	* testfile45.S.bz2: Add tests for cltq, cqto.
  	* testfile45.expect.bz2: Adjust.
  
-@@ -753,6 +755,11 @@
+@@ -759,6 +761,11 @@
  	* Makefile.am (TESTS): Add run-elflint-test.sh.
  	(EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
  

elfutils-robustify.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.11 -r 1.12 elfutils-robustify.patch
Index: elfutils-robustify.patch
===================================================================
RCS file: /cvs/pkgs/rpms/elfutils/devel/elfutils-robustify.patch,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- elfutils-robustify.patch	13 May 2008 00:44:12 -0000	1.11
+++ elfutils-robustify.patch	27 Aug 2008 08:19:15 -0000	1.12
@@ -65,1502 +65,1480 @@
 	(check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic,
 	check_symtab_shndx, check_hash, check_versym): Robustify.
 
---- elfutils-0.135/src/elflint.c.robustify
-+++ elfutils-0.135/src/elflint.c
-@@ -131,6 +131,9 @@ static uint32_t shstrndx;
- /* Array to count references in section groups.  */
- static int *scnref;
+--- elfutils-0.136/libelf/elf32_getphdr.c.robustify
++++ elfutils-0.136/libelf/elf32_getphdr.c
+@@ -105,6 +105,16 @@ __elfw2(LIBELFBITS,getphdr_wrlock) (elf)
  
-+/* Number of sections.  */
-+static unsigned int shnum;
+       if (elf->map_address != NULL)
+ 	{
++	  /* First see whether the information in the ELF header is
++	     valid and it does not ask for too much.  */
++	  if (unlikely (ehdr->e_phoff >= elf->maximum_size)
++	      || unlikely (ehdr->e_phoff + size > elf->maximum_size))
++	    {
++	      /* Something is wrong.  */
++	      __libelf_seterrno (ELF_E_INVALID_PHDR);
++	      goto out;
++	    }
 +
- 
- int
- main (int argc, char *argv[])
-@@ -320,10 +323,19 @@ section_name (Ebl *ebl, int idx)
- {
-   GElf_Shdr shdr_mem;
-   GElf_Shdr *shdr;
-+  const char *ret;
+ 	  /* All the data is already mapped.  Use it.  */
+ 	  void *file_phdr = ((char *) elf->map_address
+ 			     + elf->start_offset + ehdr->e_phoff);
+--- elfutils-0.136/libelf/elf32_getshdr.c.robustify
++++ elfutils-0.136/libelf/elf32_getshdr.c
+@@ -1,5 +1,5 @@
+ /* Return section header.
+-   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2007 Red Hat, Inc.
++   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2007, 2008 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper at redhat.com>, 1998.
+ 
+@@ -81,7 +81,8 @@ load_shdr_rwlock (Elf_Scn *scn)
+     goto out;
+ 
+   size_t shnum;
+-  if (__elf_getshnum_rdlock (elf, &shnum) != 0)
++  if (__elf_getshnum_rdlock (elf, &shnum) != 0
++      || shnum > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Shdr)))
+     goto out;
+   size_t size = shnum * sizeof (ElfW2(LIBELFBITS,Shdr));
+ 
+@@ -98,6 +99,16 @@ load_shdr_rwlock (Elf_Scn *scn)
+ 
+   if (elf->map_address != NULL)
+     {
++      /* First see whether the information in the ELF header is
++	 valid and it does not ask for too much.  */
++      if (unlikely (ehdr->e_shoff >= elf->maximum_size)
++	  || unlikely (ehdr->e_shoff + size > elf->maximum_size))
++	{
++	  /* Something is wrong.  */
++	  __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
++	  goto free_and_out;
++	}
 +
-+  if ((unsigned int) idx > shnum)
-+    return "<invalid>";
- 
-   shdr = gelf_getshdr (elf_getscn (ebl->elf, idx), &shdr_mem);
-+  if (shdr == NULL)
-+    return "<invalid>";
- 
--  return elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
-+  ret = elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
-+  if (ret == NULL)
-+    return "<invalid>";
-+  return ret;
- }
- 
- 
-@@ -345,10 +357,6 @@ static const int valid_e_machine[] =
-   (sizeof (valid_e_machine) / sizeof (valid_e_machine[0]))
+       ElfW2(LIBELFBITS,Shdr) *notcvt;
  
+       /* All the data is already mapped.  If we could use it
+--- elfutils-0.136/libelf/elf32_newphdr.c.robustify
++++ elfutils-0.136/libelf/elf32_newphdr.c
+@@ -124,6 +124,12 @@ elfw2(LIBELFBITS,newphdr) (elf, count)
+   else if (elf->state.ELFW(elf,LIBELFBITS).ehdr->e_phnum != count
+ 	   || elf->state.ELFW(elf,LIBELFBITS).phdr == NULL)
+     {
++      if (unlikely (count > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Phdr))))
++	{
++	  result = NULL;
++	  goto out;
++	}
++
+       /* Allocate a new program header with the appropriate number of
+ 	 elements.  */
+       result = (ElfW2(LIBELFBITS,Phdr) *)
+--- elfutils-0.136/libelf/elf32_updatefile.c.robustify
++++ elfutils-0.136/libelf/elf32_updatefile.c
+@@ -212,6 +212,9 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf
+   /* Write all the sections.  Well, only those which are modified.  */
+   if (shnum > 0)
+     {
++      if (unlikely (shnum > SIZE_MAX / sizeof (Elf_Scn *)))
++ 	return 1;
++
+       Elf_ScnList *list = &elf->state.ELFW(elf,LIBELFBITS).scns;
+       Elf_Scn **scns = (Elf_Scn **) alloca (shnum * sizeof (Elf_Scn *));
+       char *const shdr_start = ((char *) elf->map_address + elf->start_offset
+@@ -582,6 +585,10 @@ __elfw2(LIBELFBITS,updatefile) (Elf *elf
+   /* Write all the sections.  Well, only those which are modified.  */
+   if (shnum > 0)
+     {
++      if (unlikely (shnum > SIZE_MAX / (sizeof (Elf_Scn *)
++					+ sizeof (ElfW2(LIBELFBITS,Shdr)))))
++	return 1;
++
+       off_t shdr_offset = elf->start_offset + ehdr->e_shoff;
+ #if EV_NUM != 2
+       xfct_t shdr_fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR];
+--- elfutils-0.136/libelf/elf_begin.c.robustify
++++ elfutils-0.136/libelf/elf_begin.c
+@@ -155,7 +155,8 @@ get_shnum (void *map_address, unsigned c
  
--/* Number of sections.  */
--static unsigned int shnum;
--
--
- static void
- check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size)
- {
-@@ -613,7 +621,8 @@ section [%2d] '%s': symbol table cannot 
- 	  }
-       }
+       if (unlikely (result == 0) && ehdr.e32->e_shoff != 0)
+ 	{
+-	  if (ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize)
++	  if (unlikely (ehdr.e32->e_shoff >= maxsize)
++	      || unlikely (ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize))
+ 	    /* Cannot read the first section header.  */
+ 	    return 0;
  
--  if (shdr->sh_entsize != gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT))
-+  size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT);
-+  if (shdr->sh_entsize != sh_entsize)
-     ERROR (gettext ("\
- section [%2u] '%s': entry size is does not match ElfXX_Sym\n"),
- 	   idx, section_name (ebl, idx));
-@@ -651,7 +660,7 @@ section [%2d] '%s': XINDEX for zeroth en
- 	       xndxscnidx, section_name (ebl, xndxscnidx));
-     }
+@@ -203,7 +204,8 @@ get_shnum (void *map_address, unsigned c
  
--  for (size_t cnt = 1; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
-+  for (size_t cnt = 1; cnt < shdr->sh_size / sh_entsize; ++cnt)
-     {
-       sym = gelf_getsymshndx (data, xndxdata, cnt, &sym_mem, &xndx);
-       if (sym == NULL)
-@@ -671,7 +680,8 @@ section [%2d] '%s': symbol %zu: invalid 
-       else
+       if (unlikely (result == 0) && ehdr.e64->e_shoff != 0)
  	{
- 	  name = elf_strptr (ebl->elf, shdr->sh_link, sym->st_name);
--	  assert (name != NULL);
-+	  assert (name != NULL
-+		  || strshdr->sh_type != SHT_STRTAB);
- 	}
+-	  if (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize)
++	  if (unlikely (ehdr.e64->e_shoff >= maxsize)
++	      || unlikely (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize))
+ 	    /* Cannot read the first section header.  */
+ 	    return 0;
  
-       if (sym->st_shndx == SHN_XINDEX)
-@@ -1001,9 +1011,11 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
-     {
-       GElf_Shdr rcshdr_mem;
-       const GElf_Shdr *rcshdr = gelf_getshdr (scn, &rcshdr_mem);
--      assert (rcshdr != NULL);
+@@ -275,6 +277,15 @@ file_read_elf (int fildes, void *map_add
+     /* Could not determine the number of sections.  */
+     return NULL;
  
[...2473 lines suppressed...]
  
- 	  for (size_t cnt = 0; cnt < scncnt; ++cnt)
- 	    {
-@@ -396,13 +425,26 @@ file_read_elf (int fildes, void *map_add
- 	{
- 	  /* We can use the mmapped memory.  */
- 	  elf->state.elf64.ehdr = ehdr;
-+
-+	  if (unlikely (ehdr->e_shoff >= maxsize)
-+	      || unlikely (ehdr->e_shoff
-+			   + scncnt * sizeof (Elf32_Shdr) > maxsize))
-+	    goto free_and_out;
- 	  elf->state.elf64.shdr
- 	    = (Elf64_Shdr *) ((char *) ehdr + ehdr->e_shoff);
-+
- 	  if (ehdr->e_phnum > 0)
-+	    {
- 	    /* Assign a value only if there really is a program
- 	       header.  Otherwise the value remains NULL.  */
-+	      if (unlikely (ehdr->e_phoff >= maxsize)
-+		  || unlikely (ehdr->e_phoff
-+			       + ehdr->e_phnum
-+			       * sizeof (Elf32_Phdr) > maxsize))
-+		goto free_and_out;
- 	    elf->state.elf64.phdr
- 	      = (Elf64_Phdr *) ((char *) ehdr + ehdr->e_phoff);
-+	    }
+ 			sec = shdr_info[xshndx].idx;
+ 		      }
+@@ -1226,7 +1250,7 @@ handle_elf (int fd, Elf *elf, const char
+ 			    nxshndx = sec;
+ 			  }
  
- 	  for (size_t cnt = 0; cnt < scncnt; ++cnt)
- 	    {
-diff -up elfutils-0.135/libelf/gelf_update_rel.c.robustify elfutils-0.135/libelf/gelf_update_rel.c
---- elfutils-0.135/libelf/gelf_update_rel.c.robustify
-+++ elfutils-0.135/libelf/gelf_update_rel.c
-@@ -68,12 +68,6 @@ gelf_update_rel (Elf_Data *dst, int ndx,
-   if (dst == NULL)
-     return 0;
+-			assert (sec < SHN_LORESERVE || shndxdata != NULL);
++			elf_assert (sec < SHN_LORESERVE || shndxdata != NULL);
  
--  if (unlikely (ndx < 0))
--    {
--      __libelf_seterrno (ELF_E_INVALID_INDEX);
--      return 0;
--    }
--
-   if (unlikely (data_scn->d.d_type != ELF_T_REL))
-     {
-       /* The type of the data better should match.  */
-@@ -99,7 +93,8 @@ gelf_update_rel (Elf_Data *dst, int ndx,
- 	}
+ 			if ((inner != destidx || nshndx != sym->st_shndx
+ 			     || (shndxdata != NULL && nxshndx != xshndx))
+@@ -1250,7 +1274,7 @@ handle_elf (int fd, Elf *elf, const char
+ 			     || shdr_info[cnt].debug_data == NULL)
+ 		      /* This is a section symbol for a section which has
+ 			 been removed.  */
+-		      assert (GELF_ST_TYPE (sym->st_info) == STT_SECTION);
++		      elf_assert (GELF_ST_TYPE (sym->st_info) == STT_SECTION);
+ 		  }
  
-       /* Check whether we have to resize the data buffer.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Rel)
-+	  || unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-@@ -114,7 +109,8 @@ gelf_update_rel (Elf_Data *dst, int ndx,
-   else
-     {
-       /* Check whether we have to resize the data buffer.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf64_Rel)
-+	  || unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-diff -up elfutils-0.135/libelf/gelf_update_move.c.robustify elfutils-0.135/libelf/gelf_update_move.c
---- elfutils-0.135/libelf/gelf_update_move.c.robustify
-+++ elfutils-0.135/libelf/gelf_update_move.c
-@@ -75,7 +75,7 @@ gelf_update_move (data, ndx, src)
-   assert (sizeof (GElf_Move) == sizeof (Elf64_Move));
+ 		if (destidx != inner)
+@@ -1437,11 +1461,11 @@ handle_elf (int fd, Elf *elf, const char
+ 		  {
+ 		    GElf_Sym sym_mem;
+ 		    GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem);
+-		    assert (sym != NULL);
++		    elf_assert (sym != NULL);
  
-   /* Check whether we have to resize the data buffer.  */
--  if (unlikely (ndx < 0)
-+  if (INVALID_NDX (ndx, GElf_Move)
-       || unlikely ((ndx + 1) * sizeof (GElf_Move) > data_scn->d.d_size))
-     {
-       __libelf_seterrno (ELF_E_INVALID_INDEX);
-diff -up elfutils-0.135/libelf/gelf_update_dyn.c.robustify elfutils-0.135/libelf/gelf_update_dyn.c
---- elfutils-0.135/libelf/gelf_update_dyn.c.robustify
-+++ elfutils-0.135/libelf/gelf_update_dyn.c
-@@ -71,12 +71,6 @@ gelf_update_dyn (data, ndx, src)
-   if (data == NULL)
-     return 0;
+ 		    const char *name = elf_strptr (elf, strshndx,
+ 						   sym->st_name);
+-		    assert (name != NULL);
++		    elf_assert (name != NULL);
+ 		    size_t hidx = elf_hash (name) % nbucket;
  
--  if (unlikely (ndx < 0))
--    {
--      __libelf_seterrno (ELF_E_INVALID_INDEX);
--      return 0;
--    }
--
-   if (unlikely (data_scn->d.d_type != ELF_T_DYN))
-     {
-       /* The type of the data better should match.  */
-@@ -102,7 +96,8 @@ gelf_update_dyn (data, ndx, src)
- 	}
+ 		    if (bucket[hidx] == 0)
+@@ -1460,7 +1484,7 @@ handle_elf (int fd, Elf *elf, const char
+ 	    else
+ 	      {
+ 		/* Alpha and S390 64-bit use 64-bit SHT_HASH entries.  */
+-		assert (shdr_info[cnt].shdr.sh_entsize
++		elf_assert (shdr_info[cnt].shdr.sh_entsize
+ 			== sizeof (Elf64_Xword));
  
-       /* Check whether we have to resize the data buffer.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Dyn)
-+	  || unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-@@ -116,7 +111,8 @@ gelf_update_dyn (data, ndx, src)
-   else
-     {
-       /* Check whether we have to resize the data buffer.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf64_Dyn)
-+	  || unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  goto out;
-diff -up elfutils-0.135/libelf/gelf_getrela.c.robustify elfutils-0.135/libelf/gelf_getrela.c
---- elfutils-0.135/libelf/gelf_getrela.c.robustify
-+++ elfutils-0.135/libelf/gelf_getrela.c
-@@ -71,12 +71,6 @@ gelf_getrela (data, ndx, dst)
-   if (data_scn == NULL)
-     return NULL;
+ 		Elf64_Xword *bucket = (Elf64_Xword *) hashd->d_buf;
+@@ -1491,11 +1515,11 @@ handle_elf (int fd, Elf *elf, const char
+ 		  {
+ 		    GElf_Sym sym_mem;
+ 		    GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem);
+-		    assert (sym != NULL);
++		    elf_assert (sym != NULL);
  
--  if (unlikely (ndx < 0))
--    {
--      __libelf_seterrno (ELF_E_INVALID_INDEX);
--      return NULL;
--    }
--
-   if (unlikely (data_scn->d.d_type != ELF_T_RELA))
-     {
-       __libelf_seterrno (ELF_E_INVALID_HANDLE);
-@@ -93,7 +87,8 @@ gelf_getrela (data, ndx, dst)
-   if (scn->elf->class == ELFCLASS32)
-     {
-       /* We have to convert the data.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf32_Rela)
-+	  || unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  result = NULL;
-@@ -114,7 +109,8 @@ gelf_getrela (data, ndx, dst)
-     {
-       /* Simply copy the data after we made sure we are actually getting
- 	 correct data.  */
--      if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
-+      if (INVALID_NDX (ndx, Elf64_Rela)
-+	  || unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
- 	{
- 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
- 	  result = NULL;
+ 		    const char *name = elf_strptr (elf, strshndx,
+ 						   sym->st_name);
+-		    assert (name != NULL);
++		    elf_assert (name != NULL);
+ 		    size_t hidx = elf_hash (name) % nbucket;
+ 
+ 		    if (bucket[hidx] == 0)


Index: elfutils.spec
===================================================================
RCS file: /cvs/pkgs/rpms/elfutils/devel/elfutils.spec,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -r1.106 -r1.107
--- elfutils.spec	7 Jul 2008 17:16:37 -0000	1.106
+++ elfutils.spec	27 Aug 2008 08:19:16 -0000	1.107
@@ -1,5 +1,5 @@
-%define eu_version 0.135
-%define eu_release 2
+%define eu_version 0.137
+%define eu_release 1
 
 %if %{?_with_compat:1}%{!?_with_compat:0}
 %define compat 1
@@ -262,6 +262,11 @@
 %{_libdir}/libelf.a
 
 %changelog
+* Wed Aug 27 2008 Roland McGrath <roland at redhat.com> - 0.137-1
+- Update to 0.137
+  - libdwfl: bug fixes; new segment interfaces;
+             all the libdwfl-based tools now support --core=COREFILE option
+
 * Mon Jul  7 2008 Tom "spot" Callaway <tcallawa at redhat.com> - 0.135-2
 - fix conditional comparison
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/elfutils/devel/sources,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- sources	13 May 2008 00:35:53 -0000	1.47
+++ sources	27 Aug 2008 08:19:16 -0000	1.48
@@ -1 +1 @@
-2fb0d3d9cdb22f71ad0df91d676bb2eb  elfutils-0.135.tar.gz
+a24690a64268516bd413c4c3fe6c6dd4  elfutils-0.137.tar.gz




More information about the fedora-extras-commits mailing list