PR23282, Reinstate seek optimization
PR 23282 * bfdio.c (bfd_seek): Optimize away seeks to current position.
This commit is contained in:
parent
ab89b5a57c
commit
ff91d2f0e2
|
@ -1,3 +1,8 @@
|
|||
2018-06-14 Alan Modra <amodra@gmail.com>
|
||||
|
||||
PR 23282
|
||||
* bfdio.c (bfd_seek): Optimize away seeks to current position.
|
||||
|
||||
2018-06-13 Scott Egerton <scott.egerton@imgtec.com>
|
||||
Faraz Shahbazker <Faraz.Shahbazker@mips.com>
|
||||
|
||||
|
|
|
@ -330,6 +330,10 @@ bfd_seek (bfd *abfd, file_ptr position, int direction)
|
|||
if (direction != SEEK_CUR)
|
||||
position += offset;
|
||||
|
||||
if ((direction == SEEK_CUR && position == 0)
|
||||
|| (direction == SEEK_SET && (ufile_ptr) position == abfd->where))
|
||||
return 0;
|
||||
|
||||
result = abfd->iovec->bseek (abfd, position, direction);
|
||||
if (result != 0)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue