This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Compressed exec and core files
- From: Michael Eager <eager at eagerm dot com>
- To: Binutils <binutils at sourceware dot org>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, Paul Koning <Paul_Koning at Dell dot com>
- Date: Tue, 03 Feb 2015 08:22:43 -0800
- Subject: Re: Compressed exec and core files
- Authentication-results: sourceware.org; auth=none
- References: <54C2A8BE dot 2020807 at eagerm dot com>
On 01/23/15 12:02, Michael Eager wrote:
I'm working on a patch to BFD to support opening compressed
exec and core files transparently. When bfd_fopen is called
to open a compressed file, the file would be decompressed into
a temporary file, and the bfd for the temp returned. Compression
with gzip and bzip2 would be supported (others can be added later).
This seems pretty straight-forward. Any thoughts or comments?
It turns out that there is a complication. Part of the problem
is that GDB closes the exec file which it opened with bfd_fopen()
and then opens it with its own open routine (gdb_open_cloexec,
which adds the O_CLOEXEC flag to open) and then passes the fd to
bfd_fopen. BFD doesn't know what flags might have been used to
open the file. Which means that I can't uncompress the file into
a temporary and open the temporary with the same flags.
Unless someone has a suggestion, I'm going to give up on putting
this into BFD and add the compressed exec/core support to GDB.
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077