Lines Matching full:hash
375 /* A hash table for section names. */
848 #define bfd_link_hash_table_free(abfd, hash) \
849 BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))
1028 * Hash Tables::
1736 Clears the section list, and also resets the section count and hash
5511 /* Create a hash table for the linker. Different backends store
5516 /* Release the memory associated with the linker hash table. */
5519 /* Add symbols from this object file into the hash table. */
6761 File: bfd.info, Node: Linker Functions, Next: Hash Tables, Prev: File Caching, Up: BFD front end
6772 The first routine creates a hash table used by the other routines.
6773 The second routine adds the symbols from an object file to the hash
6783 information relevant to the link, including the linker hash table
6795 * Creating a Linker Hash Table::
6796 * Adding Symbols to the Hash Table::
6800 File: bfd.info, Node: Creating a Linker Hash Table, Next: Adding Symbols to the Hash Table, Prev: Linker Functions, Up: Linker Functions
6802 2.17.1 Creating a linker hash table
6805 The linker routines must create a hash table, which must be derived
6806 from `struct bfd_link_hash_table' described in `bfdlink.c'. *Note Hash
6807 Tables::, for information on how to create a derived hash table. This
6811 initialize an instance of the desired hash table. If the back end does
6813 the hash table, the entry point may simply create a `struct
6817 For example, with each entry in the hash table the a.out linker
6822 functions for a hash table derived from `struct bfd_link_hash_table'.
6823 The a.out linker hash table is created by the function
6825 hash table, initializes it, and returns a pointer to it.
6829 finished. You should simply create a new hash table which defines no
6833 File: bfd.info, Node: Adding Symbols to the Hash Table, Next: Performing the Final Link, Prev: Creating a Linker Hash Table, Up: Linker Functions
6835 2.17.2 Adding symbols to the hash table
6843 the hash table. For an archive, BFD must determine which elements of
6856 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
6865 has an important consequence: the function may not assume that the hash
6868 function can assume about the hash table is that it is derived from
6872 information in the hash table entry to be used by the `_bfd_final_link'
6873 function. In such a case the `creator' field of the hash table must be
6874 checked to make sure that the hash table was created by an object file
6877 The `_bfd_final_link' routine must be prepared to handle a hash
6879 `_bfd_link_add_symbols' function. A hash entry without extra
6881 to create a symbol. Note that, regardless of how a hash table entry is
6883 the hash table entry initialization function.
6887 external symbol debugging information) in a hash table entry.
6890 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
6896 must add all externally visible symbols in that object file to the hash
6897 table. The actual work of adding the symbol to the hash table is
6924 `aout_link_add_symbols'. The latter saves pointers to the hash tables
6927 hash table lookup routine to locate the entry.
6930 File: bfd.info, Node: Adding symbols from an archive, Prev: Adding symbols from an object file, Up: Adding Symbols to the Hash Table
6939 must add the symbols from the object file to the linker hash table.
6943 This function builds a hash table from the archive symbol table and
6948 the linker hash table.
6955 be added to the linker hash table just as though the element had itself
6966 actually add the symbols to the linker hash table.
6970 contain a hash table of symbols. The ECOFF back end searches the
6971 archive itself to avoid the overhead of creating a new hash table.
6974 File: bfd.info, Node: Performing the Final Link, Prev: Adding Symbols to the Hash Table, Up: Linker Functions
6985 symbols from the hash table. When producing relocatable output, it must
7068 the global hash table. This must be controlled by the `strip' and
7072 the linker hash table. The `_bfd_final_link' routine must consider
7077 The `_bfd_final_link' routine must also traverse the global hash
7081 to traverse the hash table since the linker script may have defined
7087 of the `bfd_link_info' structure is a hash table of symbols to keep;
7088 each symbol should be looked up in this hash table, and only symbols
7100 global hash table with the function `aout_link_write_other_symbol'. It
7127 File: bfd.info, Node: Hash Tables, Prev: Linker Functions, Up: BFD front end
7129 2.18 Hash Tables
7132 BFD provides a simple set of hash table functions. Routines are
7133 provided to initialize a hash table, to free a hash table, to look up a
7134 string in a hash table and optionally create an entry for it, and to
7135 traverse a hash table. There is currently no routine to delete an
7136 string from a hash table.
7138 The basic hash table does not permit any data to be stored with a
7139 string. However, a hash table is designed to present a base class from
7140 which other types of hash tables may be derived. These derived types
7141 may store additional information with the string. Hash tables were
7143 a hash table entry, because they were designed for use by the linker
7144 back ends. The linker may create thousands of hash table entries, and
7148 The basic hash table code is in `hash.c'.
7152 * Creating and Freeing a Hash Table::
7154 * Traversing a Hash Table::
7155 * Deriving a New Hash Table Type::
7158 File: bfd.info, Node: Creating and Freeing a Hash Table, Next: Looking Up or Entering a String, Prev: Hash Tables, Up: Hash Tables
7160 2.18.1 Creating and freeing a hash table
7163 To create a hash table, create an instance of a `struct bfd_hash_table'
7170 use to create new entries. For a basic hash table, use the function
7171 `bfd_hash_newfunc'. *Note Deriving a New Hash Table Type::, for why
7179 allocated for a hash table. This will not free up the `struct
7182 Use `bfd_hash_set_default_size' to set the default size of hash
7186 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
7192 hash table and to create a new entry.
7201 the hash table if it is not already there. Either way a pointer to a
7208 hash table objalloc or not. If COPY is passed as `FALSE', you must be
7209 careful not to deallocate or modify the string as long as the hash table
7213 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
7215 2.18.3 Traversing a hash table
7218 The function `bfd_hash_traverse' may be used to traverse a hash table,
7223 `void *' pointer. The function is called with a hash table entry (a
7226 indicates whether to continue traversing the hash table. If the
7231 File: bfd.info, Node: Deriving a New Hash Table Type, Prev: Traversing a Hash Table, Up: Hash Tables
7233 2.18.4 Deriving a new hash table type
7236 Many uses of hash tables want to store additional information which
7237 each entry in the hash table. Some also find it convenient to store
7238 additional information with the hash table itself. This may be done
7239 using a derived hash table.
7241 Since C is not an object oriented language, creating a derived hash
7243 differences specific to the type of hash table you want to create.
7245 An example of a derived hash table is the linker hash table. The
7249 You may also derive a hash table from an already derived hash table.
7250 For example, the a.out linker backend code uses a hash table derived
7251 from the linker hash table.
7260 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
7265 You must define a structure for an entry in the hash table, and a
7266 structure for the hash table itself.
7268 The first field in the structure for an entry in the hash table must
7269 be of the type used for an entry in the hash table you are deriving
7270 from. If you are deriving from a basic hash table this is `struct
7272 structure for the hash table itself must be of the type of the hash
7274 hash table, this is `struct bfd_hash_table'.
7276 For example, the linker hash table defines `struct
7282 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
7288 the hash table. This routine is passed as the function argument to
7291 In order to permit other hash tables to be derived from the hash
7294 The first argument to the creation routine is a pointer to a hash
7297 been allocated by a hash table type derived from this one.
7300 routine of the hash table type it is derived from, passing in a pointer
7302 by the base hash table.
7305 the new hash table type.
7309 hash table you are creating. BASE_NEWFUNC is the name of the creation
7310 routine of the hash table type your hash table is derived from.
7337 The creation routine for the linker hash table, which is in `linker.c',
7341 hash table.
7344 linker hash table entry: `type', `written' and `next'.
7347 File: bfd.info, Node: Write Other Derived Routines, Prev: Write the Derived Creation Routine, Up: Deriving a New Hash Table Type
7352 You will want to write other routines for your new hash table, as well.
7355 initialization routine of the hash table you are deriving from and
7356 initializes any other local fields. For the linker hash table, this is
7360 hash table you are deriving from and casts the result. The linker hash
7366 traversal routine of the hash table you are deriving from with
7367 appropriate casts. The linker hash table uses `bfd_link_hash_traverse'
7371 a.out backend linker hash table, which is derived from the linker hash
8928 * _bfd_link_add_symbols in target vector: Adding Symbols to the Hash Table.
8932 * _bfd_link_hash_table_create in target vector: Creating a Linker Hash Table.
9050 * bfd_hash_allocate: Creating and Freeing a Hash Table.
9054 * bfd_hash_newfunc: Creating and Freeing a Hash Table.
9056 * bfd_hash_set_default_size: Creating and Freeing a Hash Table.
9058 * bfd_hash_table_free: Creating and Freeing a Hash Table.
9060 * bfd_hash_table_init: Creating and Freeing a Hash Table.
9062 * bfd_hash_table_init_n: Creating and Freeing a Hash Table.
9064 * bfd_hash_traverse: Traversing a Hash Table.
10223 * Hash tables: Hash Tables. (line 6)
10232 * target vector (_bfd_link_add_symbols): Adding Symbols to the Hash Table.
10234 * target vector (_bfd_link_hash_table_create): Creating a Linker Hash Table.
10276 Node: Creating a Linker Hash Table246474
10277 Node: Adding Symbols to the Hash Table248212
10285 Node: Hash Tables262565
10286 Node: Creating and Freeing a Hash Table263763
10288 Node: Traversing a Hash Table266266
10289 Node: Deriving a New Hash Table Type267055