From: dje@google.com (Doug Evans)
To: gdb-patches@sourceware.org
Subject: [RFA]: ELF include file cleanup in linux-low.c
Date: Tue, 22 Dec 2009 02:35:00 -0000 [thread overview]
Message-ID: <20091222023542.8E36B84412@ruffy.mtv.corp.google.com> (raw)
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 <dje@google.com>
* linux-low.c: Delete inclusion of ansidecl.h, elf/common.h,
elf/external.h. Include <elf.h> 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 <sys/wait.h>
#include <stdio.h>
@@ -42,6 +39,13 @@
#include <dirent.h>
#include <sys/stat.h>
#include <sys/vfs.h>
+#ifndef ELFMAG0
+/* Don't include <linux/elf.h> 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 <elf.h>
+#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);
next reply other threads:[~2009-12-22 2:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-22 2:35 Doug Evans [this message]
2009-12-22 4:26 ` Daniel Jacobowitz
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=20091222023542.8E36B84412@ruffy.mtv.corp.google.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.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