diff options
author | Alan Modra <amodra@gmail.com> | 2023-05-18 17:43:14 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-05-18 18:01:49 +0930 |
commit | 204d627e83f440dc62871139a688b58c42149f59 (patch) | |
tree | 917eb57ca0145236d2fe0c4cc286462243df68af /bfd/xcofflink.c | |
parent | 92240b19576f2b71719b952f150c8a781e6e5398 (diff) | |
download | binutils-204d627e83f440dc62871139a688b58c42149f59.zip binutils-204d627e83f440dc62871139a688b58c42149f59.tar.gz binutils-204d627e83f440dc62871139a688b58c42149f59.tar.bz2 |
Re: Add section caches to coff_data_type
Another thing, section target_index is renumbered in
coff_compute_section_file_positions and _bfd_xcoff_bfd_final_link. I
don't know that there is currently any way that the output bfd
section_by_target_index could be populated before this point but
clear them out so no one need worry about it.
* coffcode.h (coff_compute_section_file_positions): Clear
section_by_target_index hash table when changing target_index.
(_bfd_xcoff_bfd_final_link): Likewise.
Diffstat (limited to 'bfd/xcofflink.c')
-rw-r--r-- | bfd/xcofflink.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c index b57ed21..a277213 100644 --- a/bfd/xcofflink.c +++ b/bfd/xcofflink.c @@ -7076,6 +7076,8 @@ _bfd_xcoff_bfd_final_link (bfd *abfd, struct bfd_link_info *info) /* Reset the section indices after inserting the new sections. */ + if (xcoff_data (abfd)->coff.section_by_target_index) + htab_empty (xcoff_data (abfd)->coff.section_by_target_index); indx = 0; for (o = abfd->sections; o != NULL; o = o->next) { |