2014-01-02 17:34:40 +01:00
|
|
|
From d560106f300dd2547c659511c8668d88a50eb577 Mon Sep 17 00:00:00 2001
|
|
|
|
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= <jezz@sysmic.org>
|
|
|
|
Date: Thu, 2 Jan 2014 16:00:49 +0100
|
|
|
|
Subject: [PATCH 3/3] Add replacement for <a.out.h>
|
|
|
|
MIME-Version: 1.0
|
|
|
|
Content-Type: text/plain; charset=UTF-8
|
|
|
|
Content-Transfer-Encoding: 8bit
|
2012-05-06 01:39:20 +02:00
|
|
|
|
|
|
|
Valgrind includes <a.out.h> to get the definition of 'struct
|
|
|
|
nlist'. However, while glibc directly defines 'struct nlist' in
|
|
|
|
<a.out.h>, uClibc relies on it being defined by kernel headers (i.e
|
|
|
|
<a.out.h> simply includes <linux/a.out.h>). This works for most
|
|
|
|
architectures, but not for PowerPC, on which the a.out binary format
|
|
|
|
has never been supported, and therefore the <linux/a.out.h> kernel
|
|
|
|
header does not exist.
|
|
|
|
|
|
|
|
One solution would have been to use the <nlist.h> header, but this one
|
|
|
|
is only available in glibc, and it also has a slightly different
|
|
|
|
definition than the one in <a.out.h>. So, for the time being, the
|
|
|
|
easiest solution is to just replace the #include <a.out.h> in Valgrind
|
|
|
|
code by a copy/paste of the 'struct nlist' definition.
|
|
|
|
|
|
|
|
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
2014-01-02 17:34:40 +01:00
|
|
|
Signed-off-by: Jérôme Pouiller <jezz@sysmic.org>
|
|
|
|
---
|
|
|
|
coregrind/m_debuginfo/readstabs.c | 16 +++++++++++++++-
|
|
|
|
1 file changed, 15 insertions(+), 1 deletion(-)
|
2012-05-06 01:39:20 +02:00
|
|
|
|
2014-01-02 17:34:40 +01:00
|
|
|
diff --git a/coregrind/m_debuginfo/readstabs.c b/coregrind/m_debuginfo/readstabs.c
|
|
|
|
index 70ad319..47f5bc7 100644
|
2012-05-06 01:39:20 +02:00
|
|
|
--- a/coregrind/m_debuginfo/readstabs.c
|
|
|
|
+++ b/coregrind/m_debuginfo/readstabs.c
|
2014-01-02 17:34:40 +01:00
|
|
|
@@ -54,7 +54,21 @@
|
2012-05-06 01:39:20 +02:00
|
|
|
|
|
|
|
/* --- !!! --- EXTERNAL HEADERS start --- !!! --- */
|
|
|
|
#if defined(VGO_linux)
|
|
|
|
-# include <a.out.h> /* stabs defns */
|
|
|
|
+/* Copied from a.out.h, because it is otherwise not available on
|
|
|
|
+ PowerPC/uClibc */
|
|
|
|
+struct nlist
|
|
|
|
+{
|
|
|
|
+ union
|
|
|
|
+ {
|
|
|
|
+ char *n_name;
|
|
|
|
+ struct nlist *n_next;
|
|
|
|
+ long n_strx;
|
|
|
|
+ } n_un;
|
|
|
|
+ unsigned char n_type;
|
|
|
|
+ char n_other;
|
|
|
|
+ short n_desc;
|
|
|
|
+ unsigned long n_value;
|
|
|
|
+};
|
|
|
|
#elif defined(VGO_darwin)
|
|
|
|
# include <mach-o/nlist.h>
|
|
|
|
# define n_other n_sect
|
2014-01-02 17:34:40 +01:00
|
|
|
--
|
|
|
|
1.8.3.2
|
|
|
|
|