diff options
author | Alan Modra <amodra@gmail.com> | 2023-05-18 11:10:38 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-05-18 12:21:40 +0930 |
commit | 0cc8cc5e6f82b8d3d8e3803c6f7f5e63f0c866ad (patch) | |
tree | 804b289fe94a7a6f0653dd898b03069f6fec47ee /bfd/peicode.h | |
parent | 4cb88cfae84363cef6ed59d9d458a20ff2e1e893 (diff) | |
download | gdb-0cc8cc5e6f82b8d3d8e3803c6f7f5e63f0c866ad.zip gdb-0cc8cc5e6f82b8d3d8e3803c6f7f5e63f0c866ad.tar.gz gdb-0cc8cc5e6f82b8d3d8e3803c6f7f5e63f0c866ad.tar.bz2 |
Re: Add section caches to coff_data_type
Commit 0e759f232b6d regressed these tests:
rs6000-aix7.2 +FAIL: Garbage collection test 1 (32-bit)
rs6000-aix7.2 +FAIL: Garbage collection test 1 (64-bit)
rs6000-aix7.2 +FAIL: Glink test 1 (32-bit)
rs6000-aix7.2 +FAIL: Glink test 1 (64-bit)
Investigation showed segfaults in coff_section_from_bfd_index called
by xcoff_write_global_symbol due to the hash table pointer being
NULL. Well, yes, the hash table isn't initialised for the output bfd.
mkobject_hook is the wrong place to do that.
* coffcode.h: Revert 0e759f232b6d changes.
* peicode.h: Likewise.
* coff-x86_64.c (htab_hash_section_index, htab_eq_section_index):
Moved here from coffcode.h.
(coff_amd64_rtype_to_howto): Create section_by_index htab.
* coffgen.c (htab_hash_section_target_index),
(htab_eq_section_target_index): Moved here from coffcode.h.
(coff_section_from_bfd_index): Create section_by_target_index
htab. Stash newly created sections in htab.
Diffstat (limited to 'bfd/peicode.h')
-rw-r--r-- | bfd/peicode.h | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/bfd/peicode.h b/bfd/peicode.h index 436ff54..e2e2be6 100644 --- a/bfd/peicode.h +++ b/bfd/peicode.h @@ -255,36 +255,6 @@ coff_swap_scnhdr_in (bfd * abfd, void * ext, void * in) #endif } -static hashval_t -htab_hash_section_index (const void * entry) -{ - const struct bfd_section * sec = entry; - return sec->index; -} - -static int -htab_eq_section_index (const void * e1, const void * e2) -{ - const struct bfd_section * sec1 = e1; - const struct bfd_section * sec2 = e2; - return sec1->index == sec2->index; -} - -static hashval_t -htab_hash_section_target_index (const void * entry) -{ - const struct bfd_section * sec = entry; - return sec->target_index; -} - -static int -htab_eq_section_target_index (const void * e1, const void * e2) -{ - const struct bfd_section * sec1 = e1; - const struct bfd_section * sec2 = e2; - return sec1->target_index == sec2->target_index; -} - static bool pe_mkobject (bfd * abfd) { @@ -382,11 +352,6 @@ pe_mkobject_hook (bfd * abfd, memcpy (pe->dos_message, internal_f->pe.dos_message, sizeof (pe->dos_message)); - pe->coff.section_by_index - = htab_create (10, htab_hash_section_index, htab_eq_section_index, NULL); - pe->coff.section_by_target_index = htab_create - (10, htab_hash_section_target_index, htab_eq_section_target_index, NULL); - return (void *) pe; } |