[PATCH] config: Check for and use gcc -Wlogical-op and -Wduplicated-cond.
by Mark Wielaard
Both -Wlogical-op and -Wduplicated-cond may produce useful warnings.
But we have to check them first. Older versions of gcc had a -Wlogical-op
that warned on some constructs using macros that are not erronious.
Only GCC6 has -Wduplicated-cond.
Signed-off-by: Mark Wielaard <mjw(a)redhat.com>
---
ChangeLog | 5 +++++
config/ChangeLog | 6 ++++++
config/eu.am | 16 +++++++++++++++-
configure.ac | 22 ++++++++++++++++++++++
4 files changed, 48 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 637bc13..d206a8e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-02-98 Mark Wielaard <mjw(a)redhat.com>
+
+ * configure.ac: Add checks for sane -Wlogical-op and whether gcc
+ accepts -Wduplicated-cond.
+
2016-01-08 Mark Wielaard <mjw(a)redhat.com>
* configure.ac: Set version to 0.165.
diff --git a/config/ChangeLog b/config/ChangeLog
index 8e20f1e..8523cb3 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,9 @@
+2016-02-09 Mark Wielaard <mjw(a)redhat.com>
+
+ * eu.am: Check SANE_LOGICAL_OP_WARNING and
+ HAVE_DUPLICATED_COND_WARNING.
+ (AM_CFLAGS): Add LOGICAL_OP_WARNING and DUPLICATED_COND_WARNING.
+
2016-01-08 Mark Wielaard <mjw(a)redhat.com>
* elfutils.spec.in: Add elfcompress. Update for 0.165.
diff --git a/config/eu.am b/config/eu.am
index 0095da5..c4e9279 100644
--- a/config/eu.am
+++ b/config/eu.am
@@ -1,6 +1,6 @@
## Common automake fragments for elfutils subdirectory makefiles.
##
-## Copyright (C) 2010, 2014 Red Hat, Inc.
+## Copyright (C) 2010, 2014, 2016 Red Hat, Inc.
##
## This file is part of elfutils.
##
@@ -42,8 +42,22 @@ STACK_USAGE_WARNING=-Wstack-usage=262144
else
STACK_USAGE_WARNING=
endif
+
+if SANE_LOGICAL_OP_WARNING
+LOGICAL_OP_WARNING=-Wlogical-op
+else
+LOGICAL_OP_WARNING=
+endif
+
+if HAVE_DUPLICATED_COND_WARNING
+DUPLICATED_COND_WARNING=-Wduplicated-cond
+else
+DUPLICATED_COND_WARNING=
+endif
+
AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
-Wold-style-definition -Wstrict-prototypes \
+ $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
$(if $($(*F)_no_Werror),,-Werror) \
$(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
$(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
diff --git a/configure.ac b/configure.ac
index 9a3301f..d447db7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -291,6 +291,28 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],
CFLAGS="$old_CFLAGS"])
AM_CONDITIONAL(ADD_STACK_USAGE_WARNING, [test "x$ac_cv_stack_usage" != "xno"])
+# -Wlogical-op was too fragile in the past, make sure we get a sane one.
+AC_CACHE_CHECK([whether gcc has a sane -Wlogical-op], ac_cv_logical_op, [dnl
+old_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wlogical-op -Werror"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE(
+ [#define FLAG 1
+ int f (int r, int f) { return (r && (FLAG || (FLAG & f))); }])],
+ ac_cv_logical_op=yes, ac_cv_logical_op=no)
+CFLAGS="$old_CFLAGS"])
+AM_CONDITIONAL(SANE_LOGICAL_OP_WARNING,
+ [test "x$ac_cv_logical_op" != "xno"])
+
+# -Wduplicated-cond was added by GCC6
+AC_CACHE_CHECK([whether gcc accepts -Wduplicated-cond], ac_cv_duplicated_cond, [dnl
+old_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wduplicated-cond"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],
+ ac_cv_duplicated_cond=yes, ac_cv_duplicated_cond=no)
+CFLAGS="$old_CFLAGS"])
+AM_CONDITIONAL(HAVE_DUPLICATED_COND_WARNING,
+ [test "x$ac_cv_duplicated_cond" != "xno"])
+
dnl Check if we have argp available from our libc
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
--
1.8.3.1
8 years, 1 month
[PATCH] elflint: Fix sh_entsize check when comparing SHT_HASH and SHT_GNU_HASH.
by Mark Wielaard
GCC6 -Wduplicated-cond found the following issue:
elflint.c: In function ‘compare_hash_gnu_hash’:
elflint.c:2483:34: error: duplicated ‘if’ condition [-Werror=duplicated-cond]
else if (hash_shdr->sh_entsize == sizeof (Elf64_Word))
~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
elflint.c:2448:29: note: previously used here
if (hash_shdr->sh_entsize == sizeof (Elf32_Word))
~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
Which is correct, a Word in both Elf32 and Elf64 files is 4 bytes.
We meant to check for sizeof (Elf64_Xword) which is 8 bytes.
Also fix the section index and name in the error message.
The reason we probably didn't see this issue before is that SHT_HASH
sections really always should have sh_entsize of 4 even on 64bit arches.
There are however a couple of arches with mistakes in their sysv ABI.
See libelf/common.h. This also would only be triggered if on such an
architectures when the ELF file would have both a SHT_HASH and SHT_GNU_HASH
section and elflint would try to compare those sections.
Add an example testfile-s390x-hash-both to run-elflint-test.sh.
Signed-off-by: Mark Wielaard <mjw(a)redhat.com>
---
src/ChangeLog | 6 ++++++
src/elflint.c | 4 ++--
tests/ChangeLog | 6 ++++++
tests/Makefile.am | 1 +
tests/run-elflint-test.sh | 9 ++++++++-
tests/testfile-s390x-hash-both.bz2 | Bin 0 -> 2435 bytes
6 files changed, 23 insertions(+), 3 deletions(-)
create mode 100755 tests/testfile-s390x-hash-both.bz2
diff --git a/src/ChangeLog b/src/ChangeLog
index af98c4d..7dfab44 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2016-02-09 Mark Wielaard <mjw(a)redhat.com>
+
+ * elflint.c (compare_hash_gnu_hash): Check hash sh_entsize against
+ sizeof (Elf64_Xword). Correct invalid sh_entsize error message
+ section idx and name.
+
2016-01-08 Mark Wielaard <mjw(a)redhat.com>
* elfcompress.c (compress_section): Use %zu to print size_t.
diff --git a/src/elflint.c b/src/elflint.c
index 7a7b9ce..e27e692 100644
--- a/src/elflint.c
+++ b/src/elflint.c
@@ -2480,7 +2480,7 @@ hash section [%2zu] '%s' uses too much data\n"),
}
}
}
- else if (hash_shdr->sh_entsize == sizeof (Elf64_Word))
+ else if (hash_shdr->sh_entsize == sizeof (Elf64_Xword))
{
const Elf64_Xword *hasharr = (Elf64_Xword *) hash_data->d_buf;
if (hash_data->d_size < 2 * sizeof (Elf32_Word))
@@ -2521,7 +2521,7 @@ hash section [%2zu] '%s' uses too much data\n"),
{
ERROR (gettext ("\
hash section [%2zu] '%s' invalid sh_entsize\n"),
- gnu_hash_idx, gnu_hash_name);
+ hash_idx, hash_name);
return;
}
diff --git a/tests/ChangeLog b/tests/ChangeLog
index defb8ae..04fe3a3 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,9 @@
+2016-02-09 Mark Wielaard <mjw(a)redhat.com>
+
+ * testfile-s390x-hash-both.bz2: New testfile.
+ * Makefile.am (EXTRA_DIST): Add testfile-s390x-hash-both.bz2.
+ * run-elflint-test.sh: Add elflint testfile-s390x-hash-both test.
+
2016-02-04 Mark Wielaard <mjw(a)redhat.com>
* run-strip-nobitsalign.sh: New test.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f3e7c01..fedcb39 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -236,6 +236,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
testfile56.bz2 testfile57.bz2 testfile58.bz2 \
run-typeiter.sh testfile59.bz2 \
run-readelf-d.sh testlib_dynseg.so.bz2 \
+ testfile-s390x-hash-both.bz2 \
run-readelf-gdb_index.sh testfilegdbindex5.bz2 \
testfilegdbindex7.bz2 \
run-readelf-s.sh testfilebazdbg.bz2 testfilebazdyn.bz2 \
diff --git a/tests/run-elflint-test.sh b/tests/run-elflint-test.sh
index 68615b9..f3bd901 100755
--- a/tests/run-elflint-test.sh
+++ b/tests/run-elflint-test.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2005, 2007, 2008 Red Hat, Inc.
+# Copyright (C) 2005, 2007, 2008, 2015 Red Hat, Inc.
# This file is part of elfutils.
# Written by Ulrich Drepper <drepper(a)redhat.com>, 2005.
#
@@ -40,4 +40,11 @@ testrun ${abs_top_builddir}/src/elflint -q testfile46
testfiles testlib_dynseg.so
testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testlib_dynseg.so
+# s390x has SHT_HASH with sh_entsize 8 (really should be 4, but see common.h)
+# This was wrongly checked when comparing .gnu.hash and .hash.
+# Simple "int main (int argc, char **argv) { return 0; }"
+# gcc -Xlinker --hash-style=both -o testfile-s390x-hash-both s390x-hash-both.c
+testfiles testfile-s390x-hash-both
+testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testfile-s390x-hash-both
+
exit 0
diff --git a/tests/testfile-s390x-hash-both.bz2 b/tests/testfile-s390x-hash-both.bz2
new file mode 100755
index 0000000000000000000000000000000000000000..86e0bcc792da1aa7f74c78c6a3de13f3b75b3723
GIT binary patch
literal 2435
zcmb7=={FmQ0>u*{4H{ytgfT*j+MXq7=g~=sG>A@$s<pL5gjhx`Lu!b9jiQ!{YGYUX
zz7}ciN=vLwRa?~3Dt)#Z)5A0GKX~`t^ZRnox#ym1;z+%sgLP20ao7!~9|HtgQK$cC
z>mPhST|Z;s>gim_(m>$$WYpo>j^n!J2M7rgv75UM9Ob^t1=`jaY@u<=sHq1tP-OsG
zNjZU;k&i$iK=@c96N&~irZH#$6pC;|fD<bby6$KMb(F;d*`T=O=cQb_N_jb&EB|1o
zz?O%9Tv1BiXQC$o#u&f>09dYoFvft03^V`%0I~tQG2jGKQ-vuu0%Ub&8Datk#77<h
zOciCaK@ci+5`+Ov0y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dL}zA_a{^}rdJJ*D|`Ta^c&vpl3Gqr?icrtH_9H%KtPt>S|PK&vgsz)3{GNkhdmo_
zKl$}8Z{S%<jlpz-AEO~RRoWL;hlIzp^HBw5SH~L^pulW+g{1CZR|T>jbAFe#0MoD)
z!e!!;(e4rwX4wLJuy8Pa6YH8$C)IG_Xfnx7v(xW{X_Wsl#<(C1Q!i)z25=n|Eod%b
zc2htV$9~SPxkVwyq!88}u*3v=4xvFw^*oc8YLIL;F_mZdY`+#13I~v3FOMyY)nyv^
zs>M5QE89rEP$hsbI51uo_byyUd$5C)yPU*KpkPZ;Mom{&*X&v_3M~dpf-&UwVD}y3
zrd#>b^B>yOS1mZq(JFZpE5e57*$E_y>Er`FgGL?2Tfw0>s}qUp#?%a{!oH1k(L#$Q
z4V1(~!>QAx_)7l?=R6rKg=JqNa`%o@GfgEut3$k~l@#P=li0W(Sr+$}nX`BOquC5M
zfmdpD>fuCoXizK|_b}p-$lvm$z0&8!?HqT_P)42d!}FJs&w$cmKVWlyt2j0@Eeq}M
zX<b0~0;(aGi72pYN)!M2!PS!|^C7NS-TRdBD@y&BYJw|U5`qAYm3fD}^B=I%CBJkX
zYBWkz1Pb#A7a#2$D~iAUcDnP!&$}w?K1@++>{Tlk7`R8S#kJ`o-M`TYX(67T^jiXm
tll}9wa7S75;5^eijV)>Y{Qb0LnziJ9m?wFp?>~Q_Y~lq)Rr2cD{{`>`StkGh
literal 0
HcmV?d00001
--
1.8.3.1
8 years, 1 month
[PATCH] Replace elfutils DCO with standard DCO.
by Richard Fontana
This patch replaces the custom DCO text in CONTRIBUTING with the de
facto standard DCO used by the Linux kernel and maintained at
http://developercertificate.org.
I wrote the elfutils modification to the Linux kernel DCO several
years ago. Based on my recollection and a comparison of the two
versions of the DCO, the changes were meant to simplify some of the
wording in the DCO, to account for the possibility that a source file
might not contain a notice of its applicable license, and to avoid use
of the term 'open source'.
I now believe that it is best not to deviate from the text of the
Linux kernel DCO, as having a standardized DCO text will promote
familiarity with and adoption of the DCO as an alternative to less
desirable contribution policies. It is the view of some Linux kernel
developers that it is best not to have proliferation of DCOs across
different projects.
Signed-off-by: Richard Fontana <fontana(a)sharpeleven.org>
---
CONTRIBUTING | 36 ++++++++++++++++++++++--------------
1 file changed, 22 insertions(+), 14 deletions(-)
diff --git a/CONTRIBUTING b/CONTRIBUTING
index 3f5e5aa..f772f0d 100644
--- a/CONTRIBUTING
+++ b/CONTRIBUTING
@@ -20,23 +20,31 @@ patch, which certifies that you wrote it or otherwise have the right
to pass it on as a patch under an appropriate license. The rules are
pretty simple: if you can certify the below:
- Developer's Certificate of Origin
+ Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
- (a) The contribution was created in whole or in part by me,
- and I have the right to submit the contribution under each
- license indicated in, or otherwise designated as being
- applicable to, the file.
-
- (b) The contribution was provided directly to me by some other
- person who certified (a), and I have not modified it.
-
- (c) I understand and agree that the project and the
- contribution are public and that a record of the
- contribution (including all personal information I submit
- with it, including my sign-off) is maintained indefinitely
- and may be redistributed.
+ (a) The contribution was created in whole or in part by me and I
+ have the right to submit it under the open source license
+ indicated in the file; or
+
+ (b) The contribution is based upon previous work that, to the best
+ of my knowledge, is covered under an appropriate open source
+ license and I have the right under that license to submit that
+ work with modifications, whether created in whole or in part
+ by me, under the same open source license (unless I am
+ permitted to submit under a different license), as indicated
+ in the file; or
+
+ (c) The contribution was provided directly to me by some other
+ person who certified (a), (b) or (c) and I have not modified
+ it.
+
+ (d) I understand and agree that this project and the contribution
+ are public and that a record of the contribution (including all
+ personal information I submit with it, including my sign-off) is
+ maintained indefinitely and may be redistributed consistent with
+ this project or the open source license(s) involved.
then you just add a line saying
--
2.4.3
8 years, 1 month
[PATCH] libelf: elf_getdata should not adjust alignment for SHT_NOBITS sections.
by Mark Wielaard
In commit c0748e "libelf: More checking of valid sh_addralign values." we
adjusted bogus alignment of data buffers if they were greater than the
offset of the data in the file. This works OK, except when there is no
data in the file. So make sure to not adjust any NOBITS sections.
Also adds a test that shows the issue and makes sure elflint is called
with --gnu in run-strip-test.sh.
https://bugzilla.redhat.com/show_bug.cgi?id=1303845
Signed-off-by: Mark Wielaard <mjw(a)redhat.com>
---
libelf/ChangeLog | 5 +++++
libelf/elf_getdata.c | 4 ++--
tests/ChangeLog | 10 ++++++++++
tests/Makefile.am | 5 ++++-
tests/run-strip-nobitsalign.sh | 35 +++++++++++++++++++++++++++++++++++
tests/run-strip-test.sh | 4 ++--
tests/testfile-nobitsalign.bz2 | Bin 0 -> 2921 bytes
tests/testfile-nobitsalign.strip.bz2 | Bin 0 -> 1723 bytes
8 files changed, 58 insertions(+), 5 deletions(-)
create mode 100755 tests/run-strip-nobitsalign.sh
create mode 100755 tests/testfile-nobitsalign.bz2
create mode 100755 tests/testfile-nobitsalign.strip.bz2
diff --git a/libelf/ChangeLog b/libelf/ChangeLog
index 9536ced..41eaa00 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -1,3 +1,8 @@
+2016-02-04 Mark Wielaard <mjw(a)redhat.com>
+
+ * elf_getdata.c (__libelf_set_rawdata_wrlock): Don't adjust align
+ for SHT_NOBITS sections.
+
2016-01-28 Mark Wielaard <mjw(a)redhat.com>
* elf.h: Update from glibc. Add new i386 and x86_64 relocations.
diff --git a/libelf/elf_getdata.c b/libelf/elf_getdata.c
index 4ec94b9..d1fafbf 100644
--- a/libelf/elf_getdata.c
+++ b/libelf/elf_getdata.c
@@ -1,5 +1,5 @@
/* Return the next data element from the section after possibly converting it.
- Copyright (C) 1998-2005, 2006, 2007, 2015 Red Hat, Inc.
+ Copyright (C) 1998-2005, 2006, 2007, 2015, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper(a)redhat.com>, 1998.
@@ -363,7 +363,7 @@ __libelf_set_rawdata_wrlock (Elf_Scn *scn)
at least an ehdr this will only trigger for alignment values > 64
which should be uncommon. */
align = align ?: 1;
- if (align > offset)
+ if (type != SHT_NOBITS && align > offset)
align = offset;
scn->rawdata.d.d_align = align;
if (elf->class == ELFCLASS32
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 234ae56..defb8ae 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,13 @@
+2016-02-04 Mark Wielaard <mjw(a)redhat.com>
+
+ * run-strip-nobitsalign.sh: New test.
+ * testfile-nobitsalign.bz2: New testfile.
+ * testfile-nobitsalign.strip.bz2: Likewise.
+ * Makefile.am (TESTS): Add run-strip-nobitsalign.sh.
+ (EXTRA_DIST): Add run-strip-nobitsalign.sh, testfile-nobitsalign.bz2
+ and testfile-nobitsalign.strip.bz2.
+ * run-strip-test.sh: Add --gnu to elflint calls.
+
2016-01-13 Mark Wielaard <mjw(a)redhat.com>
* system-elf-libelf-test.c: New test.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7b9e108..f3e7c01 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to create Makefile.in
##
-## Copyright (C) 1996-2015 Red Hat, Inc.
+## Copyright (C) 1996-2016 Red Hat, Inc.
## This file is part of elfutils.
##
## This file is free software; you can redistribute it and/or modify
@@ -80,6 +80,7 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \
run-strip-test6.sh run-strip-test7.sh run-strip-test8.sh \
run-strip-test9.sh run-strip-test10.sh \
run-strip-groups.sh run-strip-reloc.sh run-strip-strmerge.sh \
+ run-strip-nobitsalign.sh \
run-unstrip-test.sh run-unstrip-test2.sh \
run-unstrip-test3.sh run-unstrip-M.sh run-elfstrmerge-test.sh \
run-ecp-test.sh run-ecp-test2.sh run-alldts.sh \
@@ -163,6 +164,8 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
run-strip-test4.sh run-strip-test5.sh run-strip-test6.sh \
run-strip-test7.sh run-strip-test8.sh run-strip-groups.sh \
run-strip-test9.sh run-strip-test10.sh run-strip-strmerge.sh \
+ run-strip-nobitsalign.sh \
+ testfile-nobitsalign.bz2 testfile-nobitsalign.strip.bz2 \
run-strip-reloc.sh hello_i386.ko.bz2 hello_x86_64.ko.bz2 \
hello_ppc64.ko.bz2 hello_s390.ko.bz2 hello_aarch64.ko.bz2 \
run-unstrip-test.sh run-unstrip-test2.sh \
diff --git a/tests/run-strip-nobitsalign.sh b/tests/run-strip-nobitsalign.sh
new file mode 100755
index 0000000..db9b1d9
--- /dev/null
+++ b/tests/run-strip-nobitsalign.sh
@@ -0,0 +1,35 @@
+#! /bin/sh
+# Copyright (C) Red Hat, Inc., 2016.
+# This file is part of elfutils.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# elfutils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# static unsigned char buffer[4096] __attribute((aligned (4096)));
+#
+# char
+# f (int i)
+# {
+# return buffer[i];
+# }
+#
+# int
+# main (int argc, char **argv)
+# {
+# return buffer[argc] == 0;
+# }
+
+original=testfile-nobitsalign
+stripped=testfile-nobitsalign.strip
+
+. $srcdir/run-strip-test.sh
diff --git a/tests/run-strip-test.sh b/tests/run-strip-test.sh
index 43d27e5..42aa988 100755
--- a/tests/run-strip-test.sh
+++ b/tests/run-strip-test.sh
@@ -34,13 +34,13 @@ status=0
cmp $stripped testfile.temp || status=$?
# Check elflint and the expected result.
-testrun ${abs_top_builddir}/src/elflint -q testfile.temp || status=$?
+testrun ${abs_top_builddir}/src/elflint --gnu -q testfile.temp || status=$?
test -z "$debugfile" || {
cmp $debugfile testfile.debug.temp || status=$?
# Check elflint and the expected result.
-testrun ${abs_top_builddir}/src/elflint -q -d testfile.debug.temp || status=$?
+testrun ${abs_top_builddir}/src/elflint --gnu -q -d testfile.debug.temp || status=$?
# Now test unstrip recombining those files.
testrun ${abs_top_builddir}/src/unstrip -o testfile.unstrip testfile.temp testfile.debug.temp
diff --git a/tests/testfile-nobitsalign.bz2 b/tests/testfile-nobitsalign.bz2
new file mode 100755
index 0000000000000000000000000000000000000000..7f0d4249a028e73766908f9ac221174a5b4d33db
GIT binary patch
literal 2921
zcmV-v3zqakT4*^jL0KkKSu3LM{{RXtfB*mg|Nrj)|NsC0|84*O|Mu^H^;FD$(`@he
z>)wBV?_b~vyzVzuKr*&9Y4y~Mv!1il!BlO%?6_)a8d0W<(rDRDOeWBSPeW4>)6@Xa
zG-y3Q0MHsV8UqtUMt~Y=qtpW?ng9(3hC!#HJws|58e$%x(13swLTx6QLp3o*8BG9Y
zqedox88pxh13&{ndYS+RfCEE7000dErho>30g$Qb29qQvBO0EQG=`f=rh$>P0%@j3
znW>r)k)sKwn2Z82h6u@tfF_2RjWpT;GHAkLG{67}iGoCkniEYKQ`!{tY8WVHnqfT?
z(V}UljS;mxqx43Yj6sk?Pf?8;MhL)$A))D{8es-#0MI6ZiRc72h(G`u000dEriP6H
zpwJBgplD(PLlDRSWMt8x41fU8G|&b>0gy5P0B8bKYHDpteu`=8G|*^zfuljEs0N0b
z05StZAkYSb)CPb6&<z>`Kny?zfDDZq13&-(4yyW?y_)^KwD)ya+-JFxa*Um&6-`jx
zxQqy2HxdAwZ5^oKW*dQxjg2&)SyYQtg++Vy7<;@*&P6J^W27u*79pnu#+C^H4jOT$
zF+xVfK*E|xlt(L6G`y66vxb4F5I}(jl36oOPYI(DVfGNK&b2WpQPQgj641`2nS`0T
z?`;OE(lRBn>59cF7qx)w9rIndu}(n~L=kUMwox;JpuDTC1_92949ppskZB~@dM)~k
ze~*c&%*BC*G&N*qEnqgchG9^w$%Y)TWfGyp;sKxeQ-pxL1ZGB8#mInpI($t=R;JI>
zubd|Wn2f0e;Gj%(yNvDM%6R=2ohMcG%8S`HvGvi|{OrAh>R)#eiG;}jw2WVKrp`$S
zT24kankMzXK+!U9@_7-b>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8OVs4FBf
zEEC~av}|Gs&<dLi!ivx=9AMDM6!B~*KcNj6!B(M-?W$o1K47p&_hBreb8)pWmY`83
zhLEm7;F$cG@*W?WdUwr!BxT3@_CZ?a;ZZ;<QbOX{WTrqO!&4v_GLXJhP~*VI7-I}j
zBeXOZDzV+9wg7;R(oz=Dkc}{Ir##GNMm2R6QGF>wnsNtvcFLzn>68IwUMv+8d53^^
zfVgFBRtH>LDzkTl0+Mba2*bniF47-Jw4nx7tO-$e^Dyv~ugfMRlv4#E1PG|H^*gLO
zO9Pw|rCUeCTr?n>K*@-P0lL$om@QPLqvvT<E0qj^^{&dcfYAc9m|BX${rO`NgA5>I
z?j=BkK-?}R746wDYXUNfGY$fk3`(vJjL4#HHQM4Ia?Mxk>ud}vb3*jWT9h@*R(Z9s
zqI^2hUmXkk)=1au7ws7sI7-Sw&7dfXWSZ70_)$sNV6<qF2Ny++O*dU9yM2K5&5iPA
z#E`YqliF`+M?boX8($UJlu@BEJ`SNPG{TP+2)7zQgk`6IoGfRdg=UC_|4J%;!NL%n
z)64)!Ld4?R>@b8l2w`Bav}lnRp!Or)EJ&p85nogX&|CXODf|R?sC{n&_)B4xJa~wP
z!uf;}H5vj8BFp{lX&=69%4wL`EZ{IAd?{QjAGqU@RZEqe)*k-0VclHw!v@el2Vl`}
zZuiT$YU9<#CF-ZxxV70x9Td2JQOX6DHaVphcN8cUoyr-ipKFsb&I#7BYeE>vBn!{A
zNIQ^C5oZX?^{=giWl2wa3eJYC1&ok*aBx$^WWgHvfaZcTeC|}JV;ctY-+Lk$X|p%g
TcR5*om;V=XML1B9E28fIfSNm=
literal 0
HcmV?d00001
diff --git a/tests/testfile-nobitsalign.strip.bz2 b/tests/testfile-nobitsalign.strip.bz2
new file mode 100755
index 0000000000000000000000000000000000000000..f72000cc58e6f469bd817c1f13875153b7e64b93
GIT binary patch
literal 1723
zcmV;s21NNnT4*^jL0KkKSr|VCdH@B3|NsC0_x$$n|NsB*{?GsS|90<x%|uB-Q%vv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gENIU9al%3#_~rq^
zodtkYXiZXpOOJ3(&~7&CZJyjWd!WQarhx(GF>sh}M!0@29y2kGgL$vYi3S>;Cbd1r
RK5oDGyOJrwgn+^LGtj->40Qki
literal 0
HcmV?d00001
--
1.8.3.1
8 years, 1 month
[PATCH] elflint: Fix sh_entsize check when comparing SHT_HASH and SHT_GNU_HASH.
by Mark Wielaard
GCC6 -Wduplicated-cond found the following issue:
elflint.c: In function ‘compare_hash_gnu_hash’:
elflint.c:2483:34: error: duplicated ‘if’ condition [-Werror=duplicated-cond]
else if (hash_shdr->sh_entsize == sizeof (Elf64_Word))
~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
elflint.c:2448:29: note: previously used here
if (hash_shdr->sh_entsize == sizeof (Elf32_Word))
~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
Which is correct, a Word in both Elf32 and Elf64 files is 4 bytes.
We meant to check for sizeof (Elf64_Xword) which is 8 bytes.
Also fix the section index and name in the error message.
The reason we probably didn't see this issue before is that SHT_HASH
sections really always should have sh_entsize of 4 even on 64bit arches.
There are however a couple of arches with mistakes in their sysv ABI.
See libelf/common.h. This also would only be triggered if on such an
architectures when the ELF file would have both a SHT_HASH and SHT_GNU_HASH
section and elflint would try to compare those sections.
Add an example testfile-s390x-hash-both to run-elflint-test.sh.
Signed-off-by: Mark Wielaard <mjw(a)redhat.com>
---
src/ChangeLog | 6 ++++++
src/elflint.c | 4 ++--
tests/ChangeLog | 6 ++++++
tests/Makefile.am | 1 +
tests/run-elflint-test.sh | 9 ++++++++-
tests/testfile-s390x-hash-both.bz2 | Bin 0 -> 2435 bytes
6 files changed, 23 insertions(+), 3 deletions(-)
create mode 100755 tests/testfile-s390x-hash-both.bz2
diff --git a/src/ChangeLog b/src/ChangeLog
index af98c4d..7dfab44 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2016-02-09 Mark Wielaard <mjw(a)redhat.com>
+
+ * elflint.c (compare_hash_gnu_hash): Check hash sh_entsize against
+ sizeof (Elf64_Xword). Correct invalid sh_entsize error message
+ section idx and name.
+
2016-01-08 Mark Wielaard <mjw(a)redhat.com>
* elfcompress.c (compress_section): Use %zu to print size_t.
diff --git a/src/elflint.c b/src/elflint.c
index 7a7b9ce..e27e692 100644
--- a/src/elflint.c
+++ b/src/elflint.c
@@ -2480,7 +2480,7 @@ hash section [%2zu] '%s' uses too much data\n"),
}
}
}
- else if (hash_shdr->sh_entsize == sizeof (Elf64_Word))
+ else if (hash_shdr->sh_entsize == sizeof (Elf64_Xword))
{
const Elf64_Xword *hasharr = (Elf64_Xword *) hash_data->d_buf;
if (hash_data->d_size < 2 * sizeof (Elf32_Word))
@@ -2521,7 +2521,7 @@ hash section [%2zu] '%s' uses too much data\n"),
{
ERROR (gettext ("\
hash section [%2zu] '%s' invalid sh_entsize\n"),
- gnu_hash_idx, gnu_hash_name);
+ hash_idx, hash_name);
return;
}
diff --git a/tests/ChangeLog b/tests/ChangeLog
index defb8ae..04fe3a3 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,9 @@
+2016-02-09 Mark Wielaard <mjw(a)redhat.com>
+
+ * testfile-s390x-hash-both.bz2: New testfile.
+ * Makefile.am (EXTRA_DIST): Add testfile-s390x-hash-both.bz2.
+ * run-elflint-test.sh: Add elflint testfile-s390x-hash-both test.
+
2016-02-04 Mark Wielaard <mjw(a)redhat.com>
* run-strip-nobitsalign.sh: New test.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f3e7c01..fedcb39 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -236,6 +236,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
testfile56.bz2 testfile57.bz2 testfile58.bz2 \
run-typeiter.sh testfile59.bz2 \
run-readelf-d.sh testlib_dynseg.so.bz2 \
+ testfile-s390x-hash-both.bz2 \
run-readelf-gdb_index.sh testfilegdbindex5.bz2 \
testfilegdbindex7.bz2 \
run-readelf-s.sh testfilebazdbg.bz2 testfilebazdyn.bz2 \
diff --git a/tests/run-elflint-test.sh b/tests/run-elflint-test.sh
index 68615b9..f3bd901 100755
--- a/tests/run-elflint-test.sh
+++ b/tests/run-elflint-test.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2005, 2007, 2008 Red Hat, Inc.
+# Copyright (C) 2005, 2007, 2008, 2015 Red Hat, Inc.
# This file is part of elfutils.
# Written by Ulrich Drepper <drepper(a)redhat.com>, 2005.
#
@@ -40,4 +40,11 @@ testrun ${abs_top_builddir}/src/elflint -q testfile46
testfiles testlib_dynseg.so
testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testlib_dynseg.so
+# s390x has SHT_HASH with sh_entsize 8 (really should be 4, but see common.h)
+# This was wrongly checked when comparing .gnu.hash and .hash.
+# Simple "int main (int argc, char **argv) { return 0; }"
+# gcc -Xlinker --hash-style=both -o testfile-s390x-hash-both s390x-hash-both.c
+testfiles testfile-s390x-hash-both
+testrun ${abs_top_builddir}/src/elflint -q --gnu-ld testfile-s390x-hash-both
+
exit 0
diff --git a/tests/testfile-s390x-hash-both.bz2 b/tests/testfile-s390x-hash-both.bz2
new file mode 100755
index 0000000000000000000000000000000000000000..86e0bcc792da1aa7f74c78c6a3de13f3b75b3723
GIT binary patch
literal 2435
zcmb7=={FmQ0>u*{4H{ytgfT*j+MXq7=g~=sG>A@$s<pL5gjhx`Lu!b9jiQ!{YGYUX
zz7}ciN=vLwRa?~3Dt)#Z)5A0GKX~`t^ZRnox#ym1;z+%sgLP20ao7!~9|HtgQK$cC
z>mPhST|Z;s>gim_(m>$$WYpo>j^n!J2M7rgv75UM9Ob^t1=`jaY@u<=sHq1tP-OsG
zNjZU;k&i$iK=@c96N&~irZH#$6pC;|fD<bby6$KMb(F;d*`T=O=cQb_N_jb&EB|1o
zz?O%9Tv1BiXQC$o#u&f>09dYoFvft03^V`%0I~tQG2jGKQ-vuu0%Ub&8Datk#77<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