Add section caches to coff_data_type
authorOleg Tolmatcev <oleg.tolmatcev@gmail.com>
Tue, 16 May 2023 13:25:32 +0000 (14:25 +0100)
committerNick Clifton <nickc@redhat.com>
Tue, 16 May 2023 13:25:32 +0000 (14:25 +0100)
commit0e759f232b6def277d4ae3f2d8bccfe6e34d6034
treeecf626fa9cad39ed53b9582ad5143f68c47491ed
parent73eff1cbd3e35f9f3ea3f69d145aa74c57043953
Add section caches to coff_data_type

  * libcoff-in.h (struct coff_tdata): Add section_by_index and section_by_target_index hash tables.
  * libcoff.h: Regenerate.
  * coffcode.h (htab_hash_section_index): New function. (htab_eq_section_index): New function. (htab_hash_section_target_index): New function. (htab_eq_section_target_index): New function. (coff_mkobject_hool): Create the hash tables.
  * peicode.h: Add the same new functions. (pe_mkobject_hook): Create the hash tables.
  * coff-x86_64.c (coff_amd64_rtype_to_howto): Use the new tables to speed up lookups.
  * coffgen.c (coff_section_from_bfd_index): Likewise. (_bfd_coff_close_and_cleanup): Delete the hash tables.
bfd/ChangeLog
bfd/coff-x86_64.c
bfd/coffcode.h
bfd/coffgen.c
bfd/libcoff-in.h
bfd/libcoff.h
bfd/peicode.h