From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8849 invoked by alias); 22 Dec 2009 02:35:51 -0000 Received: (qmail 8837 invoked by uid 22791); 22 Dec 2009 02:35:50 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Dec 2009 02:35:46 +0000 Received: from kpbe15.cbf.corp.google.com (kpbe15.cbf.corp.google.com [172.25.105.79]) by smtp-out.google.com with ESMTP id nBM2ZhO6016506 for ; Mon, 21 Dec 2009 18:35:44 -0800 Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.18.118.116]) by kpbe15.cbf.corp.google.com with ESMTP id nBM2ZgMh014088 for ; Mon, 21 Dec 2009 18:35:43 -0800 Received: by ruffy.mtv.corp.google.com (Postfix, from userid 67641) id 8E36B84412; Mon, 21 Dec 2009 18:35:42 -0800 (PST) To: gdb-patches@sourceware.org Subject: [RFA]: ELF include file cleanup in linux-low.c Message-Id: <20091222023542.8E36B84412@ruffy.mtv.corp.google.com> Date: Tue, 22 Dec 2009 02:35:00 -0000 From: dje@google.com (Doug Evans) X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-12/txt/msg00332.txt.bz2 Hi. This patches replaces the use of elf files from the source tree with system-provided elf files (per discussion with drow on irc). Ok to check in? Tested by running the testsuite with --target_board=native-gdbserver with a native i686-linux configuration with a 64-bit gdb. [As a sanity check.] 2009-12-21 Doug Evans * linux-low.c: Delete inclusion of ansidecl.h, elf/common.h, elf/external.h. Include instead but only if necessary. Index: linux-low.c =================================================================== RCS file: /cvs/src/src/gdb/gdbserver/linux-low.c,v retrieving revision 1.118 diff -u -p -r1.118 linux-low.c --- linux-low.c 21 Dec 2009 21:23:43 -0000 1.118 +++ linux-low.c 22 Dec 2009 01:40:18 -0000 @@ -19,9 +19,6 @@ #include "server.h" #include "linux-low.h" -#include "ansidecl.h" /* For ATTRIBUTE_PACKED, must be bug in external.h. */ -#include "elf/common.h" -#include "elf/external.h" #include #include @@ -42,6 +39,13 @@ #include #include #include +#ifndef ELFMAG0 +/* Don't include here. If it got included by gdb_proc_service.h + then ELFMAG0 will have been defined. If it didn't get included by + gdb_proc_service.h then including it will likely introduce a duplicate + definition of elf_fpregset_t. */ +#include +#endif #ifndef SPUFS_MAGIC #define SPUFS_MAGIC 0x23c9b64e @@ -191,7 +195,7 @@ linux_child_pid_to_exec_file (int pid) /* Return non-zero if HEADER is a 64-bit ELF file. */ static int -elf_64_header_p (const Elf64_External_Ehdr *header) +elf_64_header_p (const Elf64_Ehdr *header) { return (header->e_ident[EI_MAG0] == ELFMAG0 && header->e_ident[EI_MAG1] == ELFMAG1 @@ -207,7 +211,7 @@ elf_64_header_p (const Elf64_External_Eh int elf_64_file_p (const char *file) { - Elf64_External_Ehdr header; + Elf64_Ehdr header; int fd; fd = open (file, O_RDONLY);