--- elfutils/backends/ChangeLog
+++ elfutils/backends/ChangeLog
-@@ -19,6 +19,11 @@
+@@ -47,6 +47,11 @@
* sparc_init.c: Likewise.
* x86_64_init.c: Likewise.
2005-11-19 Roland McGrath <roland@redhat.com>
* ppc64_reloc.def: REL30 -> ADDR30.
-@@ -41,6 +46,9 @@
+@@ -69,6 +74,9 @@
* Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
(CLEANFILES): Add libebl_$(m).so.
--- elfutils/backends/Makefile.am
+++ elfutils/backends/Makefile.am
-@@ -13,12 +13,14 @@
- ## 3001 King Ranch Road, Ukiah, CA 95482.
+@@ -25,12 +25,14 @@
+ ## <http://www.openinventionnetwork.com>.
##
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\"
+WEXTRA = @WEXTRA@
-std=gnu99
INCLUDES = -I$(srcdir) -I$(top_srcdir)/libebl \
-I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
-@@ -51,7 +53,7 @@ textrel_check = if readelf -d $@ | fgrep
+@@ -63,7 +65,7 @@ textrel_check = if readelf -d $@ | fgrep
libebl_%.so: libebl_%_pic.a libebl_%.map $(libelf) $(libdw)
$(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
-Wl,--version-script,$(word 2,$^) \
libebl_%.map: Makefile
--- elfutils/backends/Makefile.in
+++ elfutils/backends/Makefile.in
-@@ -159,6 +159,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -160,6 +160,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-@@ -194,6 +195,7 @@ TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
+@@ -195,6 +196,7 @@ TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
YACC = @YACC@
ac_ct_CC = @ac_ct_CC@
-@@ -236,9 +238,9 @@ sharedstatedir = @sharedstatedir@
+@@ -237,9 +239,9 @@ sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
@MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
INCLUDES = -I$(srcdir) -I$(top_srcdir)/libebl \
-I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \
-I$(top_srcdir)/lib -I..
-@@ -594,7 +596,7 @@ uninstall-am: uninstall-info-am
+@@ -597,7 +599,7 @@ uninstall-am: uninstall-info-am
libebl_%.so: libebl_%_pic.a libebl_%.map $(libelf) $(libdw)
$(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
-Wl,--version-script,$(word 2,$^) \
ac_ct_CC = @ac_ct_CC@
--- elfutils/configure
+++ elfutils/configure
-@@ -276,7 +276,7 @@ PACKAGE_STRING='Red Hat elfutils 0.118'
+@@ -276,7 +276,7 @@ PACKAGE_STRING='Red Hat elfutils 0.120'
PACKAGE_BUGREPORT='http://bugzilla.redhat.com/bugzilla/'
ac_unique_file="libelf/libelf.h"
AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR")
--- elfutils/lib/ChangeLog
+++ elfutils/lib/ChangeLog
-@@ -12,6 +12,11 @@
+@@ -16,6 +16,11 @@
* Makefile.am (libeu_a_SOURCES): Add it.
* system.h: Declare crc32_file.
* Makefile.am: Use -ffunction-sections for xmalloc.c.
--- elfutils/lib/Makefile.am
+++ elfutils/lib/Makefile.am
-@@ -16,12 +16,13 @@
- ## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+@@ -25,12 +25,13 @@
+ ## <http://www.openinventionnetwork.com>.
##
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
+WEXTRA = @WEXTRA@
noinst_LIBRARIES = libeu.a
--- elfutils/lib/Makefile.in
+++ elfutils/lib/Makefile.in
-@@ -106,6 +106,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -105,6 +105,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-@@ -141,6 +142,7 @@ TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
+@@ -140,6 +141,7 @@ TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
YACC = @YACC@
ac_ct_CC = @ac_ct_CC@
-@@ -183,9 +185,9 @@ sharedstatedir = @sharedstatedir@
+@@ -182,9 +184,9 @@ sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
@MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \
+@MUDFLAP_TRUE@ -Wunused $(WEXTRA) $($(*F)_CFLAGS)
INCLUDES = -I$(srcdir)/../libelf -I..
noinst_LIBRARIES = libeu.a
- libeu_a_SOURCES = xstrdup.c xstrndup.c xmalloc.c next_prime.c \
+ libeu_a_SOURCES = xstrndup.c xmalloc.c next_prime.c \
--- elfutils/libasm/ChangeLog
+++ elfutils/libasm/ChangeLog
@@ -28,6 +28,11 @@
* Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
--- elfutils/libasm/Makefile.am
+++ elfutils/libasm/Makefile.am
-@@ -13,12 +13,13 @@
- ## 3001 King Ranch Road, Ukiah, CA 95482.
+@@ -25,12 +25,13 @@
+ ## <http://www.openinventionnetwork.com>.
##
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
+WEXTRA = @WEXTRA@
* Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
--- elfutils/libcpu/Makefile.am
+++ elfutils/libcpu/Makefile.am
-@@ -13,7 +13,8 @@
- ## 3001 King Ranch Road, Ukiah, CA 95482.
+@@ -25,7 +25,8 @@
+ ## <http://www.openinventionnetwork.com>.
##
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
-AM_CFLAGS = -Wall -Wshadow -Werror -Wextra -Wformat=2 -Wunused
libcpu_i386_a_SOURCES = i386_dis.c
--- elfutils/libdw/ChangeLog
+++ elfutils/libdw/ChangeLog
-@@ -251,6 +251,11 @@
+@@ -276,6 +276,11 @@
2005-05-31 Roland McGrath <roland@redhat.com>
--- elfutils/libdw/Makefile.am
+++ elfutils/libdw/Makefile.am
-@@ -13,6 +13,7 @@
- ## 3001 King Ranch Road, Ukiah, CA 95482.
+@@ -25,6 +25,7 @@
+ ## <http://www.openinventionnetwork.com>.
##
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DIS_LIBDW
+WEXTRA = @WEXTRA@
if MUDFLAP
AM_CFLAGS = -fmudflap
else
-@@ -21,7 +22,7 @@ endif
+@@ -33,7 +34,7 @@ endif
if BUILD_STATIC
AM_CFLAGS += -fpic
endif
$(COMPILE)))
--- elfutils/libdwfl/ChangeLog
+++ elfutils/libdwfl/ChangeLog
-@@ -245,6 +245,11 @@
+@@ -268,6 +268,11 @@
2005-07-21 Roland McGrath <roland@redhat.com>
* test2.c (main): Check sscanf result to quiet warning.
--- elfutils/libdwfl/Makefile.am
+++ elfutils/libdwfl/Makefile.am
-@@ -15,12 +15,13 @@
- ## 3001 King Ranch Road, Ukiah, CA 95482.
+@@ -27,12 +27,13 @@
+ ## <http://www.openinventionnetwork.com>.
##
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
+WEXTRA = @WEXTRA@
* libebl_x86_64.map: Add x86_64_core_note.
--- elfutils/libebl/Makefile.am
+++ elfutils/libebl/Makefile.am
-@@ -13,12 +13,13 @@
- ## 3001 King Ranch Road, Ukiah, CA 95482.
+@@ -25,12 +25,13 @@
+ ## <http://www.openinventionnetwork.com>.
##
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\"
+WEXTRA = @WEXTRA@
--- elfutils/libelf/ChangeLog
+++ elfutils/libelf/ChangeLog
-@@ -103,6 +103,11 @@
+@@ -130,6 +130,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.
* elf.h: Update again.
--- elfutils/libelf/common.h
+++ elfutils/libelf/common.h
-@@ -122,7 +122,7 @@ libelf_release_all (Elf *elf)
+@@ -155,7 +155,7 @@ libelf_release_all (Elf *elf)
(Var) = (sizeof (Var) == 1 \
? (unsigned char) (Var) \
: (sizeof (Var) == 2 \
: (sizeof (Var) == 4 \
? bswap_32 (Var) \
: bswap_64 (Var))))
-@@ -131,7 +131,7 @@ libelf_release_all (Elf *elf)
+@@ -164,7 +164,7 @@ libelf_release_all (Elf *elf)
(Dst) = (sizeof (Var) == 1 \
? (unsigned char) (Var) \
: (sizeof (Var) == 2 \
: bswap_64 (Var))))
--- elfutils/libelf/Makefile.am
+++ elfutils/libelf/Makefile.am
-@@ -16,6 +16,7 @@
- ## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+@@ -25,6 +25,7 @@
+ ## <http://www.openinventionnetwork.com>.
##
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
+WEXTRA = @WEXTRA@
if MUDFLAP
AM_CFLAGS = -fmudflap
else
-@@ -24,7 +25,10 @@ endif
+@@ -33,7 +34,10 @@ endif
if BUILD_STATIC
AM_CFLAGS += -fpic
endif
ac_ct_CC = @ac_ct_CC@
--- elfutils/src/ChangeLog
+++ elfutils/src/ChangeLog
-@@ -236,6 +236,11 @@
+@@ -261,6 +261,11 @@
* readelf.c (print_debug_loc_section): Fix indentation for larger
address size.
* readelf.c (print_debug_line_section): Print section offset of each
--- elfutils/src/findtextrel.c
+++ elfutils/src/findtextrel.c
-@@ -476,7 +476,11 @@ ptrcompare (const void *p1, const void *
+@@ -488,7 +488,11 @@ ptrcompare (const void *p1, const void *
static void
{
--- elfutils/src/Makefile.am
+++ elfutils/src/Makefile.am
-@@ -14,6 +14,7 @@
+@@ -26,6 +26,7 @@
##
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H $(YYDEBUG) \
-DSRCDIR=\"$(shell cd $(srcdir);pwd)\" -DOBJDIR=\"$(shell pwd)\"
if MUDFLAP
AM_CFLAGS = -fmudflap
else
-@@ -21,7 +22,7 @@ AM_CFLAGS =
+@@ -33,7 +34,7 @@ AM_CFLAGS =
endif
AM_CFLAGS += -Wall -Wshadow -std=gnu99 $(native_ld_cflags) \
$(if $($(*F)_no_Werror),,-Werror) \
-I$(srcdir)/../libdw -I$(srcdir)/../libdwfl \
--- elfutils/src/strip.c
+++ elfutils/src/strip.c
-@@ -40,6 +40,12 @@
+@@ -52,6 +52,12 @@
#include <libebl.h>
#include <system.h>
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
-@@ -288,8 +294,18 @@ process_file (const char *fname)
+@@ -300,8 +306,18 @@ process_file (const char *fname)
/* If we have to preserve the timestamp, we need it in the
format utimes() understands. */
}
/* Open the file. */
-@@ -1679,7 +1695,7 @@ handle_elf (int fd, Elf *elf, const char
+@@ -1691,7 +1707,7 @@ handle_elf (int fd, Elf *elf, const char
/* If requested, preserve the timestamp. */
if (tvp != NULL)
{
{
error (0, errno, gettext ("\
cannot set access and modification date of '%s'"),
-@@ -1736,7 +1752,7 @@ handle_ar (int fd, Elf *elf, const char
+@@ -1748,7 +1764,7 @@ handle_ar (int fd, Elf *elf, const char
if (tvp != NULL)
{
cannot set access and modification date of '%s'"), fname);
--- elfutils/tests/ChangeLog
+++ elfutils/tests/ChangeLog
-@@ -316,6 +316,11 @@
+@@ -373,6 +373,11 @@
* Makefile.am (TESTS): Add run-elflint-test.sh.
(EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
* get-files.c (main): Use correct format specifier.
--- elfutils/tests/Makefile.am
+++ elfutils/tests/Makefile.am
-@@ -13,12 +13,13 @@
- ## 3001 King Ranch Road, Ukiah, CA 95482.
+@@ -25,12 +25,13 @@
+ ## <http://www.openinventionnetwork.com>.
##
DEFS = -DHAVE_CONFIG_H -D_GNU_SOURCE
+WEXTRA = @WEXTRA@
endif
--- elfutils/tests/Makefile.in
+++ elfutils/tests/Makefile.in
-@@ -283,6 +283,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -289,6 +289,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-@@ -318,6 +319,7 @@ TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
+@@ -324,6 +325,7 @@ TESTS_RPATH_FALSE = @TESTS_RPATH_FALSE@
TESTS_RPATH_TRUE = @TESTS_RPATH_TRUE@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
XGETTEXT = @XGETTEXT@
YACC = @YACC@
ac_ct_CC = @ac_ct_CC@
-@@ -359,10 +361,10 @@ sbindir = @sbindir@
+@@ -365,10 +367,10 @@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
(check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic,
check_symtab_shndx, check_hash, check_versym): Robustify.
---- elfutils-0.116/libelf/elf32_getphdr.c
-+++ elfutils-0.116/libelf/elf32_getphdr.c
-@@ -82,6 +82,16 @@
+--- elfutils-0.120/libelf/elf32_getphdr.c
++++ elfutils-0.120/libelf/elf32_getphdr.c
+@@ -115,6 +115,16 @@ elfw2(LIBELFBITS,getphdr) (elf)
if (elf->map_address != NULL)
{
/* All the data is already mapped. Use it. */
if (ehdr->e_ident[EI_DATA] == MY_ELFDATA
&& (ALLOW_UNALIGNED
---- elfutils-0.116/libelf/elf32_getshdr.c
-+++ elfutils-0.116/libelf/elf32_getshdr.c
-@@ -68,11 +68,12 @@
+--- elfutils-0.120/libelf/elf32_getshdr.c
++++ elfutils-0.120/libelf/elf32_getshdr.c
+@@ -101,11 +101,12 @@ elfw2(LIBELFBITS,getshdr) (scn)
goto out;
size_t shnum;
of entries from the ELF header. */
ElfW2(LIBELFBITS,Shdr) *shdr = elf->state.ELFW(elf,LIBELFBITS).shdr =
(ElfW2(LIBELFBITS,Shdr) *) malloc (size);
-@@ -94,6 +95,16 @@
- && (ehdr->e_shoff
+@@ -128,6 +129,16 @@ elfw2(LIBELFBITS,getshdr) (scn)
+ + ehdr->e_shoff)
& (__alignof__ (ElfW2(LIBELFBITS,Shdr)) - 1)) != 0));
+ /* First see whether the information in the ELF header is
/* Now copy the data and at the same time convert the byte
order. */
if (ALLOW_UNALIGNED
---- elfutils-0.116/libelf/elf32_newphdr.c
-+++ elfutils-0.116/libelf/elf32_newphdr.c
-@@ -1,5 +1,5 @@
- /* Create new ELF program header table.
-- Copyright (C) 1999, 2000, 2002 Red Hat, Inc.
-+ Copyright (C) 1999, 2000, 2002, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 1998.
-
- This program is free software; you can redistribute it and/or modify
-@@ -91,6 +91,12 @@
+--- elfutils-0.120/libelf/elf32_newphdr.c
++++ elfutils-0.120/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)
{
/* Allocate a new program header with the appropriate number of
elements. */
result = (ElfW2(LIBELFBITS,Phdr) *)
---- elfutils-0.116/libelf/elf32_updatefile.c
-+++ elfutils-0.116/libelf/elf32_updatefile.c
-@@ -166,6 +166,9 @@
+--- elfutils-0.120/libelf/elf32_updatefile.c
++++ elfutils-0.120/libelf/elf32_updatefile.c
+@@ -201,6 +201,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;
++ return 1;
+
- ElfW2(LIBELFBITS,Shdr) *shdr_dest;
Elf_ScnList *list = &elf->state.ELFW(elf,LIBELFBITS).scns;
Elf_Scn **scns = (Elf_Scn **) alloca (shnum * sizeof (Elf_Scn *));
-@@ -470,6 +473,10 @@
+ char *const shdr_start = ((char *) elf->map_address + elf->start_offset
+@@ -545,6 +548,10 @@ __elfw2(LIBELFBITS,updatefile) (Elf *elf
/* Write all the sections. Well, only those which are modified. */
if (shnum > 0)
{
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.116/libelf/elf_begin.c
-+++ elfutils-0.116/libelf/elf_begin.c
-@@ -122,7 +122,8 @@
+--- elfutils-0.120/libelf/elf_begin.c
++++ elfutils-0.120/libelf/elf_begin.c
+@@ -155,7 +155,8 @@ get_shnum (void *map_address, unsigned c
if (unlikely (result == 0) && ehdr.e32->e_shoff != 0)
{
/* Cannot read the first section header. */
return (size_t) -1l;
-@@ -165,7 +166,8 @@
+@@ -198,7 +199,8 @@ get_shnum (void *map_address, unsigned c
if (unlikely (result == 0) && ehdr.e64->e_shoff != 0)
{
/* Cannot read the first section header. */
return (size_t) -1l;
-@@ -232,6 +234,15 @@
+@@ -265,6 +267,15 @@ file_read_elf (int fildes, void *map_add
/* Could not determine the number of sections. */
return NULL;
/* We can now allocate the memory. */
Elf *elf = allocate_elf (fildes, map_address, offset, maxsize, cmd, parent,
ELF_K_ELF, scncnt * sizeof (Elf_Scn));
-@@ -265,13 +276,31 @@
+@@ -298,13 +309,31 @@ file_read_elf (int fildes, void *map_add
{
/* We can use the mmapped memory. */
elf->state.elf32.ehdr = ehdr;
for (size_t cnt = 0; cnt < scncnt; ++cnt)
{
-@@ -340,13 +369,26 @@
+@@ -373,13 +402,26 @@ file_read_elf (int fildes, void *map_add
{
/* We can use the mmapped memory. */
elf->state.elf64.ehdr = ehdr;
for (size_t cnt = 0; cnt < scncnt; ++cnt)
{
---- elfutils-0.116/libelf/elf_getarsym.c
-+++ elfutils-0.116/libelf/elf_getarsym.c
-@@ -146,6 +146,9 @@
+--- elfutils-0.120/libelf/elf_getarsym.c
++++ elfutils-0.120/libelf/elf_getarsym.c
+@@ -179,6 +179,9 @@ elf_getarsym (elf, ptr)
size_t index_size = atol (tmpbuf);
if (SARMAG + sizeof (struct ar_hdr) + index_size > elf->maximum_size
|| n * sizeof (uint32_t) > index_size)
{
/* This index table cannot be right since it does not fit into
---- elfutils-0.116/libelf/elf_getshstrndx.c
-+++ elfutils-0.116/libelf/elf_getshstrndx.c
-@@ -92,10 +92,25 @@
+--- elfutils-0.120/libelf/elf_getshstrndx.c
++++ elfutils-0.120/libelf/elf_getshstrndx.c
+@@ -125,10 +125,25 @@ elf_getshstrndx (elf, dst)
if (elf->map_address != NULL
&& elf->state.elf32.ehdr->e_ident[EI_DATA] == MY_ELFDATA
&& (ALLOW_UNALIGNED
else
{
/* We avoid reading in all the section headers. Just read
-@@ -130,10 +145,25 @@
+@@ -163,10 +178,25 @@ elf_getshstrndx (elf, dst)
if (elf->map_address != NULL
&& elf->state.elf64.ehdr->e_ident[EI_DATA] == MY_ELFDATA
&& (ALLOW_UNALIGNED
else
{
/* We avoid reading in all the section headers. Just read
---- elfutils-0.116/libelf/elf_newscn.c
-+++ elfutils-0.116/libelf/elf_newscn.c
-@@ -1,5 +1,5 @@
- /* Append new section.
-- Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
-+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 1998.
-
- This program is free software; you can redistribute it and/or modify
-@@ -71,13 +71,21 @@
+--- elfutils-0.120/libelf/elf_newscn.c
++++ elfutils-0.120/libelf/elf_newscn.c
+@@ -104,13 +104,21 @@ elf_newscn (elf)
else
{
/* We must allocate a new element. */
if (newp == NULL)
{
__libelf_seterrno (ELF_E_NOMEM);
---- elfutils-0.116/libelf/gelf_getdyn.c
-+++ elfutils-0.116/libelf/gelf_getdyn.c
-@@ -1,5 +1,5 @@
- /* Get information from dynamic table at the given index.
-- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+ Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 2000.
-
- This program is free software; you can redistribute it and/or modify
-@@ -60,7 +60,8 @@
+--- elfutils-0.120/libelf/gelf_getdyn.c
++++ elfutils-0.120/libelf/gelf_getdyn.c
+@@ -93,7 +93,8 @@ gelf_getdyn (data, ndx, dst)
table entries has to be adopted. The user better has provided
a buffer where we can store the information. While copying the
data we are converting the format. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
-@@ -81,7 +82,8 @@
+@@ -114,7 +115,8 @@ gelf_getdyn (data, ndx, dst)
/* The data is already in the correct form. Just make sure the
index is OK. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
---- elfutils-0.116/libelf/gelf_getlib.c
-+++ elfutils-0.116/libelf/gelf_getlib.c
-@@ -1,5 +1,5 @@
- /* Get library from table at the given index.
-- Copyright (C) 2004 Red Hat, Inc.
-+ Copyright (C) 2004, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 2004.
-
- This program is free software; you can redistribute it and/or modify
-@@ -53,7 +53,8 @@
+--- elfutils-0.120/libelf/gelf_getlib.c
++++ elfutils-0.120/libelf/gelf_getlib.c
+@@ -86,7 +86,8 @@ gelf_getlib (data, ndx, dst)
/* The data is already in the correct form. Just make sure the
index is OK. */
GElf_Lib *result = NULL;
__libelf_seterrno (ELF_E_INVALID_INDEX);
else
{
---- elfutils-0.116/libelf/gelf_getmove.c
-+++ elfutils-0.116/libelf/gelf_getmove.c
-@@ -1,5 +1,5 @@
- /* Get move structure at the given index.
-- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+ Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 2000.
-
- This program is free software; you can redistribute it and/or modify
-@@ -50,7 +50,8 @@
+--- elfutils-0.120/libelf/gelf_getmove.c
++++ elfutils-0.120/libelf/gelf_getmove.c
+@@ -83,7 +83,8 @@ gelf_getmove (data, ndx, dst)
/* The data is already in the correct form. Just make sure the
index is OK. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
---- elfutils-0.116/libelf/gelf_getrela.c
-+++ elfutils-0.116/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, 2001, 2002, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 2000.
-
- This program is free software; you can redistribute it and/or modify
-@@ -38,12 +38,6 @@
+--- elfutils-0.120/libelf/gelf_getrela.c
++++ elfutils-0.120/libelf/gelf_getrela.c
+@@ -71,12 +71,6 @@ gelf_getrela (data, ndx, dst)
if (data_scn == NULL)
return NULL;
if (unlikely (data_scn->d.d_type != ELF_T_RELA))
{
__libelf_seterrno (ELF_E_INVALID_HANDLE);
-@@ -60,7 +54,8 @@
+@@ -93,7 +87,8 @@ gelf_getrela (data, ndx, dst)
if (scn->elf->class == ELFCLASS32)
{
/* We have to convert the data. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
result = NULL;
-@@ -81,7 +76,8 @@
+@@ -114,7 +109,8 @@ gelf_getrela (data, ndx, dst)
{
/* Simply copy the data after we made sure we are actually getting
correct data. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
result = NULL;
---- elfutils-0.116/libelf/gelf_getrel.c
-+++ elfutils-0.116/libelf/gelf_getrel.c
-@@ -1,5 +1,5 @@
- /* Get REL relocation information at given index.
-- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+ Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 2000.
-
- This program is free software; you can redistribute it and/or modify
-@@ -38,12 +38,6 @@
+--- elfutils-0.120/libelf/gelf_getrel.c
++++ elfutils-0.120/libelf/gelf_getrel.c
+@@ -71,12 +71,6 @@ gelf_getrel (data, ndx, dst)
if (data_scn == NULL)
return NULL;
if (unlikely (data_scn->d.d_type != ELF_T_REL))
{
__libelf_seterrno (ELF_E_INVALID_HANDLE);
-@@ -60,7 +54,8 @@
+@@ -93,7 +87,8 @@ gelf_getrel (data, ndx, dst)
if (scn->elf->class == ELFCLASS32)
{
/* We have to convert the data. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
result = NULL;
-@@ -80,7 +75,8 @@
+@@ -113,7 +108,8 @@ gelf_getrel (data, ndx, dst)
{
/* Simply copy the data after we made sure we are actually getting
correct data. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
result = NULL;
---- elfutils-0.116/libelf/gelf_getsym.c
-+++ elfutils-0.116/libelf/gelf_getsym.c
-@@ -1,5 +1,5 @@
- /* Get symbol information from symbol table at the given index.
-- Copyright (C) 1999, 2000, 2001, 2002 Red Hat, Inc.
-+ Copyright (C) 1999, 2000, 2001, 2002, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 1999.
-
- This program is free software; you can redistribute it and/or modify
-@@ -57,7 +57,8 @@
+--- elfutils-0.120/libelf/gelf_getsym.c
++++ elfutils-0.120/libelf/gelf_getsym.c
+@@ -90,7 +90,8 @@ gelf_getsym (data, ndx, dst)
table entries has to be adopted. The user better has provided
a buffer where we can store the information. While copying the
data we are converting the format. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
-@@ -86,7 +87,8 @@
+@@ -119,7 +120,8 @@ gelf_getsym (data, ndx, dst)
/* The data is already in the correct form. Just make sure the
index is OK. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
---- elfutils-0.116/libelf/gelf_getsyminfo.c
-+++ elfutils-0.116/libelf/gelf_getsyminfo.c
-@@ -1,5 +1,5 @@
- /* Get additional symbol information from symbol table at the given index.
-- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+ Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 2000.
-
- This program is free software; you can redistribute it and/or modify
-@@ -51,7 +51,8 @@
+--- elfutils-0.120/libelf/gelf_getsyminfo.c
++++ elfutils-0.120/libelf/gelf_getsyminfo.c
+@@ -84,7 +84,8 @@ gelf_getsyminfo (data, ndx, dst)
/* The data is already in the correct form. Just make sure the
index is OK. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
---- elfutils-0.116/libelf/gelf_getsymshndx.c
-+++ elfutils-0.116/libelf/gelf_getsymshndx.c
-@@ -1,6 +1,6 @@
- /* Get symbol information and separate section index from symbol table
- at the given index.
-- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+ Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 2000.
-
- This program is free software; you can redistribute it and/or modify
-@@ -57,7 +57,9 @@
+--- elfutils-0.120/libelf/gelf_getsymshndx.c
++++ elfutils-0.120/libelf/gelf_getsymshndx.c
+@@ -90,7 +90,9 @@ gelf_getsymshndx (symdata, shndxdata, nd
section index table. */
if (likely (shndxdata_scn != NULL))
{
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
-@@ -77,7 +79,8 @@
+@@ -110,7 +112,8 @@ gelf_getsymshndx (symdata, shndxdata, nd
table entries has to be adopted. The user better has provided
a buffer where we can store the information. While copying the
data we are converting the format. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
-@@ -106,7 +109,8 @@
+@@ -139,7 +142,8 @@ gelf_getsymshndx (symdata, shndxdata, nd
/* The data is already in the correct form. Just make sure the
index is OK. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
---- elfutils-0.116/libelf/gelf_getversym.c
-+++ elfutils-0.116/libelf/gelf_getversym.c
-@@ -1,5 +1,5 @@
- /* Get symbol version information at the given index.
-- Copyright (C) 1999, 2000, 2001, 2002 Red Hat, Inc.
-+ Copyright (C) 1999, 2000, 2001, 2002, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 1999.
-
- This program is free software; you can redistribute it and/or modify
-@@ -59,7 +59,8 @@
+--- elfutils-0.120/libelf/gelf_getversym.c
++++ elfutils-0.120/libelf/gelf_getversym.c
+@@ -92,7 +92,8 @@ gelf_getversym (data, ndx, dst)
/* The data is already in the correct form. Just make sure the
index is OK. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
result = NULL;
---- elfutils-0.116/libelf/gelf_update_dyn.c
-+++ elfutils-0.116/libelf/gelf_update_dyn.c
-@@ -1,5 +1,5 @@
- /* Update information in dynamic table at the given index.
-- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+ Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 2000.
-
- This program is free software; you can redistribute it and/or modify
-@@ -38,12 +38,6 @@
+--- elfutils-0.120/libelf/gelf_update_dyn.c
++++ elfutils-0.120/libelf/gelf_update_dyn.c
+@@ -71,12 +71,6 @@ gelf_update_dyn (data, ndx, src)
if (data == NULL)
return 0;
if (unlikely (data_scn->d.d_type != ELF_T_DYN))
{
/* The type of the data better should match. */
-@@ -69,7 +63,8 @@
+@@ -102,7 +96,8 @@ gelf_update_dyn (data, ndx, src)
}
/* Check whether we have to resize the data buffer. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
-@@ -83,7 +78,8 @@
+@@ -116,7 +111,8 @@ gelf_update_dyn (data, ndx, src)
else
{
/* Check whether we have to resize the data buffer. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
---- elfutils-0.116/libelf/gelf_update_lib.c
-+++ elfutils-0.116/libelf/gelf_update_lib.c
-@@ -1,5 +1,5 @@
- /* Update library in table at the given index.
-- Copyright (C) 2004 Red Hat, Inc.
-+ Copyright (C) 2004, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 2004.
-
- This program is free software; you can redistribute it and/or modify
-@@ -35,12 +35,6 @@
+--- elfutils-0.120/libelf/gelf_update_lib.c
++++ elfutils-0.120/libelf/gelf_update_lib.c
+@@ -68,12 +68,6 @@ gelf_update_lib (data, ndx, src)
if (data == NULL)
return 0;
Elf_Data_Scn *data_scn = (Elf_Data_Scn *) data;
if (unlikely (data_scn->d.d_type != ELF_T_LIB))
{
-@@ -54,7 +48,8 @@
+@@ -87,7 +81,8 @@ gelf_update_lib (data, ndx, src)
/* Check whether we have to resize the data buffer. */
int result = 0;
__libelf_seterrno (ELF_E_INVALID_INDEX);
else
{
---- elfutils-0.116/libelf/gelf_update_move.c
-+++ elfutils-0.116/libelf/gelf_update_move.c
-@@ -1,5 +1,5 @@
- /* Update move structure at the given index.
-- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+ Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 2000.
-
- This program is free software; you can redistribute it and/or modify
-@@ -42,7 +42,7 @@
+--- elfutils-0.120/libelf/gelf_update_move.c
++++ elfutils-0.120/libelf/gelf_update_move.c
+@@ -75,7 +75,7 @@ gelf_update_move (data, ndx, src)
assert (sizeof (GElf_Move) == sizeof (Elf64_Move));
/* Check whether we have to resize the data buffer. */
|| unlikely ((ndx + 1) * sizeof (GElf_Move) > data_scn->d.d_size))
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
---- elfutils-0.116/libelf/gelf_update_rela.c
-+++ elfutils-0.116/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, 2001, 2002, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 2000.
-
- This program is free software; you can redistribute it and/or modify
-@@ -35,12 +35,6 @@
+--- elfutils-0.120/libelf/gelf_update_rela.c
++++ elfutils-0.120/libelf/gelf_update_rela.c
+@@ -68,12 +68,6 @@ gelf_update_rela (Elf_Data *dst, int ndx
if (dst == NULL)
return 0;
if (unlikely (data_scn->d.d_type != ELF_T_RELA))
{
/* The type of the data better should match. */
-@@ -68,7 +62,8 @@
+@@ -101,7 +95,8 @@ gelf_update_rela (Elf_Data *dst, int ndx
}
/* Check whether we have to resize the data buffer. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
-@@ -84,7 +79,8 @@
+@@ -117,7 +112,8 @@ gelf_update_rela (Elf_Data *dst, int ndx
else
{
/* Check whether we have to resize the data buffer. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
---- elfutils-0.116/libelf/gelf_update_rel.c
-+++ elfutils-0.116/libelf/gelf_update_rel.c
-@@ -1,5 +1,5 @@
- /* Update REL relocation information at given index.
-- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+ Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 2000.
-
- This program is free software; you can redistribute it and/or modify
-@@ -35,12 +35,6 @@
+--- elfutils-0.120/libelf/gelf_update_rel.c
++++ elfutils-0.120/libelf/gelf_update_rel.c
+@@ -68,12 +68,6 @@ gelf_update_rel (Elf_Data *dst, int ndx,
if (dst == NULL)
return 0;
if (unlikely (data_scn->d.d_type != ELF_T_REL))
{
/* The type of the data better should match. */
-@@ -66,7 +60,8 @@
+@@ -99,7 +93,8 @@ gelf_update_rel (Elf_Data *dst, int ndx,
}
/* Check whether we have to resize the data buffer. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
-@@ -81,7 +76,8 @@
+@@ -114,7 +109,8 @@ gelf_update_rel (Elf_Data *dst, int ndx,
else
{
/* Check whether we have to resize the data buffer. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
---- elfutils-0.116/libelf/gelf_update_sym.c
-+++ elfutils-0.116/libelf/gelf_update_sym.c
-@@ -1,5 +1,5 @@
- /* Update symbol information in symbol table at the given index.
-- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+ Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 2000.
-
- This program is free software; you can redistribute it and/or modify
-@@ -39,12 +39,6 @@
+--- elfutils-0.120/libelf/gelf_update_sym.c
++++ elfutils-0.120/libelf/gelf_update_sym.c
+@@ -72,12 +72,6 @@ gelf_update_sym (data, ndx, src)
if (data == NULL)
return 0;
if (unlikely (data_scn->d.d_type != ELF_T_SYM))
{
/* The type of the data better should match. */
-@@ -69,7 +63,8 @@
+@@ -102,7 +96,8 @@ gelf_update_sym (data, ndx, src)
}
/* Check whether we have to resize the data buffer. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
-@@ -92,7 +87,8 @@
+@@ -125,7 +120,8 @@ gelf_update_sym (data, ndx, src)
else
{
/* Check whether we have to resize the data buffer. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
---- elfutils-0.116/libelf/gelf_update_syminfo.c
-+++ elfutils-0.116/libelf/gelf_update_syminfo.c
-@@ -1,5 +1,5 @@
- /* Update additional symbol information in symbol table at the given index.
-- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+ Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 2000.
-
- This program is free software; you can redistribute it and/or modify
-@@ -39,12 +39,6 @@
+--- elfutils-0.120/libelf/gelf_update_syminfo.c
++++ elfutils-0.120/libelf/gelf_update_syminfo.c
+@@ -72,12 +72,6 @@ gelf_update_syminfo (data, ndx, src)
if (data == NULL)
return 0;
if (unlikely (data_scn->d.d_type != ELF_T_SYMINFO))
{
/* The type of the data better should match. */
-@@ -60,7 +54,8 @@
+@@ -93,7 +87,8 @@ gelf_update_syminfo (data, ndx, src)
rwlock_wrlock (scn->elf->lock);
/* Check whether we have to resize the data buffer. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
---- elfutils-0.116/libelf/gelf_update_symshndx.c
-+++ elfutils-0.116/libelf/gelf_update_symshndx.c
-@@ -1,6 +1,6 @@
- /* Update symbol information and section index in symbol table at the
- given index.
-- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
-+ Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 2000.
-
- This program is free software; you can redistribute it and/or modify
-@@ -44,12 +44,6 @@
+--- elfutils-0.120/libelf/gelf_update_symshndx.c
++++ elfutils-0.120/libelf/gelf_update_symshndx.c
+@@ -77,12 +77,6 @@ gelf_update_symshndx (symdata, shndxdata
if (symdata == NULL)
return 0;
if (unlikely (symdata_scn->d.d_type != ELF_T_SYM))
{
/* The type of the data better should match. */
-@@ -95,7 +89,8 @@
+@@ -128,7 +122,8 @@ gelf_update_symshndx (symdata, shndxdata
}
/* Check whether we have to resize the data buffer. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
-@@ -118,7 +113,8 @@
+@@ -151,7 +146,8 @@ gelf_update_symshndx (symdata, shndxdata
else
{
/* Check whether we have to resize the data buffer. */
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
---- elfutils-0.116/libelf/gelf_update_versym.c
-+++ elfutils-0.116/libelf/gelf_update_versym.c
-@@ -1,5 +1,5 @@
- /* Update symbol version information.
-- Copyright (C) 2001, 2002 Red Hat, Inc.
-+ Copyright (C) 2001, 2002, 2005 Red Hat, Inc.
- Written by Ulrich Drepper <drepper@redhat.com>, 2001.
-
- This program is free software; you can redistribute it and/or modify
-@@ -42,7 +42,7 @@
+--- elfutils-0.120/libelf/gelf_update_versym.c
++++ elfutils-0.120/libelf/gelf_update_versym.c
+@@ -75,7 +75,7 @@ gelf_update_versym (data, ndx, src)
assert (sizeof (GElf_Versym) == sizeof (Elf64_Versym));
/* Check whether we have to resize the data buffer. */
|| unlikely ((ndx + 1) * sizeof (GElf_Versym) > data_scn->d.d_size))
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
---- elfutils-0.116/libelf/libelfP.h
-+++ elfutils-0.116/libelf/libelfP.h
-@@ -536,4 +536,13 @@
+--- elfutils-0.120/libelf/libelfP.h
++++ elfutils-0.120/libelf/libelfP.h
+@@ -569,4 +569,13 @@ extern uint32_t __libelf_crc32 (uint32_t
} while (0)
#endif
+#endif
+
#endif /* libelfP.h */
---- elfutils-0.116/src/elflint.c
-+++ elfutils-0.116/src/elflint.c
-@@ -111,6 +111,9 @@
+--- elfutils-0.120/src/elflint.c
++++ elfutils-0.120/src/elflint.c
+@@ -123,6 +123,9 @@ static uint32_t shstrndx;
/* Array to count references in section groups. */
static int *scnref;
int
main (int argc, char *argv[])
-@@ -300,10 +303,19 @@
+@@ -312,10 +315,19 @@ section_name (Ebl *ebl, int idx)
{
GElf_Shdr shdr_mem;
GElf_Shdr *shdr;
}
-@@ -325,10 +337,6 @@
+@@ -337,10 +349,6 @@ static const int valid_e_machine[] =
(sizeof (valid_e_machine) / sizeof (valid_e_machine[0]))
static void
check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size)
{
-@@ -591,7 +599,8 @@
+@@ -603,7 +611,8 @@ section [%2d] '%s': symbol table cannot
}
}
ERROR (gettext ("\
section [%2zu] '%s': entry size is does not match ElfXX_Sym\n"),
cnt, section_name (ebl, cnt));
-@@ -629,7 +638,7 @@
+@@ -641,7 +650,7 @@ section [%2d] '%s': XINDEX for zeroth en
xndxscnidx, section_name (ebl, xndxscnidx));
}
{
sym = gelf_getsymshndx (data, xndxdata, cnt, &sym_mem, &xndx);
if (sym == NULL)
-@@ -647,7 +656,8 @@
+@@ -659,7 +668,8 @@ section [%2d] '%s': symbol %zu: invalid
else
{
name = elf_strptr (ebl->elf, shdr->sh_link, sym->st_name);
}
if (sym->st_shndx == SHN_XINDEX)
-@@ -958,7 +968,7 @@
+@@ -970,7 +980,7 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
const GElf_Shdr *rcshdr = gelf_getshdr (scn, &rcshdr_mem);
assert (rcshdr != NULL);
{
/* Found the dynamic section. Look through it. */
Elf_Data *d = elf_getdata (scn, NULL);
-@@ -968,14 +978,17 @@
+@@ -980,14 +990,17 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
{
GElf_Dyn dyn_mem;
GElf_Dyn *dyn = gelf_getdyn (d, cnt, &dyn_mem);
ERROR (gettext ("\
section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"),
idx, section_name (ebl, idx),
-@@ -1050,7 +1063,8 @@
+@@ -1062,7 +1075,8 @@ section [%2d] '%s': no relocations for m
}
}
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"),
-@@ -1258,7 +1272,8 @@
+@@ -1280,7 +1294,8 @@ check_rela (Ebl *ebl, GElf_Ehdr *ehdr, G
Elf_Data *symdata = elf_getdata (symscn, NULL);
enum load_state state = state_undecided;
{
GElf_Rela rela_mem;
GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem);
-@@ -1307,7 +1322,8 @@
+@@ -1330,7 +1345,8 @@ check_rel (Ebl *ebl, GElf_Ehdr *ehdr, GE
Elf_Data *symdata = elf_getdata (symscn, NULL);
enum load_state state = state_undecided;
{
GElf_Rel rel_mem;
GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem);
-@@ -1408,7 +1424,8 @@
+@@ -1432,7 +1448,8 @@ section [%2d] '%s': referenced as string
shdr->sh_link, section_name (ebl, shdr->sh_link),
idx, section_name (ebl, idx));
ERROR (gettext ("\
section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"),
idx, section_name (ebl, idx));
-@@ -1418,7 +1435,7 @@
+@@ -1442,7 +1459,7 @@ section [%2d] '%s': section entry size d
idx, section_name (ebl, idx));
bool non_null_warned = false;
{
GElf_Dyn dyn_mem;
GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dyn_mem);
-@@ -1559,6 +1576,8 @@
+@@ -1633,6 +1650,8 @@ section [%2d] '%s': entry size does not
idx, section_name (ebl, idx));
if (symshdr != NULL
&& (shdr->sh_size / shdr->sh_entsize
< symshdr->sh_size / symshdr->sh_entsize))
ERROR (gettext ("\
-@@ -1585,6 +1604,12 @@
+@@ -1659,6 +1678,12 @@ section [%2d] '%s': extended section ind
}
Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
if (*((Elf32_Word *) data->d_buf) != 0)
ERROR (gettext ("symbol 0 should have zero extended section index\n"));
-@@ -1665,23 +1690,30 @@
+@@ -1739,23 +1764,30 @@ section [%2d] '%s': hash table section i
idx, section_name (ebl, idx), (long int) shdr->sh_size,
(long int) ((2 + nbucket + nchain) * shdr->sh_entsize));
ERROR (gettext ("\
section [%2d] '%s': hash chain reference %zu out of bounds\n"),
idx, section_name (ebl, idx), cnt - 2 - nbucket);
-@@ -2023,8 +2055,9 @@
+@@ -2097,8 +2129,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. */
ERROR (gettext ("\
section [%2d] '%s' has different number of entries than symbol table [%2d] '%s'\n"),
idx, section_name (ebl, idx),
-@@ -2928,6 +2961,8 @@
+@@ -3002,6 +3035,8 @@ phdr[%d]: no note entries defined for th
return;
char *notemem = gelf_rawchunk (ebl->elf, phdr->p_offset, phdr->p_filesz);
/* ELF64 files often use note section entries in the 32-bit format.
The p_align field is set to 8 in case the 64-bit format is used.
---- elfutils-0.116/src/readelf.c
-+++ elfutils-0.116/src/readelf.c
-@@ -946,6 +946,8 @@
+--- elfutils-0.120/src/readelf.c
++++ elfutils-0.120/src/readelf.c
+@@ -958,6 +958,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
Elf32_Word *grpref = (Elf32_Word *) data->d_buf;
GElf_Sym sym_mem;
printf ((grpref[0] & GRP_COMDAT)
? ngettext ("\
\nCOMDAT section group [%2zu] '%s' with signature '%s' contains %zu entry:\n",
-@@ -958,8 +960,8 @@
+@@ -970,8 +972,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),
?: gettext ("<INVALID SYMBOL>"),
data->d_size / sizeof (Elf32_Word) - 1);
-@@ -1110,7 +1112,8 @@
+@@ -1122,7 +1124,8 @@ static void
handle_dynamic (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
{
int class = gelf_getclass (ebl->elf);
Elf_Data *data;
size_t cnt;
size_t shstrndx;
-@@ -1125,6 +1128,11 @@
+@@ -1137,6 +1140,11 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn,
error (EXIT_FAILURE, 0,
gettext ("cannot get section header string table index"));
printf (ngettext ("\
\nDynamic segment contains %lu entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
"\
-@@ -1134,9 +1142,7 @@
+@@ -1146,9 +1154,7 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn,
class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
shdr->sh_offset,
(int) shdr->sh_link,
fputs_unlocked (gettext (" Type Value\n"), stdout);
for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
-@@ -1654,6 +1660,13 @@
+@@ -1666,6 +1672,13 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
error (EXIT_FAILURE, 0,
gettext ("cannot get section header string table index"));
/* Now we can compute the number of entries in the section. */
unsigned int nsyms = data->d_size / (class == ELFCLASS32
? sizeof (Elf32_Sym)
-@@ -1664,15 +1677,12 @@
+@@ -1676,15 +1689,12 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
nsyms),
(unsigned int) elf_ndxscn (scn),
elf_strptr (ebl->elf, shstrndx, shdr->sh_name), nsyms);
fputs_unlocked (class == ELFCLASS32
? gettext ("\
-@@ -1908,7 +1918,13 @@
+@@ -1920,7 +1930,13 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn,
error (EXIT_FAILURE, 0,
gettext ("cannot get section header string table index"));
printf (ngettext ("\
\nVersion needs section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
"\
-@@ -1919,9 +1935,7 @@
+@@ -1931,9 +1947,7 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn,
class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
shdr->sh_offset,
(unsigned int) shdr->sh_link,
unsigned int offset = 0;
for (int cnt = shdr->sh_info; --cnt >= 0; )
-@@ -1974,8 +1988,14 @@
+@@ -1986,8 +2000,14 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
error (EXIT_FAILURE, 0,
gettext ("cannot get section header string table index"));
printf (ngettext ("\
\nVersion definition section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
"\
-@@ -1987,9 +2007,7 @@
+@@ -1999,9 +2019,7 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
shdr->sh_offset,
(unsigned int) shdr->sh_link,
unsigned int offset = 0;
for (int cnt = shdr->sh_info; --cnt >= 0; )
-@@ -2251,8 +2269,14 @@
+@@ -2263,8 +2281,14 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G
filename = NULL;
}
printf (ngettext ("\
\nVersion symbols section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'",
"\
-@@ -2264,9 +2288,7 @@
+@@ -2276,9 +2300,7 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G
class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
shdr->sh_offset,
(unsigned int) shdr->sh_link,
/* Now we can finally look at the actual contents of this section. */
for (unsigned int cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
-@@ -2341,7 +2363,17 @@
+@@ -2353,7 +2375,17 @@ handle_hash (Ebl *ebl)
Elf32_Word *bucket = &((Elf32_Word *) data->d_buf)[2];
Elf32_Word *chain = &((Elf32_Word *) data->d_buf)[2 + nbucket];
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",
"\
-@@ -2354,10 +2386,7 @@
+@@ -2366,10 +2398,7 @@ handle_hash (Ebl *ebl)
shdr->sh_addr,
shdr->sh_offset,
(unsigned int) shdr->sh_link,
uint32_t *lengths = (uint32_t *) xcalloc (nbucket,
sizeof (uint32_t));
-@@ -3460,6 +3489,16 @@
+@@ -3510,6 +3539,16 @@ print_debug_aranges_section (Ebl *ebl __
return;
}
printf (ngettext ("\
\nDWARF section '%s' at offset %#" PRIx64 " contains %zu entry:\n",
"\
---- elfutils-0.116/src/strip.c
-+++ elfutils-0.116/src/strip.c
-@@ -400,6 +400,7 @@
+--- elfutils-0.120/src/strip.c
++++ elfutils-0.120/src/strip.c
+@@ -412,6 +412,7 @@ handle_elf (int fd, Elf *elf, const char
Elf_Data debuglink_crc_data;
bool any_symtab_changes = false;
Elf_Data *shstrtab_data = NULL;
/* Create the full name of the file. */
if (prefix != NULL)
-@@ -530,6 +531,11 @@
+@@ -542,6 +543,11 @@ handle_elf (int fd, Elf *elf, const char
goto fail_close;
}
/* 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.
-@@ -551,7 +557,7 @@
+@@ -563,7 +569,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). */
shdr_info[cnt].scn = scn;
-@@ -564,6 +570,7 @@
+@@ -576,6 +582,7 @@ handle_elf (int fd, Elf *elf, const char
shdr_info[cnt].shdr.sh_name);
if (shdr_info[cnt].name == NULL)
{
error (0, 0, gettext ("illformed file '%s'"), fname);
goto fail_close;
}
-@@ -573,6 +580,8 @@
+@@ -585,6 +592,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;
/* Sections in files other than relocatable object files which
are not loaded can be freely moved by us. In relocatable
-@@ -585,7 +594,7 @@
+@@ -597,7 +606,7 @@ handle_elf (int fd, Elf *elf, const char
appropriate reference. */
if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB_SHNDX))
{
shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx = cnt;
}
else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GROUP))
-@@ -602,7 +611,12 @@
+@@ -614,7 +623,12 @@ handle_elf (int fd, Elf *elf, const char
for (inner = 1;
inner < shdr_info[cnt].data->d_size / sizeof (Elf32_Word);
++inner)
if (inner == 1 || (inner == 2 && (grpref[0] & GRP_COMDAT) == 0))
/* If the section group contains only one element and this
-@@ -613,7 +627,7 @@
+@@ -625,7 +639,7 @@ handle_elf (int fd, Elf *elf, const char
}
else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GNU_versym))
{
shdr_info[shdr_info[cnt].shdr.sh_link].version_idx = cnt;
}
-@@ -621,7 +635,7 @@
+@@ -633,7 +647,7 @@ handle_elf (int fd, Elf *elf, const char
discarded right away. */
if ((shdr_info[cnt].shdr.sh_flags & SHF_GROUP) != 0)
{
if (shdr_info[shdr_info[cnt].group_idx].idx == 0)
{
-@@ -696,10 +710,14 @@
+@@ -708,10 +722,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. */
}
if (shdr_info[cnt].idx == 1)
-@@ -725,7 +743,7 @@
+@@ -737,7 +755,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)
{
shdr_info[shdr_info[cnt].symtab_idx].data
= elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn,
-@@ -765,6 +783,9 @@
+@@ -777,6 +795,9 @@ handle_elf (int fd, Elf *elf, const char
else if (scnidx == SHN_XINDEX)
scnidx = xndx;
if (shdr_info[scnidx].idx == 0)
{
/* Mark this section as used. */
-@@ -796,11 +817,15 @@
+@@ -808,11 +829,15 @@ handle_elf (int fd, Elf *elf, const char
}
/* Handle references through sh_info. */
}
/* Mark the section as investigated. */
-@@ -900,7 +925,7 @@
+@@ -912,7 +937,7 @@ handle_elf (int fd, Elf *elf, const char
error (EXIT_FAILURE, 0, gettext ("while generating output file: %s"),
elf_errmsg (-1));
/* Add this name to the section header string table. */
shdr_info[cnt].se = ebl_strtabadd (shst, shdr_info[cnt].name, 0);
-@@ -937,7 +962,7 @@
+@@ -949,7 +974,7 @@ handle_elf (int fd, Elf *elf, const char
error (EXIT_FAILURE, 0,
gettext ("while create section header section: %s"),
elf_errmsg (-1));
shdr_info[cnt].data = elf_newdata (shdr_info[cnt].newscn);
if (shdr_info[cnt].data == NULL)
-@@ -968,7 +993,7 @@
+@@ -980,7 +1005,7 @@ handle_elf (int fd, Elf *elf, const char
}
/* Index of the section header table in the shdr_info array. */
/* Add the section header string table section name. */
shdr_info[cnt].se = ebl_strtabadd (shst, ".shstrtab", 10);
-@@ -993,7 +1018,7 @@
+@@ -1005,7 +1030,7 @@ handle_elf (int fd, Elf *elf, const char
error (EXIT_FAILURE, 0,
gettext ("while create section header section: %s"),
elf_errmsg (-1));
/* Finalize the string table and fill in the correct indices in the
section headers. */
-@@ -1083,21 +1108,21 @@
+@@ -1095,21 +1120,21 @@ handle_elf (int fd, Elf *elf, const char
shndxdata = elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn,
NULL);
}
shdr_info[cnt].newsymidx
-@@ -1151,7 +1176,7 @@
+@@ -1163,7 +1188,7 @@ handle_elf (int fd, Elf *elf, const char
sec = shdr_info[sym->st_shndx].idx;
else
{
sec = shdr_info[xshndx].idx;
}
-@@ -1172,7 +1197,7 @@
+@@ -1184,7 +1209,7 @@ handle_elf (int fd, Elf *elf, const char
nxshndx = sec;
}
if ((inner != destidx || nshndx != sym->st_shndx
|| (shndxdata != NULL && nxshndx != xshndx))
-@@ -1195,7 +1220,7 @@
+@@ -1207,7 +1232,7 @@ handle_elf (int fd, Elf *elf, const char
else
/* This is a section symbol for a section which has
been removed. */
}
if (destidx != inner)
-@@ -1359,11 +1384,11 @@
+@@ -1371,11 +1396,11 @@ handle_elf (int fd, Elf *elf, const char
{
GElf_Sym sym_mem;
GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem);
size_t hidx = elf_hash (name) % nbucket;
if (bucket[hidx] == 0)
-@@ -1382,8 +1407,8 @@
+@@ -1394,8 +1419,8 @@ handle_elf (int fd, Elf *elf, const char
else
{
/* Alpha and S390 64-bit use 64-bit SHT_HASH entries. */
Elf64_Xword *bucket = (Elf64_Xword *) hashd->d_buf;
-@@ -1416,11 +1441,11 @@
+@@ -1428,11 +1453,11 @@ handle_elf (int fd, Elf *elf, const char
{
GElf_Sym sym_mem;
GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem);