public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: elfutils-devel@lists.fedorahosted.org
Subject: Some Debian elfutils issues
Date: Wed, 13 Jan 2016 23:13:28 +0100	[thread overview]
Message-ID: <20160113221328.GA2958@blokker.redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1480 bytes --]

Hi Kurt,

Thanks for the Debian builds of elfutils-0.165. Sorry for the breakage,
wrt old glibc elf.h system header. But happy to see the simple fix seems
to work.

I looked at the latest build logs:
https://buildd.debian.org/status/package.php?p=elfutils

For the hppa failure we need some hppa hacker to explain whether or not
this is a real issue or not:

elflint /<<PKGBUILDDIR>>/tests/elfstrmerge
section [24] '.plt' is both executable and writable
FAIL run-strip-strmerge.sh (exit status: 1)

Normaly elflint is correct, this would be a bad thing.

The hurd test build issue should be easy to fix with the attached patch.

For the kFreeBSD variants you could start with the second patch to
elflint to at least recognize ELFOSABI_FREEBSD. Although I suspect there
might be more issues. But maybe we are lucky and it really is just like
normal GNU/Linux ELF files since you are using the normal GNU toolchain.

The other issue on kFreeBSD is that we try to run a test that uses the
linux specific dwfl_linux_proc_attach. We should just skip that on none
GNU/Linux platforms like the third attached patch does.

The mips failures are a bit harder to fix since elflint really doesn't
like some of the mips specific issues. We really should import the Debian
mips backend, I am sorry I haven't found time to do all the needed
research.

If you could try the attached patches on a new Debian build that would
be appreciated.

Thanks,

Mark

[-- Attachment #2: 0001-tests-Guard-linux-specific-header-includes-with-ifde.patch --]
[-- Type: text/plain, Size: 1191 bytes --]

From 6bf03d4a3f2badac3d353d376501574204688c0f Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mjw@redhat.com>
Date: Wed, 13 Jan 2016 22:49:02 +0100
Subject: [PATCH] tests: Guard linux specific header includes with ifdef
 __linux__.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
---
 tests/ChangeLog          | 4 ++++
 tests/dwfl-proc-attach.c | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/tests/ChangeLog b/tests/ChangeLog
index 366aea9..3900d1b 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2016-01-13  Mark Wielaard  <mjw@redhat.com>
+
+	* dwfl-proc-attach.c: Guard linux specific header.
+
 2016-01-08  Mark Wielaard  <mjw@redhat.com>
 
 	* elfputzdata.c (main): Fix parentheses in strncmp test.
diff --git a/tests/dwfl-proc-attach.c b/tests/dwfl-proc-attach.c
index 0ba0be2..e7bb201 100644
--- a/tests/dwfl-proc-attach.c
+++ b/tests/dwfl-proc-attach.c
@@ -22,6 +22,7 @@
 #include <errno.h>
 #include <error.h>
 #include <unistd.h>
+#ifdef __linux__
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/user.h>
@@ -29,6 +30,7 @@
 #include <string.h>
 #include ELFUTILS_HEADER(dwfl)
 #include <pthread.h>
+#endif
 
 #ifndef __linux__
 int
-- 
2.5.0


[-- Attachment #3: 0001-elflint-Recognize-ELFOSABI_FREEBSD-which-Debian-kFre.patch --]
[-- Type: text/plain, Size: 1593 bytes --]

From 866aaf612c028853e160161ee3ca4d6704d22bef Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mjw@redhat.com>
Date: Wed, 13 Jan 2016 22:57:03 +0100
Subject: [PATCH] elflint: Recognize ELFOSABI_FREEBSD which Debian kFreeBSD
 uses.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
---
 src/ChangeLog | 4 ++++
 src/elflint.c | 6 ++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index af98c4d..707c271 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2016-01-13  Mark Wielaard  <mjw@redhat.com>
+
+	* elflint.c (check_elf_header): Recognize ELFOSABI_FREEBSD.
+
 2016-01-08  Mark Wielaard  <mjw@redhat.com>
 
 	* elfcompress.c (compress_section): Use %zu to print size_t.
diff --git a/src/elflint.c b/src/elflint.c
index 7a7b9ce..eae7761 100644
--- a/src/elflint.c
+++ b/src/elflint.c
@@ -380,9 +380,11 @@ check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size)
     ERROR (gettext ("unknown ELF header version number e_ident[%d] == %d\n"),
 	   EI_VERSION, ehdr->e_ident[EI_VERSION]);
 
-  /* We currently don't handle any OS ABIs other than Linux.  */
+  /* We currently don't handle any OS ABIs other than Linux and the
+     kFreeBSD variant of Debian.  */
   if (ehdr->e_ident[EI_OSABI] != ELFOSABI_NONE
-      && ehdr->e_ident[EI_OSABI] != ELFOSABI_LINUX)
+      && ehdr->e_ident[EI_OSABI] != ELFOSABI_LINUX
+      && ehdr->e_ident[EI_OSABI] != ELFOSABI_FREEBSD)
     ERROR (gettext ("unsupported OS ABI e_ident[%d] == '%s'\n"),
 	   EI_OSABI,
 	   ebl_osabi_name (ebl, ehdr->e_ident[EI_OSABI], buf, sizeof (buf)));
