0.168-1 - New upstream release from https://sourceware.org/elfutils/

This commit is contained in:
Mark Wielaard 2016-12-28 18:15:48 +01:00
parent d3c2ef0ac8
commit af747cd683
5 changed files with 14 additions and 150 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@
/elfutils-0.165.tar.bz2 /elfutils-0.165.tar.bz2
/elfutils-0.166.tar.bz2 /elfutils-0.166.tar.bz2
/elfutils-0.167.tar.bz2 /elfutils-0.167.tar.bz2
/elfutils-0.168.tar.bz2

View File

@ -1,50 +0,0 @@
From 836a16fe5b5bab4a3afe2c991c104652775ce3a3 Mon Sep 17 00:00:00 2001
From: David Abdurachmanov <davidlt@cern.ch>
Date: Mon, 11 Apr 2016 16:00:57 +0200
Subject: [PATCH] elfcmp: fix self-comparison error with GCC 6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Noticed with Fedora 24 Alpha, gcc (GCC) 6.0.0 20160406
(Red Hat 6.0.0-0.20).
elfcmp.c: In function main:
elfcmp.c:364:199: error: self-comparison always evaluates
to false [-Werror=tautological-compare]
if (unlikely (name1 == NULL || name2 == NULL
Signed-off-by: David Abdurachmanov <davidlt@cern.ch>
---
src/ChangeLog | 4 ++++
src/elfcmp.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/ChangeLog b/src/ChangeLog
index f74b5dc..bdc9d13 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2016-04-11 David Abdurachmanov <davidlt@cern.ch>
+
+ * elfcmp.c (main): Fix self-comparison error with GCC 6.
+
2016-03-21 Mark Wielaard <mjw@redhat.com>
* nm.c (show_symbols): Check for malloc size argument overflow.
diff --git a/src/elfcmp.c b/src/elfcmp.c
index 852b92f..7b5d39c 100644
--- a/src/elfcmp.c
+++ b/src/elfcmp.c
@@ -368,7 +368,7 @@ main (int argc, char *argv[])
&& sym1->st_shndx != SHN_UNDEF)
|| sym1->st_info != sym2->st_info
|| sym1->st_other != sym2->st_other
- || sym1->st_shndx != sym1->st_shndx))
+ || sym1->st_shndx != sym2->st_shndx))
{
// XXX Do we want to allow reordered symbol tables?
symtab_mismatch:
--
1.8.3.1

View File

@ -1,92 +0,0 @@
commit 7bf4b63a4980788e6c1969cae02f0483e79c069f
Author: Mark Wielaard <mjw@redhat.com>
Date: Thu Oct 6 16:06:32 2016 +0200
strip: Don't remove real symbols from allocated symbol tables.
Having a symbol in an allocated symbol table (like .dynsym) that
points to an unallocated section is wrong. Traditionally strip
has removed such symbols if they are section or group symbols.
But removing a real symbol from an allocate symbol table is hard
and probably a mistake. Really removing it means rewriting the
dynamic segment and hash sections. Since we don't do that, don't
remove the symbol (and corrupt the ELF file). Do warn and set
the symbol section to SHN_UNDEF.
https://bugzilla.redhat.com/show_bug.cgi?id=1380961
Signed-off-by: Mark Wielaard <mjw@redhat.com>
diff --git a/src/ChangeLog b/src/ChangeLog
index e5b3b20..70d11f2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2016-10-06 Mark Wielaard <mjw@redhat.com>
+
+ * strip.c (handle_elf): Don't remove real symbols from allocated
+ symbol tables.
+
2016-08-25 Mark Wielaard <mjw@redhat.com>
* strip.c (handle_elf): Recompress with ELF_CHF_FORCE.
diff --git a/src/strip.c b/src/strip.c
index da093e9..819b67e 100644
--- a/src/strip.c
+++ b/src/strip.c
@@ -1341,15 +1341,12 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
/* Get the full section index, if necessary from the
XINDEX table. */
- if (sym->st_shndx != SHN_XINDEX)
- sec = shdr_info[sym->st_shndx].idx;
- else
- {
- elf_assert (shndxdata != NULL
- && shndxdata->d_buf != NULL);
-
- sec = shdr_info[xshndx].idx;
- }
+ if (sym->st_shndx == SHN_XINDEX)
+ elf_assert (shndxdata != NULL
+ && shndxdata->d_buf != NULL);
+ size_t sidx = (sym->st_shndx != SHN_XINDEX
+ ? sym->st_shndx : xshndx);
+ sec = shdr_info[sidx].idx;
if (sec != 0)
{
@@ -1387,6 +1384,24 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
shdr_info[cnt].shdr.sh_info = destidx - 1;
}
}
+ else if ((shdr_info[cnt].shdr.sh_flags & SHF_ALLOC) != 0
+ && GELF_ST_TYPE (sym->st_info) != STT_SECTION
+ && shdr_info[sidx].shdr.sh_type != SHT_GROUP)
+ {
+ /* Removing a real symbol from an allocated
+ symbol table is hard and probably a
+ mistake. Really removing it means
+ rewriting the dynamic segment and hash
+ sections. Just warn and set the symbol
+ section to UNDEF. */
+ error (0, 0,
+ gettext ("Cannot remove symbol [%zd] from allocated symbol table [%zd]"), inner, cnt);
+ sym->st_shndx = SHN_UNDEF;
+ if (gelf_update_sym (shdr_info[cnt].data, destidx,
+ sym) == 0)
+ INTERNAL_ERROR (fname);
+ shdr_info[cnt].newsymidx[inner] = destidx++;
+ }
else if (debug_fname != NULL
&& shdr_info[cnt].debug_data == NULL)
/* The symbol points to a section that is discarded
@@ -1394,8 +1409,6 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
this is a section or group signature symbol
for a section which has been removed. */
{
- size_t sidx = (sym->st_shndx != SHN_XINDEX
- ? sym->st_shndx : xshndx);
elf_assert (GELF_ST_TYPE (sym->st_info) == STT_SECTION
|| ((shdr_info[sidx].shdr.sh_type
== SHT_GROUP)

View File

@ -1,9 +1,9 @@
Name: elfutils Name: elfutils
Summary: A collection of utilities and DSOs to handle compiled objects Summary: A collection of utilities and DSOs to handle ELF files and DWARF data
Version: 0.167 Version: 0.168
%global baserelease 2 %global baserelease 1
URL: https://fedorahosted.org/elfutils/ URL: http://elfutils.org/
%global source_url http://fedorahosted.org/releases/e/l/elfutils/%{version}/ %global source_url ftp://sourceware.org/pub/elfutils/%{version}/
License: GPLv3+ and (GPLv2+ or LGPLv3+) License: GPLv3+ and (GPLv2+ or LGPLv3+)
Group: Development/Tools Group: Development/Tools
@ -20,7 +20,6 @@ Release: %{baserelease}%{?dist}
Source: %{?source_url}%{name}-%{version}.tar.bz2 Source: %{?source_url}%{name}-%{version}.tar.bz2
# Patches # Patches
Patch1: elfutils-0.167-strip-alloc-symbol.patch
Requires: elfutils-libelf%{depsuffix} = %{version}-%{release} Requires: elfutils-libelf%{depsuffix} = %{version}-%{release}
Requires: elfutils-libs%{depsuffix} = %{version}-%{release} Requires: elfutils-libs%{depsuffix} = %{version}-%{release}
@ -164,7 +163,6 @@ profiling) of processes.
%setup -q %setup -q
# Apply patches # Apply patches
%patch1 -p1 -b .strip_alloc_sym
find . -name \*.sh ! -perm -0100 -print | xargs chmod +x find . -name \*.sh ! -perm -0100 -print | xargs chmod +x
@ -295,6 +293,13 @@ rm -rf ${RPM_BUILD_ROOT}
%endif %endif
%changelog %changelog
* Wed Dec 28 2016 Mark Wielaard <mark@klomp.org> - 0.168-1
- New upstream release from new home https://sourceware.org/elfutils/
- Resolves:
- #1396092 Please implement eu-readelf --symbols[=SECTION]
- #1388057 memory allocation failure in allocate_elf
- #1387584 memory allocation failure in __libelf_set_rawdata_wrlock
* Fri Oct 7 2016 Mark Wielaard <mjw@redhat.com> - 0.167-2 * Fri Oct 7 2016 Mark Wielaard <mjw@redhat.com> - 0.167-2
- Add elfutils-0.167-strip-alloc-symbol.patch (#1380961) - Add elfutils-0.167-strip-alloc-symbol.patch (#1380961)

View File

@ -1 +1 @@
efc6c2067dfad5646777e93e85222e8f elfutils-0.167.tar.bz2 SHA512 (elfutils-0.168.tar.bz2) = c8f2077ffe6877ad9e9d2f553bf0576361799c601d246f53e1d99a6f7046794c5916e1087b97ad1d1e5f59f9debc20384f864d507ef6c4c75a8e767d15d6eb91