]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Update binary_get_section_contents to seek using section's file position
authorKevin Buettner <kevinb@redhat.com>
Fri, 12 Jun 2020 01:58:49 +0000 (18:58 -0700)
committerKevin Buettner <kevinb@redhat.com>
Wed, 22 Jul 2020 19:42:31 +0000 (12:42 -0700)
commit5efb677960e786a7cfa3b5a53f15cc6656f33f02
treef1aff157d20297eb39ed9c9679be06909f75a8df
parent94c265d790b88e691b9ea0173b7000a54a3eb0a0
Update binary_get_section_contents to seek using section's file position

I have a patch for GDB which opens and reads from BFDs using the
"binary" target.  However, for it to work, we need to be able to get a
section's contents based from the file position of that section.

At the moment, reading a section's contents will always read from the
start of the file regardless of where that section is located.  While
this was fine for the original use of the "binary" target, it won't
work for my use case.  This change shouldn't impact any existing
callers due to the fact that the single .data section is initialized
with a filepos of 0.

bfd/ChangeLog:

* binary.c (binary_get_section_contents): Seek using offset
from section's file position.
bfd/ChangeLog
bfd/binary.c