This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
[PATCH] elflint: do not rely on ebl_check_special_section when checking debuginfo files.
- From: Jose E. Marchesi <jose dot marchesi at oracle dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Fri, 09 Oct 2015 14:16:13 +0200
- Subject: [PATCH] elflint: do not rely on ebl_check_special_section when checking debuginfo files.
commit c5d24f902b7d97d57fe72cece3983d02efd91c5f
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
Date: Fri Oct 9 08:09:00 2015 -0400
Do not rely on ebl_check_special_section when checking debuginfo files.
The test run-strip-strmerge.sh is failing in sparc targets. This is
because it does an `elflint -d' in a debuginfo file, and this fails
with:
section [21] '.plt' is both executable and writable
elflint uses the ebl_check_special_section hook (implemented only by
the alpha and sparc backends) in order to determine whether an
executable+writable section must be flagged or not. In both cases the
hook will fail analyzing eu-strip debuginfo files (as they should,
because debuginfo files are broken ;).
This patch just modifies elflint to not use the hook when -d is
specified in the command-line. This fixes the test in sparc-* and
sparc64-* targets (and presumably in alpha* targets too).
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com>
diff --git a/src/ChangeLog b/src/ChangeLog
index 5e69d3a..24e80c0 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2015-10-09 Jose E. Marchesi <jose.marchesi@oracle.com>
+
+ * elflint.c (check_sections): Do not rely on
+ ebl_check_special_section when checking debuginfo files.
+
2015-10-04 Mark Wielaard <mjw@redhat.com>
* strip.c (handle_elf): Only sanity check section symbols to not
diff --git a/src/elflint.c b/src/elflint.c
index c1f0be5..456d376 100644
--- a/src/elflint.c
+++ b/src/elflint.c
@@ -3939,6 +3939,7 @@ section [%2zu] '%s' has unexpected type %d for an executable section\n"),
}
if ((shdr->sh_flags & SHF_WRITE)
+ && !is_debuginfo
&& !ebl_check_special_section (ebl, cnt, shdr,
section_name (ebl, cnt)))
ERROR (gettext ("\