This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] Don't include <elf.h> in gdbserver/linux-arm-low.c
- From: dje at google dot com (Doug Evans)
- To: gdb-patches at sourceware dot org
- Date: Tue, 19 Jan 2010 16:34:36 -0800 (PST)
- Subject: [RFA] Don't include <elf.h> in gdbserver/linux-arm-low.c
Hi.
ref: http://sourceware.org/ml/gdb-patches/2010-01/msg00487.html
I forgot that linux/elf.h is conditionally included by gdb_proc_service.h.
This patch uses the same condition that linux-low.c already uses when
deciding whether to include <elf.h>, so I think this patch should be
reasonable.
Ok to check in?
2010-01-19 Doug Evans <dje@google.com>
* linux-arm-low.c: Remove redundant include of gdb_proc_service.h.
Only include elf.h if gdb_proc_service.h didn't include linux/elf.h.
Index: linux-arm-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-arm-low.c,v
retrieving revision 1.21
diff -u -p -r1.21 linux-arm-low.c
--- linux-arm-low.c 1 Jan 2010 07:31:49 -0000 1.21
+++ linux-arm-low.c 20 Jan 2010 00:31:21 -0000
@@ -20,11 +20,13 @@
#include "server.h"
#include "linux-low.h"
+/* Don't include elf.h if linux/elf.h got included by gdb_proc_service.h.
+ On Bionic elf.h and linux/elf.h have conflicting definitions. */
+#ifndef ELFMAG0
#include <elf.h>
+#endif
#include <sys/ptrace.h>
-#include "gdb_proc_service.h"
-
/* Defined in auto-generated files. */
void init_registers_arm (void);
void init_registers_arm_with_iwmmxt (void);