Lines Matching full:hash
376 /* A hash table for section names. */
852 #define bfd_link_hash_table_free(abfd, hash) \
853 BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))
1072 * Hash Tables::
1774 Clears the section list, and also resets the section count and hash
5641 /* Create a hash table for the linker. Different backends store
5646 /* Release the memory associated with the linker hash table. */
5649 /* Add symbols from this object file into the hash table. */
6897 File: bfd.info, Node: Linker Functions, Next: Hash Tables, Prev: File Caching, Up: BFD front end
6908 The first routine creates a hash table used by the other routines.
6909 The second routine adds the symbols from an object file to the hash
6919 information relevant to the link, including the linker hash table
6931 * Creating a Linker Hash Table::
6932 * Adding Symbols to the Hash Table::
6936 File: bfd.info, Node: Creating a Linker Hash Table, Next: Adding Symbols to the Hash Table, Prev: Linker Functions, Up: Linker Functions
6938 2.17.1 Creating a linker hash table
6941 The linker routines must create a hash table, which must be derived
6942 from `struct bfd_link_hash_table' described in `bfdlink.c'. *Note Hash
6943 Tables::, for information on how to create a derived hash table. This
6947 initialize an instance of the desired hash table. If the back end does
6949 the hash table, the entry point may simply create a `struct
6953 For example, with each entry in the hash table the a.out linker
6958 functions for a hash table derived from `struct bfd_link_hash_table'.
6959 The a.out linker hash table is created by the function
6961 hash table, initializes it, and returns a pointer to it.
6965 finished. You should simply create a new hash table which defines no
6969 File: bfd.info, Node: Adding Symbols to the Hash Table, Next: Performing the Final Link, Prev: Creating a Linker Hash Table, Up: Linker Functions
6971 2.17.2 Adding symbols to the hash table
6979 the hash table. For an archive, BFD must determine which elements of
6992 File: bfd.info, Node: Differing file formats, Next: Adding symbols from an object file, Prev: Adding Symbols to the Hash Table, Up: Adding Symbols to the Hash Table
7001 has an important consequence: the function may not assume that the hash
7004 function can assume about the hash table is that it is derived from
7008 information in the hash table entry to be used by the `_bfd_final_link'
7009 function. In such a case the `creator' field of the hash table must be
7010 checked to make sure that the hash table was created by an object file
7013 The `_bfd_final_link' routine must be prepared to handle a hash
7015 `_bfd_link_add_symbols' function. A hash entry without extra
7017 to create a symbol. Note that, regardless of how a hash table entry is
7019 the hash table entry initialization function.
7023 external symbol debugging information) in a hash table entry.
7026 File: bfd.info, Node: Adding symbols from an object file, Next: Adding symbols from an archive, Prev: Differing file formats, Up: Adding Symbols to the Hash Table
7032 must add all externally visible symbols in that object file to the hash
7033 table. The actual work of adding the symbol to the hash table is
7060 `aout_link_add_symbols'. The latter saves pointers to the hash tables
7063 hash table lookup routine to locate the entry.
7066 File: bfd.info, Node: Adding symbols from an archive, Prev: Adding symbols from an object file, Up: Adding Symbols to the Hash Table
7075 must add the symbols from the object file to the linker hash table.
7079 This function builds a hash table from the archive symbol table and
7084 the linker hash table.
7091 be added to the linker hash table just as though the element had itself
7102 actually add the symbols to the linker hash table.
7106 contain a hash table of symbols. The ECOFF back end searches the
7107 archive itself to avoid the overhead of creating a new hash table.
7110 File: bfd.info, Node: Performing the Final Link, Prev: Adding Symbols to the Hash Table, Up: Linker Functions
7121 symbols from the hash table. When producing relocatable output, it must
7204 the global hash table. This must be controlled by the `strip' and
7208 the linker hash table. The `_bfd_final_link' routine must consider
7213 The `_bfd_final_link' routine must also traverse the global hash
7217 to traverse the hash table since the linker script may have defined
7223 of the `bfd_link_info' structure is a hash table of symbols to keep;
7224 each symbol should be looked up in this hash table, and only symbols
7236 global hash table with the function `aout_link_write_other_symbol'. It
7264 File: bfd.info, Node: Hash Tables, Prev: Linker Functions, Up: BFD front end
7266 2.18 Hash Tables
7269 BFD provides a simple set of hash table functions. Routines are
7270 provided to initialize a hash table, to free a hash table, to look up a
7271 string in a hash table and optionally create an entry for it, and to
7272 traverse a hash table. There is currently no routine to delete an
7273 string from a hash table.
7275 The basic hash table does not permit any data to be stored with a
7276 string. However, a hash table is designed to present a base class from
7277 which other types of hash tables may be derived. These derived types
7278 may store additional information with the string. Hash tables were
7280 a hash table entry, because they were designed for use by the linker
7281 back ends. The linker may create thousands of hash table entries, and
7285 The basic hash table code is in `hash.c'.
7289 * Creating and Freeing a Hash Table::
7291 * Traversing a Hash Table::
7292 * Deriving a New Hash Table Type::
7295 File: bfd.info, Node: Creating and Freeing a Hash Table, Next: Looking Up or Entering a String, Prev: Hash Tables, Up: Hash Tables
7297 2.18.1 Creating and freeing a hash table
7300 To create a hash table, create an instance of a `struct bfd_hash_table'
7307 use to create new entries. For a basic hash table, use the function
7308 `bfd_hash_newfunc'. *Note Deriving a New Hash Table Type::, for why
7316 allocated for a hash table. This will not free up the `struct
7319 Use `bfd_hash_set_default_size' to set the default size of hash
7323 File: bfd.info, Node: Looking Up or Entering a String, Next: Traversing a Hash Table, Prev: Creating and Freeing a Hash Table, Up: Hash Tables
7329 hash table and to create a new entry.
7338 the hash table if it is not already there. Either way a pointer to a
7345 hash table objalloc or not. If COPY is passed as `FALSE', you must be
7346 careful not to deallocate or modify the string as long as the hash table
7350 File: bfd.info, Node: Traversing a Hash Table, Next: Deriving a New Hash Table Type, Prev: Looking Up or Entering a String, Up: Hash Tables
7352 2.18.3 Traversing a hash table
7355 The function `bfd_hash_traverse' may be used to traverse a hash table,
7360 `void *' pointer. The function is called with a hash table entry (a
7363 indicates whether to continue traversing the hash table. If the
7368 File: bfd.info, Node: Deriving a New Hash Table Type, Prev: Traversing a Hash Table, Up: Hash Tables
7370 2.18.4 Deriving a new hash table type
7373 Many uses of hash tables want to store additional information which
7374 each entry in the hash table. Some also find it convenient to store
7375 additional information with the hash table itself. This may be done
7376 using a derived hash table.
7378 Since C is not an object oriented language, creating a derived hash
7380 differences specific to the type of hash table you want to create.
7382 An example of a derived hash table is the linker hash table. The
7386 You may also derive a hash table from an already derived hash table.
7387 For example, the a.out linker backend code uses a hash table derived
7388 from the linker hash table.
7397 File: bfd.info, Node: Define the Derived Structures, Next: Write the Derived Creation Routine, Prev: Deriving a New Hash Table Type, Up: Deriving a New Hash Table Type
7402 You must define a structure for an entry in the hash table, and a
7403 structure for the hash table itself.
7405 The first field in the structure for an entry in the hash table must
7406 be of the type used for an entry in the hash table you are deriving
7407 from. If you are deriving from a basic hash table this is `struct
7409 structure for the hash table itself must be of the type of the hash
7411 hash table, this is `struct bfd_hash_table'.
7413 For example, the linker hash table defines `struct
7419 File: bfd.info, Node: Write the Derived Creation Routine, Next: Write Other Derived Routines, Prev: Define the Derived Structures, Up: Deriving a New Hash Table Type
7425 the hash table. This routine is passed as the function argument to
7428 In order to permit other hash tables to be derived from the hash
7431 The first argument to the creation routine is a pointer to a hash
7434 been allocated by a hash table type derived from this one.
7437 routine of the hash table type it is derived from, passing in a pointer
7439 by the base hash table.
7442 the new hash table type.
7446 hash table you are creating. BASE_NEWFUNC is the name of the creation
7447 routine of the hash table type your hash table is derived from.
7474 The creation routine for the linker hash table, which is in `linker.c',
7478 hash table.
7481 linker hash table entry: `type', `written' and `next'.
7484 File: bfd.info, Node: Write Other Derived Routines, Prev: Write the Derived Creation Routine, Up: Deriving a New Hash Table Type
7489 You will want to write other routines for your new hash table, as well.
7492 initialization routine of the hash table you are deriving from and
7493 initializes any other local fields. For the linker hash table, this is
7497 hash table you are deriving from and casts the result. The linker hash
7503 traversal routine of the hash table you are deriving from with
7504 appropriate casts. The linker hash table uses `bfd_link_hash_traverse'
7508 a.out backend linker hash table, which is derived from the linker hash
9068 * _bfd_link_add_symbols in target vector: Adding Symbols to the Hash Table.
9072 * _bfd_link_hash_table_create in target vector: Creating a Linker Hash Table.
9194 * bfd_hash_allocate: Creating and Freeing a Hash Table.
9198 * bfd_hash_newfunc: Creating and Freeing a Hash Table.
9200 * bfd_hash_set_default_size: Creating and Freeing a Hash Table.
9202 * bfd_hash_table_free: Creating and Freeing a Hash Table.
9204 * bfd_hash_table_init: Creating and Freeing a Hash Table.
9206 * bfd_hash_table_init_n: Creating and Freeing a Hash Table.
9208 * bfd_hash_traverse: Traversing a Hash Table.
10429 * Hash tables: Hash Tables. (line 6)
10438 * target vector (_bfd_link_add_symbols): Adding Symbols to the Hash Table.
10440 * target vector (_bfd_link_hash_table_create): Creating a Linker Hash Table.
10482 Node: Creating a Linker Hash Table250528
10483 Node: Adding Symbols to the Hash Table252266
10491 Node: Hash Tables266668
10492 Node: Creating and Freeing a Hash Table267866
10494 Node: Traversing a Hash Table270369
10495 Node: Deriving a New Hash Table Type271158