[PATCH] ld: Restore file offset after a plugin fails to claim a file
Alan Modra
amodra@gmail.com
Tue Jul 19 00:38:00 GMT 2016
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
More information about the Binutils
mailing list