]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
bfd: fix potential missing seek
authorRoman Kapl <code@rkapl.cz>
Sat, 29 Nov 2025 11:45:27 +0000 (12:45 +0100)
committerAlan Modra <amodra@gmail.com>
Sun, 30 Nov 2025 03:14:50 +0000 (13:44 +1030)
commit2fbe667884bc37e710f12937ded1b355be42fa56
tree06f36353bff94890808ba828473753f66c478407
parent5b16df3bd6f8419c434d5ec8648ddc7f63a13eb1
bfd: fix potential missing seek

If a file was closed by cache and then bfd_open_file was called followed
by e.g. bfd_seek to the original position, the seek would be optimized out
while the real file position was still zero (as fopened).  I added
`bfd_io_force` to force the seek at next IO occasion.

This could lead e.g. to appearence of a corrupted object in ld:
  symbol number 0 uses unsupported binding of 6
  or invalid string offset #X >= #Y for section

Signed-off-by: Roman Kapl <code@rkapl.cz>
bfd/cache.c