Don't call bfd_get_file_size in _bfd_generic_get_section_contents
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 28 Jun 2017 18:07:04 +0000 (11:07 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 28 Jun 2017 18:07:04 +0000 (11:07 -0700)
commit328ce951b2513a102711bb640496a2f1b5f8d3dd
tree410c0349ea93ed40c1d24e91f277c618d5c37986
parent47fdcf63c04b5c220974affc8ff1d9ef8a041919
Don't call bfd_get_file_size in _bfd_generic_get_section_contents

Since it is impossible to read beyond the end of normal files, we only
need to check archive element size in _bfd_generic_get_section_contents

* libbfd.c (_bfd_generic_get_section_contents): Don't call
bfd_get_file_size.  Check archive element size.
(_bfd_generic_get_section_contents_in_window): Likewise.
bfd/ChangeLog
bfd/libbfd.c