-- 
2.5.0


[-- Attachment #4: 0001-tests-Skip-dwfl-bug-fd-leak-test-if-dwfl_linux_proc_.patch --]
[-- Type: text/plain, Size: 1277 bytes --]

From 1dfe8770f682534605d9eda7749afb86bd528165 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mjw@redhat.com>
Date: Wed, 13 Jan 2016 23:06:33 +0100
Subject: [PATCH] tests: Skip dwfl-bug-fd-leak test if dwfl_linux_proc_report
 is unsupported.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
---
 tests/ChangeLog          |  4 ++++
 tests/dwfl-bug-fd-leak.c | 10 ++++++++++
 2 files changed, 14 insertions(+)

diff --git a/tests/ChangeLog b/tests/ChangeLog
index 3900d1b..7deb3e6 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,5 +1,9 @@
 2016-01-13  Mark Wielaard  <mjw@redhat.com>
 
+	* dwfl-bug-fd-leak.c: Skip test unless on __linux__.
+
+2016-01-13  Mark Wielaard  <mjw@redhat.com>
+
 	* dwfl-proc-attach.c: Guard linux specific header.
 
 2016-01-08  Mark Wielaard  <mjw@redhat.com>
diff --git a/tests/dwfl-bug-fd-leak.c b/tests/dwfl-bug-fd-leak.c
index bcbfb29..689cdd7 100644
--- a/tests/dwfl-bug-fd-leak.c
+++ b/tests/dwfl-bug-fd-leak.c
@@ -27,6 +27,15 @@
 #include <error.h>
 #include <unistd.h>
 #include <dwarf.h>
+
+#ifndef __linux__
+int
+main (void)
+{
+  return 77; /* dwfl_linux_proc_report is linux specific.  */
+}
+#else
+
 #include <sys/resource.h>
 #include ELFUTILS_HEADER(dwfl)
 
@@ -104,3 +113,4 @@ main (void)
 
   return 0;
 }
+#endif
-- 
2.5.0


             reply	other threads:[~2016-01-13 22:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-13 22:13 Mark Wielaard [this message]
2016-01-13 23:22 Kurt Roeckx
2016-01-13 23:40 Kurt Roeckx
2016-01-18 14:35 Mark Wielaard
2016-01-18 16:37 Jose E. Marchesi
2016-01-19  3:33 Kurt Roeckx

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160113221328.GA2958@blokker.redhat.com \
    --to=mark@klomp.org \
    --cc=elfutils-devel@lists.fedorahosted.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).