summaryrefslogtreecommitdiff
path: root/bfd/libbfd.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2001-12-17 00:40:53 +0000
committerAlan Modra <amodra@bigpond.net.au>2001-12-17 00:40:53 +0000
commit09af635dac82bf68305a15a4fbafd5c5eae677dc (patch)
tree65ab48630379291b26f6b607659a4b204649ae9a /bfd/libbfd.h
parent73e8d0ab0220f9de8d8ec175bf1db6da54ec2105 (diff)
downloadbinutils-redhat-09af635dac82bf68305a15a4fbafd5c5eae677dc.tar.gz
hash bfd sections for fast lookup and create.
bfd/ChangeLog * bfd.c (struct _bfd): Add section_htab, section_tail. * libbfd-in.h (_bfd_delete_bfd): Declare. (bfd_section_hash_newfunc): Declare. * opncls.c (_bfd_new_bfd): Free memory on failure. Init section_htab and section_tail. (_bfd_delete_bfd): New function. (bfd_openr): Use it. (bfd_fdopenr): Likewise. (bfd_openstreamr): Likewise. (bfd_openw): Likewise. (bfd_close): Likewise. (bfd_close_all_done): Likewise. (bfd_release): Comment. * section.c (struct section_hash_entry): New. (bfd_section_hash_newfunc): New function. (section_hash_lookup): Define. (bfd_section_init): New function, split out from bfd_make_section_anyway. (bfd_get_section_by_name): Lookup via hash table. (bfd_get_unique_section_name): Likewise. (bfd_make_section_old_way): Rewrite to use hash table. (bfd_make_section_anyway): Likewise. (bfd_make_section): Likewise. Return NULL for attempts to make BFD_{ABS,COM,UND,IND}_SECTION_NAME. (_bfd_strip_section_from_output): Adjust section_tail if needed. * configure.in: Bump bfd version. * configure: Regenerate. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. ld/ChangeLog * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Adjust section_tail when fiddling with section list. (gld${EMULATION_NAME}_list_options): Ensure sentences aren't broken into separate strings to make translation easier. * emultempl/mmo.em (mmo_place_orphan): Adjust section_tail when fiddling with section list. * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
Diffstat (limited to 'bfd/libbfd.h')
-rw-r--r--bfd/libbfd.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index 89b6f1a877..54629cf5db 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -117,6 +117,7 @@ boolean _bfd_compute_and_write_armap PARAMS ((bfd *, unsigned int elength));
bfd *_bfd_get_elt_at_filepos PARAMS ((bfd *archive, file_ptr filepos));
extern bfd *_bfd_generic_get_elt_at_index PARAMS ((bfd *, symindex));
bfd * _bfd_new_bfd PARAMS ((void));
+void _bfd_delete_bfd PARAMS ((bfd *));
boolean bfd_false PARAMS ((bfd *ignore));
boolean bfd_true PARAMS ((bfd *ignore));
@@ -373,6 +374,10 @@ extern boolean _bfd_dwarf2_find_nearest_line
const char **, unsigned int *, unsigned int,
PTR *));
+/* Create a new section entry. */
+extern struct bfd_hash_entry *bfd_section_hash_newfunc
+ PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
+
/* A routine to create entries for a bfd_link_hash_table. */
extern struct bfd_hash_entry *_bfd_link_hash_newfunc
PARAMS ((struct bfd_hash_entry *entry,