diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index 9627477..0000000 --- a/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -elfutils-0.140.tar.bz2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3758108 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +elfutils-0.147.tar.bz2 diff --git a/Makefile b/Makefile deleted file mode 100644 index 8d35a02..0000000 --- a/Makefile +++ /dev/null @@ -1,98 +0,0 @@ -# Makefile for source rpm: elfutils -# $Id$ -NAME := elfutils -SPECFILE = elfutils.spec - -all: - -UPSTREAM_CHECKS := sig -UPSTREAM_FILES = $(NAME)-$(VERSION).tar.bz2 -upstream:; - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) - -ifneq (,$(CURL)) -CURL += -k -endif - -patches := $(patsubst %,elfutils-%.patch,robustify portability) -all: $(patches) - -branch-portability = portable -branch-master = elfutils-$(VERSION) - -elfutils-%/configure: .git/refs/heads/* Makefile - @rm -rf $(@D) - git archive --prefix=$(@D)/ $(firstword $(branch-$*) $*) | tar xf - - cd $(@D) && autoreconf -i && rm -rf autom4te.cache - -elfutils-%.patch: elfutils-master/configure elfutils-%/configure - diff --exclude='.gitignore' -Nrpu $(^D) | \ - filterdiff --remove-timestamps --strip=1 --addprefix=elfutils/ > $@.new - mv $@.new $@ - -elfutils-portable.spec: elfutils.spec - (echo '%define _with_compat 1'; sed 's/ check$$/& || :/' $<) > $@.new - mv -f $@.new $@ - -portable-r = 0.$(subst $(DIST),,$(RELEASE)) -portable-vr = $(VERSION)-$(portable-r) -portable.srpm = elfutils-$(portable-vr).src.rpm -$(portable.srpm): elfutils-portable.spec $(patches) \ - elfutils-$(VERSION).tar.bz2 - $(RPM_WITH_DIRS) --nodeps -bs $< - -portable-srpm: $(portable.srpm) - -portable-dist = 3.0E-scratch -portable-build = \ - $(redhat)/brewroot/packages/elfutils/$(VERSION)/$(portable-r) - -ifeq (,$(wildcard /mnt/redhat/brewroot/packages/elfutils)) -redhat = datadump.devel.redhat.com::redhat -rsync-to = devserv.devel.redhat.com:dist/elfutils/devel/systemtap-dist/ -build-dep = $(portable.srpm) -else -redhat = /mnt/redhat -$(portable-build): $(portable.srpm) - brew build $(BUILD_FLAGS) dist-$(portable-dist) $< -rsync-to = $(public) -build-dep = $(portable-build)/src/$(portable.srpm) -portable-build: $(portable-build) -$(build-dep): $(portable-build) -endif - -dist-files = README.elfutils systemtap-elfutils.repo -rsync-files = --exclude=tests --exclude=data $(portable-build)/ -public = sources.redhat.com:/sourceware/ftp/anonftp/pub/systemtap/elfutils/ - -RSYNC = RSYNC_RSH=ssh rsync - -systemtap-dist: $(build-dep) $(dist-files) - @mkdir -p $@ - $(RSYNC) -a --delete --progress -v $(rsync-files) systemtap-dist/ - ln $(dist-files) systemtap-dist/ - ln -v `rpm -qlp $<` systemtap-dist/ - -systemtap-dist-createrepo: systemtap-dist -ifneq ($(wildcard /usr/bin/createrepo),) - createrepo -q `cd $<; /bin/pwd` -endif - -systemtap-sync: systemtap-dist-createrepo - $(RSYNC) -az --delete --progress -v systemtap-dist/ $(rsync-to) diff --git a/README.elfutils b/README.elfutils deleted file mode 100644 index 730d93a..0000000 --- a/README.elfutils +++ /dev/null @@ -1,76 +0,0 @@ -THIS IS HERE ONLY TO SUPPORT SYSTEMTAP DEVELOPMENT. IT IS NOT FOR GENERAL USE. - -Building systemtap requires a recent development version of elfutils, -which provides libraries for making use of debugging information. - -This is unfinished work in active development. This code is not intended -for general consumption in its present form. Development of these -libraries is simultaneous with Systemtap development. The Systemtap code -will require new versions as things evolve; the systemtap.spec.in file in -the systemtap source tree should always indicate the minimum version of -elfutils libraries that will suffice. We will make an effort to make a -compatible version available here, that you can use for compiling Systemtap. - -Current elfutils can always be found in Fedora Core Development, AKA Rawhide. -If you are interested in the elfutils code in general or for any purpose -other than developing Systemtap, please see http://fedora.redhat.com/ about -getting involved with Fedora Core Development directly. - -To use the elfutils libraries to build Systemtap, you can either use -installed libraries, or you can build elfutils from source as part of the -systemtap build. To use installed libraries, you'll need to have the -current elfutils version installed on your system where the compiler will -find it with whatever build flags you pass systemtap's configure script. -Unless your system already has the current elfutils installed -(i.e. Rawhide), you'll have to install a nonstandard build either via RPM -or by hand with "make" as detailed below. To build the elfutils source -locally as part of the systemtap build, see systemtap's README about the ---with-elfutils=... option to systemtap's configure. - -You can find the rawhide rpms updated daily on a variety of sites -(see http://fedora.redhat.com/download/mirrors.html) under core/development. -What's distributed in this directory is made trivially from those same sources. - -The vanilla elfutils code, in elfutils-VERSION.tar.gz and what the rawhide -RPMs ordinarily build, can only be built using GCC 4 and a recent glibc. -Fedora Core 4 is the only released system meeting the requirements. - -To rebuild the rawhide src.rpm on an older system, you can use: - - rpmbuild --with compat --rebuild elfutils-VERSION-N.src.rpm - -The SRPMS/elfutils-VERSION-0.N.src.rpm provided here is exactly the same as -the elfutils-VERSION-N.src.rpm from Rawhide except that it doesn't require -that you specify --with compat to build on an older system. - -We have done this for you for a few architectures, and those RPMs are -available here. These were built on RHEL3, and so their requirements -should not be too demanding. We must remind you that this is unsupported, -pre-beta development code. Furthermore, these builds are completely -unofficial, unsupported, unsigned, unlikely to have been tested, -unequivocally not guaranteed not to ruin your whole day, and we really -cannot recommend that anyone install them on their system. Do so at your -own risk. All that said, here they is, and if you copy this file: - - ftp://sources.redhat.com/pub/systemtap/elfutils/systemtap-elfutils.repo - -into your /etc/yum.repos.d/ directory, then you can get them all with just: - - yum install elfutils-devel - - -To compile elfutils from source by hand, simply use elfutils-VERSION.tar.gz -and follow the usual procedure for GNU configure conventions. The patch -available here has to be applied before you can compile on an older system: - - tar xzf elfutils-VERSION.tar.gz - patch -p1 -d elfutils-VERSION < elfutils-portability.patch - cd elfutils-VERSION - ./configure --program-prefix=eu-devel- - make && make check && make install - -(That of course installs things under /usr/local, unlike the RPMs.) - - -Caveat emptor. Carpe noctem. -Reply to . diff --git a/elfutils-0.140.tar.bz2.sig b/elfutils-0.140.tar.bz2.sig deleted file mode 100644 index e0158dd..0000000 Binary files a/elfutils-0.140.tar.bz2.sig and /dev/null differ diff --git a/elfutils-0.147.tar.bz2.sig b/elfutils-0.147.tar.bz2.sig new file mode 100644 index 0000000..3ddbcc1 Binary files /dev/null and b/elfutils-0.147.tar.bz2.sig differ diff --git a/elfutils-portability.patch b/elfutils-portability.patch index 4c3a131..0d98e51 100644 --- a/elfutils-portability.patch +++ b/elfutils-portability.patch @@ -1,6 +1,6 @@ --- elfutils/backends/ChangeLog +++ elfutils/backends/ChangeLog -@@ -3,6 +3,10 @@ +@@ -106,6 +106,10 @@ * ppc_attrs.c (ppc_check_object_attribute): Handle tag GNU_Power_ABI_Struct_Return. @@ -11,7 +11,7 @@ 2008-10-04 Ulrich Drepper * i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and -@@ -330,6 +334,11 @@ +@@ -433,6 +437,11 @@ * sparc_init.c: Likewise. * x86_64_init.c: Likewise. @@ -23,7 +23,7 @@ 2005-11-19 Roland McGrath * ppc64_reloc.def: REL30 -> ADDR30. -@@ -352,6 +361,9 @@ +@@ -455,6 +464,9 @@ * Makefile.am (uninstall): Don't try to remove $(pkgincludedir). (CLEANFILES): Add libebl_$(m).so. @@ -35,50 +35,18 @@ --- elfutils/backends/Makefile.am +++ elfutils/backends/Makefile.am -@@ -1,6 +1,6 @@ - ## Process this file with automake to create Makefile.in - ## --## Copyright (C) 2000-2006, 2007, 2008 Red Hat, Inc. -+## Copyright (C) 2000-2006, 2007, 2008, 2009 Red Hat, Inc. - ## This file is part of Red Hat elfutils. - ## - ## Red Hat elfutils is free software; you can redistribute it and/or modify -@@ -25,12 +25,14 @@ - ## . - ## - DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\" -+WEXTRA = @WEXTRA@ -+LD_AS_NEEDED = @LD_AS_NEEDED@ - if MUDFLAP - AM_CFLAGS = -fmudflap - else - AM_CFLAGS = - endif --AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 \ -+AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 \ - -std=gnu99 - INCLUDES = -I$(srcdir) -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \ - -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \ -@@ -59,7 +61,6 @@ endif - - textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi - -- - i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c \ - i386_retval.c i386_regs.c i386_auxv.c i386_syscall.c - cpu_i386 = ../libcpu/libcpu_i386.a -@@ -114,7 +115,7 @@ libebl_%.so: libebl_%_pic.a libebl_%.map - $(LINK) -shared -o $@ -Wl,--whole-archive,$<\ - $(cpu_$(@:libebl_%.so=%)) -Wl,--no-whole-archive \ - -Wl,--version-script,$(word 2,$^) \ +@@ -103,7 +103,7 @@ libebl_%.so libebl_%.map: libebl_%_pic.a + $(LINK) -shared -o $(@:.map=.so) \ + -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \ + -Wl,--version-script,$(@:.so=.map) \ - -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap) + -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap) $(textrel_check) - # XXX Should not be needed... + libebl_i386.so: $(cpu_i386) --- elfutils/backends/Makefile.in +++ elfutils/backends/Makefile.in -@@ -156,6 +156,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -165,6 +165,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -86,38 +54,58 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -185,6 +186,7 @@ SHELL = @SHELL@ +@@ -193,6 +194,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +WEXTRA = @WEXTRA@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ - YACC = @YACC@ -@@ -243,9 +245,9 @@ top_builddir = @top_builddir@ - top_srcdir = @top_srcdir@ - zip_LIBS = @zip_LIBS@ - @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \ --@MUDFLAP_FALSE@ -Wextra -Wformat=2 -std=gnu99 -+@MUDFLAP_FALSE@ $(WEXTRA) -Wformat=2 -std=gnu99 - @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -fpic -Wall -Wshadow -Werror \ --@MUDFLAP_TRUE@ -Wunused -Wextra -Wformat=2 -std=gnu99 -+@MUDFLAP_TRUE@ -Wunused $(WEXTRA) -Wformat=2 -std=gnu99 - INCLUDES = -I$(srcdir) -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \ - -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \ - -I$(top_srcdir)/lib -I.. -@@ -641,7 +643,7 @@ libebl_%.so: libebl_%_pic.a libebl_%.map - $(LINK) -shared -o $@ -Wl,--whole-archive,$<\ - $(cpu_$(@:libebl_%.so=%)) -Wl,--no-whole-archive \ - -Wl,--version-script,$(word 2,$^) \ + XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +@@ -256,7 +258,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi + -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw + AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \ + $($(*F)_no_Werror),,-Werror) $(if \ +- $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \ ++ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \ + $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \ + $(am__append_1) + @MUDFLAP_FALSE@libmudflap = +@@ -697,7 +699,7 @@ libebl_%.so libebl_%.map: libebl_%_pic.a + $(LINK) -shared -o $(@:.map=.so) \ + -Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \ + -Wl,--version-script,$(@:.so=.map) \ - -Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap) + -Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap) $(textrel_check) - # XXX Should not be needed... + libebl_i386.so: $(cpu_i386) --- elfutils/ChangeLog +++ elfutils/ChangeLog -@@ -1,5 +1,7 @@ +@@ -2,6 +2,10 @@ + + * configure.ac (LOCALEDIR, DATADIRNAME): Removed. + ++2009-11-22 Roland McGrath ++ ++ * configure.ac: Use sed and expr instead of modern bash extensions. ++ + 2009-09-21 Ulrich Drepper + + * configure.ac: Update for more modern autoconf. +@@ -10,6 +14,10 @@ + + * configure.ac (zip_LIBS): Check for liblzma too. + ++2009-08-17 Roland McGrath ++ ++ * configure.ac: Check for -fgnu89-inline; add it to WEXTRA if it works. ++ + 2009-04-19 Roland McGrath + + * configure.ac (eu_version): Round down here, not in version.h macros. +@@ -21,6 +29,8 @@ + 2009-01-23 Roland McGrath + * configure.ac: Check for __builtin_popcount. @@ -125,7 +113,7 @@ * configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3. * configure.ac (__thread check): Use AC_LINK_IFELSE, in case of -@@ -80,6 +82,10 @@ +@@ -101,6 +111,10 @@ * configure.ac: Add dummy automake conditional to get dependencies for non-generic linker right. See src/Makefile.am. @@ -136,7 +124,7 @@ 2005-11-18 Roland McGrath * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable. -@@ -127,6 +133,17 @@ +@@ -148,6 +162,17 @@ * Makefile.am (all_SUBDIRS): Add libdwfl. * configure.ac: Write libdwfl/Makefile. @@ -154,9 +142,27 @@ 2005-05-19 Roland McGrath * configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros. +--- elfutils/config/eu.am ++++ elfutils/config/eu.am +@@ -25,11 +25,14 @@ + ## . + ## + ++WEXTRA = @WEXTRA@ ++LD_AS_NEEDED = @LD_AS_NEEDED@ ++ + DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"' + INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. + AM_CFLAGS = -std=gnu99 -Wall -Wshadow \ + $(if $($(*F)_no_Werror),,-Werror) \ +- $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ ++ $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \ + $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \ + $($(*F)_CFLAGS) + --- elfutils/config/Makefile.in +++ elfutils/config/Makefile.in -@@ -73,6 +73,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -76,6 +76,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -164,14 +170,14 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -102,6 +103,7 @@ SHELL = @SHELL@ +@@ -104,6 +105,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +WEXTRA = @WEXTRA@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ - YACC = @YACC@ + XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ --- elfutils/config.h.in +++ elfutils/config.h.in @@ -1,5 +1,8 @@ @@ -193,16 +199,16 @@ #include --- elfutils/configure +++ elfutils/configure -@@ -642,6 +642,8 @@ NATIVE_LD_FALSE +@@ -646,6 +646,8 @@ NEVER_TRUE + base_cpu + NATIVE_LD_FALSE NATIVE_LD_TRUE - DATADIRNAME - LOCALEDIR +LD_AS_NEEDED +WEXTRA LEXLIB LEX_OUTPUT_ROOT LEX -@@ -4041,6 +4043,152 @@ $as_echo "$as_me: error: gcc with C99 su +@@ -4098,6 +4100,205 @@ $as_echo "$as_me: error: gcc with C99 su fi @@ -255,6 +261,59 @@ +fi + + ++{ $as_echo "$as_me:$LINENO: checking for -fgnu89-inline option to $CC" >&5 ++$as_echo_n "checking for -fgnu89-inline option to $CC... " >&6; } ++if test "${ac_cv_cc_gnu89_inline+set}" = set; then ++ $as_echo_n "(cached) " >&6 ++else ++ old_CFLAGS="$CFLAGS" ++CFLAGS="$CFLAGS -fgnu89-inline -Werror" ++cat >conftest.$ac_ext <<_ACEOF ++ ++void foo (void) ++{ ++ inline void bar (void) {} ++ bar (); ++} ++extern inline void baz (void) {} ++ ++_ACEOF ++rm -f conftest.$ac_objext ++if { (ac_try="$ac_compile" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" ++$as_echo "$ac_try_echo") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_cv_cc_gnu89_inline=yes ++else ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_cc_gnu89_inline=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++CFLAGS="$old_CFLAGS" ++fi ++{ $as_echo "$as_me:$LINENO: result: $ac_cv_cc_gnu89_inline" >&5 ++$as_echo "$ac_cv_cc_gnu89_inline" >&6; } ++if test "x$ac_cv_cc_gnu89_inline" = xyes; then ++ WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline" ++fi ++ ++ +{ $as_echo "$as_me:$LINENO: checking for --as-needed linker option" >&5 +$as_echo_n "checking for --as-needed linker option... " >&6; } +if test "${ac_cv_as_needed+set}" = set; then @@ -355,7 +414,7 @@ { $as_echo "$as_me:$LINENO: checking for __thread support" >&5 $as_echo_n "checking for __thread support... " >&6; } if test "${ac_cv_tls+set}" = set; then -@@ -4106,9 +4254,18 @@ fi +@@ -4163,9 +4364,18 @@ fi { $as_echo "$as_me:$LINENO: result: $ac_cv_tls" >&5 $as_echo "$ac_cv_tls" >&6; } if test "x$ac_cv_tls" != xyes; then @@ -376,9 +435,27 @@ fi +@@ -5454,7 +5664,7 @@ ac_config_files="$ac_config_files versio + + # 1.234 -> 1234 + case "$PACKAGE_VERSION" in +-[0-9].*) eu_version="${PACKAGE_VERSION/./}" ;; ++[0-9].*) eu_version=`echo "$PACKAGE_VERSION" | sed 's@\.@@'` ;; + *) { { $as_echo "$as_me:$LINENO: error: confused by version number '$PACKAGE_VERSION'" >&5 + $as_echo "$as_me: error: confused by version number '$PACKAGE_VERSION'" >&2;} + { (exit 1); exit 1; }; } ;; +@@ -5489,7 +5699,7 @@ $as_echo "$as_me: error: confused by ver + esac + + # Round up to the next release API (x.y) version. +-eu_version=$[($eu_version + 999) / 1000] ++eu_version=`expr \( $eu_version + 999 \) / 1000` + + cat >confcache <<\_ACEOF + # This file is a shell script that caches the results of configure --- elfutils/configure.ac +++ elfutils/configure.ac -@@ -74,6 +74,39 @@ CFLAGS="$old_CFLAGS"]) +@@ -73,6 +73,54 @@ CFLAGS="$old_CFLAGS"]) AS_IF([test "x$ac_cv_c99" != xyes], AC_MSG_ERROR([gcc with C99 support required])) @@ -391,6 +468,21 @@ +AC_SUBST(WEXTRA) +AS_IF([test "x$ac_cv_cc_wextra" = xyes], [WEXTRA=-Wextra], [WEXTRA=-W]) + ++AC_CACHE_CHECK([for -fgnu89-inline option to $CC], ac_cv_cc_gnu89_inline, [dnl ++old_CFLAGS="$CFLAGS" ++CFLAGS="$CFLAGS -fgnu89-inline -Werror" ++AC_COMPILE_IFELSE([ ++void foo (void) ++{ ++ inline void bar (void) {} ++ bar (); ++} ++extern inline void baz (void) {} ++], ac_cv_cc_gnu89_inline=yes, ac_cv_cc_gnu89_inline=no) ++CFLAGS="$old_CFLAGS"]) ++AS_IF([test "x$ac_cv_cc_gnu89_inline" = xyes], ++ [WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"]) ++ +AC_CACHE_CHECK([for --as-needed linker option], + ac_cv_as_needed, [dnl +cat > conftest.c < -> 1234 + case "$PACKAGE_VERSION" in +-[[0-9]].*) eu_version="${PACKAGE_VERSION/./}" ;; ++[[0-9]].*) eu_version=`echo "$PACKAGE_VERSION" | sed 's@\.@@'` ;; + *) AC_MSG_ERROR([confused by version number '$PACKAGE_VERSION']) ;; + esac + case "$eu_version" in +@@ -280,6 +331,6 @@ case "$eu_version" in + esac + + # Round up to the next release API (x.y) version. +-[eu_version=$[($eu_version + 999) / 1000]] ++eu_version=`expr \( $eu_version + 999 \) / 1000` + + AC_OUTPUT --- elfutils/lib/ChangeLog +++ elfutils/lib/ChangeLog -@@ -1,5 +1,8 @@ +@@ -8,6 +8,9 @@ + 2009-01-23 Roland McGrath + * eu-config.h [! HAVE_BUILTIN_POPCOUNT] @@ -441,7 +551,7 @@ * eu-config.h: Add multiple inclusion protection. 2009-01-17 Ulrich Drepper -@@ -56,6 +59,11 @@ +@@ -64,6 +67,11 @@ * Makefile.am (libeu_a_SOURCES): Add it. * system.h: Declare crc32_file. @@ -455,7 +565,7 @@ * Makefile.am: Use -ffunction-sections for xmalloc.c. --- elfutils/lib/eu-config.h +++ elfutils/lib/eu-config.h -@@ -182,5 +182,16 @@ asm (".section predict_data, \"aw\"; .pr +@@ -182,6 +182,17 @@ asm (".section predict_data, \"aw\"; .pr /* This macro is used by the tests conditionalize for standalone building. */ #define ELFUTILS_HEADER(name) @@ -471,27 +581,11 @@ +#endif /* HAVE_BUILTIN_POPCOUNT */ + - #endif /* eu-config.h */ ---- elfutils/lib/Makefile.am -+++ elfutils/lib/Makefile.am -@@ -25,12 +25,13 @@ - ## . - ## - DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -+WEXTRA = @WEXTRA@ - if MUDFLAP - AM_CFLAGS = -fmudflap - else - AM_CFLAGS = - endif --AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra $($(*F)_CFLAGS) -+AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) $($(*F)_CFLAGS) - INCLUDES = -I$(srcdir)/../libelf -I.. - - noinst_LIBRARIES = libeu.a + #ifdef SHARED + # define OLD_VERSION(name, version) \ --- elfutils/lib/Makefile.in +++ elfutils/lib/Makefile.in -@@ -94,6 +94,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -99,6 +99,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -499,29 +593,26 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -123,6 +124,7 @@ SHELL = @SHELL@ +@@ -127,6 +128,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +WEXTRA = @WEXTRA@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ - YACC = @YACC@ -@@ -181,9 +183,9 @@ top_builddir = @top_builddir@ - top_srcdir = @top_srcdir@ - zip_LIBS = @zip_LIBS@ - @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \ --@MUDFLAP_FALSE@ -Wextra $($(*F)_CFLAGS) -+@MUDFLAP_FALSE@ $(WEXTRA) $($(*F)_CFLAGS) - @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -fpic -Wall -Wshadow -Werror \ --@MUDFLAP_TRUE@ -Wunused -Wextra $($(*F)_CFLAGS) -+@MUDFLAP_TRUE@ -Wunused $(WEXTRA) $($(*F)_CFLAGS) - INCLUDES = -I$(srcdir)/../libelf -I.. - noinst_LIBRARIES = libeu.a - libeu_a_SOURCES = xstrndup.c xmalloc.c next_prime.c \ + XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +@@ -189,7 +191,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi + -I$(srcdir)/../libelf + AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \ + $($(*F)_no_Werror),,-Werror) $(if \ +- $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \ ++ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \ + $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \ + $(am__append_1) -fpic + @MUDFLAP_FALSE@libmudflap = --- elfutils/libasm/ChangeLog +++ elfutils/libasm/ChangeLog -@@ -63,6 +63,11 @@ +@@ -67,6 +67,11 @@ * asm_error.c: Add new error ASM_E_IOERROR. * libasmP.h: Add ASM_E_IOERROR definition. @@ -533,26 +624,9 @@ 2005-02-15 Ulrich Drepper * Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2. ---- elfutils/libasm/Makefile.am -+++ elfutils/libasm/Makefile.am -@@ -25,12 +25,13 @@ - ## . - ## - DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -+WEXTRA = @WEXTRA@ - if MUDFLAP - AM_CFLAGS = -fmudflap - else - AM_CFLAGS = - endif --AM_CFLAGS += -std=gnu99 -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 -+AM_CFLAGS += -std=gnu99 -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 - INCLUDES = -I. -I$(srcdir) -I.. \ - -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl -I$(top_srcdir)/libdw\ - -I$(top_srcdir)/lib --- elfutils/libasm/Makefile.in +++ elfutils/libasm/Makefile.in -@@ -128,6 +128,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -147,6 +147,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -560,29 +634,27 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -157,6 +158,7 @@ SHELL = @SHELL@ +@@ -175,6 +176,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = 1 +WEXTRA = @WEXTRA@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ - YACC = @YACC@ -@@ -215,9 +217,9 @@ top_builddir = @top_builddir@ - top_srcdir = @top_srcdir@ - zip_LIBS = @zip_LIBS@ - @MUDFLAP_FALSE@AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Werror -Wunused \ --@MUDFLAP_FALSE@ -Wextra -Wformat=2 -+@MUDFLAP_FALSE@ $(WEXTRA) -Wformat=2 - @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -std=gnu99 -Wall -Wshadow -Werror \ --@MUDFLAP_TRUE@ -Wunused -Wextra -Wformat=2 -+@MUDFLAP_TRUE@ -Wunused $(WEXTRA) -Wformat=2 - INCLUDES = -I. -I$(srcdir) -I.. \ - -I$(top_srcdir)/libelf -I$(top_srcdir)/libebl -I$(top_srcdir)/libdw\ - -I$(top_srcdir)/lib + XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +@@ -238,7 +240,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi + -I$(top_srcdir)/libdw + AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \ + $($(*F)_no_Werror),,-Werror) $(if \ +- $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \ ++ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \ + $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \ + $(am__append_1) + @MUDFLAP_FALSE@libmudflap = --- elfutils/libcpu/ChangeLog +++ elfutils/libcpu/ChangeLog -@@ -1,5 +1,8 @@ +@@ -9,6 +9,9 @@ + 2009-01-23 Roland McGrath + * i386_disasm.c (i386_disasm): Add abort after assert-constant for old @@ -591,7 +663,7 @@ * Makefile.am (i386_parse_CFLAGS): Use quotes around command substitution that can produce leading whitespace. -@@ -329,6 +332,11 @@ +@@ -338,6 +341,11 @@ * defs/i386.doc: New file. * defs/x86_64: New file. @@ -613,21 +685,9 @@ } } else ---- elfutils/libcpu/Makefile.am -+++ elfutils/libcpu/Makefile.am -@@ -30,7 +30,8 @@ AM_CFLAGS = -fmudflap - else - AM_CFLAGS = - endif --AM_CFLAGS += -Wall -Wshadow -Wunused -Wextra -std=gnu99 -fpic \ -+WEXTRA = @WEXTRA@ -+AM_CFLAGS += -Wall -Wshadow -Wunused $(WEXTRA) -std=gnu99 -fpic \ - $($(*F)_CFLAGS) \ - $(if $($(*F)_no_Werror),,-Werror) - INCLUDES = -I$(srcdir) -I$(srcdir)/../lib -I$(srcdir)/../libelf \ --- elfutils/libcpu/Makefile.in +++ elfutils/libcpu/Makefile.in -@@ -110,6 +110,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -116,6 +116,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -635,31 +695,37 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = lex.$( ++ ++ * libdw.h: Disable extern inlines for GCC 4.2. ++ + 2009-08-10 Roland McGrath + + * dwarf_getscopevar.c: Use dwarf_diename. +@@ -850,6 +854,11 @@ 2005-05-31 Roland McGrath @@ -671,28 +737,20 @@ * dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to formref offset. ---- elfutils/libdw/Makefile.am -+++ elfutils/libdw/Makefile.am -@@ -25,6 +25,7 @@ - ## . - ## - DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DIS_LIBDW -+WEXTRA = @WEXTRA@ - if MUDFLAP - AM_CFLAGS = -fmudflap - else -@@ -33,7 +34,7 @@ endif - if BUILD_STATIC - AM_CFLAGS += -fpic - endif --AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 -Wextra -std=gnu99 -+AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 $(WEXTRA) -std=gnu99 - INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib - VERSION = 1 +--- elfutils/libdw/libdw.h ++++ elfutils/libdw/libdw.h +@@ -814,7 +814,7 @@ extern Dwarf_OOM dwarf_new_oom_handler ( + + /* Inline optimizations. */ +-#ifdef __OPTIMIZE__ ++#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2) + /* Return attribute code of given attribute. */ + __libdw_extern_inline unsigned int + dwarf_whatattr (Dwarf_Attribute *attr) --- elfutils/libdw/Makefile.in +++ elfutils/libdw/Makefile.in -@@ -165,6 +165,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -189,6 +189,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -700,30 +758,26 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -194,6 +195,7 @@ SHELL = @SHELL@ +@@ -217,6 +218,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = 1 +WEXTRA = @WEXTRA@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ - YACC = @YACC@ -@@ -252,9 +254,10 @@ top_builddir = @top_builddir@ - top_srcdir = @top_srcdir@ - zip_LIBS = @zip_LIBS@ - @MUDFLAP_FALSE@AM_CFLAGS = $(am__append_1) -Wall -Werror -Wshadow \ --@MUDFLAP_FALSE@ -Wunused -Wformat=2 -Wextra -std=gnu99 -+@MUDFLAP_FALSE@ -Wunused -Wformat=2 $(WEXTRA) -std=gnu99 - @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap $(am__append_1) -Wall -Werror \ --@MUDFLAP_TRUE@ -Wshadow -Wunused -Wformat=2 -Wextra -std=gnu99 -+@MUDFLAP_TRUE@ -Wshadow -Wunused -Wformat=2 $(WEXTRA) \ -+@MUDFLAP_TRUE@ -std=gnu99 - INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib - COMPILE.os = $(filter-out -fprofile-arcs, $(filter-out -ftest-coverage, \ - $(COMPILE))) + XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +@@ -279,7 +281,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi + -I$(srcdir)/../libelf + AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \ + $($(*F)_no_Werror),,-Werror) $(if \ +- $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \ ++ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \ + $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \ + $(am__append_1) $(am__append_2) + @MUDFLAP_FALSE@libmudflap = --- elfutils/libdwfl/ChangeLog +++ elfutils/libdwfl/ChangeLog -@@ -1013,6 +1013,11 @@ +@@ -1207,6 +1207,11 @@ 2005-07-21 Roland McGrath @@ -735,26 +789,9 @@ * Makefile.am (noinst_HEADERS): Add loc2c.c. * test2.c (main): Check sscanf result to quiet warning. ---- elfutils/libdwfl/Makefile.am -+++ elfutils/libdwfl/Makefile.am -@@ -27,12 +27,13 @@ - ## . - ## - DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -+WEXTRA = @WEXTRA@ - if MUDFLAP - AM_CFLAGS = -fmudflap - else - AM_CFLAGS = - endif --AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 -Wextra -std=gnu99 -+AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 $(WEXTRA) -std=gnu99 - INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \ - -I$(srcdir)/../libdw -I.. -I$(srcdir)/../lib - VERSION = 1 --- elfutils/libdwfl/Makefile.in +++ elfutils/libdwfl/Makefile.in -@@ -155,6 +155,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -181,6 +181,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -762,29 +799,26 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -184,6 +185,7 @@ SHELL = @SHELL@ +@@ -209,6 +210,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = 1 +WEXTRA = @WEXTRA@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ - YACC = @YACC@ -@@ -242,9 +244,9 @@ top_builddir = @top_builddir@ - top_srcdir = @top_srcdir@ - zip_LIBS = @zip_LIBS@ - @MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wshadow -Wunused -Wformat=2 \ --@MUDFLAP_FALSE@ -Wextra -std=gnu99 -+@MUDFLAP_FALSE@ $(WEXTRA) -std=gnu99 - @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Werror -Wshadow -Wunused \ --@MUDFLAP_TRUE@ -Wformat=2 -Wextra -std=gnu99 -+@MUDFLAP_TRUE@ -Wformat=2 $(WEXTRA) -std=gnu99 - INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \ - -I$(srcdir)/../libdw -I.. -I$(srcdir)/../lib - + XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +@@ -272,7 +274,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi + -I$(srcdir)/../libdw + AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \ + $($(*F)_no_Werror),,-Werror) $(if \ +- $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \ ++ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \ + $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \ + $(am__append_1) + @MUDFLAP_FALSE@libmudflap = --- elfutils/libebl/ChangeLog +++ elfutils/libebl/ChangeLog -@@ -563,6 +563,11 @@ +@@ -624,6 +624,11 @@ * Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency tracking works right. @@ -796,26 +830,9 @@ 2005-05-21 Ulrich Drepper * libebl_x86_64.map: Add x86_64_core_note. ---- elfutils/libebl/Makefile.am -+++ elfutils/libebl/Makefile.am -@@ -25,12 +25,13 @@ - ## . - ## - DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DOBJDIR=\"$(shell pwd)\" -+WEXTRA = @WEXTRA@ - if MUDFLAP - AM_CFLAGS = -fmudflap - else - AM_CFLAGS = - endif --AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 \ -+AM_CFLAGS += -fpic -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 \ - -std=gnu99 - - INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \ --- elfutils/libebl/Makefile.in +++ elfutils/libebl/Makefile.in -@@ -124,6 +124,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -143,6 +143,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -823,29 +840,26 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -153,6 +154,7 @@ SHELL = @SHELL@ +@@ -171,6 +172,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = 1 +WEXTRA = @WEXTRA@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ - YACC = @YACC@ -@@ -211,9 +213,9 @@ top_builddir = @top_builddir@ - top_srcdir = @top_srcdir@ - zip_LIBS = @zip_LIBS@ - @MUDFLAP_FALSE@AM_CFLAGS = -fpic -Wall -Wshadow -Werror -Wunused \ --@MUDFLAP_FALSE@ -Wextra -Wformat=2 -std=gnu99 -+@MUDFLAP_FALSE@ $(WEXTRA) -Wformat=2 -std=gnu99 - @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -fpic -Wall -Wshadow -Werror \ --@MUDFLAP_TRUE@ -Wunused -Wextra -Wformat=2 -std=gnu99 -+@MUDFLAP_TRUE@ -Wunused $(WEXTRA) -Wformat=2 -std=gnu99 - INCLUDES = -I$(srcdir) -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw \ - -I$(top_srcdir)/lib -I.. -I$(srcdir)/../libasm - + XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +@@ -234,7 +236,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi + -I$(srcdir)/../libasm + AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \ + $($(*F)_no_Werror),,-Werror) $(if \ +- $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \ ++ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \ + $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \ + $(am__append_1) -fpic + @MUDFLAP_FALSE@libmudflap = --- elfutils/libelf/ChangeLog +++ elfutils/libelf/ChangeLog -@@ -529,6 +529,11 @@ +@@ -651,6 +651,11 @@ * elf.h: Update from glibc. @@ -877,28 +891,9 @@ : (sizeof (Var) == 4 \ ? bswap_32 (Var) \ : bswap_64 (Var)))) ---- elfutils/libelf/Makefile.am -+++ elfutils/libelf/Makefile.am -@@ -25,6 +25,7 @@ - ## . - ## - DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -+WEXTRA = @WEXTRA@ - if MUDFLAP - AM_CFLAGS = -fmudflap - else -@@ -33,7 +34,7 @@ endif - if BUILD_STATIC - AM_CFLAGS += -fpic - endif --AM_CFLAGS += -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 -std=gnu99 \ -+AM_CFLAGS += -Wall -Wshadow -Werror -Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \ - $($(*F)_CFLAGS) - INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I.. - GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include) --- elfutils/libelf/Makefile.in +++ elfutils/libelf/Makefile.in -@@ -172,6 +172,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -189,6 +189,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -906,30 +901,26 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -201,6 +202,7 @@ SHELL = @SHELL@ +@@ -217,6 +218,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = 1 +WEXTRA = @WEXTRA@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ - YACC = @YACC@ -@@ -259,10 +261,10 @@ top_builddir = @top_builddir@ - top_srcdir = @top_srcdir@ - zip_LIBS = @zip_LIBS@ - @MUDFLAP_FALSE@AM_CFLAGS = $(am__append_1) -Wall -Wshadow -Werror \ --@MUDFLAP_FALSE@ -Wunused -Wextra -Wformat=2 -std=gnu99 \ -+@MUDFLAP_FALSE@ -Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \ - @MUDFLAP_FALSE@ $($(*F)_CFLAGS) - @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap $(am__append_1) -Wall -Wshadow \ --@MUDFLAP_TRUE@ -Werror -Wunused -Wextra -Wformat=2 -std=gnu99 \ -+@MUDFLAP_TRUE@ -Werror -Wunused $(WEXTRA) -Wformat=2 -std=gnu99 \ - @MUDFLAP_TRUE@ $($(*F)_CFLAGS) - INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I.. - GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include) + XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +@@ -278,7 +280,7 @@ zip_LIBS = @zip_LIBS@ + INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. + AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \ + $($(*F)_no_Werror),,-Werror) $(if \ +- $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \ ++ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \ + $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \ + $(am__append_1) $(am__append_2) + @MUDFLAP_FALSE@libmudflap = --- elfutils/m4/Makefile.in +++ elfutils/m4/Makefile.in -@@ -72,6 +72,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -75,6 +75,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -937,17 +928,17 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -101,6 +102,7 @@ SHELL = @SHELL@ +@@ -103,6 +104,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +WEXTRA = @WEXTRA@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ - YACC = @YACC@ + XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ --- elfutils/Makefile.in +++ elfutils/Makefile.in -@@ -110,6 +110,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -155,6 +155,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -955,29 +946,24 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -139,6 +140,7 @@ SHELL = @SHELL@ +@@ -183,6 +184,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +WEXTRA = @WEXTRA@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ - YACC = @YACC@ + XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ --- elfutils/src/addr2line.c +++ elfutils/src/addr2line.c -@@ -376,7 +376,7 @@ handle_address (const char *string, Dwfl +@@ -447,10 +447,10 @@ handle_address (const char *string, Dwfl bool parsed = false; int n; char *name = NULL; - if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &n) == 2 + if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &n) == 2 && string[n] == '\0') - { - /* It was (section)+offset. This makes sense if there is -@@ -417,7 +417,7 @@ handle_address (const char *string, Dwfl - } - } - } + parsed = adjust_to_section (name, &addr, dwfl); - else if (sscanf (string, "%m[^-+]%" PRIiMAX "%n", &name, &addr, &n) == 2 + else if (sscanf (string, "%a[^-+]%" PRIiMAX "%n", &name, &addr, &n) == 2 && string[n] == '\0') @@ -985,7 +971,24 @@ /* It was symbol+offset. */ --- elfutils/src/ChangeLog +++ elfutils/src/ChangeLog -@@ -62,6 +62,8 @@ +@@ -98,8 +98,16 @@ + * readelf.c (attr_callback): Use print_block only when we don't use + print_ops. + ++2009-08-17 Roland McGrath ++ ++ * ld.h: Disable extern inlines for GCC 4.2. ++ + 2009-08-14 Roland McGrath + ++ * strings.c (read_block): Conditionalize posix_fadvise use ++ on [POSIX_FADV_SEQUENTIAL]. ++ From Petr Salinger . ++ + * ar.c (do_oper_extract): Use pathconf instead of statfs. + + 2009-08-01 Ulrich Drepper +@@ -263,6 +271,8 @@ * readelf.c (print_debug_frame_section): Use t instead of j formats for ptrdiff_t OFFSET. @@ -994,7 +997,7 @@ 2009-01-21 Ulrich Drepper * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section -@@ -245,6 +247,11 @@ +@@ -446,6 +456,11 @@ that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really is valid in RELRO. @@ -1006,7 +1009,7 @@ 2008-02-29 Roland McGrath * readelf.c (print_attributes): Add a cast. -@@ -496,6 +503,8 @@ +@@ -697,6 +712,8 @@ * readelf.c (hex_dump): Fix rounding error in whitespace calculation. @@ -1015,7 +1018,7 @@ 2007-10-15 Roland McGrath * make-debug-archive.in: New file. -@@ -935,6 +944,10 @@ +@@ -1136,6 +1153,10 @@ * elflint.c (valid_e_machine): Add EM_ALPHA. Reported by Christian Aichinger . @@ -1026,7 +1029,7 @@ 2006-08-08 Ulrich Drepper * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB. -@@ -1011,6 +1024,10 @@ +@@ -1212,6 +1233,10 @@ * Makefile.am: Add hacks to create dependency files for non-generic linker. @@ -1037,7 +1040,7 @@ 2006-06-12 Ulrich Drepper * ldgeneric.c (ld_generic_generate_sections): Don't create .interp -@@ -1359,6 +1376,11 @@ +@@ -1560,6 +1585,11 @@ * readelf.c (print_debug_loc_section): Fix indentation for larger address size. @@ -1064,26 +1067,26 @@ GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw, const char *fname, bool more_than_one, void **knownsrcs) { +--- elfutils/src/ld.h ++++ elfutils/src/ld.h +@@ -1122,6 +1122,7 @@ extern bool dynamically_linked_p (void); + + /* Checked whether the symbol is undefined and referenced from a DSO. */ + extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx); ++#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2) + #ifdef __GNUC_STDC_INLINE__ + __attribute__ ((__gnu_inline__)) + #endif +@@ -1139,5 +1140,6 @@ linked_from_dso_p (struct scninfo *scnin + + return sym->defined && sym->in_dso; + } ++#endif /* Optimizing and not GCC 4.2. */ + + #endif /* ld.h */ --- elfutils/src/Makefile.am +++ elfutils/src/Makefile.am -@@ -26,6 +26,7 @@ - ## - DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H $(YYDEBUG) -DDEBUGPRED=@DEBUGPRED@ \ - -DSRCDIR=\"$(shell cd $(srcdir);pwd)\" -DOBJDIR=\"$(shell pwd)\" -+WEXTRA = @WEXTRA@ - if MUDFLAP - AM_CFLAGS = -fmudflap - else -@@ -33,7 +34,7 @@ AM_CFLAGS = - endif - AM_CFLAGS += -Wall -Wshadow -std=gnu99 $(native_ld_cflags) \ - $(if $($(*F)_no_Werror),,-Werror) \ -- $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ -+ $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \ - $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $(CFLAGS_$(*F)) - - INCLUDES = -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \ -@@ -112,6 +113,9 @@ addr2line_no_Wformat = yes +@@ -99,6 +99,9 @@ addr2line_no_Wformat = yes # XXX While the file is not finished, don't warn about this ldgeneric_no_Wunused = yes @@ -1095,7 +1098,7 @@ size_LDADD = $(libelf) $(libeu) $(libmudflap) --- elfutils/src/Makefile.in +++ elfutils/src/Makefile.in -@@ -202,6 +202,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -228,6 +228,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -1103,31 +1106,24 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -231,6 +232,7 @@ SHELL = @SHELL@ +@@ -256,6 +257,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +WEXTRA = @WEXTRA@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ - YACC = @YACC@ -d -@@ -291,13 +293,13 @@ zip_LIBS = @zip_LIBS@ - @MUDFLAP_FALSE@AM_CFLAGS = -Wall -Wshadow -std=gnu99 \ - @MUDFLAP_FALSE@ $(native_ld_cflags) $(if \ - @MUDFLAP_FALSE@ $($(*F)_no_Werror),,-Werror) $(if \ --@MUDFLAP_FALSE@ $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \ -+@MUDFLAP_FALSE@ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \ - @MUDFLAP_FALSE@ $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \ - @MUDFLAP_FALSE@ $(CFLAGS_$(*F)) - @MUDFLAP_TRUE@AM_CFLAGS = -fmudflap -Wall -Wshadow -std=gnu99 \ - @MUDFLAP_TRUE@ $(native_ld_cflags) $(if \ - @MUDFLAP_TRUE@ $($(*F)_no_Werror),,-Werror) $(if \ --@MUDFLAP_TRUE@ $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \ -+@MUDFLAP_TRUE@ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \ - @MUDFLAP_TRUE@ $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \ - @MUDFLAP_TRUE@ $(CFLAGS_$(*F)) - INCLUDES = -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \ -@@ -343,6 +345,9 @@ strings_no_Wformat = yes + XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +@@ -320,7 +322,7 @@ INCLUDES = -I. -I$(srcdir) -I$(top_srcdi + -I$(srcdir)/../libasm + AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \ + $($(*F)_no_Werror),,-Werror) $(if \ +- $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \ ++ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \ + $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \ + $(am__append_1) + @MUDFLAP_FALSE@libmudflap = +@@ -367,6 +369,9 @@ strings_no_Wformat = yes addr2line_no_Wformat = yes # XXX While the file is not finished, don't warn about this ldgeneric_no_Wunused = yes @@ -1139,7 +1135,7 @@ size_LDADD = $(libelf) $(libeu) $(libmudflap) --- elfutils/src/readelf.c +++ elfutils/src/readelf.c -@@ -7436,7 +7436,7 @@ dump_archive_index (Elf *elf, const char +@@ -7655,7 +7655,7 @@ dump_archive_index (Elf *elf, const char if (unlikely (elf_rand (elf, as_off) == 0) || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf)) == NULL)) @@ -1175,9 +1171,21 @@ break; } if (errno != EINVAL && errno != ENOMEM) +@@ -586,9 +595,11 @@ read_block (int fd, const char *fname, o + elfmap_off = from & ~(ps - 1); + elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size); + ++#ifdef POSIX_FADV_SEQUENTIAL + if (unlikely (elfmap == MAP_FAILED)) + /* Let the kernel know we are going to read everything in sequence. */ + (void) posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL); ++#endif + } + + if (unlikely (elfmap == MAP_FAILED)) --- elfutils/src/strip.c +++ elfutils/src/strip.c -@@ -52,6 +52,12 @@ +@@ -53,6 +53,12 @@ #include #include @@ -1190,7 +1198,7 @@ /* Name and version of program. */ static void print_version (FILE *stream, struct argp_state *state); -@@ -300,8 +306,18 @@ process_file (const char *fname) +@@ -301,8 +307,18 @@ process_file (const char *fname) /* If we have to preserve the timestamp, we need it in the format utimes() understands. */ @@ -1209,7 +1217,7 @@ } /* Open the file. */ -@@ -1745,7 +1761,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -1747,7 +1763,7 @@ handle_elf (int fd, Elf *elf, const char /* If requested, preserve the timestamp. */ if (tvp != NULL) { @@ -1218,7 +1226,7 @@ { error (0, errno, gettext ("\ cannot set access and modification date of '%s'"), -@@ -1802,7 +1818,7 @@ handle_ar (int fd, Elf *elf, const char +@@ -1804,7 +1820,7 @@ handle_ar (int fd, Elf *elf, const char if (tvp != NULL) { @@ -1229,7 +1237,7 @@ cannot set access and modification date of '%s'"), fname); --- elfutils/tests/ChangeLog +++ elfutils/tests/ChangeLog -@@ -95,6 +95,8 @@ +@@ -150,6 +150,8 @@ 2008-01-21 Roland McGrath @@ -1238,7 +1246,7 @@ * testfile45.S.bz2: Add tests for cltq, cqto. * testfile45.expect.bz2: Adjust. -@@ -803,6 +805,11 @@ +@@ -858,6 +860,11 @@ * Makefile.am (TESTS): Add run-elflint-test.sh. (EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2. @@ -1261,27 +1269,9 @@ { default: case 0: ---- elfutils/tests/Makefile.am -+++ elfutils/tests/Makefile.am -@@ -25,12 +25,13 @@ - ## . - ## - DEFS = -DHAVE_CONFIG_H -D_GNU_SOURCE -+WEXTRA = @WEXTRA@ - if MUDFLAP --AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 -fmudflap\ -+AM_CFLAGS = -Wall -Werror $(WEXTRA) -std=gnu99 -fmudflap\ - $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) - BUILD_RPATH = \$$ORIGIN/../backends - else --AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 \ -+AM_CFLAGS = -Wall -Werror $(WEXTRA) -std=gnu99 \ - $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) - BUILT_RPATH = \$$ORIGIN/../libasm:\$$ORIGIN/../libdw:\$$ORIGIN/../backends:\$$ORIGIN/../libelf - endif --- elfutils/tests/Makefile.in +++ elfutils/tests/Makefile.in -@@ -342,6 +342,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -372,6 +372,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ @@ -1289,24 +1279,20 @@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -371,6 +372,7 @@ SHELL = @SHELL@ +@@ -400,6 +401,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +WEXTRA = @WEXTRA@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ - YACC = @YACC@ -@@ -428,10 +430,10 @@ top_build_prefix = @top_build_prefix@ - top_builddir = @top_builddir@ - top_srcdir = @top_srcdir@ - zip_LIBS = @zip_LIBS@ --@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 \ -+@MUDFLAP_FALSE@AM_CFLAGS = -Wall -Werror $(WEXTRA) -std=gnu99 \ - @MUDFLAP_FALSE@ $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) - --@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Werror -Wextra -std=gnu99 -fmudflap\ -+@MUDFLAP_TRUE@AM_CFLAGS = -Wall -Werror $(WEXTRA) -std=gnu99 -fmudflap\ - @MUDFLAP_TRUE@ $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) - - @MUDFLAP_TRUE@BUILD_RPATH = \$$ORIGIN/../backends + XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +@@ -461,7 +463,7 @@ zip_LIBS = @zip_LIBS@ + INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. $(am__append_2) + AM_CFLAGS = -std=gnu99 -Wall -Wshadow $(if \ + $($(*F)_no_Werror),,-Werror) $(if \ +- $($(*F)_no_Wunused),,-Wunused -Wextra) $(if \ ++ $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) $(if \ + $($(*F)_no_Wformat),-Wno-format,-Wformat=2) $($(*F)_CFLAGS) \ + $(am__append_1) + @MUDFLAP_FALSE@libmudflap = diff --git a/elfutils-robustify.patch b/elfutils-robustify.patch index ec6d76e..e1356d4 100644 --- a/elfutils-robustify.patch +++ b/elfutils-robustify.patch @@ -1,24 +1,9 @@ --- elfutils/libelf/ChangeLog +++ elfutils/libelf/ChangeLog -@@ -521,6 +521,49 @@ +@@ -643,10 +643,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. -+2005-05-17 Jakub Jelinek -+ -+ * elf32_getphdr.c (elfw2(LIBELFBITS,getphdr)): Check if program header -+ table fits into object's bounds. -+ * elf_getshstrndx.c (elf_getshstrndx): Add elf->start_offset to -+ elf->map_address. Check if first section header fits into object's -+ bounds. -+ * elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)): -+ Check if section header table fits into object's bounds. -+ * elf_begin.c (get_shnum): Ensure section headers fits into -+ object's bounds. -+ (file_read_elf): Make sure scncnt is small enough to allocate both -+ ElfXX_Shdr and Elf_Scn array. Make sure section and program header -+ tables fit into object's bounds. Avoid memory leak on failure. -+ +2005-05-14 Jakub Jelinek + + * libelfP.h (INVALID_NDX): Define. @@ -50,16 +35,35 @@ 2005-05-11 Ulrich Drepper * elf.h: Update again. + ++2005-05-17 Jakub Jelinek ++ ++ * elf32_getphdr.c (elfw2(LIBELFBITS,getphdr)): Check if program header ++ table fits into object's bounds. ++ * elf_getshstrndx.c (elf_getshstrndx): Add elf->start_offset to ++ elf->map_address. Check if first section header fits into object's ++ bounds. ++ * elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)): ++ Check if section header table fits into object's bounds. ++ * elf_begin.c (get_shnum): Ensure section headers fits into ++ object's bounds. ++ (file_read_elf): Make sure scncnt is small enough to allocate both ++ ElfXX_Shdr and Elf_Scn array. Make sure section and program header ++ tables fit into object's bounds. Avoid memory leak on failure. ++ + 2005-05-09 Ulrich Drepper + + * elf.h: Update from glibc. --- elfutils/libelf/elf32_getphdr.c +++ elfutils/libelf/elf32_getphdr.c -@@ -105,6 +105,16 @@ __elfw2(LIBELFBITS,getphdr_wrlock) (elf) +@@ -114,6 +114,16 @@ __elfw2(LIBELFBITS,getphdr_wrlock) (elf) if (elf->map_address != NULL) { + /* First see whether the information in the ELF header is + valid and it does not ask for too much. */ + if (unlikely (ehdr->e_phoff >= elf->maximum_size) -+ || unlikely (ehdr->e_phoff + size > elf->maximum_size)) ++ || unlikely (elf->maximum_size - ehdr->e_phoff < size)) + { + /* Something is wrong. */ + __libelf_seterrno (ELF_E_INVALID_PHDR); @@ -73,8 +77,8 @@ +++ elfutils/libelf/elf32_getshdr.c @@ -1,5 +1,5 @@ /* Return section header. -- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2007 Red Hat, Inc. -+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2007, 2008 Red Hat, Inc. +- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2007, 2009 Red Hat, Inc. ++ Copyright (C) 1998-2009 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper , 1998. @@ -82,8 +86,8 @@ goto out; size_t shnum; -- if (__elf_getshnum_rdlock (elf, &shnum) != 0) -+ if (__elf_getshnum_rdlock (elf, &shnum) != 0 +- if (__elf_getshdrnum_rdlock (elf, &shnum) != 0) ++ if (__elf_getshdrnum_rdlock (elf, &shnum) != 0 + || shnum > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Shdr))) goto out; size_t size = shnum * sizeof (ElfW2(LIBELFBITS,Shdr)); @@ -95,7 +99,7 @@ + /* First see whether the information in the ELF header is + valid and it does not ask for too much. */ + if (unlikely (ehdr->e_shoff >= elf->maximum_size) -+ || unlikely (ehdr->e_shoff + size > elf->maximum_size)) ++ || unlikely (elf->maximum_size - ehdr->e_shoff < size)) + { + /* Something is wrong. */ + __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER); @@ -107,8 +111,8 @@ /* All the data is already mapped. If we could use it --- elfutils/libelf/elf32_newphdr.c +++ elfutils/libelf/elf32_newphdr.c -@@ -124,6 +124,12 @@ elfw2(LIBELFBITS,newphdr) (elf, count) - else if (elf->state.ELFW(elf,LIBELFBITS).ehdr->e_phnum != count +@@ -135,6 +135,12 @@ elfw2(LIBELFBITS,newphdr) (elf, count) + || count == PN_XNUM || elf->state.ELFW(elf,LIBELFBITS).phdr == NULL) { + if (unlikely (count > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Phdr)))) @@ -122,7 +126,7 @@ result = (ElfW2(LIBELFBITS,Phdr) *) --- elfutils/libelf/elf32_updatefile.c +++ elfutils/libelf/elf32_updatefile.c -@@ -220,6 +220,9 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf +@@ -223,6 +223,9 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf /* Write all the sections. Well, only those which are modified. */ if (shnum > 0) { @@ -132,7 +136,7 @@ Elf_ScnList *list = &elf->state.ELFW(elf,LIBELFBITS).scns; Elf_Scn **scns = (Elf_Scn **) alloca (shnum * sizeof (Elf_Scn *)); char *const shdr_start = ((char *) elf->map_address + elf->start_offset -@@ -633,6 +636,10 @@ __elfw2(LIBELFBITS,updatefile) (Elf *elf +@@ -645,6 +648,10 @@ __elfw2(LIBELFBITS,updatefile) (Elf *elf /* Write all the sections. Well, only those which are modified. */ if (shnum > 0) { @@ -151,7 +155,7 @@ { - if (ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize) + if (unlikely (ehdr.e32->e_shoff >= maxsize) -+ || unlikely (ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize)) ++ || unlikely (maxsize - ehdr.e32->e_shoff < sizeof (Elf32_Shdr))) /* Cannot read the first section header. */ return 0; @@ -178,17 +182,17 @@ + else if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf64_Shdr))) + 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)); -@@ -318,13 +329,31 @@ file_read_elf (int fildes, void *map_add + /* We can now allocate the memory. Even if there are no section headers, + we allocate space for a zeroth section in case we need it later. */ + const size_t scnmax = (scncnt ?: (cmd == ELF_C_RDWR || cmd == ELF_C_RDWR_MMAP) +@@ -324,6 +335,16 @@ file_read_elf (int fildes, void *map_add { /* We can use the mmapped memory. */ elf->state.elf32.ehdr = ehdr; + + if (unlikely (ehdr->e_shoff >= maxsize) -+ || unlikely (ehdr->e_shoff -+ + scncnt * sizeof (Elf32_Shdr) > maxsize)) ++ || unlikely (maxsize - ehdr->e_shoff ++ < scncnt * sizeof (Elf32_Shdr))) + { + free_and_out: + free (elf); @@ -197,23 +201,8 @@ + } elf->state.elf32.shdr = (Elf32_Shdr *) ((char *) ehdr + ehdr->e_shoff); -+ - if (ehdr->e_phnum > 0) -+ { - /* Assign a value only if there really is a program - header. Otherwise the value remains NULL. */ -+ if (unlikely (ehdr->e_phoff >= maxsize) -+ || unlikely (ehdr->e_phoff -+ + ehdr->e_phnum -+ * sizeof (Elf32_Phdr) > maxsize)) -+ goto free_and_out; - elf->state.elf32.phdr - = (Elf32_Phdr *) ((char *) ehdr + ehdr->e_phoff); -+ } - for (size_t cnt = 0; cnt < scncnt; ++cnt) - { -@@ -406,13 +435,26 @@ file_read_elf (int fildes, void *map_add +@@ -410,6 +431,11 @@ file_read_elf (int fildes, void *map_add { /* We can use the mmapped memory. */ elf->state.elf64.ehdr = ehdr; @@ -224,22 +213,7 @@ + goto free_and_out; elf->state.elf64.shdr = (Elf64_Shdr *) ((char *) ehdr + ehdr->e_shoff); -+ - if (ehdr->e_phnum > 0) -+ { - /* Assign a value only if there really is a program - header. Otherwise the value remains NULL. */ -+ if (unlikely (ehdr->e_phoff >= maxsize) -+ || unlikely (ehdr->e_phoff -+ + ehdr->e_phnum -+ * sizeof (Elf32_Phdr) > maxsize)) -+ goto free_and_out; - elf->state.elf64.phdr - = (Elf64_Phdr *) ((char *) ehdr + ehdr->e_phoff); -+ } - for (size_t cnt = 0; cnt < scncnt; ++cnt) - { --- elfutils/libelf/elf_getarsym.c +++ elfutils/libelf/elf_getarsym.c @@ -179,6 +179,9 @@ elf_getarsym (elf, ptr) @@ -252,9 +226,9 @@ || n * sizeof (uint32_t) > index_size) { /* This index table cannot be right since it does not fit into ---- elfutils/libelf/elf_getshstrndx.c -+++ elfutils/libelf/elf_getshstrndx.c -@@ -125,10 +125,25 @@ elf_getshstrndx (elf, dst) +--- elfutils/libelf/elf_getshdrstrndx.c ++++ elfutils/libelf/elf_getshdrstrndx.c +@@ -125,10 +125,25 @@ elf_getshdrstrndx (elf, dst) if (elf->map_address != NULL && elf->state.elf32.ehdr->e_ident[EI_DATA] == MY_ELFDATA && (ALLOW_UNALIGNED @@ -262,11 +236,13 @@ + || (((size_t) ((char *) elf->map_address + + elf->start_offset + offset)) & (__alignof__ (Elf32_Shdr) - 1)) == 0)) +- /* We can directly access the memory. */ +- num = ((Elf32_Shdr *) (elf->map_address + offset))->sh_link; + { + /* First see whether the information in the ELF header is + valid and it does not ask for too much. */ -+ if (unlikely (offset + sizeof (Elf32_Shdr) -+ > elf->maximum_size)) ++ if (unlikely (elf->maximum_size - offset ++ < sizeof (Elf32_Shdr))) + { + /* Something is wrong. */ + __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER); @@ -274,15 +250,14 @@ + goto out; + } + - /* We can directly access the memory. */ -- num = ((Elf32_Shdr *) (elf->map_address + offset))->sh_link; ++ /* We can directly access the memory. */ + num = ((Elf32_Shdr *) (elf->map_address + elf->start_offset + + offset))->sh_link; + } else { /* We avoid reading in all the section headers. Just read -@@ -163,10 +178,25 @@ elf_getshstrndx (elf, dst) +@@ -163,10 +178,25 @@ elf_getshdrstrndx (elf, dst) if (elf->map_address != NULL && elf->state.elf64.ehdr->e_ident[EI_DATA] == MY_ELFDATA && (ALLOW_UNALIGNED @@ -290,11 +265,13 @@ + || (((size_t) ((char *) elf->map_address + + elf->start_offset + offset)) & (__alignof__ (Elf64_Shdr) - 1)) == 0)) +- /* We can directly access the memory. */ +- num = ((Elf64_Shdr *) (elf->map_address + offset))->sh_link; + { + /* First see whether the information in the ELF header is + valid and it does not ask for too much. */ -+ if (unlikely (offset + sizeof (Elf64_Shdr) -+ > elf->maximum_size)) ++ if (unlikely (elf->maximum_size - offset ++ < sizeof (Elf64_Shdr))) + { + /* Something is wrong. */ + __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER); @@ -302,10 +279,9 @@ + goto out; + } + - /* We can directly access the memory. */ -- num = ((Elf64_Shdr *) (elf->map_address + offset))->sh_link; -+ num = ((Elf64_Shdr *) (elf->map_address -+ + elf->start_offset + offset))->sh_link; ++ /* We can directly access the memory. */ ++ num = ((Elf64_Shdr *) (elf->map_address + elf->start_offset ++ + offset))->sh_link; + } else { @@ -334,52 +310,76 @@ * sizeof (Elf_Scn)), 1); --- elfutils/libelf/gelf_getdyn.c +++ elfutils/libelf/gelf_getdyn.c -@@ -93,7 +93,8 @@ gelf_getdyn (data, ndx, dst) +@@ -1,5 +1,5 @@ + /* Get information from dynamic table at the given index. +- Copyright (C) 2000, 2001, 2002 Red Hat, Inc. ++ Copyright (C) 2000-2009 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper , 2000. + +@@ -93,7 +93,7 @@ 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. */ - if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf32_Dyn) -+ || unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf32_Dyn, &data_scn->d)) { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; -@@ -114,7 +115,8 @@ gelf_getdyn (data, ndx, dst) +@@ -114,7 +114,7 @@ gelf_getdyn (data, ndx, dst) /* The data is already in the correct form. Just make sure the index is OK. */ - if (unlikely ((ndx + 1) * sizeof (GElf_Dyn) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, GElf_Dyn) -+ || unlikely ((ndx + 1) * sizeof (GElf_Dyn) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, GElf_Dyn, &data_scn->d)) { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; --- elfutils/libelf/gelf_getlib.c +++ elfutils/libelf/gelf_getlib.c -@@ -86,7 +86,8 @@ gelf_getlib (data, ndx, dst) +@@ -1,5 +1,5 @@ + /* Get library from table at the given index. +- Copyright (C) 2004 Red Hat, Inc. ++ Copyright (C) 2004-2009 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper , 2004. + +@@ -86,7 +86,7 @@ gelf_getlib (data, ndx, dst) /* The data is already in the correct form. Just make sure the index is OK. */ GElf_Lib *result = NULL; - if (unlikely ((ndx + 1) * sizeof (GElf_Lib) > data->d_size)) -+ if (INVALID_NDX (ndx, GElf_Lib) -+ || unlikely ((ndx + 1) * sizeof (GElf_Lib) > data->d_size)) ++ if (INVALID_NDX (ndx, GElf_Lib, data)) __libelf_seterrno (ELF_E_INVALID_INDEX); else { --- elfutils/libelf/gelf_getmove.c +++ elfutils/libelf/gelf_getmove.c -@@ -83,7 +83,8 @@ gelf_getmove (data, ndx, dst) +@@ -1,5 +1,5 @@ + /* Get move structure at the given index. +- Copyright (C) 2000, 2001, 2002 Red Hat, Inc. ++ Copyright (C) 2000-2009 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper , 2000. + +@@ -83,7 +83,7 @@ gelf_getmove (data, ndx, dst) /* The data is already in the correct form. Just make sure the index is OK. */ - if (unlikely ((ndx + 1) * sizeof (GElf_Move) > data->d_size)) -+ if (INVALID_NDX (ndx, GElf_Move) -+ || unlikely ((ndx + 1) * sizeof (GElf_Move) > data->d_size)) ++ if (INVALID_NDX (ndx, GElf_Move, data)) { __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 Red Hat elfutils. + Written by Ulrich Drepper , 2000. + @@ -71,12 +71,6 @@ gelf_getrela (data, ndx, dst) if (data_scn == NULL) return NULL; @@ -393,28 +393,33 @@ if (unlikely (data_scn->d.d_type != ELF_T_RELA)) { __libelf_seterrno (ELF_E_INVALID_HANDLE); -@@ -93,7 +87,8 @@ gelf_getrela (data, ndx, dst) +@@ -93,7 +87,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) -+ || 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; -@@ -114,7 +109,8 @@ gelf_getrela (data, ndx, dst) +@@ -114,7 +108,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) -+ || 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 @@ + /* Get REL 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 Red Hat elfutils. + Written by Ulrich Drepper , 2000. + @@ -71,12 +71,6 @@ gelf_getrel (data, ndx, dst) if (data_scn == NULL) return NULL; @@ -428,107 +433,133 @@ if (unlikely (data_scn->d.d_type != ELF_T_REL)) { __libelf_seterrno (ELF_E_INVALID_HANDLE); -@@ -93,7 +87,8 @@ gelf_getrel (data, ndx, dst) +@@ -93,7 +87,7 @@ gelf_getrel (data, ndx, dst) if (scn->elf->class == ELFCLASS32) { /* We have to convert the data. */ - if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf32_Rel) -+ || unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf32_Rel, &data_scn->d)) { __libelf_seterrno (ELF_E_INVALID_INDEX); result = NULL; -@@ -113,7 +108,8 @@ gelf_getrel (data, ndx, dst) +@@ -113,7 +107,7 @@ gelf_getrel (data, ndx, dst) { /* Simply copy the data after we made sure we are actually getting correct data. */ - if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf64_Rel) -+ || unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf64_Rel, &data_scn->d)) { __libelf_seterrno (ELF_E_INVALID_INDEX); result = NULL; --- elfutils/libelf/gelf_getsym.c +++ elfutils/libelf/gelf_getsym.c -@@ -90,7 +90,8 @@ gelf_getsym (data, ndx, dst) +@@ -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-2009 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper , 1999. + +@@ -90,7 +90,7 @@ 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. */ - if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data->d_size)) -+ if (INVALID_NDX (ndx, Elf32_Sym) -+ || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data->d_size)) ++ if (INVALID_NDX (ndx, Elf32_Sym, data)) { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; -@@ -119,7 +120,8 @@ gelf_getsym (data, ndx, dst) +@@ -119,7 +119,7 @@ gelf_getsym (data, ndx, dst) /* The data is already in the correct form. Just make sure the index is OK. */ - if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > data->d_size)) -+ if (INVALID_NDX (ndx, GElf_Sym) -+ || unlikely ((ndx + 1) * sizeof (GElf_Sym) > data->d_size)) ++ if (INVALID_NDX (ndx, GElf_Sym, data)) { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; --- elfutils/libelf/gelf_getsyminfo.c +++ elfutils/libelf/gelf_getsyminfo.c -@@ -84,7 +84,8 @@ gelf_getsyminfo (data, ndx, dst) +@@ -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-2009 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper , 2000. + +@@ -84,7 +84,7 @@ gelf_getsyminfo (data, ndx, dst) /* The data is already in the correct form. Just make sure the index is OK. */ - if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data->d_size)) -+ if (INVALID_NDX (ndx, GElf_Syminfo) -+ || unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data->d_size)) ++ if (INVALID_NDX (ndx, GElf_Syminfo, data)) { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; --- elfutils/libelf/gelf_getsymshndx.c +++ elfutils/libelf/gelf_getsymshndx.c -@@ -90,7 +90,9 @@ gelf_getsymshndx (symdata, shndxdata, nd +@@ -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-2009 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper , 2000. + +@@ -90,7 +90,7 @@ gelf_getsymshndx (symdata, shndxdata, nd section index table. */ if (likely (shndxdata_scn != NULL)) { - if (unlikely ((ndx + 1) * sizeof (Elf32_Word) > shndxdata_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf32_Word) -+ || unlikely ((ndx + 1) * sizeof (Elf32_Word) -+ > shndxdata_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf32_Word, &shndxdata_scn->d)) { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; -@@ -110,7 +112,8 @@ gelf_getsymshndx (symdata, shndxdata, nd +@@ -110,7 +110,7 @@ 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. */ - if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata->d_size)) -+ if (INVALID_NDX (ndx, Elf32_Sym) -+ || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata->d_size)) ++ if (INVALID_NDX (ndx, Elf32_Sym, symdata)) { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; -@@ -139,7 +142,8 @@ gelf_getsymshndx (symdata, shndxdata, nd +@@ -139,7 +139,7 @@ gelf_getsymshndx (symdata, shndxdata, nd /* The data is already in the correct form. Just make sure the index is OK. */ - if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > symdata->d_size)) -+ if (INVALID_NDX (ndx, GElf_Sym) -+ || unlikely ((ndx + 1) * sizeof (GElf_Sym) > symdata->d_size)) ++ if (INVALID_NDX (ndx, GElf_Sym, symdata)) { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; --- elfutils/libelf/gelf_getversym.c +++ elfutils/libelf/gelf_getversym.c -@@ -92,7 +92,8 @@ gelf_getversym (data, ndx, dst) +@@ -1,5 +1,5 @@ + /* Get symbol version information at the given index. +- Copyright (C) 1999, 2000, 2001, 2002 Red Hat, Inc. ++ Copyright (C) 1999-2009 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper , 1999. + +@@ -92,7 +92,7 @@ gelf_getversym (data, ndx, dst) /* The data is already in the correct form. Just make sure the index is OK. */ - if (unlikely ((ndx + 1) * sizeof (GElf_Versym) > data->d_size)) -+ if (INVALID_NDX (ndx, GElf_Versym) -+ || unlikely ((ndx + 1) * sizeof (GElf_Versym) > data->d_size)) ++ if (INVALID_NDX (ndx, GElf_Versym, data)) { __libelf_seterrno (ELF_E_INVALID_INDEX); result = NULL; --- elfutils/libelf/gelf_update_dyn.c +++ elfutils/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-2009 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper , 2000. + @@ -71,12 +71,6 @@ gelf_update_dyn (data, ndx, src) if (data == NULL) return 0; @@ -542,28 +573,33 @@ if (unlikely (data_scn->d.d_type != ELF_T_DYN)) { /* The type of the data better should match. */ -@@ -102,7 +96,8 @@ gelf_update_dyn (data, ndx, src) +@@ -102,7 +96,7 @@ gelf_update_dyn (data, ndx, src) } /* Check whether we have to resize the data buffer. */ - if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf32_Dyn) -+ || unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf32_Dyn, &data_scn->d)) { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; -@@ -116,7 +111,8 @@ gelf_update_dyn (data, ndx, src) +@@ -116,7 +110,7 @@ gelf_update_dyn (data, ndx, src) else { /* Check whether we have to resize the data buffer. */ - if (unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf64_Dyn) -+ || unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf64_Dyn, &data_scn->d)) { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; --- elfutils/libelf/gelf_update_lib.c +++ elfutils/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-2009 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper , 2004. + @@ -68,12 +68,6 @@ gelf_update_lib (data, ndx, src) if (data == NULL) return 0; @@ -577,29 +613,43 @@ Elf_Data_Scn *data_scn = (Elf_Data_Scn *) data; if (unlikely (data_scn->d.d_type != ELF_T_LIB)) { -@@ -87,7 +81,8 @@ gelf_update_lib (data, ndx, src) +@@ -87,7 +81,7 @@ gelf_update_lib (data, ndx, src) /* Check whether we have to resize the data buffer. */ int result = 0; - if (unlikely ((ndx + 1) * sizeof (Elf64_Lib) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf64_Lib) -+ || unlikely ((ndx + 1) * sizeof (Elf64_Lib) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf64_Lib, &data_scn->d)) __libelf_seterrno (ELF_E_INVALID_INDEX); else { --- elfutils/libelf/gelf_update_move.c +++ elfutils/libelf/gelf_update_move.c -@@ -75,7 +75,7 @@ gelf_update_move (data, ndx, src) +@@ -1,5 +1,5 @@ + /* Update move structure at the given index. +- Copyright (C) 2000, 2001, 2002 Red Hat, Inc. ++ Copyright (C) 2000-2009 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper , 2000. + +@@ -75,8 +75,7 @@ gelf_update_move (data, ndx, src) assert (sizeof (GElf_Move) == sizeof (Elf64_Move)); /* Check whether we have to resize the data buffer. */ - if (unlikely (ndx < 0) -+ if (INVALID_NDX (ndx, GElf_Move) - || unlikely ((ndx + 1) * sizeof (GElf_Move) > data_scn->d.d_size)) +- || unlikely ((ndx + 1) * sizeof (GElf_Move) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, GElf_Move, &data_scn->d)) { __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 Red Hat elfutils. + Written by Ulrich Drepper , 2000. + @@ -68,12 +68,6 @@ gelf_update_rela (Elf_Data *dst, int ndx if (dst == NULL) return 0; @@ -613,28 +663,33 @@ if (unlikely (data_scn->d.d_type != ELF_T_RELA)) { /* The type of the data better should match. */ -@@ -101,7 +95,8 @@ gelf_update_rela (Elf_Data *dst, int ndx +@@ -101,7 +95,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) -+ || 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; -@@ -117,7 +112,8 @@ gelf_update_rela (Elf_Data *dst, int ndx +@@ -117,7 +111,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) -+ || 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 @@ + /* Update REL 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 Red Hat elfutils. + Written by Ulrich Drepper , 2000. + @@ -68,12 +68,6 @@ gelf_update_rel (Elf_Data *dst, int ndx, if (dst == NULL) return 0; @@ -648,28 +703,33 @@ if (unlikely (data_scn->d.d_type != ELF_T_REL)) { /* The type of the data better should match. */ -@@ -99,7 +93,8 @@ gelf_update_rel (Elf_Data *dst, int ndx, +@@ -99,7 +93,7 @@ gelf_update_rel (Elf_Data *dst, int ndx, } /* Check whether we have to resize the data buffer. */ - if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf32_Rel) -+ || unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf32_Rel, &data_scn->d)) { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; -@@ -114,7 +109,8 @@ gelf_update_rel (Elf_Data *dst, int ndx, +@@ -114,7 +108,7 @@ gelf_update_rel (Elf_Data *dst, int ndx, else { /* Check whether we have to resize the data buffer. */ - if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf64_Rel) -+ || unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf64_Rel, &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 @@ + /* Update symbol information in symbol table at the given index. +- Copyright (C) 2000, 2001, 2002 Red Hat, Inc. ++ Copyright (C) 2000-2009 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper , 2000. + @@ -72,12 +72,6 @@ gelf_update_sym (data, ndx, src) if (data == NULL) return 0; @@ -683,28 +743,33 @@ if (unlikely (data_scn->d.d_type != ELF_T_SYM)) { /* The type of the data better should match. */ -@@ -102,7 +96,8 @@ gelf_update_sym (data, ndx, src) +@@ -102,7 +96,7 @@ gelf_update_sym (data, ndx, src) } /* Check whether we have to resize the data buffer. */ - if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf32_Sym) -+ || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf32_Sym, &data_scn->d)) { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; -@@ -125,7 +120,8 @@ gelf_update_sym (data, ndx, src) +@@ -125,7 +119,7 @@ gelf_update_sym (data, ndx, src) else { /* Check whether we have to resize the data buffer. */ - if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf64_Sym) -+ || unlikely ((ndx + 1) * sizeof (Elf64_Sym) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf64_Sym, &data_scn->d)) { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; --- elfutils/libelf/gelf_update_syminfo.c +++ elfutils/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-2009 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper , 2000. + @@ -72,12 +72,6 @@ gelf_update_syminfo (data, ndx, src) if (data == NULL) return 0; @@ -718,18 +783,25 @@ if (unlikely (data_scn->d.d_type != ELF_T_SYMINFO)) { /* The type of the data better should match. */ -@@ -93,7 +87,8 @@ gelf_update_syminfo (data, ndx, src) +@@ -93,7 +87,7 @@ gelf_update_syminfo (data, ndx, src) rwlock_wrlock (scn->elf->lock); /* Check whether we have to resize the data buffer. */ - if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data_scn->d.d_size)) -+ if (INVALID_NDX (ndx, GElf_Syminfo) -+ || unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, GElf_Syminfo, &data_scn->d)) { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; --- elfutils/libelf/gelf_update_symshndx.c +++ elfutils/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-2009 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper , 2000. + @@ -77,12 +77,6 @@ gelf_update_symshndx (symdata, shndxdata if (symdata == NULL) return 0; @@ -743,56 +815,57 @@ if (unlikely (symdata_scn->d.d_type != ELF_T_SYM)) { /* The type of the data better should match. */ -@@ -128,7 +122,8 @@ gelf_update_symshndx (symdata, shndxdata +@@ -128,7 +122,7 @@ gelf_update_symshndx (symdata, shndxdata } /* Check whether we have to resize the data buffer. */ - if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf32_Sym) -+ || unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf32_Sym, &symdata_scn->d)) { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; -@@ -151,7 +146,8 @@ gelf_update_symshndx (symdata, shndxdata +@@ -151,7 +145,7 @@ gelf_update_symshndx (symdata, shndxdata else { /* Check whether we have to resize the data buffer. */ - if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > symdata_scn->d.d_size)) -+ if (INVALID_NDX (ndx, Elf64_Sym) -+ || unlikely ((ndx + 1) * sizeof (Elf64_Sym) > symdata_scn->d.d_size)) ++ if (INVALID_NDX (ndx, Elf64_Sym, &symdata_scn->d)) { __libelf_seterrno (ELF_E_INVALID_INDEX); goto out; --- elfutils/libelf/gelf_update_versym.c +++ elfutils/libelf/gelf_update_versym.c -@@ -75,7 +75,7 @@ gelf_update_versym (data, ndx, src) +@@ -1,5 +1,5 @@ + /* Update symbol version information. +- Copyright (C) 2001, 2002 Red Hat, Inc. ++ Copyright (C) 2001-2009 Red Hat, Inc. + This file is part of Red Hat elfutils. + Written by Ulrich Drepper , 2001. + +@@ -75,8 +75,7 @@ gelf_update_versym (data, ndx, src) assert (sizeof (GElf_Versym) == sizeof (Elf64_Versym)); /* Check whether we have to resize the data buffer. */ - if (unlikely (ndx < 0) -+ if (INVALID_NDX (ndx, GElf_Versym) - || unlikely ((ndx + 1) * sizeof (GElf_Versym) > data_scn->d.d_size)) +- || unlikely ((ndx + 1) * sizeof (GElf_Versym) > data_scn->d.d_size)) ++ if (INVALID_NDX (ndx, GElf_Versym, &data_scn->d)) { __libelf_seterrno (ELF_E_INVALID_INDEX); + return 0; --- elfutils/libelf/libelfP.h +++ elfutils/libelf/libelfP.h -@@ -611,4 +611,13 @@ extern uint32_t __libelf_crc32 (uint32_t +@@ -608,4 +608,8 @@ extern uint32_t __libelf_crc32 (uint32_t /* Align offset to 4 bytes as needed for note name and descriptor data. */ #define NOTE_ALIGN(n) (((n) + 3) & -4U) -+/* Convenience macro. Assumes int NDX and TYPE with size at least -+ 2 bytes. */ -+#if SIZE_MAX > 4294967295U -+# define INVALID_NDX(ndx, type) unlikely (ndx < 0) -+#else -+# define INVALID_NDX(ndx, type) \ -+ unlikely ((unsigned int) (ndx) >= SIZE_MAX / sizeof (type)) -+#endif ++/* Convenience macro. */ ++#define INVALID_NDX(ndx, type, data) \ ++ unlikely ((data)->d_size / sizeof (type) <= (unsigned int) (ndx)) + #endif /* libelfP.h */ --- elfutils/src/ChangeLog +++ elfutils/src/ChangeLog -@@ -1347,6 +1347,16 @@ +@@ -1548,6 +1548,16 @@ object symbols or symbols with unknown type. (check_rel): Likewise. @@ -809,7 +882,7 @@ 2005-06-08 Roland McGrath * readelf.c (print_ops): Add consts. -@@ -1392,6 +1402,19 @@ +@@ -1593,6 +1603,19 @@ * readelf.c (dwarf_tag_string): Add new tags. @@ -831,17 +904,18 @@ * strip.c (handle_elf): Don't translate hash and versym data formats, --- elfutils/src/elflint.c +++ elfutils/src/elflint.c -@@ -130,6 +130,9 @@ static uint32_t shstrndx; +@@ -131,6 +131,10 @@ static uint32_t shstrndx; /* Array to count references in section groups. */ static int *scnref; -+/* Number of sections. */ ++/* Numbers of sections and program headers. */ +static unsigned int shnum; ++static unsigned int phnum; + int main (int argc, char *argv[]) -@@ -318,10 +321,19 @@ section_name (Ebl *ebl, int idx) +@@ -319,10 +323,19 @@ section_name (Ebl *ebl, int idx) { GElf_Shdr shdr_mem; GElf_Shdr *shdr; @@ -862,18 +936,19 @@ } -@@ -343,10 +355,6 @@ static const int valid_e_machine[] = +@@ -344,11 +357,6 @@ static const int valid_e_machine[] = (sizeof (valid_e_machine) / sizeof (valid_e_machine[0])) --/* Number of sections. */ +-/* Numbers of sections and program headers. */ -static unsigned int shnum; +-static unsigned int phnum; - - static void check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size) { -@@ -611,7 +619,8 @@ section [%2d] '%s': symbol table cannot +@@ -632,7 +640,8 @@ section [%2d] '%s': symbol table cannot } } @@ -883,7 +958,7 @@ ERROR (gettext ("\ section [%2u] '%s': entry size is does not match ElfXX_Sym\n"), idx, section_name (ebl, idx)); -@@ -649,7 +658,7 @@ section [%2d] '%s': XINDEX for zeroth en +@@ -670,7 +679,7 @@ section [%2d] '%s': XINDEX for zeroth en xndxscnidx, section_name (ebl, xndxscnidx)); } @@ -892,7 +967,7 @@ { sym = gelf_getsymshndx (data, xndxdata, cnt, &sym_mem, &xndx); if (sym == NULL) -@@ -669,7 +678,8 @@ section [%2d] '%s': symbol %zu: invalid +@@ -690,7 +699,8 @@ section [%2d] '%s': symbol %zu: invalid else { name = elf_strptr (ebl->elf, shdr->sh_link, sym->st_name); @@ -902,7 +977,7 @@ } if (sym->st_shndx == SHN_XINDEX) -@@ -999,9 +1009,11 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e +@@ -1038,9 +1048,11 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e { GElf_Shdr rcshdr_mem; const GElf_Shdr *rcshdr = gelf_getshdr (scn, &rcshdr_mem); @@ -916,7 +991,7 @@ { /* Found the dynamic section. Look through it. */ Elf_Data *d = elf_getdata (scn, NULL); -@@ -1011,7 +1023,9 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e +@@ -1050,7 +1062,9 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e { GElf_Dyn dyn_mem; GElf_Dyn *dyn = gelf_getdyn (d, cnt, &dyn_mem); @@ -927,7 +1002,7 @@ if (dyn->d_tag == DT_RELCOUNT) { -@@ -1025,7 +1039,9 @@ section [%2d] '%s': DT_RELCOUNT used for +@@ -1064,7 +1078,9 @@ section [%2d] '%s': DT_RELCOUNT used for /* Does the number specified number of relative relocations exceed the total number of relocations? */ @@ -938,7 +1013,7 @@ ERROR (gettext ("\ section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"), idx, section_name (ebl, idx), -@@ -1185,7 +1201,8 @@ section [%2d] '%s': no relocations for m +@@ -1224,7 +1240,8 @@ section [%2d] '%s': no relocations for m } } @@ -948,7 +1023,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"), -@@ -1408,7 +1425,8 @@ check_rela (Ebl *ebl, GElf_Ehdr *ehdr, G +@@ -1447,7 +1464,8 @@ check_rela (Ebl *ebl, GElf_Ehdr *ehdr, G Elf_Data *symdata = elf_getdata (symscn, NULL); enum load_state state = state_undecided; @@ -958,7 +1033,7 @@ { GElf_Rela rela_mem; GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem); -@@ -1458,7 +1476,8 @@ check_rel (Ebl *ebl, GElf_Ehdr *ehdr, GE +@@ -1497,7 +1515,8 @@ check_rel (Ebl *ebl, GElf_Ehdr *ehdr, GE Elf_Data *symdata = elf_getdata (symscn, NULL); enum load_state state = state_undecided; @@ -968,7 +1043,7 @@ { GElf_Rel rel_mem; GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem); -@@ -1561,7 +1580,8 @@ section [%2d] '%s': referenced as string +@@ -1600,7 +1619,8 @@ section [%2d] '%s': referenced as string shdr->sh_link, section_name (ebl, shdr->sh_link), idx, section_name (ebl, idx)); @@ -978,7 +1053,7 @@ ERROR (gettext ("\ section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"), idx, section_name (ebl, idx)); -@@ -1571,7 +1591,7 @@ section [%2d] '%s': section entry size d +@@ -1610,7 +1630,7 @@ section [%2d] '%s': section entry size d idx, section_name (ebl, idx)); bool non_null_warned = false; @@ -987,7 +1062,7 @@ { GElf_Dyn dyn_mem; GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dyn_mem); -@@ -1852,6 +1872,8 @@ section [%2d] '%s': entry size does not +@@ -1891,6 +1911,8 @@ section [%2d] '%s': entry size does not idx, section_name (ebl, idx)); if (symshdr != NULL @@ -996,7 +1071,7 @@ && (shdr->sh_size / shdr->sh_entsize < symshdr->sh_size / symshdr->sh_entsize)) ERROR (gettext ("\ -@@ -1878,6 +1900,12 @@ section [%2d] '%s': extended section ind +@@ -1917,6 +1939,12 @@ section [%2d] '%s': extended section ind } Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL); @@ -1009,7 +1084,7 @@ if (*((Elf32_Word *) data->d_buf) != 0) ERROR (gettext ("symbol 0 should have zero extended section index\n")); -@@ -1920,7 +1948,7 @@ section [%2d] '%s': hash table section i +@@ -1959,7 +1987,7 @@ section [%2d] '%s': hash table section i size_t maxidx = nchain; @@ -1018,7 +1093,7 @@ { size_t symsize = symshdr->sh_size / symshdr->sh_entsize; -@@ -1931,18 +1959,28 @@ section [%2d] '%s': hash table section i +@@ -1970,18 +1998,28 @@ section [%2d] '%s': hash table section i maxidx = symsize; } @@ -1049,7 +1124,7 @@ } -@@ -1972,18 +2010,28 @@ section [%2d] '%s': hash table section i +@@ -2011,18 +2049,28 @@ section [%2d] '%s': hash table section i maxidx = symsize; } @@ -1081,7 +1156,7 @@ } -@@ -2008,7 +2056,7 @@ section [%2d] '%s': bitmask size not pow +@@ -2047,7 +2095,7 @@ section [%2d] '%s': bitmask size not pow if (shdr->sh_size < (4 + bitmask_words + nbuckets) * sizeof (Elf32_Word)) { ERROR (gettext ("\ @@ -1090,7 +1165,7 @@ idx, section_name (ebl, idx), (long int) shdr->sh_size, (long int) ((4 + bitmask_words + nbuckets) * sizeof (Elf32_Word))); return; -@@ -2680,8 +2728,9 @@ section [%2d] '%s' refers in sh_link to +@@ -2719,8 +2767,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. */ @@ -1104,7 +1179,7 @@ idx, section_name (ebl, idx), --- elfutils/src/readelf.c +++ elfutils/src/readelf.c -@@ -1136,6 +1136,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G +@@ -1171,6 +1171,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G Elf32_Word *grpref = (Elf32_Word *) data->d_buf; GElf_Sym sym_mem; @@ -1113,7 +1188,7 @@ printf ((grpref[0] & GRP_COMDAT) ? ngettext ("\ \nCOMDAT section group [%2zu] '%s' with signature '%s' contains %zu entry:\n", -@@ -1148,8 +1150,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G +@@ -1183,8 +1185,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), @@ -1124,7 +1199,7 @@ ?: gettext (""), data->d_size / sizeof (Elf32_Word) - 1); -@@ -1300,7 +1302,8 @@ static void +@@ -1335,7 +1337,8 @@ static void handle_dynamic (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr) { int class = gelf_getclass (ebl->elf); @@ -1134,7 +1209,7 @@ Elf_Data *data; size_t cnt; size_t shstrndx; -@@ -1315,6 +1318,11 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn, +@@ -1350,6 +1353,11 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn, error (EXIT_FAILURE, 0, gettext ("cannot get section header string table index")); @@ -1146,7 +1221,7 @@ printf (ngettext ("\ \nDynamic segment contains %lu entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n", "\ -@@ -1324,9 +1332,7 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn, +@@ -1359,9 +1367,7 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn, class == ELFCLASS32 ? 10 : 18, shdr->sh_addr, shdr->sh_offset, (int) shdr->sh_link, @@ -1157,7 +1232,7 @@ fputs_unlocked (gettext (" Type Value\n"), stdout); for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt) -@@ -1826,6 +1832,13 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G +@@ -1944,6 +1950,13 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G error (EXIT_FAILURE, 0, gettext ("cannot get section header string table index")); @@ -1171,7 +1246,7 @@ /* Now we can compute the number of entries in the section. */ unsigned int nsyms = data->d_size / (class == ELFCLASS32 ? sizeof (Elf32_Sym) -@@ -1836,15 +1849,12 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G +@@ -1954,15 +1967,12 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G nsyms), (unsigned int) elf_ndxscn (scn), elf_strptr (ebl->elf, shstrndx, shdr->sh_name), nsyms); @@ -1188,7 +1263,7 @@ fputs_unlocked (class == ELFCLASS32 ? gettext ("\ -@@ -2080,7 +2090,13 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn, +@@ -2198,7 +2208,13 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn, error (EXIT_FAILURE, 0, gettext ("cannot get section header string table index")); @@ -1203,7 +1278,7 @@ printf (ngettext ("\ \nVersion needs section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n", "\ -@@ -2091,9 +2107,7 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn, +@@ -2209,9 +2225,7 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn, class == ELFCLASS32 ? 10 : 18, shdr->sh_addr, shdr->sh_offset, (unsigned int) shdr->sh_link, @@ -1214,7 +1289,7 @@ unsigned int offset = 0; for (int cnt = shdr->sh_info; --cnt >= 0; ) -@@ -2146,8 +2160,14 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G +@@ -2264,8 +2278,14 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G error (EXIT_FAILURE, 0, gettext ("cannot get section header string table index")); @@ -1230,7 +1305,7 @@ printf (ngettext ("\ \nVersion definition section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n", "\ -@@ -2159,9 +2179,7 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G +@@ -2277,9 +2297,7 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G class == ELFCLASS32 ? 10 : 18, shdr->sh_addr, shdr->sh_offset, (unsigned int) shdr->sh_link, @@ -1241,7 +1316,7 @@ unsigned int offset = 0; for (int cnt = shdr->sh_info; --cnt >= 0; ) -@@ -2423,8 +2441,14 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G +@@ -2541,8 +2559,14 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G filename = NULL; } @@ -1257,7 +1332,7 @@ printf (ngettext ("\ \nVersion symbols section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'", "\ -@@ -2436,9 +2460,7 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G +@@ -2554,9 +2578,7 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G class == ELFCLASS32 ? 10 : 18, shdr->sh_addr, shdr->sh_offset, (unsigned int) shdr->sh_link, @@ -1268,7 +1343,7 @@ /* 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) -@@ -2490,7 +2512,17 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn, +@@ -2608,7 +2630,17 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn, for (Elf32_Word cnt = 0; cnt < nbucket; ++cnt) ++counts[lengths[cnt]]; @@ -1287,7 +1362,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", "\ -@@ -2503,9 +2535,7 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn, +@@ -2621,9 +2653,7 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn, shdr->sh_addr, shdr->sh_offset, (unsigned int) shdr->sh_link, @@ -1298,7 +1373,7 @@ if (extrastr != NULL) fputs (extrastr, stdout); -@@ -4104,6 +4134,16 @@ print_debug_aranges_section (Dwfl_Module +@@ -4265,6 +4295,16 @@ print_debug_aranges_section (Dwfl_Module return; } @@ -1317,7 +1392,7 @@ "\ --- elfutils/src/strip.c +++ elfutils/src/strip.c -@@ -544,6 +544,11 @@ handle_elf (int fd, Elf *elf, const char +@@ -545,6 +545,11 @@ handle_elf (int fd, Elf *elf, const char goto fail_close; } @@ -1329,7 +1404,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. -@@ -565,7 +570,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -566,7 +571,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). */ @@ -1338,7 +1413,7 @@ shdr_info[cnt].scn = scn; -@@ -578,6 +583,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -579,6 +584,7 @@ handle_elf (int fd, Elf *elf, const char shdr_info[cnt].shdr.sh_name); if (shdr_info[cnt].name == NULL) { @@ -1346,7 +1421,7 @@ error (0, 0, gettext ("illformed file '%s'"), fname); goto fail_close; } -@@ -587,6 +593,8 @@ handle_elf (int fd, Elf *elf, const char +@@ -588,6 +594,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; @@ -1355,7 +1430,7 @@ /* Sections in files other than relocatable object files which are not loaded can be freely moved by us. In relocatable -@@ -599,7 +607,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -600,7 +608,7 @@ handle_elf (int fd, Elf *elf, const char appropriate reference. */ if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB_SHNDX)) { @@ -1364,7 +1439,7 @@ shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx = cnt; } else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GROUP)) -@@ -616,7 +624,12 @@ handle_elf (int fd, Elf *elf, const char +@@ -617,7 +625,12 @@ handle_elf (int fd, Elf *elf, const char for (inner = 1; inner < shdr_info[cnt].data->d_size / sizeof (Elf32_Word); ++inner) @@ -1377,7 +1452,7 @@ if (inner == 1 || (inner == 2 && (grpref[0] & GRP_COMDAT) == 0)) /* If the section group contains only one element and this -@@ -627,7 +640,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -628,7 +641,7 @@ handle_elf (int fd, Elf *elf, const char } else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GNU_versym)) { @@ -1386,7 +1461,7 @@ shdr_info[shdr_info[cnt].shdr.sh_link].version_idx = cnt; } -@@ -635,7 +648,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -636,7 +649,7 @@ handle_elf (int fd, Elf *elf, const char discarded right away. */ if ((shdr_info[cnt].shdr.sh_flags & SHF_GROUP) != 0) { @@ -1395,7 +1470,7 @@ if (shdr_info[shdr_info[cnt].group_idx].idx == 0) { -@@ -710,11 +723,15 @@ handle_elf (int fd, Elf *elf, const char +@@ -711,11 +724,15 @@ 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. */ @@ -1413,7 +1488,7 @@ if (shdr_info[cnt].idx == 1) { -@@ -741,7 +758,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -742,7 +759,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) { @@ -1422,7 +1497,7 @@ shdr_info[shdr_info[cnt].symtab_idx].data = elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn, -@@ -781,6 +798,9 @@ handle_elf (int fd, Elf *elf, const char +@@ -782,6 +799,9 @@ handle_elf (int fd, Elf *elf, const char else if (scnidx == SHN_XINDEX) scnidx = xndx; @@ -1432,7 +1507,7 @@ if (shdr_info[scnidx].idx == 0) /* This symbol table has a real symbol in a discarded section. So preserve the -@@ -811,12 +831,16 @@ handle_elf (int fd, Elf *elf, const char +@@ -812,12 +832,16 @@ handle_elf (int fd, Elf *elf, const char } /* Handle references through sh_info. */ @@ -1451,7 +1526,7 @@ /* Mark the section as investigated. */ shdr_info[cnt].idx = 2; -@@ -954,7 +978,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -956,7 +980,7 @@ handle_elf (int fd, Elf *elf, const char error (EXIT_FAILURE, 0, gettext ("while generating output file: %s"), elf_errmsg (-1)); @@ -1460,7 +1535,7 @@ /* Add this name to the section header string table. */ shdr_info[cnt].se = ebl_strtabadd (shst, shdr_info[cnt].name, 0); -@@ -991,7 +1015,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -993,7 +1017,7 @@ handle_elf (int fd, Elf *elf, const char error (EXIT_FAILURE, 0, gettext ("while create section header section: %s"), elf_errmsg (-1)); @@ -1469,7 +1544,7 @@ shdr_info[cnt].data = elf_newdata (shdr_info[cnt].newscn); if (shdr_info[cnt].data == NULL) -@@ -1047,7 +1071,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -1049,7 +1073,7 @@ handle_elf (int fd, Elf *elf, const char error (EXIT_FAILURE, 0, gettext ("while create section header section: %s"), elf_errmsg (-1)); @@ -1478,7 +1553,7 @@ /* Finalize the string table and fill in the correct indices in the section headers. */ -@@ -1137,20 +1161,20 @@ handle_elf (int fd, Elf *elf, const char +@@ -1139,20 +1163,20 @@ handle_elf (int fd, Elf *elf, const char shndxdata = elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn, NULL); @@ -1502,7 +1577,7 @@ >= shdr_info[cnt].data->d_size / elsize); } -@@ -1205,7 +1229,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -1207,7 +1231,7 @@ handle_elf (int fd, Elf *elf, const char sec = shdr_info[sym->st_shndx].idx; else { @@ -1511,7 +1586,7 @@ sec = shdr_info[xshndx].idx; } -@@ -1226,7 +1250,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -1228,7 +1252,7 @@ handle_elf (int fd, Elf *elf, const char nxshndx = sec; } @@ -1520,7 +1595,7 @@ if ((inner != destidx || nshndx != sym->st_shndx || (shndxdata != NULL && nxshndx != xshndx)) -@@ -1250,7 +1274,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -1252,7 +1276,7 @@ handle_elf (int fd, Elf *elf, const char || shdr_info[cnt].debug_data == NULL) /* This is a section symbol for a section which has been removed. */ @@ -1529,7 +1604,7 @@ } if (destidx != inner) -@@ -1437,11 +1461,11 @@ handle_elf (int fd, Elf *elf, const char +@@ -1439,11 +1463,11 @@ handle_elf (int fd, Elf *elf, const char { GElf_Sym sym_mem; GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem); @@ -1543,7 +1618,7 @@ size_t hidx = elf_hash (name) % nbucket; if (bucket[hidx] == 0) -@@ -1460,7 +1484,7 @@ handle_elf (int fd, Elf *elf, const char +@@ -1462,7 +1486,7 @@ handle_elf (int fd, Elf *elf, const char else { /* Alpha and S390 64-bit use 64-bit SHT_HASH entries. */ @@ -1552,7 +1627,7 @@ == sizeof (Elf64_Xword)); Elf64_Xword *bucket = (Elf64_Xword *) hashd->d_buf; -@@ -1491,11 +1515,11 @@ handle_elf (int fd, Elf *elf, const char +@@ -1493,11 +1517,11 @@ handle_elf (int fd, Elf *elf, const char { GElf_Sym sym_mem; GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem); diff --git a/elfutils.spec b/elfutils.spec index ebd38a7..d6bb226 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,24 +1,24 @@ -%define eu_version 0.140 -%define eu_release 2 +%global eu_version 0.147 +%global eu_release 1 %if %{?_with_compat:1}%{!?_with_compat:0} -%define compat 1 +%global compat 1 %else -%define compat 0 +%global compat 0 %endif %if 0%{?fedora} >= 8 -%define scanf_has_m 1 +%global scanf_has_m 1 %endif %if 0%{?rhel} >= 6 -%define scanf_has_m 1 +%global scanf_has_m 1 %endif %if 0%{?fedora} >= 7 -%define separate_devel_static 1 +%global separate_devel_static 1 %endif %if 0%{?rhel} >= 6 -%define separate_devel_static 1 +%global separate_devel_static 1 %endif Summary: A collection of utilities and DSOs to handle compiled objects @@ -27,7 +27,7 @@ Version: %{eu_version} %if !%{compat} Release: %{eu_release}%{?dist} %else -Release: 0.%{eu_release}.1 +Release: 0.%{eu_release} %endif License: GPLv2 with exceptions Group: Development/Tools @@ -38,7 +38,7 @@ Patch2: elfutils-portability.patch Requires: elfutils-libelf-%{_arch} = %{version}-%{release} Requires: elfutils-libs-%{_arch} = %{version}-%{release} -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: gettext BuildRequires: bison >= 1.875 BuildRequires: flex >= 2.5.4a BuildRequires: bzip2 @@ -50,12 +50,20 @@ BuildRequires: glibc-headers >= 2.3.4-11 BuildRequires: gcc >= 3.2 %endif -%define use_zlib 0 +%global use_zlib 0 %if 0%{?fedora} >= 5 -%define use_zlib 1 +%global use_zlib 1 %endif %if 0%{?rhel} >= 5 -%define use_zlib 1 +%global use_zlib 1 +%endif + +%global use_xz 0 +%if 0%{?fedora} >= 10 +%global use_xz 1 +%endif +%if 0%{?rhel} >= 6 +%global use_xz 1 %endif %if %{use_zlib} @@ -63,8 +71,12 @@ BuildRequires: zlib-devel >= 1.2.2.3 BuildRequires: bzip2-devel %endif -%define _gnu %{nil} -%define _program_prefix eu- +%if %{use_xz} +BuildRequires: xz-devel +%endif + +%global _gnu %{nil} +%global _program_prefix eu- %description Elfutils is a collection of utilities, including ld (a linker), @@ -183,7 +195,10 @@ RPM_OPT_FLAGS=${RPM_OPT_FLAGS/-Wall/} RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D__NO_INLINE__" %endif -%configure CFLAGS="$RPM_OPT_FLAGS -fexceptions" +%configure CFLAGS="$RPM_OPT_FLAGS -fexceptions" || { + cat config.log + exit 2 +} make -s %{?_smp_mflags} %install @@ -198,6 +213,8 @@ chmod +x ${RPM_BUILD_ROOT}%{_prefix}/%{_lib}/elfutils/lib*.so* rm -f .%{_bindir}/eu-ld ) +%find_lang %{name} + %check make -s check @@ -214,7 +231,7 @@ rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,root) -%doc README TODO +%doc COPYING README TODO %{_bindir}/eu-addr2line %{_bindir}/eu-ar %{_bindir}/eu-elfcmp @@ -259,7 +276,7 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/libasm.a %{_libdir}/libdw.a -%files libelf +%files -f %{name}.lang libelf %defattr(-,root,root) %{_libdir}/libelf-%{version}.so %{_libdir}/libelf.so.* @@ -276,6 +293,69 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/libelf.a %changelog +* Mon May 3 2010 Roland McGrath - 0.147-1 +- Update to 0.147 + +* Wed Apr 21 2010 Roland McGrath - 0.146-1 +- Update to 0.146 + - libdwfl: New function dwfl_core_file_report. + - libelf: Fix handling of phdrs in truncated file. (#577310) + - libdwfl: Fix infinite loop handling clobbered link_map. (#576379) +- Package translations. + +* Tue Feb 23 2010 Roland McGrath - 0.145-1 +- Update to 0.145 + - Fix build with --disable-dependency-tracking. (#564646) + - Fix build with most recent glibc headers. + - libdw: Fix CFI decoding. (#563528) + - libdwfl: Fix address bias returned by CFI accessors. (#563528) + Fix core file module layout identification. (#559836) + - readelf: Fix CFI decoding. + +* Fri Jan 15 2010 Roland McGrath - 0.144-2 +- Fix sloppy #include's breaking build with F-13 glibc. + +* Thu Jan 14 2010 Roland McGrath - 0.144-1 +- Update to 0.144 + - libdw: New function dwarf_aggregate_size for computing (constant) type + sizes, including array_type cases with nontrivial calculation. + - readelf: Don't give errors for missing info under -a. + Handle Linux "VMCOREINFO" notes under -n. +- Resolves: RHBZ #527004, RHBZ #530704, RHBZ #550858 + +* Mon Sep 21 2009 Roland McGrath - 0.143-1 +- Update to 0.143 + - libdw: Various convenience functions for individual attributes now use + dwarf_attr_integrate to look up indirect inherited attributes. + Location expression handling now supports DW_OP_implicit_value. + - libdwfl: Support automatic decompression of files in XZ format, + and of Linux kernel images made with bzip2 or LZMA + (as well as gzip). + +* Tue Jul 28 2009 Roland McGrath - 0.142-1 +- Update to 0.142 + - libelf: Bug fix in filling gaps between sections. (#512840) + - libelf: Add elf_getshdrnum alias for elf_getshnum and elf_getshdrstrndx + alias for elf_getshstrndx and deprecate original names. + - libebl, elflint: Add support for STB_GNU_UNIQUE. (#511436) + - readelf: Add -N option, speeds up DWARF printing + without address->name lookups. (#505347) + - libdw: Add support for decoding DWARF CFI into location description form. + Handle some new DWARF 3 expression operations previously omitted. + Basic handling of some new encodings slated for DWARF 4. + +* Thu Apr 23 2009 Roland McGrath - 0.141-1 +- Update to 0.141 + - libebl: sparc backend fixes (#490585) + some more arm backend support + - libdwfl: fix dwfl_module_build_id for prelinked DSO case (#489439) + fixes in core file support (#494858) + dwfl_module_getsym interface improved for non-address symbols + - eu-strip: fix infinite loop on strange inputs with -f + - eu-addr2line: take -j/--section=NAME option for binutils compatibility + (same effect as '(NAME)0x123' syntax already supported) +- Resolves: RHBZ #495213, RHBZ #465872, RHBZ #470055, RHBZ #484623 + * Tue Feb 24 2009 Fedora Release Engineering - 0.140-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild @@ -287,7 +367,7 @@ rm -rf ${RPM_BUILD_ROOT} - Update to 0.139 - libcpu: Add Intel SSE4 disassembler support - readelf: Implement call frame information and exception handling dumping. - Add -e option. Enable it implicitly for -a. + Add -e option. Enable it implicitly for -a. - elflint: Check PT_GNU_EH_FRAME program header entry. - libdwfl: Support automatic gzip/bzip2 decompression of ELF files. (#472136) diff --git a/sources b/sources index 3d851fa..cb86e2f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d4d64f9c05ba127a5a8b55beb6d88ab2 elfutils-0.140.tar.bz2 +ccb6bba1d96c096f1b5dbd34444554a3 elfutils-0.147.tar.bz2 diff --git a/systemtap-elfutils.repo b/systemtap-elfutils.repo deleted file mode 100644 index 96d326b..0000000 --- a/systemtap-elfutils.repo +++ /dev/null @@ -1,5 +0,0 @@ -[systemtap-elfutils] -name=FOR SYSTEMTAP DEVELOPMENT ONLY -baseurl=ftp://sources.redhat.com/pub/systemtap/elfutils/ -enabled=1 -gpgcheck=0