forked from rpms/elfutils
		
	Update to 0.156.
- #890447 - Add __bss_start and __TMC_END__ to elflint. - #909481 - Only try opening files with installed compression libraries. - #914908 - Add __bss_start__ to elflint. - #853757 - Updated Polish translation. - #985438 - Incorrect prototype of __libdwfl_find_elf_build_id. - Drop upstreamed elfutils-0.155-binutils-pr-ld-13621.patch. - Drop upstreamed elfutils-0.155-mem-align.patch. - Drop upstreamed elfutils-0.155-sizeof-pointer-memaccess.patch.
This commit is contained in:
		
							parent
							
								
									e15f354dc7
								
							
						
					
					
						commit
						20454159c6
					
				
							
								
								
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -1,3 +1 @@ | ||||
| /elfutils-0.154.tar.bz2 | ||||
| /elfutils-*/ | ||||
| /elfutils-0.155.tar.bz2 | ||||
| /elfutils-0.156.tar.bz2 | ||||
|  | ||||
| @ -1,97 +0,0 @@ | ||||
| commit 3bdc16ce98295463c071192eab2ec611a8edc508 | ||||
| Author: Mark Wielaard <mjw@redhat.com> | ||||
| Date:   Wed Feb 6 16:20:17 2013 +0100 | ||||
| 
 | ||||
|     elflint: Add two more symbols to gnuld list of allowed bad values. | ||||
|      | ||||
|     Add __bss_start and __TMC_END__ to the list of symbols allowed to have | ||||
|     out of section values because of the following GNU ld bug: | ||||
|     http://sourceware.org/bugzilla/show_bug.cgi?id=13621. | ||||
|     Allow them to appear in either .symtab or .dynsym, but only when they | ||||
|     are zero sized. It is impossible to define a general rule for this bug, | ||||
|     but this should catch most common issues that are mostly harmless | ||||
|     because the symbols signify the removed section was empty to being with. | ||||
|     This catches at least all symbols often flagged in the tests. | ||||
|      | ||||
|     Signed-off-by: Mark Wielaard <mjw@redhat.com> | ||||
| 
 | ||||
| diff --git a/src/ChangeLog b/src/ChangeLog
 | ||||
| index f3f9b51..7d7b66f 100644
 | ||||
| --- a/src/ChangeLog
 | ||||
| +++ b/src/ChangeLog
 | ||||
| @@ -1,3 +1,10 @@
 | ||||
| +2013-02-06  Mark Wielaard  <mjw@redhat.com>
 | ||||
| +
 | ||||
| +	* elflint.c (check_symtab): Add __bss_start and __TMC_END__ to the
 | ||||
| +	list of symbols allowed to have out of section values because of
 | ||||
| +	GNU ld bugs in either .symtab or .dynsym, but only when they are
 | ||||
| +	zero sized.
 | ||||
| +
 | ||||
|  2012-08-27  Mark Wielaard  <mjw@redhat.com> | ||||
|   | ||||
|  	* readelf.c (print_debug_macro_section): Print offset as PRIx64. | ||||
| diff --git a/src/elflint.c b/src/elflint.c
 | ||||
| index 4084987..bc5ed33 100644
 | ||||
| --- a/src/elflint.c
 | ||||
| +++ b/src/elflint.c
 | ||||
| @@ -767,15 +767,22 @@ section [%2d] '%s': symbol %zu: function in COMMON section is nonsense\n"),
 | ||||
|  			{ | ||||
|  			  /* GNU ld has severe bugs.  When it decides to remove | ||||
|  			     empty sections it leaves symbols referencing them | ||||
| -			     behind.  These are symbols in .symtab.  */
 | ||||
| +			     behind.  These are symbols in .symtab or .dynsym
 | ||||
| +			     and for the named symbols have zero size.  See
 | ||||
| +			     sourceware PR13621.  */
 | ||||
|  			  if (!gnuld | ||||
| -			      || strcmp (section_name (ebl, idx), ".symtab")
 | ||||
| +			      || (strcmp (section_name (ebl, idx), ".symtab")
 | ||||
| +			          && strcmp (section_name (ebl, idx),
 | ||||
| +					     ".dynsym"))
 | ||||
| +			      || sym->st_size != 0
 | ||||
|  			      || (strcmp (name, "__preinit_array_start") != 0 | ||||
|  				  && strcmp (name, "__preinit_array_end") != 0 | ||||
|  				  && strcmp (name, "__init_array_start") != 0 | ||||
|  				  && strcmp (name, "__init_array_end") != 0 | ||||
|  				  && strcmp (name, "__fini_array_start") != 0 | ||||
| -				  && strcmp (name, "__fini_array_end") != 0))
 | ||||
| +				  && strcmp (name, "__fini_array_end") != 0
 | ||||
| +				  && strcmp (name, "__bss_start") != 0
 | ||||
| +				  && strcmp (name, "__TMC_END__") != 0))
 | ||||
