This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] ld: Restore file offset after a plugin fails to claim a file
- From: Alan Modra <amodra at gmail dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 19 Jul 2016 10:08:34 +0930
- Subject: Re: [PATCH] ld: Restore file offset after a plugin fails to claim a file
- Authentication-results: sourceware.org; auth=none
- References: <1468876250-18050-1-git-send-email-andrew.burgess@embecosm.com>
On Mon, Jul 18, 2016 at 10:10:50PM +0100, Andrew Burgess wrote:
> * plugin.c (plugin_call_claim_file): Restore the file offset after
> an unsuccessful attempt to claim a file.
> * testplug.c (bytes_to_read_before_claim): New global.
> (record_read_length): New function, sets new global
> bytes_to_read_before_claim.
> (parse_option): Handle 'read:<NUMBER>' option.
> (onclaim_file): Read file content before checking for claim.
> * testsuite/ld-plugin/plugin-30.d: New file.
> * testsuite/ld-plugin/plugin.exp: Add new test.
Thanks. This is OK with the following warnings fixed.
/home/alan/src/binutils-gdb/ld/testplug.c: In function ‘record_read_length’:
/home/alan/src/binutils-gdb/ld/testplug.c:173:26: warning: implicit declaration of function ‘isdigit’ [-Wimplicit-function-declaration]
while (*tmp != '\0' && isdigit (*tmp))
^
/home/alan/src/binutils-gdb/ld/testplug.c: In function ‘onclaim_file’:
/home/alan/src/binutils-gdb/ld/testplug.c:559:7: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
read (file->fd, buffer, bytes_to_read_before_claim);
^
--
Alan Modra
Australia Development Lab, IBM