Lines Matching full:hash
377 /* A hash table for section names. */
850 #define bfd_link_hash_table_free(abfd, hash) \
851 BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))
1030 * Hash Tables::
1738 Clears the section list, and also resets the section count and hash
5513 /* Create a hash table for the linker. Different backends store
5518 /* Release the memory associated with the linker hash table. */
5521 /* Add symbols from this object file into the hash table. */
6763 File: bfd.info, Node: Linker Functions, Next: Hash Tables, Prev: File Caching, Up: BFD front end
6774 The first routine creates a hash table used by the other routines.
6775 The second routine adds the symbols from an object file to the hash
6785 information relevant to the link, including the linker hash table
6797 * Creating a Linker Hash Table::
6798 * Adding Symbols to the Hash Table::
6802 File: bfd.info, Node: Creating a Linker Hash Table, Next: Adding Symbols to the Hash Table, Prev: Linker Functions, Up: Linker Functions
6804 2.17.1 Creating a linker hash table
6807 The linker routines must create a hash table, which must be derived
6808 from `struct bfd_link_hash_table' described in `bfdlink.c'. *Note Hash
6809 Tables::, for information on how to create a derived hash table. This
6813 initialize an instance of the desired hash table. If the back end does
6815 the hash table, the entry point may simply create a `struct
6819 For example, with each entry in the hash table the a.out linker
6824 functions for a hash table derived from `struct bfd_link_hash_table'.
6825 The a.out linker hash table is created by the function
6827 hash table, initializes it, and returns a pointer to it.
6831 finished. You should simply create a new hash table which defines no
6835 File: bfd.info, Node: Adding Symbols to the Hash Table, Next: Performing the Final Link, Prev: Creating a Linker Hash Table, Up: Linker Functions
6837 2.17.2 Adding symbols to the hash table
6845 the hash table. For an archive, BFD must determine which elements of
6858 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
6867 has an important consequence: the function may not assume that the hash
6870 function can assume about the hash table is that it is derived from
6874 information in the hash table entry to be used by the `_bfd_final_link'
6875 function. In such a case the `creator' field of the hash table must be
6876 checked to make sure that the hash table was created by an object file
6879 The `_bfd_final_link' routine must be prepared to handle a hash
6881 `_bfd_link_add_symbols' function. A hash entry without extra
6883 to create a symbol. Note that, regardless of how a hash table entry is
6885 the hash table entry initialization function.
6889 external symbol debugging information) in a hash table entry.
6892 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
6898 must add all externally visible symbols in that object file to the hash
6899 table. The actual work of adding the symbol to the hash table is
6926 `aout_link_add_symbols'. The latter saves pointers to the hash tables
6929 hash table lookup routine to locate the entry.
6932 File: bfd.info, Node: Adding symbols from an archive, Prev: Adding symbols from an object file, Up: Adding Symbols to the Hash Table
6941 must add the symbols from the object file to the linker hash table.
6945 This function builds a hash table from the archive symbol table and
6950 the linker hash table.
6957 be added to the linker hash table just as though the element had itself
6968 actually add the symbols to the linker hash table.
6972 contain a hash table of symbols. The ECOFF back end searches the
6973 archive itself to avoid the overhead of creating a new hash table.
6976 File: bfd.info, Node: Performing the Final Link, Prev: Adding Symbols to the Hash Table, Up: Linker Functions
6987 symbols from the hash table. When producing relocatable output, it must
7070 the global hash table. This must be controlled by the `strip' and
7074 the linker hash table. The `_bfd_final_link' routine must consider
7079 The `_bfd_final_link' routine must also traverse the global hash
7083 to traverse the hash table since the linker script may have defined
7089 of the `bfd_link_info' structure is a hash table of symbols to keep;
7090 each symbol should be looked up in this hash table, and only symbols
7102 global hash table with the function `aout_link_write_other_symbol'. It
7129 File: bfd.info, Node: Hash Tables, Prev: Linker Functions, Up: BFD front end
7131 2.18 Hash Tables
7134 BFD provides a simple set of hash table functions. Routines are
7135 provided to initialize a hash table, to free a hash table, to look up a
7136 string in a hash table and optionally create an entry for it, and to
7137 traverse a hash table. There is currently no routine to delete an
7138 string from a hash table.
7140 The basic hash table does not permit any data to be stored with a
7141 string. However, a hash table is designed to present a base class from
7142 which other types of hash tables may be derived. These derived types
7143 may store additional information with the string. Hash tables were
7145 a hash table entry, because they were designed for use by the linker
7146 back ends. The linker may create thousands of hash table entries, and
7150 The basic hash table code is in `hash.c'.
7154 * Creating and Freeing a Hash Table::
7156 * Traversing a Hash Table::
7157 * Deriving a New Hash Table Type::
7160 File: bfd.info, Node: Creating and Freeing a Hash Table, Next: Looking Up or Entering a String, Prev: Hash Tables, Up: Hash Tables
7162 2.18.1 Creating and freeing a hash table
7165 To create a hash table, create an instance of a `struct bfd_hash_table'
7172 use to create new entries. For a basic hash table, use the function
7173 `bfd_hash_newfunc'. *Note Deriving a New Hash Table Type::, for why
7181 allocated for a hash table. This will not free up the `struct
7184 Use `bfd_hash_set_default_size' to set the default size of hash
7188 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
7194 hash table and to create a new entry.
7203 the hash table if it is not already there. Either way a pointer to a
7210 hash table objalloc or not. If COPY is passed as `FALSE', you must be
7211 careful not to deallocate or modify the string as long as the hash table
7215 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
7217 2.18.3 Traversing a hash table
7220 The function `bfd_hash_traverse' may be used to traverse a hash table,
7225 `void *' pointer. The function is called with a hash table entry (a
7228 indicates whether to continue traversing the hash table. If the
7233 File: bfd.info, Node: Deriving a New Hash Table Type, Prev: Traversing a Hash Table, Up: Hash Tables
7235 2.18.4 Deriving a new hash table type
7238 Many uses of hash tables want to store additional information which
7239 each entry in the hash table. Some also find it convenient to store
7240 additional information with the hash table itself. This may be done
7241 using a derived hash table.
7243 Since C is not an object oriented language, creating a derived hash
7245 differences specific to the type of hash table you want to create.
7247 An example of a derived hash table is the linker hash table. The
7251 You may also derive a hash table from an already derived hash table.
7252 For example, the a.out linker backend code uses a hash table derived
7253 from the linker hash table.
7262 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
7267 You must define a structure for an entry in the hash table, and a
7268 structure for the hash table itself.
7270 The first field in the structure for an entry in the hash table must
7271 be of the type used for an entry in the hash table you are deriving
7272 from. If you are deriving from a basic hash table this is `struct
7274 structure for the hash table itself must be of the type of the hash
7276 hash table, this is `struct bfd_hash_table'.
7278 For example, the linker hash table defines `struct
7284 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
7290 the hash table. This routine is passed as the function argument to
7293 In order to permit other hash tables to be derived from the hash
7296 The first argument to the creation routine is a pointer to a hash
7299 been allocated by a hash table type derived from this one.
7302 routine of the hash table type it is derived from, passing in a pointer
7304 by the base hash table.
7307 the new hash table type.
7311 hash table you are creating. BASE_NEWFUNC is the name of the creation
7312 routine of the hash table type your hash table is derived from.
7339 The creation routine for the linker hash table, which is in `linker.c',
7343 hash table.
7346 linker hash table entry: `type', `written' and `next'.
7349 File: bfd.info, Node: Write Other Derived Routines, Prev: Write the Derived Creation Routine, Up: Deriving a New Hash Table Type
7354 You will want to write other routines for your new hash table, as well.
7357 initialization routine of the hash table you are deriving from and
7358 initializes any other local fields. For the linker hash table, this is
7362 hash table you are deriving from and casts the result. The linker hash
7368 traversal routine of the hash table you are deriving from with
7369 appropriate casts. The linker hash table uses `bfd_link_hash_traverse'
7373 a.out backend linker hash table, which is derived from the linker hash
8930 * _bfd_link_add_symbols in target vector: Adding Symbols to the Hash Table.
8934 * _bfd_link_hash_table_create in target vector: Creating a Linker Hash Table.
9052 * bfd_hash_allocate: Creating and Freeing a Hash Table.
9056 * bfd_hash_newfunc: Creating and Freeing a Hash Table.
9058 * bfd_hash_set_default_size: Creating and Freeing a Hash Table.
9060 * bfd_hash_table_free: Creating and Freeing a Hash Table.
9062 * bfd_hash_table_init: Creating and Freeing a Hash Table.
9064 * bfd_hash_table_init_n: Creating and Freeing a Hash Table.
9066 * bfd_hash_traverse: Traversing a Hash Table.
10225 * Hash tables: Hash Tables. (line 6)
10234 * target vector (_bfd_link_add_symbols): Adding Symbols to the Hash Table.
10236 * target vector (_bfd_link_hash_table_create): Creating a Linker Hash Table.
10278 Node: Creating a Linker Hash Table246564
10279 Node: Adding Symbols to the Hash Table248302
10287 Node: Hash Tables262655
10288 Node: Creating and Freeing a Hash Table263853
10290 Node: Traversing a Hash Table266356
10291 Node: Deriving a New Hash Table Type267145