|  			    ERROR (gettext ("\ | ||||
|  section [%2d] '%s': symbol %zu: st_value out of bounds\n"), | ||||
|  				   idx, section_name (ebl, idx), cnt); | ||||
| commit b94cceae503b56fb360cd597f154fa2b33552887 | ||||
| Author: Mark Wielaard <mjw@redhat.com> | ||||
| Date:   Sun Feb 24 22:58:49 2013 +0100 | ||||
| 
 | ||||
|     elflint.c (check_symtab): Add __bss_start__ to the list of allowed symbols. | ||||
|      | ||||
|     Some architectures (ARM) use __bss_start__ instead of __bss_start. | ||||
|      | ||||
|     Signed-off-by: Mark Wielaard <mjw@redhat.com> | ||||
| 
 | ||||
| diff --git a/src/ChangeLog b/src/ChangeLog
 | ||||
| index 7d7b66f..6e219e6 100644
 | ||||
| --- a/src/ChangeLog
 | ||||
| +++ b/src/ChangeLog
 | ||||
| @@ -1,3 +1,8 @@
 | ||||
| +2013-02-24  Mark Wielaard  <mjw@redhat.com>
 | ||||
| +
 | ||||
| +	* elflint.c (check_symtab): Add __bss_start__ to the list of symbols
 | ||||
| +	allowed to have out of section values because of GNU ld bugs.
 | ||||
| +
 | ||||
|  2013-02-06  Mark Wielaard  <mjw@redhat.com> | ||||
|   | ||||
|  	* elflint.c (check_symtab): Add __bss_start and __TMC_END__ to the | ||||
| diff --git a/src/elflint.c b/src/elflint.c
 | ||||
| index bc5ed33..acd458b 100644
 | ||||
| --- a/src/elflint.c
 | ||||
| +++ b/src/elflint.c
 | ||||
| @@ -782,6 +782,7 @@ section [%2d] '%s': symbol %zu: function in COMMON section is nonsense\n"),
 | ||||
|  				  && strcmp (name, "__fini_array_start") != 0 | ||||
|  				  && strcmp (name, "__fini_array_end") != 0 | ||||
|  				  && strcmp (name, "__bss_start") != 0 | ||||
| +				  && strcmp (name, "__bss_start__") != 0
 | ||||
|  				  && strcmp (name, "__TMC_END__") != 0)) | ||||
|  			    ERROR (gettext ("\ | ||||
|  section [%2d] '%s': symbol %zu: st_value out of bounds\n"), | ||||
| @ -1,194 +0,0 @@ | ||||
| --- a/libdw/ChangeLog	2012-08-27 20:29:31.000000000 +0200
 | ||||
| +++ b/libdw/ChangeLog	2013-01-10 10:59:28.039026230 +0100
 | ||||
| @@ -1,3 +1,9 @@
 | ||||
| +2013-01-07  Roland McGrath  <roland@hack.frob.com>
 | ||||
| +
 | ||||
| +	* memory-access.h
 | ||||
| +	[ALLOW_UNALIGNED] (read_8ubyte_unaligned_noncvt): New macro.
 | ||||
| +	[!ALLOW_UNALIGNED] (read_8ubyte_unaligned_noncvt): New inline function.
 | ||||
| +
 | ||||
|  2012-08-24  Mark Wielaard  <mjw@redhat.com> | ||||
|   | ||||
|  	* dwarf_begin_elf.c (check_section): Only probe for dwz multi files | ||||
| --- a/libdw/memory-access.h	2012-08-27 20:27:31.000000000 +0200
 | ||||
| +++ b/libdw/memory-access.h	2013-01-10 10:56:07.171152555 +0100
 | ||||
| @@ -1,5 +1,5 @@
 | ||||
|  /* Unaligned memory access functionality. | ||||
| -   Copyright (C) 2000-2010 Red Hat, Inc.
 | ||||
| +   Copyright (C) 2000-2013 Red Hat, Inc.
 | ||||
|     This file is part of elfutils. | ||||
|     Written by Ulrich Drepper <drepper@redhat.com>, 2001. | ||||
|   | ||||
| @@ -147,6 +147,8 @@
 | ||||
|     ? (int32_t) bswap_32 (*((const int32_t *) (Addr)))			      \ | ||||
|     : *((const int32_t *) (Addr))) | ||||
|   | ||||
| +# define read_8ubyte_unaligned_noncvt(Addr) \
 | ||||
| +   *((const uint64_t *) (Addr))
 | ||||
|  # define read_8ubyte_unaligned(Dbg, Addr) \ | ||||
|    (unlikely ((Dbg)->other_byte_order)					      \ | ||||
|     ? bswap_64 (*((const uint64_t *) (Addr)))				      \ | ||||
| @@ -223,6 +225,12 @@
 | ||||
|  } | ||||
|   | ||||
|  static inline uint64_t | ||||
| +read_8ubyte_unaligned_noncvt (const void *p)
 | ||||
| +{
 | ||||
| +  const union unaligned *up = p;
 | ||||
| +  return up->u8;
 | ||||
| +}
 | ||||
| +static inline uint64_t
 | ||||
|  read_8ubyte_unaligned_1 (bool other_byte_order, const void *p) | ||||
|  { | ||||
|    const union unaligned *up = p; | ||||
| --- a/libdwfl/ChangeLog	2013-01-10 10:59:53.882008409 +0100
 | ||||
| +++ b/libdwfl/ChangeLog	2013-01-10 10:57:48.451130775 +0100
 | ||||
| @@ -1,3 +1,9 @@
 | ||||
| +2013-01-07  Roland McGrath  <roland@hack.frob.com>
 | ||||
| +
 | ||||
| +	* link_map.c (auxv_format_probe): Handle unaligned 64-bit data, but
 | ||||
| +	still assume the data is at least 32-bit aligned anyway.
 | ||||
| +	(dwfl_link_map_report): Handle unaligned auxv data.
 | ||||
| +
 | ||||
|  2012-08-01  Petr Machata  <pmachata@redhat.com> | ||||
|   | ||||
|  	* offline.c (process_archive_member): Ignore entry "/SYM64/". | ||||
| --- a/libdwfl/link_map.c	2012-08-27 20:27:31.000000000 +0200
 | ||||
| +++ b/libdwfl/link_map.c	2013-01-10 10:56:07.207002831 +0100
 | ||||
| @@ -1,5 +1,5 @@
 | ||||
|  /* Report modules by examining dynamic linker data structures. | ||||
| -   Copyright (C) 2008-2010 Red Hat, Inc.
 | ||||
| +   Copyright (C) 2008-2013 Red Hat, Inc.
 | ||||
|     This file is part of elfutils. | ||||
|   | ||||
|     This file is free software; you can redistribute it and/or modify | ||||
| @@ -28,6 +28,7 @@
 | ||||
|   | ||||
|  #include <config.h> | ||||
|  #include "libdwflP.h" | ||||
| +#include "../libdw/memory-access.h"
 | ||||
|   | ||||
|  #include <byteswap.h> | ||||
|  #include <endian.h> | ||||
| @@ -66,15 +67,22 @@
 | ||||
|   | ||||
|    inline bool check64 (size_t i) | ||||
|    { | ||||
| -    if (u->a64[i].a_type == BE64 (PROBE_TYPE)
 | ||||
| -	&& u->a64[i].a_un.a_val == BE64 (PROBE_VAL64))
 | ||||
| +    /* The AUXV pointer might not even be naturally aligned for 64-bit
 | ||||
| +       data, because note payloads in a core file are not aligned.
 | ||||
| +       But we assume the data is 32-bit aligned.  */
 | ||||
| +
 | ||||
| +    uint64_t type = read_8ubyte_unaligned_noncvt (&u->a64[i].a_type);
 | ||||
| +    uint64_t val = read_8ubyte_unaligned_noncvt (&u->a64[i].a_un.a_val);
 | ||||
| +
 | ||||
| +    if (type == BE64 (PROBE_TYPE)
 | ||||
| +	&& val == BE64 (PROBE_VAL64))
 | ||||
|        { | ||||
|  	*elfdata = ELFDATA2MSB; | ||||
|  	return true; | ||||
|        } | ||||
|   | ||||
| -    if (u->a64[i].a_type == LE64 (PROBE_TYPE)
 | ||||
| -	&& u->a64[i].a_un.a_val == LE64 (PROBE_VAL64))
 | ||||
| +    if (type == LE64 (PROBE_TYPE)
 | ||||
| +	&& val == LE64 (PROBE_VAL64))
 | ||||
|        { | ||||
|  	*elfdata = ELFDATA2LSB; | ||||
|  	return true; | ||||
| @@ -618,29 +626,32 @@
 | ||||
|        GElf_Xword phent = 0; | ||||
|        GElf_Xword phnum = 0; | ||||
|   | ||||
| -#define AUXV_SCAN(NN, BL) do					\
 | ||||
| -	{							\
 | ||||
| -	  const Elf##NN##_auxv_t *av = auxv;			\
 | ||||
| -	  for (size_t i = 0; i < auxv_size / sizeof av[0]; ++i)	\
 | ||||
| -	    {							\
 | ||||
| -	      Elf##NN##_Addr val = BL##NN (av[i].a_un.a_val);	\
 | ||||
| -	      if (av[i].a_type == BL##NN (AT_ENTRY))		\
 | ||||
| -		entry = val;					\
 | ||||
| -	      else if (av[i].a_type == BL##NN (AT_PHDR))	\
 | ||||
| -		phdr = val;					\
 | ||||
| -	      else if (av[i].a_type == BL##NN (AT_PHNUM))	\
 | ||||
| -		phnum = val;					\
 | ||||
| -	      else if (av[i].a_type == BL##NN (AT_PHENT))	\
 | ||||
| -		phent = val;					\
 | ||||
| -	      else if (av[i].a_type == BL##NN (AT_PAGESZ))	\
 | ||||
| -		{						\
 | ||||
| -		  if (val > 1					\
 | ||||
| -		      && (dwfl->segment_align == 0		\
 | ||||
| -			  || val < dwfl->segment_align))	\
 | ||||
| -		    dwfl->segment_align = val;			\
 | ||||
| -		}						\
 | ||||
| -	    }							\
 | ||||
| -	}							\
 | ||||
| +#define READ_AUXV32(ptr)	read_4ubyte_unaligned_noncvt (ptr)
 | ||||
| +#define READ_AUXV64(ptr)	read_8ubyte_unaligned_noncvt (ptr)
 | ||||
| +#define AUXV_SCAN(NN, BL) do                                            \
 | ||||
| +	{                                                               \
 | ||||
| +	  const Elf##NN##_auxv_t *av = auxv;                            \
 | ||||
| +	  for (size_t i = 0; i < auxv_size / sizeof av[0]; ++i)         \
 | ||||
| +	    {                                                           \
 | ||||
| +              uint##NN##_t type = READ_AUXV##NN (&av[i].a_type);        \
 | ||||
| +              uint##NN##_t val = BL##NN (READ_AUXV##NN (&av[i].a_un.a_val)); \
 | ||||
| +	      if (type == BL##NN (AT_ENTRY))                            \
 | ||||
| +		entry = val;                                            \
 | ||||
| +	      else if (type == BL##NN (AT_PHDR))                        \
 | ||||
| +		phdr = val;                                             \
 | ||||
| +	      else if (type == BL##NN (AT_PHNUM))                       \
 | ||||
| +		phnum = val;                                            \
 | ||||
| +	      else if (type == BL##NN (AT_PHENT))                       \
 | ||||
| +		phent = val;                                            \
 | ||||
| +	      else if (type == BL##NN (AT_PAGESZ))                      \
 | ||||
| +		{                                                       \
 | ||||
| +		  if (val > 1                                           \
 | ||||
| +		      && (dwfl->segment_align == 0                      \
 | ||||
| +			  || val < dwfl->segment_align))                \
 | ||||
| +		    dwfl->segment_align = val;                          \
 | ||||
| +		}                                                       \
 | ||||
| +	    }                                                           \
 | ||||
| +	}                                                               \
 | ||||
|        while (0) | ||||
|   | ||||
|        if (elfclass == ELFCLASS32) | ||||
| --- a/libelf/ChangeLog	2013-01-10 10:59:53.884010033 +0100
 | ||||
| +++ b/libelf/ChangeLog	2013-01-10 10:58:57.505003982 +0100
 | ||||
| @@ -1,3 +1,13 @@
 | ||||
| +2013-01-07  Roland McGrath  <roland@hack.frob.com>
 | ||||
| +
 | ||||
| +	* elf_getarsym.c (elf_getarsym): Copy FILE_DATA into stack space if it
 | ||||
| +	would be unaligned and !ALLOW_UNALIGNED.
 | ||||
| +
 | ||||
| +2013-01-07  Roland McGrath  <roland@hack.frob.com>
 | ||||
| +
 | ||||
| +	* elf_getarsym.c (read_number_entries): Use memcpy instead of pointer
 | ||||
| +	dereference so as not to assume the field is naturally aligned.
 | ||||
| +
 | ||||
|  2012-08-16  Roland McGrath  <roland@hack.frob.com> | ||||
|   | ||||
|  	* elf.h: Update from glibc. | ||||
| --- a/libelf/elf_getarsym.c	2013-01-10 10:59:53.888006636 +0100
 | ||||
| +++ b/libelf/elf_getarsym.c	2013-01-10 10:56:07.210254028 +0100
 | ||||
| @@ -57,7 +57,9 @@
 | ||||
|   | ||||
|    size_t w = index64_p ? 8 : 4; | ||||
|    if (elf->map_address != NULL) | ||||
| -    u = *(union u *) (elf->map_address + *offp);
 | ||||
| +    /* Use memcpy instead of pointer dereference so as not to assume the
 | ||||
| +       field is naturally aligned within the file.  */
 | ||||
| +    memcpy (&u, elf->map_address + *offp, sizeof u);
 | ||||
|    else if ((size_t) pread_retry (elf->fildes, &u, w, *offp) != w) | ||||
|      return -1; | ||||
|   | ||||
| @@ -241,6 +243,9 @@
 | ||||
|  	  else | ||||
|  	    { | ||||
|  	      file_data = (void *) (elf->map_address + off); | ||||
| +	      if (!ALLOW_UNALIGNED
 | ||||
| +		  && ((uintptr_t) file_data & -(uintptr_t) n) != 0)
 | ||||
| +		file_data = memcpy (alloca (sz), elf->map_address + off, sz);
 | ||||
|  	      str_data = (char *) (elf->map_address + off + sz); | ||||
|  	    } | ||||
|   | ||||
| @ -1,68 +0,0 @@ | ||||
| commit 1a4d0668d18bf1090c5c08cdb5cb3ba2b8eb5410 | ||||
| Author: David Abdurachmanov <David.Abdurachmanov@cern.ch> | ||||
| Date:   Sun Jan 13 16:44:21 2013 +0100 | ||||
| 
 | ||||
|     ar.c (do_oper_delete): Fix num passed to memset. | ||||
|      | ||||
|     Signed-off-by: David Abdurachmanov <David.Abdurachmanov@cern.ch> | ||||
| 
 | ||||
| diff --git a/src/ar.c b/src/ar.c
 | ||||
| index 03da1b7..2d6ad60 100644
 | ||||
| --- a/src/ar.c
 | ||||
| +++ b/src/ar.c
 | ||||
| @@ -919,7 +919,7 @@ do_oper_delete (const char *arfname, char **argv, int argc,
 | ||||
|  		long int instance) | ||||
|  { | ||||
|    bool *found = alloca (sizeof (bool) * argc); | ||||
| -  memset (found, '\0', sizeof (found));
 | ||||
| +  memset (found, '\0', sizeof (bool) * argc);
 | ||||
|   | ||||
|    /* List of the files we keep.  */ | ||||
|    struct armem *to_copy = NULL; | ||||
| 
 | ||||
| commit 57bd66cabf6e6b9ecf622cdbf350804897a8df58 | ||||
| Author: Roland McGrath <roland@hack.frob.com> | ||||
| Date:   Tue Dec 11 09:42:07 2012 -0800 | ||||
| 
 | ||||
|     nm: Fix size passed to snprintf for invalid sh_name case. | ||||
|      | ||||
|     Signed-off-by: Roland McGrath <roland@hack.frob.com> | ||||
| 
 | ||||
| diff --git a/src/nm.c b/src/nm.c
 | ||||
| index f50da0b..8a1c57a 100644
 | ||||
| --- a/src/nm.c
 | ||||
| +++ b/src/nm.c
 | ||||
| @@ -769,8 +769,9 @@ show_symbols_sysv (Ebl *ebl, GElf_Word strndx, const char *fullname,
 | ||||
|  			       gelf_getshdr (scn, &shdr_mem)->sh_name); | ||||
|        if (unlikely (name == NULL)) | ||||
|  	{ | ||||
| -	  name = alloca (sizeof "[invalid sh_name 0x12345678]");
 | ||||
| -	  snprintf (name, sizeof name, "[invalid sh_name %#" PRIx32 "]",
 | ||||
| +          const size_t bufsz = sizeof "[invalid sh_name 0x12345678]"
 | ||||
| +	  name = alloca (bufsz);
 | ||||
| +	  snprintf (name, bufsz, "[invalid sh_name %#" PRIx32 "]",
 | ||||
|  		    gelf_getshdr (scn, &shdr_mem)->sh_name); | ||||
|  	} | ||||
|        scnnames[elf_ndxscn (scn)] = name; | ||||
| 
 | ||||
| commit 7df3d2cd70932cd70515dbeb75e4db66fd27f192 | ||||
| Author: Mark Wielaard <mjw@redhat.com> | ||||
| Date:   Tue Dec 11 22:27:05 2012 +0100 | ||||
| 
 | ||||
|     Add missing semicolon in show_symbols_sysv | ||||
|      | ||||
|     Signed-off-by: Mark Wielaard <mjw@redhat.com> | ||||
| 
 | ||||
| diff --git a/src/nm.c b/src/nm.c
 | ||||
| index 8a1c57a..7aae84b 100644
 | ||||
| --- a/src/nm.c
 | ||||
| +++ b/src/nm.c
 | ||||
| @@ -769,7 +769,7 @@ show_symbols_sysv (Ebl *ebl, GElf_Word strndx, const char *fullname,
 | ||||
|  			       gelf_getshdr (scn, &shdr_mem)->sh_name); | ||||
|        if (unlikely (name == NULL)) | ||||
|  	{ | ||||
| -          const size_t bufsz = sizeof "[invalid sh_name 0x12345678]"
 | ||||
| +	  const size_t bufsz = sizeof "[invalid sh_name 0x12345678]";
 | ||||
|  	  name = alloca (bufsz); | ||||
|  	  snprintf (name, bufsz, "[invalid sh_name %#" PRIx32 "]", | ||||
|  		    gelf_getshdr (scn, &shdr_mem)->sh_name); | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -1,6 +1,6 @@ | ||||
| --- elfutils/libdwfl/ChangeLog
 | ||||
| +++ elfutils/libdwfl/ChangeLog
 | ||||
| @@ -52,6 +52,11 @@
 | ||||
| @@ -291,6 +291,11 @@
 | ||||
|  	* dwfl_module_getdwarf.c (open_elf): Clear errno before CBFAIL. | ||||
|  	Reported by Kurt Roeckx <kurt@roeckx.be>. | ||||
|   | ||||
| @ -21,7 +21,7 @@ | ||||
|     This file is part of elfutils. | ||||
|   | ||||
|     This file is free software; you can redistribute it and/or modify | ||||
| @@ -457,7 +457,10 @@ relocate_section (Dwfl_Module *mod, Elf
 | ||||
| @@ -456,7 +456,10 @@ relocate_section (Dwfl_Module *mod, Elf
 | ||||
|        } | ||||
|    } | ||||
|   | ||||
| @ -33,7 +33,7 @@ | ||||
|    size_t complete = 0; | ||||
|    if (shdr->sh_type == SHT_REL) | ||||
|      for (size_t relidx = 0; !result && relidx < nrels; ++relidx) | ||||
| @@ -559,7 +562,7 @@ relocate_section (Dwfl_Module *mod, Elf
 | ||||
| @@ -558,7 +561,7 @@ relocate_section (Dwfl_Module *mod, Elf
 | ||||
|  	  nrels = next; | ||||
|  	} | ||||
|   | ||||
| @ -44,7 +44,7 @@ | ||||
|   | ||||
| --- elfutils/libelf/ChangeLog
 | ||||
| +++ elfutils/libelf/ChangeLog
 | ||||
| @@ -703,10 +703,53 @@
 | ||||
| @@ -715,10 +715,53 @@
 | ||||
|  	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. | ||||
|   | ||||
| @ -253,7 +253,7 @@ | ||||
|   | ||||
| --- elfutils/libelf/elf_getarsym.c
 | ||||
| +++ elfutils/libelf/elf_getarsym.c
 | ||||
| @@ -181,6 +181,9 @@ elf_getarsym (elf, ptr)
 | ||||
| @@ -183,6 +183,9 @@ elf_getarsym (elf, ptr)
 | ||||
|        size_t index_size = atol (tmpbuf); | ||||
|   | ||||
|        if (SARMAG + sizeof (struct ar_hdr) + index_size > elf->maximum_size | ||||
| @ -408,46 +408,6 @@ | ||||
|      { | ||||
|        __libelf_seterrno (ELF_E_INVALID_INDEX); | ||||
|        goto out; | ||||
| --- elfutils/libelf/gelf_getrela.c
 | ||||
| +++ elfutils/libelf/gelf_getrela.c
 | ||||
| @@ -1,5 +1,5 @@
 | ||||
|  /* Get RELA relocation information at given index. | ||||
| -   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
 | ||||
| +   Copyright (C) 2000-2009 Red Hat, Inc.
 | ||||
|     This file is part of elfutils. | ||||
|     Written by Ulrich Drepper <drepper@redhat.com>, 2000. | ||||
|   | ||||
| @@ -50,12 +50,6 @@ gelf_getrela (data, ndx, dst)
 | ||||
|    if (data_scn == NULL) | ||||
|      return 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); | ||||
| @@ -72,7 +66,7 @@ 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, &data_scn->d))
 | ||||
|  	{ | ||||
|  	  __libelf_seterrno (ELF_E_INVALID_INDEX); | ||||
|  	  result = NULL; | ||||
| @@ -93,7 +87,7 @@ 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, &data_scn->d))
 | ||||
|  	{ | ||||
|  	  __libelf_seterrno (ELF_E_INVALID_INDEX); | ||||
|  	  result = NULL; | ||||
| --- elfutils/libelf/gelf_getrel.c
 | ||||
| +++ elfutils/libelf/gelf_getrel.c
 | ||||
| @@ -1,5 +1,5 @@
 | ||||
| @ -488,6 +448,46 @@ | ||||
|  	{ | ||||
|  	  __libelf_seterrno (ELF_E_INVALID_INDEX); | ||||
|  	  result = NULL; | ||||
| --- elfutils/libelf/gelf_getrela.c
 | ||||
| +++ elfutils/libelf/gelf_getrela.c
 | ||||
| @@ -1,5 +1,5 @@
 | ||||
|  /* Get RELA relocation information at given index. | ||||
| -   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
 | ||||
| +   Copyright (C) 2000-2009 Red Hat, Inc.
 | ||||
|     This file is part of elfutils. | ||||
|     Written by Ulrich Drepper <drepper@redhat.com>, 2000. | ||||
|   | ||||
| @@ -50,12 +50,6 @@ gelf_getrela (data, ndx, dst)
 | ||||
|    if (data_scn == NULL) | ||||
|      return 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); | ||||
| @@ -72,7 +66,7 @@ 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, &data_scn->d))
 | ||||
|  	{ | ||||
|  	  __libelf_seterrno (ELF_E_INVALID_INDEX); | ||||
|  	  result = NULL; | ||||
| @@ -93,7 +87,7 @@ 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, &data_scn->d))
 | ||||
|  	{ | ||||
|  	  __libelf_seterrno (ELF_E_INVALID_INDEX); | ||||
|  	  result = NULL; | ||||
| --- elfutils/libelf/gelf_getsym.c
 | ||||
| +++ elfutils/libelf/gelf_getsym.c
 | ||||
| @@ -1,5 +1,5 @@
 | ||||
| @ -678,46 +678,6 @@ | ||||
|      { | ||||
|        __libelf_seterrno (ELF_E_INVALID_INDEX); | ||||
|        return 0; | ||||
| --- elfutils/libelf/gelf_update_rela.c
 | ||||
| +++ elfutils/libelf/gelf_update_rela.c
 | ||||
| @@ -1,5 +1,5 @@
 | ||||
|  /* Update RELA relocation information at given index. | ||||
| -   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
 | ||||
| +   Copyright (C) 2000-2009 Red Hat, Inc.
 | ||||
|     This file is part of elfutils. | ||||
|     Written by Ulrich Drepper <drepper@redhat.com>, 2000. | ||||
|   | ||||
| @@ -47,12 +47,6 @@ gelf_update_rela (Elf_Data *dst, int ndx
 | ||||
|    if (dst == NULL) | ||||
|      return 0; | ||||
|   | ||||
| -  if (unlikely (ndx < 0))
 | ||||
| -    {
 | ||||
| -      __libelf_seterrno (ELF_E_INVALID_INDEX);
 | ||||
| -      return 0;
 | ||||
| -    }
 | ||||
| -
 | ||||
|    if (unlikely (data_scn->d.d_type != ELF_T_RELA)) | ||||
|      { | ||||
|        /* The type of the data better should match.  */ | ||||
| @@ -80,7 +74,7 @@ gelf_update_rela (Elf_Data *dst, int ndx
 | ||||
|  	} | ||||
|   | ||||
|        /* Check whether we have to resize the data buffer.  */ | ||||
| -      if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
 | ||||
| +      if (INVALID_NDX (ndx, Elf32_Rela, &data_scn->d))
 | ||||
|  	{ | ||||
|  	  __libelf_seterrno (ELF_E_INVALID_INDEX); | ||||
|  	  goto out; | ||||
| @@ -96,7 +90,7 @@ gelf_update_rela (Elf_Data *dst, int ndx
 | ||||
|    else | ||||
|      { | ||||
|        /* Check whether we have to resize the data buffer.  */ | ||||
| -      if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
 | ||||
| +      if (INVALID_NDX (ndx, Elf64_Rela, &data_scn->d))
 | ||||
|  	{ | ||||
|  	  __libelf_seterrno (ELF_E_INVALID_INDEX); | ||||
|  	  goto out; | ||||
| --- elfutils/libelf/gelf_update_rel.c
 | ||||
| +++ elfutils/libelf/gelf_update_rel.c
 | ||||
| @@ -1,5 +1,5 @@
 | ||||
| @ -758,6 +718,46 @@ | ||||
|  	{ | ||||
|  	  __libelf_seterrno (ELF_E_INVALID_INDEX); | ||||
|  	  goto out; | ||||
| --- elfutils/libelf/gelf_update_rela.c
 | ||||
| +++ elfutils/libelf/gelf_update_rela.c
 | ||||
| @@ -1,5 +1,5 @@
 | ||||
|  /* Update RELA relocation information at given index. | ||||
| -   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
 | ||||
| +   Copyright (C) 2000-2009 Red Hat, Inc.
 | ||||
|     This file is part of elfutils. | ||||
|     Written by Ulrich Drepper <drepper@redhat.com>, 2000. | ||||
|   | ||||
| @@ -47,12 +47,6 @@ gelf_update_rela (Elf_Data *dst, int ndx
 | ||||
|    if (dst == NULL) | ||||
|      return 0; | ||||
|   | ||||
| -  if (unlikely (ndx < 0))
 | ||||
| -    {
 | ||||
| -      __libelf_seterrno (ELF_E_INVALID_INDEX);
 | ||||
| -      return 0;
 | ||||
| -    }
 | ||||
| -
 | ||||
|    if (unlikely (data_scn->d.d_type != ELF_T_RELA)) | ||||
|      { | ||||
|        /* The type of the data better should match.  */ | ||||
| @@ -80,7 +74,7 @@ gelf_update_rela (Elf_Data *dst, int ndx
 | ||||
|  	} | ||||
|   | ||||
|        /* Check whether we have to resize the data buffer.  */ | ||||
| -      if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
 | ||||
| +      if (INVALID_NDX (ndx, Elf32_Rela, &data_scn->d))
 | ||||
|  	{ | ||||
|  	  __libelf_seterrno (ELF_E_INVALID_INDEX); | ||||
|  	  goto out; | ||||
| @@ -96,7 +90,7 @@ gelf_update_rela (Elf_Data *dst, int ndx
 | ||||
|    else | ||||
|      { | ||||
|        /* Check whether we have to resize the data buffer.  */ | ||||
| -      if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
 | ||||
| +      if (INVALID_NDX (ndx, Elf64_Rela, &data_scn->d))
 | ||||
|  	{ | ||||
|  	  __libelf_seterrno (ELF_E_INVALID_INDEX); | ||||
|  	  goto out; | ||||
| --- elfutils/libelf/gelf_update_sym.c
 | ||||
| +++ elfutils/libelf/gelf_update_sym.c
 | ||||
| @@ -1,5 +1,5 @@
 | ||||
| @ -902,7 +902,7 @@ | ||||
|  #endif  /* libelfP.h */ | ||||
| --- elfutils/src/ChangeLog
 | ||||
| +++ elfutils/src/ChangeLog
 | ||||
| @@ -344,6 +344,12 @@
 | ||||
| @@ -504,6 +504,12 @@
 | ||||
|   | ||||
|  	* readelf.c (dwarf_attr_string): Grok DW_AT_GNU_odr_signature. | ||||
|   | ||||
| @ -915,7 +915,7 @@ | ||||
|  2011-02-11  Roland McGrath  <roland@redhat.com> | ||||
|   | ||||
|  	* elfcmp.c (verbose): New variable. | ||||
| @@ -2056,6 +2062,16 @@
 | ||||
| @@ -2216,6 +2222,16 @@
 | ||||
|  	object symbols or symbols with unknown type. | ||||
|  	(check_rel): Likewise. | ||||
|   | ||||
| @ -932,7 +932,7 @@ | ||||
|  2005-06-08  Roland McGrath  <roland@redhat.com> | ||||
|   | ||||
|  	* readelf.c (print_ops): Add consts. | ||||
| @@ -2101,6 +2117,19 @@
 | ||||
| @@ -2261,6 +2277,19 @@
 | ||||
|   | ||||
|  	* readelf.c (dwarf_tag_string): Add new tags. | ||||
|   | ||||
| @ -1027,7 +1027,7 @@ | ||||
|  	} | ||||
|   | ||||
|        if (sym->st_shndx == SHN_XINDEX) | ||||
| @@ -1032,9 +1042,11 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
 | ||||
| @@ -1040,9 +1050,11 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
 | ||||
|      { | ||||
|        GElf_Shdr rcshdr_mem; | ||||
|        const GElf_Shdr *rcshdr = gelf_getshdr (scn, &rcshdr_mem); | ||||
| @ -1041,7 +1041,7 @@ | ||||
|  	{ | ||||
|  	  /* Found the dynamic section.  Look through it.  */ | ||||
|  	  Elf_Data *d = elf_getdata (scn, NULL); | ||||
| @@ -1044,7 +1056,9 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
 | ||||
| @@ -1052,7 +1064,9 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
 | ||||
|  	    { | ||||
|  	      GElf_Dyn dyn_mem; | ||||
|  	      GElf_Dyn *dyn = gelf_getdyn (d, cnt, &dyn_mem); | ||||
| @ -1052,7 +1052,7 @@ | ||||
|   | ||||
|  	      if (dyn->d_tag == DT_RELCOUNT) | ||||
|  		{ | ||||
| @@ -1058,7 +1072,9 @@ section [%2d] '%s': DT_RELCOUNT used for
 | ||||
| @@ -1066,7 +1080,9 @@ section [%2d] '%s': DT_RELCOUNT used for
 | ||||
|  		      /* Does the number specified number of relative | ||||
|  			 relocations exceed the total number of | ||||
|  			 relocations?  */ | ||||
| @ -1063,7 +1063,7 @@ | ||||
|  			ERROR (gettext ("\ | ||||
|  section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"), | ||||
|  			       idx, section_name (ebl, idx), | ||||
| @@ -1218,7 +1234,8 @@ section [%2d] '%s': no relocations for m
 | ||||
| @@ -1226,7 +1242,8 @@ section [%2d] '%s': no relocations for m
 | ||||
|  	} | ||||
|      } | ||||
|   | ||||
| @ -1073,7 +1073,7 @@ | ||||
|      ERROR (gettext (reltype == ELF_T_RELA ? "\ | ||||
|  section [%2d] '%s': section entry size does not match ElfXX_Rela\n" : "\ | ||||
|  section [%2d] '%s': section entry size does not match ElfXX_Rel\n"), | ||||
| @@ -1441,7 +1458,8 @@ check_rela (Ebl *ebl, GElf_Ehdr *ehdr, G
 | ||||
| @@ -1449,7 +1466,8 @@ check_rela (Ebl *ebl, GElf_Ehdr *ehdr, G
 | ||||
|    Elf_Data *symdata = elf_getdata (symscn, NULL); | ||||
|    enum load_state state = state_undecided; | ||||
|   | ||||
| @ -1083,7 +1083,7 @@ | ||||
|      { | ||||
|        GElf_Rela rela_mem; | ||||
|        GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem); | ||||
| @@ -1491,7 +1509,8 @@ check_rel (Ebl *ebl, GElf_Ehdr *ehdr, GE
 | ||||
| @@ -1499,7 +1517,8 @@ check_rel (Ebl *ebl, GElf_Ehdr *ehdr, GE
 | ||||
|    Elf_Data *symdata = elf_getdata (symscn, NULL); | ||||
|    enum load_state state = state_undecided; | ||||
|   | ||||
| @ -1093,7 +1093,7 @@ | ||||
|      { | ||||
|        GElf_Rel rel_mem; | ||||
|        GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem); | ||||
| @@ -1590,7 +1609,8 @@ section [%2d] '%s': referenced as string
 | ||||
| @@ -1598,7 +1617,8 @@ section [%2d] '%s': referenced as string
 | ||||
|  	   shdr->sh_link, section_name (ebl, shdr->sh_link), | ||||
|  	   idx, section_name (ebl, idx)); | ||||
|   | ||||
| @ -1103,7 +1103,7 @@ | ||||
|      ERROR (gettext ("\ | ||||
|  section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"), | ||||
|  	   idx, section_name (ebl, idx)); | ||||
| @@ -1600,7 +1620,7 @@ section [%2d] '%s': section entry size d
 | ||||
| @@ -1608,7 +1628,7 @@ section [%2d] '%s': section entry size d
 | ||||
|  	   idx, section_name (ebl, idx)); | ||||
|   | ||||
|    bool non_null_warned = false; | ||||
| @ -1112,7 +1112,7 @@ | ||||
|      { | ||||
|        GElf_Dyn dyn_mem; | ||||
|        GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dyn_mem); | ||||
| @@ -1872,6 +1892,8 @@ section [%2d] '%s': entry size does not
 | ||||
| @@ -1880,6 +1900,8 @@ section [%2d] '%s': entry size does not
 | ||||
|  	   idx, section_name (ebl, idx)); | ||||
|   | ||||
|    if (symshdr != NULL | ||||
| @ -1121,7 +1121,7 @@ | ||||
|        && (shdr->sh_size / shdr->sh_entsize | ||||
|  	  < symshdr->sh_size / symshdr->sh_entsize)) | ||||
|      ERROR (gettext ("\ | ||||
| @@ -1898,6 +1920,12 @@ section [%2d] '%s': extended section ind
 | ||||
| @@ -1906,6 +1928,12 @@ section [%2d] '%s': extended section ind
 | ||||
|      } | ||||
|   | ||||
|    Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL); | ||||
| @ -1134,7 +1134,7 @@ | ||||
|   | ||||
|    if (*((Elf32_Word *) data->d_buf) != 0) | ||||
|      ERROR (gettext ("symbol 0 should have zero extended section index\n")); | ||||
| @@ -1940,7 +1968,7 @@ section [%2d] '%s': hash table section i
 | ||||
| @@ -1948,7 +1976,7 @@ section [%2d] '%s': hash table section i
 | ||||
|   | ||||
|    size_t maxidx = nchain; | ||||
|   | ||||
| @ -1143,7 +1143,7 @@ | ||||
|      { | ||||
|        size_t symsize = symshdr->sh_size / symshdr->sh_entsize; | ||||
|   | ||||
| @@ -1951,18 +1979,28 @@ section [%2d] '%s': hash table section i
 | ||||
| @@ -1959,18 +1987,28 @@ section [%2d] '%s': hash table section i
 | ||||
|        maxidx = symsize; | ||||
|      } | ||||
|   | ||||
| @ -1174,7 +1174,7 @@ | ||||
|  } | ||||
|   | ||||
|   | ||||
| @@ -1992,18 +2030,28 @@ section [%2d] '%s': hash table section i
 | ||||
| @@ -2000,18 +2038,28 @@ section [%2d] '%s': hash table section i
 | ||||
|        maxidx = symsize; | ||||
|      } | ||||
|   | ||||
| @ -1206,7 +1206,7 @@ | ||||
|  } | ||||
|   | ||||
|   | ||||
| @@ -2028,7 +2076,7 @@ section [%2d] '%s': bitmask size not pow
 | ||||
| @@ -2036,7 +2084,7 @@ section [%2d] '%s': bitmask size not pow
 | ||||
|    if (shdr->sh_size < (4 + bitmask_words + nbuckets) * sizeof (Elf32_Word)) | ||||
|      { | ||||
|        ERROR (gettext ("\ | ||||
| @ -1215,7 +1215,7 @@ | ||||
|  	     idx, section_name (ebl, idx), (long int) shdr->sh_size, | ||||
|  	     (long int) ((4 + bitmask_words + nbuckets) * sizeof (Elf32_Word))); | ||||
|        return; | ||||
| @@ -2700,8 +2748,9 @@ section [%2d] '%s' refers in sh_link to
 | ||||
| @@ -2708,8 +2756,9 @@ section [%2d] '%s' refers in sh_link to
 | ||||
|   | ||||
|    /* The number of elements in the version symbol table must be the | ||||
|       same as the number of symbols.  */ | ||||
| @ -1229,7 +1229,7 @@ | ||||
|  	   idx, section_name (ebl, idx), | ||||
| --- elfutils/src/readelf.c
 | ||||
| +++ elfutils/src/readelf.c
 | ||||
| @@ -1189,6 +1189,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
 | ||||
| @@ -1363,6 +1363,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
 | ||||
|    Elf32_Word *grpref = (Elf32_Word *) data->d_buf; | ||||
|   | ||||
|    GElf_Sym sym_mem; | ||||
| @ -1238,7 +1238,7 @@ | ||||
|    printf ((grpref[0] & GRP_COMDAT) | ||||
|  	  ? ngettext ("\ | ||||
|  \nCOMDAT section group [%2zu] '%s' with signature '%s' contains %zu entry:\n", | ||||
| @@ -1201,8 +1203,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
 | ||||
| @@ -1375,8 +1377,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
 | ||||
|  		      data->d_size / sizeof (Elf32_Word) - 1), | ||||
|  	  elf_ndxscn (scn), | ||||
|  	  elf_strptr (ebl->elf, shstrndx, shdr->sh_name), | ||||
| @ -1249,7 +1249,7 @@ | ||||
|  	  ?: gettext ("<INVALID SYMBOL>"), | ||||
|  	  data->d_size / sizeof (Elf32_Word) - 1); | ||||
|   | ||||
| @@ -1353,10 +1355,12 @@ static void
 | ||||
| @@ -1527,10 +1529,12 @@ static void
 | ||||
|  handle_dynamic (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr) | ||||
|  { | ||||
|    int class = gelf_getclass (ebl->elf); | ||||
| @ -1263,7 +1263,7 @@ | ||||
|   | ||||
|    /* Get the data of the section.  */ | ||||
|    data = elf_getdata (scn, NULL); | ||||
| @@ -1368,21 +1372,26 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn,
 | ||||
| @@ -1542,21 +1546,26 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn,
 | ||||
|      error (EXIT_FAILURE, 0, | ||||
|  	   gettext ("cannot get section header string table index")); | ||||
|   | ||||
| @ -1296,7 +1296,7 @@ | ||||
|      { | ||||
|        GElf_Dyn dynmem; | ||||
|        GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dynmem); | ||||
| @@ -1531,7 +1540,8 @@ static void
 | ||||
| @@ -1705,7 +1714,8 @@ static void
 | ||||
|  handle_relocs_rel (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr) | ||||
|  { | ||||
|    int class = gelf_getclass (ebl->elf); | ||||
| @ -1306,7 +1306,7 @@ | ||||
|   | ||||
|    /* Get the data of the section.  */ | ||||
|    Elf_Data *data = elf_getdata (scn, NULL); | ||||
| @@ -1717,7 +1727,8 @@ static void
 | ||||
| @@ -1891,7 +1901,8 @@ static void
 | ||||
|  handle_relocs_rela (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr) | ||||
|  { | ||||
|    int class = gelf_getclass (ebl->elf); | ||||
| @ -1316,7 +1316,7 @@ | ||||
|   | ||||
|    /* Get the data of the section.  */ | ||||
|    Elf_Data *data = elf_getdata (scn, NULL); | ||||
| @@ -1964,6 +1975,13 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
 | ||||
| @@ -2138,6 +2149,13 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
 | ||||
|      error (EXIT_FAILURE, 0, | ||||
|  	   gettext ("cannot get section header string table index")); | ||||
|   | ||||
| @ -1330,7 +1330,7 @@ | ||||
|    /* Now we can compute the number of entries in the section.  */ | ||||
|    unsigned int nsyms = data->d_size / (class == ELFCLASS32 | ||||
|  				       ? sizeof (Elf32_Sym) | ||||
| @@ -1974,15 +1992,12 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
 | ||||
| @@ -2148,15 +2166,12 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
 | ||||
|  		    nsyms), | ||||
|  	  (unsigned int) elf_ndxscn (scn), | ||||
|  	  elf_strptr (ebl->elf, shstrndx, shdr->sh_name), nsyms); | ||||
| @ -1347,7 +1347,7 @@ | ||||
|   | ||||
|    fputs_unlocked (class == ELFCLASS32 | ||||
|  		  ? gettext ("\ | ||||
| @@ -2218,7 +2233,13 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn,
 | ||||
| @@ -2392,7 +2407,13 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn,
 | ||||
|      error (EXIT_FAILURE, 0, | ||||
|  	   gettext ("cannot get section header string table index")); | ||||
|   | ||||
| @ -1362,7 +1362,7 @@ | ||||
|    printf (ngettext ("\ | ||||
|  \nVersion needs section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 "  Offset: %#08" PRIx64 "  Link to section: [%2u] '%s'\n", | ||||
|  		    "\ | ||||
| @@ -2229,9 +2250,7 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn,
 | ||||
| @@ -2403,9 +2424,7 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn,
 | ||||
|  	  class == ELFCLASS32 ? 10 : 18, shdr->sh_addr, | ||||
|  	  shdr->sh_offset, | ||||
|  	  (unsigned int) shdr->sh_link, | ||||
| @ -1373,7 +1373,7 @@ | ||||
|   | ||||
|    unsigned int offset = 0; | ||||
|    for (int cnt = shdr->sh_info; --cnt >= 0; ) | ||||
| @@ -2284,8 +2303,14 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
 | ||||
| @@ -2458,8 +2477,14 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
 | ||||
|      error (EXIT_FAILURE, 0, | ||||
|  	   gettext ("cannot get section header string table index")); | ||||
|   | ||||
| @ -1389,7 +1389,7 @@ | ||||
|    printf (ngettext ("\ | ||||
|  \nVersion definition section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 "  Offset: %#08" PRIx64 "  Link to section: [%2u] '%s'\n", | ||||
|  		    "\ | ||||
| @@ -2297,9 +2322,7 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
 | ||||
| @@ -2471,9 +2496,7 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
 | ||||
|  	  class == ELFCLASS32 ? 10 : 18, shdr->sh_addr, | ||||
|  	  shdr->sh_offset, | ||||
|  	  (unsigned int) shdr->sh_link, | ||||
| @ -1400,7 +1400,7 @@ | ||||
|   | ||||
|    unsigned int offset = 0; | ||||
|    for (int cnt = shdr->sh_info; --cnt >= 0; ) | ||||
| @@ -2561,25 +2584,30 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G
 | ||||
| @@ -2735,25 +2758,30 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G
 | ||||
|        filename = NULL; | ||||
|      } | ||||
|   | ||||
| @ -1438,7 +1438,7 @@ | ||||
|      { | ||||
|        if (cnt % 2 == 0) | ||||
|  	printf ("\n %4d:", cnt); | ||||
| @@ -2628,7 +2656,17 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn,
 | ||||
| @@ -2802,7 +2830,17 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn,
 | ||||
|    for (Elf32_Word cnt = 0; cnt < nbucket; ++cnt) | ||||
|      ++counts[lengths[cnt]]; | ||||
|   | ||||
| @ -1457,7 +1457,7 @@ | ||||
|    printf (ngettext ("\ | ||||
|  \nHistogram for bucket list length in section [%2u] '%s' (total of %d bucket):\n Addr: %#0*" PRIx64 "  Offset: %#08" PRIx64 "  Link to section: [%2u] '%s'\n", | ||||
|  		    "\ | ||||
| @@ -2641,9 +2679,7 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn,
 | ||||
| @@ -2815,9 +2853,7 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn,
 | ||||
|  	  shdr->sh_addr, | ||||
|  	  shdr->sh_offset, | ||||
|  	  (unsigned int) shdr->sh_link, | ||||
| @ -1468,7 +1468,7 @@ | ||||
|   | ||||
|    if (extrastr != NULL) | ||||
|      fputs (extrastr, stdout); | ||||
| @@ -2903,7 +2939,8 @@ print_liblist (Ebl *ebl)
 | ||||
| @@ -3077,7 +3113,8 @@ print_liblist (Ebl *ebl)
 | ||||
|   | ||||
|        if (shdr != NULL && shdr->sh_type == SHT_GNU_LIBLIST) | ||||
|  	{ | ||||
| @ -1478,7 +1478,7 @@ | ||||
|  	  printf (ngettext ("\ | ||||
|  \nLibrary list section [%2zu] '%s' at offset %#0" PRIx64 " contains %d entry:\n", | ||||
|  			    "\ | ||||
| @@ -4164,6 +4201,16 @@ print_debug_aranges_section (Dwfl_Module
 | ||||
| @@ -4397,6 +4434,16 @@ print_decoded_aranges_section (Ebl *ebl,
 | ||||
|        return; | ||||
|      } | ||||
|   | ||||
| @ -1497,7 +1497,7 @@ | ||||
|  		    "\ | ||||
| --- elfutils/src/strip.c
 | ||||
| +++ elfutils/src/strip.c
 | ||||
| @@ -564,6 +564,11 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -565,6 +565,11 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|        goto fail_close; | ||||
|      } | ||||
|   | ||||
| @ -1509,7 +1509,7 @@ | ||||
|    /* Storage for section information.  We leave room for two more | ||||
|       entries since we unconditionally create a section header string | ||||
|       table.  Maybe some weird tool created an ELF file without one. | ||||
| @@ -585,7 +590,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -586,7 +591,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|      { | ||||
|        /* This should always be true (i.e., there should not be any | ||||
|  	 holes in the numbering).  */ | ||||
| @ -1518,7 +1518,7 @@ | ||||
|   | ||||
|        shdr_info[cnt].scn = scn; | ||||
|   | ||||
| @@ -598,6 +603,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -599,6 +604,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|  					shdr_info[cnt].shdr.sh_name); | ||||
|        if (shdr_info[cnt].name == NULL) | ||||
|  	{ | ||||
| @ -1526,7 +1526,7 @@ | ||||
|  	  error (0, 0, gettext ("illformed file '%s'"), fname); | ||||
|  	  goto fail_close; | ||||
|  	} | ||||
| @@ -607,6 +613,8 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -608,6 +614,8 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|   | ||||
|        /* Remember the shdr.sh_link value.  */ | ||||
|        shdr_info[cnt].old_sh_link = shdr_info[cnt].shdr.sh_link; | ||||
| @ -1535,7 +1535,7 @@ | ||||
|   | ||||
|        /* Sections in files other than relocatable object files which | ||||
|  	 are not loaded can be freely moved by us.  In relocatable | ||||
| @@ -619,7 +627,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -620,7 +628,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|  	 appropriate reference.  */ | ||||
|        if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB_SHNDX)) | ||||
|  	{ | ||||
| @ -1544,7 +1544,7 @@ | ||||
|  	  shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx = cnt; | ||||
|  	} | ||||
|        else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GROUP)) | ||||
| @@ -636,7 +644,12 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -637,7 +645,12 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|  	  for (inner = 1; | ||||
|  	       inner < shdr_info[cnt].data->d_size / sizeof (Elf32_Word); | ||||
|  	       ++inner) | ||||
| @ -1557,7 +1557,7 @@ | ||||
|   | ||||
|  	  if (inner == 1 || (inner == 2 && (grpref[0] & GRP_COMDAT) == 0)) | ||||
|  	    /* If the section group contains only one element and this | ||||
| @@ -647,7 +660,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -648,7 +661,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|  	} | ||||
|        else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GNU_versym)) | ||||
|  	{ | ||||
| @ -1566,7 +1566,7 @@ | ||||
|  	  shdr_info[shdr_info[cnt].shdr.sh_link].version_idx = cnt; | ||||
|  	} | ||||
|   | ||||
| @@ -655,7 +668,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -656,7 +669,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|  	 discarded right away.  */ | ||||
|        if ((shdr_info[cnt].shdr.sh_flags & SHF_GROUP) != 0) | ||||
|  	{ | ||||
| @ -1575,7 +1575,7 @@ | ||||
|   | ||||
|  	  if (shdr_info[shdr_info[cnt].group_idx].idx == 0) | ||||
|  	    { | ||||
| @@ -731,10 +744,14 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -732,10 +745,14 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|  	    { | ||||
|  	      /* If a relocation section is marked as being removed make | ||||
|  		 sure the section it is relocating is removed, too.  */ | ||||
| @ -1593,7 +1593,7 @@ | ||||
|   | ||||
|  	      /* If a group section is marked as being removed make | ||||
|  		 sure all the sections it contains are being removed, too.  */ | ||||
| @@ -778,7 +795,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -779,7 +796,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|  		  if (shdr_info[cnt].symtab_idx != 0 | ||||
|  		      && shdr_info[shdr_info[cnt].symtab_idx].data == NULL) | ||||
|  		    { | ||||
| @ -1602,7 +1602,7 @@ | ||||
|   | ||||
|  		      shdr_info[shdr_info[cnt].symtab_idx].data | ||||
|  			= elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn, | ||||
| @@ -818,6 +835,9 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -819,6 +836,9 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|  		      else if (scnidx == SHN_XINDEX) | ||||
|  			scnidx = xndx; | ||||
|   | ||||
| @ -1612,7 +1612,7 @@ | ||||
|  		      if (shdr_info[scnidx].idx == 0) | ||||
|  			/* This symbol table has a real symbol in | ||||
|  			   a discarded section.  So preserve the | ||||
| @@ -848,12 +868,16 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -849,12 +869,16 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|  		} | ||||
|   | ||||
|  	      /* Handle references through sh_info.  */ | ||||
| @ -1631,7 +1631,7 @@ | ||||
|   | ||||
|  	      /* Mark the section as investigated.  */ | ||||
|  	      shdr_info[cnt].idx = 2; | ||||
| @@ -994,7 +1018,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -995,7 +1019,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|  	  error (EXIT_FAILURE, 0, gettext ("while generating output file: %s"), | ||||
|  		 elf_errmsg (-1)); | ||||
|   | ||||
| @ -1640,7 +1640,7 @@ | ||||
|   | ||||
|  	/* Add this name to the section header string table.  */ | ||||
|  	shdr_info[cnt].se = ebl_strtabadd (shst, shdr_info[cnt].name, 0); | ||||
| @@ -1031,7 +1055,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -1032,7 +1056,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|  	error (EXIT_FAILURE, 0, | ||||
|  	       gettext ("while create section header section: %s"), | ||||
|  	       elf_errmsg (-1)); | ||||
| @ -1649,7 +1649,7 @@ | ||||
|   | ||||
|        shdr_info[cnt].data = elf_newdata (shdr_info[cnt].newscn); | ||||
|        if (shdr_info[cnt].data == NULL) | ||||
| @@ -1087,7 +1111,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -1089,7 +1113,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|      error (EXIT_FAILURE, 0, | ||||
|  	   gettext ("while create section header section: %s"), | ||||
|  	   elf_errmsg (-1)); | ||||
| @ -1658,7 +1658,7 @@ | ||||
|   | ||||
|    /* Finalize the string table and fill in the correct indices in the | ||||
|       section headers.  */ | ||||
| @@ -1177,20 +1201,20 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -1179,20 +1203,20 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|  		    shndxdata = elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn, | ||||
|  					     NULL); | ||||
|   | ||||
| @ -1682,7 +1682,7 @@ | ||||
|  			    >= shdr_info[cnt].data->d_size / elsize); | ||||
|  		  } | ||||
|   | ||||
| @@ -1245,7 +1269,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -1247,7 +1271,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|  		      sec = shdr_info[sym->st_shndx].idx; | ||||
|  		    else | ||||
|  		      { | ||||
| @ -1691,7 +1691,7 @@ | ||||
|   | ||||
|  			sec = shdr_info[xshndx].idx; | ||||
|  		      } | ||||
| @@ -1266,7 +1290,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -1268,7 +1292,7 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|  			    nxshndx = sec; | ||||
|  			  } | ||||
|   | ||||
| @ -1700,7 +1700,7 @@ | ||||
|   | ||||
|  			if ((inner != destidx || nshndx != sym->st_shndx | ||||
|  			     || (shndxdata != NULL && nxshndx != xshndx)) | ||||
| @@ -1293,9 +1317,11 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -1295,9 +1319,11 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|  		      { | ||||
|  			size_t sidx = (sym->st_shndx != SHN_XINDEX | ||||
|  					? sym->st_shndx : xshndx); | ||||
| @ -1715,7 +1715,7 @@ | ||||
|  		      } | ||||
|  		  } | ||||
|   | ||||
| @@ -1483,11 +1509,11 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -1485,11 +1511,11 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|  		  { | ||||
|  		    GElf_Sym sym_mem; | ||||
|  		    GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem); | ||||
| @ -1729,7 +1729,7 @@ | ||||
|  		    size_t hidx = elf_hash (name) % nbucket; | ||||
|   | ||||
|  		    if (bucket[hidx] == 0) | ||||
| @@ -1506,8 +1532,8 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -1508,8 +1534,8 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|  	    else | ||||
|  	      { | ||||
|  		/* Alpha and S390 64-bit use 64-bit SHT_HASH entries.  */ | ||||
| @ -1740,7 +1740,7 @@ | ||||
|   | ||||
|  		Elf64_Xword *bucket = (Elf64_Xword *) hashd->d_buf; | ||||
|   | ||||
| @@ -1537,11 +1563,11 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
| @@ -1539,11 +1565,11 @@ handle_elf (int fd, Elf *elf, const char
 | ||||
|  		  { | ||||
|  		    GElf_Sym sym_mem; | ||||
|  		    GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem); | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| Name: elfutils | ||||
| Summary: A collection of utilities and DSOs to handle compiled objects | ||||
| Version: 0.155 | ||||
| %global baserelease 6 | ||||
| Version: 0.156 | ||||
| %global baserelease 1 | ||||
| URL: https://fedorahosted.org/elfutils/ | ||||
| %global source_url http://fedorahosted.org/releases/e/l/elfutils/%{version}/ | ||||
| License: GPLv3+ and (GPLv2+ or LGPLv3+) | ||||
| @ -45,9 +45,6 @@ Group: Development/Tools | ||||
| Source: %{?source_url}%{name}-%{version}.tar.bz2 | ||||
| Patch1: %{?source_url}elfutils-robustify.patch | ||||
| Patch2: %{?source_url}elfutils-portability.patch | ||||
| Patch3: elfutils-0.155-binutils-pr-ld-13621.patch | ||||
| Patch4: elfutils-0.155-mem-align.patch | ||||
| Patch5: elfutils-0.155-sizeof-pointer-memaccess.patch | ||||
| 
 | ||||
| %if !%{compat} | ||||
| Release: %{baserelease}%{?dist} | ||||
| @ -212,10 +209,6 @@ sed -i.scanf-m -e 's/%m/%a/g' src/addr2line.c tests/line2addr.c | ||||
| %endif | ||||
| %endif | ||||
| 
 | ||||
| %patch3 -p1 -b .binutils-pr-ld-13621 | ||||
| %patch4 -p1 -b .mem-align | ||||
| %patch5 -p1 -b .sizeof-pointer-memaccess | ||||
| 
 | ||||
| find . -name \*.sh ! -perm -0100 -print | xargs chmod +x | ||||
| 
 | ||||
| %build | ||||
| @ -331,6 +324,17 @@ rm -rf ${RPM_BUILD_ROOT} | ||||
| %{_libdir}/libelf.a | ||||
| 
 | ||||
| %changelog | ||||
| * Thu Jul 25 2013 Jan Kratochvil <jan.kratochvil@redhat.com> 0.156-1 | ||||
| - Update to 0.156. | ||||
|   - #890447 - Add __bss_start and __TMC_END__ to elflint. | ||||
|   - #909481 - Only try opening files with installed compression libraries. | ||||
|   - #914908 - Add __bss_start__ to elflint. | ||||
|   - #853757 - Updated Polish translation. | ||||
|   - #985438 - Incorrect prototype of __libdwfl_find_elf_build_id. | ||||
|   - Drop upstreamed elfutils-0.155-binutils-pr-ld-13621.patch. | ||||
|   - Drop upstreamed elfutils-0.155-mem-align.patch. | ||||
|   - Drop upstreamed elfutils-0.155-sizeof-pointer-memaccess.patch. | ||||
| 
 | ||||
| * Tue Jul 02 2013 Karsten Hopp <karsten@redhat.com> 0.155-6 | ||||
| - bump release and rebuild to fix dependencies on PPC | ||||
| 
 | ||||
| @ -359,7 +363,7 @@ rm -rf ${RPM_BUILD_ROOT} | ||||
| * Wed Aug 01 2012 Mark Wielaard <mjw@redhat.com> 0.154-3 | ||||
| - Add dwz support | ||||
| 
 | ||||
| * Mon Jul 18 2012 Mark Wielaard <mjw@redhat.com> 0.154-2 | ||||
| * Wed Jul 18 2012 Mark Wielaard <mjw@redhat.com> 0.154-2 | ||||
| - Add upstream xlatetom fix (#835877) | ||||
| 
 | ||||
| * Mon Jul 02 2012 Karsten Hopp <karsten@redhat.com> 0.154-1.1 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user