diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2019-01-29 21:55:33 +0000 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2019-01-29 21:56:18 +0000 |
commit | d21856c6b7ba9348121de36979d22d94fb0bfc16 (patch) | |
tree | b1180879110d81a8cb75c366830b652bfb88391e /dev-libs/elfutils | |
parent | mail-client/thunderbird-bin: bump to v60.5.0 (diff) | |
download | gentoo-d21856c6b7ba9348121de36979d22d94fb0bfc16.tar.gz gentoo-d21856c6b7ba9348121de36979d22d94fb0bfc16.tar.bz2 gentoo-d21856c6b7ba9348121de36979d22d94fb0bfc16.zip |
dev-libs/elfutils: fix parsing of partial core, bug #676794
Reported-by: Demetris Nakos
Bug: https://bugs.gentoo.org/676794
Bug: https://sourceware.org/PR24103
Package-Manager: Portage-2.3.59, Repoman-2.3.12
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'dev-libs/elfutils')
-rw-r--r-- | dev-libs/elfutils/elfutils-0.173-r1.ebuild | 69 | ||||
-rw-r--r-- | dev-libs/elfutils/elfutils-0.175-r1.ebuild (renamed from dev-libs/elfutils/elfutils-0.175.ebuild) | 7 | ||||
-rw-r--r-- | dev-libs/elfutils/files/elfutils-0.173-partial-core.patch | 34 |
3 files changed, 108 insertions, 2 deletions
diff --git a/dev-libs/elfutils/elfutils-0.173-r1.ebuild b/dev-libs/elfutils/elfutils-0.173-r1.ebuild new file mode 100644 index 000000000000..0b41180c4eba --- /dev/null +++ b/dev-libs/elfutils/elfutils-0.173-r1.ebuild @@ -0,0 +1,69 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit flag-o-matic multilib-minimal + +DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)" +HOMEPAGE="http://elfutils.org/" +SRC_URI="https://sourceware.org/elfutils/ftp/${PV}/${P}.tar.bz2" + +LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux" +IUSE="bzip2 lzma nls static-libs test +threads +utils" + +RDEPEND=">=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] + bzip2? ( >=app-arch/bzip2-1.0.6-r4[${MULTILIB_USEDEP}] ) + lzma? ( >=app-arch/xz-utils-5.0.5-r1[${MULTILIB_USEDEP}] ) + !dev-libs/libelf" +DEPEND="${RDEPEND} + nls? ( sys-devel/gettext ) + >=sys-devel/flex-2.5.4a + sys-devel/m4" + +PATCHES=( + "${FILESDIR}"/${PN}-0.118-PaX-support.patch + "${FILESDIR}"/${PN}-0.173-partial-core.patch +) + +src_prepare() { + default + + if ! use static-libs; then + sed -i -e '/^lib_LIBRARIES/s:=.*:=:' -e '/^%.os/s:%.o$::' lib{asm,dw,elf}/Makefile.in || die + fi + sed -i 's:-Werror::' */Makefile.in || die +} + +src_configure() { + use test && append-flags -g #407135 + multilib-minimal_src_configure +} + +multilib_src_configure() { + ECONF_SOURCE="${S}" econf \ + $(use_enable nls) \ + $(use_enable threads thread-safety) \ + --program-prefix="eu-" \ + --with-zlib \ + $(use_with bzip2 bzlib) \ + $(use_with lzma) +} + +multilib_src_test() { + env LD_LIBRARY_PATH="${BUILD_DIR}/libelf:${BUILD_DIR}/libebl:${BUILD_DIR}/libdw:${BUILD_DIR}/libasm" \ + LC_ALL="C" \ + emake check VERBOSE=1 +} + +multilib_src_install_all() { + einstalldocs + dodoc NOTES + # These build quick, and are needed for most tests, so don't + # disable their building when the USE flag is disabled. + if ! use utils; then + rm -rf "${ED}"/usr/bin || die + fi +} diff --git a/dev-libs/elfutils/elfutils-0.175.ebuild b/dev-libs/elfutils/elfutils-0.175-r1.ebuild index 39a57eb90c12..ad1c1988b467 100644 --- a/dev-libs/elfutils/elfutils-0.175.ebuild +++ b/dev-libs/elfutils/elfutils-0.175-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Authors +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -23,7 +23,10 @@ DEPEND="${RDEPEND} >=sys-devel/flex-2.5.4a sys-devel/m4" -PATCHES=("${FILESDIR}"/${PN}-0.118-PaX-support.patch) +PATCHES=( + "${FILESDIR}"/${PN}-0.118-PaX-support.patch + "${FILESDIR}"/${PN}-0.173-partial-core.patch +) src_prepare() { default diff --git a/dev-libs/elfutils/files/elfutils-0.173-partial-core.patch b/dev-libs/elfutils/files/elfutils-0.173-partial-core.patch new file mode 100644 index 000000000000..41ef14d66838 --- /dev/null +++ b/dev-libs/elfutils/files/elfutils-0.173-partial-core.patch @@ -0,0 +1,34 @@ +https://sourceware.org/PR24103 +https://bugs.gentoo.org/676794 + +From da5c5336a1eaf519de246f7d9f0f5585e1d4ac59 Mon Sep 17 00:00:00 2001 +From: Mark Wielaard <mark@klomp.org> +Date: Sun, 20 Jan 2019 23:05:56 +0100 +Subject: [PATCH] libdwfl: Sanity check partial core file dyn data read. + +When reading the dyn data from the core file check if we got everything, +or just part of the data. + +https://sourceware.org/bugzilla/show_bug.cgi?id=24103 + +Signed-off-by: Mark Wielaard <mark@klomp.org> +--- + libdwfl/dwfl_segment_report_module.c | 6 ++++++ + +--- a/libdwfl/dwfl_segment_report_module.c ++++ b/libdwfl/dwfl_segment_report_module.c +@@ -783,6 +783,12 @@ dwfl_segment_report_module (Dwfl *dwfl, int ndx, const char *name, + if (dyn_filesz != 0 && dyn_filesz % dyn_entsize == 0 + && ! read_portion (&dyn_data, &dyn_data_size, dyn_vaddr, dyn_filesz)) + { ++ /* dyn_data_size will be zero if we got everything from the initial ++ buffer, otherwise it will be the size of the new buffer that ++ could be read. */ ++ if (dyn_data_size != 0) ++ dyn_filesz = dyn_data_size; ++ + void *dyns = malloc (dyn_filesz); + Elf32_Dyn (*d32)[dyn_filesz / sizeof (Elf32_Dyn)] = dyns; + Elf64_Dyn (*d64)[dyn_filesz / sizeof (Elf64_Dyn)] = dyns; +-- +2.20.1 |