From: Pedro Alves Date: Fri, 17 Jan 2014 13:33:30 +0000 (+0000) Subject: Fix PR PR16445 - gdbserver build failure on x86. X-Git-Tag: hjl/linux/release/2.24.51.0.3~1^2~13^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b5737fa98a3a488dbdc0c6aa7391cd038f6d24f1;p=thirdparty%2Fbinutils-gdb.git Fix PR PR16445 - gdbserver build failure on x86. If gdb_proc_service.h ends up including linux/elf.h, we'll trip on duplicate definitions: In file included from ../../../gdb/gdbserver/linux-x86-low.c:29:0: ../../../gdb/gdbserver/../../include/elf/common.h:36:0: error: "ELFMAG0" redefined [-Werror] ... etc ... Handle this the same way linux-low.c and linux-arm-low.c handle this. gdb/gdbserver/ 2014-01-17 Pedro Alves PR PR16445 * linux-x86-low.c (linux-x86-low.c): Don't include elf/common.h if ELFMAG0 is defined after including gdb_proc_service.h. --- diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index c387aa64ce6..cbe90c7450a 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,9 @@ +2014-01-17 Pedro Alves + + PR PR16445 + * linux-x86-low.c (linux-x86-low.c): Don't include elf/common.h if + ELFMAG0 is defined after including gdb_proc_service.h. + 2014-01-16 Doug Evans * dll.c (UNSPECIFIED_CORE_ADDR): New macro. diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c index 04fa3c9be2d..e1daa7da7fe 100644 --- a/gdb/gdbserver/linux-x86-low.c +++ b/gdb/gdbserver/linux-x86-low.c @@ -26,9 +26,14 @@ #include "i387-fp.h" #include "i386-low.h" #include "i386-xstate.h" -#include "elf/common.h" #include "gdb_proc_service.h" +/* Don't include elf/common.h if linux/elf.h got included by + gdb_proc_service.h. */ +#ifndef ELFMAG0 +#include "elf/common.h" +#endif + #include "agent.h" #include "tdesc.h" #include "tracepoint.h"