This is the mail archive of the
mailing list for the binutils project.
Re: Appending to BFD
- From: Dave Korn <dave dot korn dot cygwin at gmail dot com>
- To: "Paulo J. Matos" <paulo at matos-sorge dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 15 Nov 2011 22:49:25 +0000
- Subject: Re: Appending to BFD
- References: <email@example.com> <firstname.lastname@example.org>
On 15/11/2011 14:18, Paulo J. Matos wrote:
> Is this even possible?
I don't know, but this code ....
> bfd *
> bfd_fopen (const char *filename, const char *target, const char *mode, int fd)
[ ... snip ... ]
> /* Figure out whether the user is opening the file for reading,
> writing, or both, by looking at the MODE argument. */
> if ((mode == 'r' || mode == 'w' || mode == 'a')
> && mode == '+')
> nbfd->direction = both_direction;
... suggests that it ought to be possible. However you may need to insert
calls to bfd_make_readable/bfd_make_writable at appropriate points, and treat
it as if it was only either readable or writable but not both at any given time.