This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] ld: Restore file offset after a plugin fails to claim a file


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]