| 1 | This is bfd.info, produced by makeinfo version 4.0 from bfd.texinfo.
|
|---|
| 2 |
|
|---|
| 3 | START-INFO-DIR-ENTRY
|
|---|
| 4 | * Bfd: (bfd). The Binary File Descriptor library.
|
|---|
| 5 | END-INFO-DIR-ENTRY
|
|---|
| 6 |
|
|---|
| 7 | This file documents the BFD library.
|
|---|
| 8 |
|
|---|
| 9 | Copyright (C) 1991, 2000 Free Software Foundation, Inc.
|
|---|
| 10 |
|
|---|
| 11 | Permission is granted to copy, distribute and/or modify this document
|
|---|
| 12 | under the terms of the GNU Free Documentation License, Version 1.1
|
|---|
| 13 | or any later version published by the Free Software Foundation;
|
|---|
| 14 | with no Invariant Sections, with no Front-Cover Texts, and with no
|
|---|
| 15 | Back-Cover Texts. A copy of the license is included in the
|
|---|
| 16 | section entitled "GNU Free Documentation License".
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 | File: bfd.info, Node: Linker Functions, Next: Hash Tables, Prev: File Caching, Up: BFD front end
|
|---|
| 20 |
|
|---|
| 21 | Linker Functions
|
|---|
| 22 | ================
|
|---|
| 23 |
|
|---|
| 24 | The linker uses three special entry points in the BFD target vector.
|
|---|
| 25 | It is not necessary to write special routines for these entry points
|
|---|
| 26 | when creating a new BFD back end, since generic versions are provided.
|
|---|
| 27 | However, writing them can speed up linking and make it use
|
|---|
| 28 | significantly less runtime memory.
|
|---|
| 29 |
|
|---|
| 30 | The first routine creates a hash table used by the other routines.
|
|---|
| 31 | The second routine adds the symbols from an object file to the hash
|
|---|
| 32 | table. The third routine takes all the object files and links them
|
|---|
| 33 | together to create the output file. These routines are designed so
|
|---|
| 34 | that the linker proper does not need to know anything about the symbols
|
|---|
| 35 | in the object files that it is linking. The linker merely arranges the
|
|---|
| 36 | sections as directed by the linker script and lets BFD handle the
|
|---|
| 37 | details of symbols and relocs.
|
|---|
| 38 |
|
|---|
| 39 | The second routine and third routines are passed a pointer to a
|
|---|
| 40 | `struct bfd_link_info' structure (defined in `bfdlink.h') which holds
|
|---|
| 41 | information relevant to the link, including the linker hash table
|
|---|
| 42 | (which was created by the first routine) and a set of callback
|
|---|
| 43 | functions to the linker proper.
|
|---|
| 44 |
|
|---|
| 45 | The generic linker routines are in `linker.c', and use the header
|
|---|
| 46 | file `genlink.h'. As of this writing, the only back ends which have
|
|---|
| 47 | implemented versions of these routines are a.out (in `aoutx.h') and
|
|---|
| 48 | ECOFF (in `ecoff.c'). The a.out routines are used as examples
|
|---|
| 49 | throughout this section.
|
|---|
| 50 |
|
|---|
| 51 | * Menu:
|
|---|
| 52 |
|
|---|
| 53 | * Creating a Linker Hash Table::
|
|---|
| 54 | * Adding Symbols to the Hash Table::
|
|---|
| 55 | * Performing the Final Link::
|
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 | File: bfd.info, Node: Creating a Linker Hash Table, Next: Adding Symbols to the Hash Table, Prev: Linker Functions, Up: Linker Functions
|
|---|
| 59 |
|
|---|
| 60 | Creating a linker hash table
|
|---|
| 61 | ----------------------------
|
|---|
| 62 |
|
|---|
| 63 | The linker routines must create a hash table, which must be derived
|
|---|
| 64 | from `struct bfd_link_hash_table' described in `bfdlink.c'. *Note Hash
|
|---|
| 65 | Tables::, for information on how to create a derived hash table. This
|
|---|
| 66 | entry point is called using the target vector of the linker output file.
|
|---|
| 67 |
|
|---|
| 68 | The `_bfd_link_hash_table_create' entry point must allocate and
|
|---|
| 69 | initialize an instance of the desired hash table. If the back end does
|
|---|
| 70 | not require any additional information to be stored with the entries in
|
|---|
| 71 | the hash table, the entry point may simply create a `struct
|
|---|
| 72 | bfd_link_hash_table'. Most likely, however, some additional
|
|---|
| 73 | information will be needed.
|
|---|
| 74 |
|
|---|
| 75 | For example, with each entry in the hash table the a.out linker
|
|---|
| 76 | keeps the index the symbol has in the final output file (this index
|
|---|
| 77 | number is used so that when doing a relocateable link the symbol index
|
|---|
| 78 | used in the output file can be quickly filled in when copying over a
|
|---|
| 79 | reloc). The a.out linker code defines the required structures and
|
|---|
| 80 | functions for a hash table derived from `struct bfd_link_hash_table'.
|
|---|
| 81 | The a.out linker hash table is created by the function
|
|---|
| 82 | `NAME(aout,link_hash_table_create)'; it simply allocates space for the
|
|---|
| 83 | hash table, initializes it, and returns a pointer to it.
|
|---|
| 84 |
|
|---|
| 85 | When writing the linker routines for a new back end, you will
|
|---|
| 86 | generally not know exactly which fields will be required until you have
|
|---|
| 87 | finished. You should simply create a new hash table which defines no
|
|---|
| 88 | additional fields, and then simply add fields as they become necessary.
|
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 | File: bfd.info, Node: Adding Symbols to the Hash Table, Next: Performing the Final Link, Prev: Creating a Linker Hash Table, Up: Linker Functions
|
|---|
| 92 |
|
|---|
| 93 | Adding symbols to the hash table
|
|---|
| 94 | --------------------------------
|
|---|
| 95 |
|
|---|
| 96 | The linker proper will call the `_bfd_link_add_symbols' entry point
|
|---|
| 97 | for each object file or archive which is to be linked (typically these
|
|---|
| 98 | are the files named on the command line, but some may also come from
|
|---|
| 99 | the linker script). The entry point is responsible for examining the
|
|---|
| 100 | file. For an object file, BFD must add any relevant symbol information
|
|---|
| 101 | to the hash table. For an archive, BFD must determine which elements
|
|---|
| 102 | of the archive should be used and adding them to the link.
|
|---|
| 103 |
|
|---|
| 104 | The a.out version of this entry point is
|
|---|
| 105 | `NAME(aout,link_add_symbols)'.
|
|---|
| 106 |
|
|---|
| 107 | * Menu:
|
|---|
| 108 |
|
|---|
| 109 | * Differing file formats::
|
|---|
| 110 | * Adding symbols from an object file::
|
|---|
| 111 | * Adding symbols from an archive::
|
|---|
| 112 |
|
|---|
| 113 |
|
|---|
| 114 | 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
|
|---|
| 115 |
|
|---|
| 116 | Differing file formats
|
|---|
| 117 | ......................
|
|---|
| 118 |
|
|---|
| 119 | Normally all the files involved in a link will be of the same
|
|---|
| 120 | format, but it is also possible to link together different format
|
|---|
| 121 | object files, and the back end must support that. The
|
|---|
| 122 | `_bfd_link_add_symbols' entry point is called via the target vector of
|
|---|
| 123 | the file to be added. This has an important consequence: the function
|
|---|
| 124 | may not assume that the hash table is the type created by the
|
|---|
| 125 | corresponding `_bfd_link_hash_table_create' vector. All the
|
|---|
| 126 | `_bfd_link_add_symbols' function can assume about the hash table is
|
|---|
| 127 | that it is derived from `struct bfd_link_hash_table'.
|
|---|
| 128 |
|
|---|
| 129 | Sometimes the `_bfd_link_add_symbols' function must store some
|
|---|
| 130 | information in the hash table entry to be used by the `_bfd_final_link'
|
|---|
| 131 | function. In such a case the `creator' field of the hash table must be
|
|---|
| 132 | checked to make sure that the hash table was created by an object file
|
|---|
| 133 | of the same format.
|
|---|
| 134 |
|
|---|
| 135 | The `_bfd_final_link' routine must be prepared to handle a hash
|
|---|
| 136 | entry without any extra information added by the
|
|---|
| 137 | `_bfd_link_add_symbols' function. A hash entry without extra
|
|---|
| 138 | information will also occur when the linker script directs the linker
|
|---|
| 139 | to create a symbol. Note that, regardless of how a hash table entry is
|
|---|
| 140 | added, all the fields will be initialized to some sort of null value by
|
|---|
| 141 | the hash table entry initialization function.
|
|---|
| 142 |
|
|---|
| 143 | See `ecoff_link_add_externals' for an example of how to check the
|
|---|
| 144 | `creator' field before saving information (in this case, the ECOFF
|
|---|
| 145 | external symbol debugging information) in a hash table entry.
|
|---|
| 146 |
|
|---|
| 147 |
|
|---|
| 148 | 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
|
|---|
| 149 |
|
|---|
| 150 | Adding symbols from an object file
|
|---|
| 151 | ..................................
|
|---|
| 152 |
|
|---|
| 153 | When the `_bfd_link_add_symbols' routine is passed an object file,
|
|---|
| 154 | it must add all externally visible symbols in that object file to the
|
|---|
| 155 | hash table. The actual work of adding the symbol to the hash table is
|
|---|
| 156 | normally handled by the function `_bfd_generic_link_add_one_symbol'.
|
|---|
| 157 | The `_bfd_link_add_symbols' routine is responsible for reading all the
|
|---|
| 158 | symbols from the object file and passing the correct information to
|
|---|
| 159 | `_bfd_generic_link_add_one_symbol'.
|
|---|
| 160 |
|
|---|
| 161 | The `_bfd_link_add_symbols' routine should not use
|
|---|
| 162 | `bfd_canonicalize_symtab' to read the symbols. The point of providing
|
|---|
| 163 | this routine is to avoid the overhead of converting the symbols into
|
|---|
| 164 | generic `asymbol' structures.
|
|---|
| 165 |
|
|---|
| 166 | `_bfd_generic_link_add_one_symbol' handles the details of combining
|
|---|
| 167 | common symbols, warning about multiple definitions, and so forth. It
|
|---|
| 168 | takes arguments which describe the symbol to add, notably symbol flags,
|
|---|
| 169 | a section, and an offset. The symbol flags include such things as
|
|---|
| 170 | `BSF_WEAK' or `BSF_INDIRECT'. The section is a section in the object
|
|---|
| 171 | file, or something like `bfd_und_section_ptr' for an undefined symbol
|
|---|
| 172 | or `bfd_com_section_ptr' for a common symbol.
|
|---|
| 173 |
|
|---|
| 174 | If the `_bfd_final_link' routine is also going to need to read the
|
|---|
| 175 | symbol information, the `_bfd_link_add_symbols' routine should save it
|
|---|
| 176 | somewhere attached to the object file BFD. However, the information
|
|---|
| 177 | should only be saved if the `keep_memory' field of the `info' argument
|
|---|
| 178 | is true, so that the `-no-keep-memory' linker switch is effective.
|
|---|
| 179 |
|
|---|
| 180 | The a.out function which adds symbols from an object file is
|
|---|
| 181 | `aout_link_add_object_symbols', and most of the interesting work is in
|
|---|
| 182 | `aout_link_add_symbols'. The latter saves pointers to the hash tables
|
|---|
| 183 | entries created by `_bfd_generic_link_add_one_symbol' indexed by symbol
|
|---|
| 184 | number, so that the `_bfd_final_link' routine does not have to call the
|
|---|
| 185 | hash table lookup routine to locate the entry.
|
|---|
| 186 |
|
|---|
| 187 |
|
|---|
| 188 | File: bfd.info, Node: Adding symbols from an archive, Prev: Adding symbols from an object file, Up: Adding Symbols to the Hash Table
|
|---|
| 189 |
|
|---|
| 190 | Adding symbols from an archive
|
|---|
| 191 | ..............................
|
|---|
| 192 |
|
|---|
| 193 | When the `_bfd_link_add_symbols' routine is passed an archive, it
|
|---|
| 194 | must look through the symbols defined by the archive and decide which
|
|---|
| 195 | elements of the archive should be included in the link. For each such
|
|---|
| 196 | element it must call the `add_archive_element' linker callback, and it
|
|---|
| 197 | must add the symbols from the object file to the linker hash table.
|
|---|
| 198 |
|
|---|
| 199 | In most cases the work of looking through the symbols in the archive
|
|---|
| 200 | should be done by the `_bfd_generic_link_add_archive_symbols' function.
|
|---|
| 201 | This function builds a hash table from the archive symbol table and
|
|---|
| 202 | looks through the list of undefined symbols to see which elements
|
|---|
| 203 | should be included. `_bfd_generic_link_add_archive_symbols' is passed
|
|---|
| 204 | a function to call to make the final decision about adding an archive
|
|---|
| 205 | element to the link and to do the actual work of adding the symbols to
|
|---|
| 206 | the linker hash table.
|
|---|
| 207 |
|
|---|
| 208 | The function passed to `_bfd_generic_link_add_archive_symbols' must
|
|---|
| 209 | read the symbols of the archive element and decide whether the archive
|
|---|
| 210 | element should be included in the link. If the element is to be
|
|---|
| 211 | included, the `add_archive_element' linker callback routine must be
|
|---|
| 212 | called with the element as an argument, and the elements symbols must
|
|---|
| 213 | be added to the linker hash table just as though the element had itself
|
|---|
| 214 | been passed to the `_bfd_link_add_symbols' function.
|
|---|
| 215 |
|
|---|
| 216 | When the a.out `_bfd_link_add_symbols' function receives an archive,
|
|---|
| 217 | it calls `_bfd_generic_link_add_archive_symbols' passing
|
|---|
| 218 | `aout_link_check_archive_element' as the function argument.
|
|---|
| 219 | `aout_link_check_archive_element' calls `aout_link_check_ar_symbols'.
|
|---|
| 220 | If the latter decides to add the element (an element is only added if
|
|---|
| 221 | it provides a real, non-common, definition for a previously undefined
|
|---|
| 222 | or common symbol) it calls the `add_archive_element' callback and then
|
|---|
| 223 | `aout_link_check_archive_element' calls `aout_link_add_symbols' to
|
|---|
| 224 | actually add the symbols to the linker hash table.
|
|---|
| 225 |
|
|---|
| 226 | The ECOFF back end is unusual in that it does not normally call
|
|---|
| 227 | `_bfd_generic_link_add_archive_symbols', because ECOFF archives already
|
|---|
| 228 | contain a hash table of symbols. The ECOFF back end searches the
|
|---|
| 229 | archive itself to avoid the overhead of creating a new hash table.
|
|---|
| 230 |
|
|---|
| 231 |
|
|---|
| 232 | File: bfd.info, Node: Performing the Final Link, Prev: Adding Symbols to the Hash Table, Up: Linker Functions
|
|---|
| 233 |
|
|---|
| 234 | Performing the final link
|
|---|
| 235 | -------------------------
|
|---|
| 236 |
|
|---|
| 237 | When all the input files have been processed, the linker calls the
|
|---|
| 238 | `_bfd_final_link' entry point of the output BFD. This routine is
|
|---|
| 239 | responsible for producing the final output file, which has several
|
|---|
| 240 | aspects. It must relocate the contents of the input sections and copy
|
|---|
| 241 | the data into the output sections. It must build an output symbol
|
|---|
| 242 | table including any local symbols from the input files and the global
|
|---|
| 243 | symbols from the hash table. When producing relocateable output, it
|
|---|
| 244 | must modify the input relocs and write them into the output file.
|
|---|
| 245 | There may also be object format dependent work to be done.
|
|---|
| 246 |
|
|---|
| 247 | The linker will also call the `write_object_contents' entry point
|
|---|
| 248 | when the BFD is closed. The two entry points must work together in
|
|---|
| 249 | order to produce the correct output file.
|
|---|
| 250 |
|
|---|
| 251 | The details of how this works are inevitably dependent upon the
|
|---|
| 252 | specific object file format. The a.out `_bfd_final_link' routine is
|
|---|
| 253 | `NAME(aout,final_link)'.
|
|---|
| 254 |
|
|---|
| 255 | * Menu:
|
|---|
| 256 |
|
|---|
| 257 | * Information provided by the linker::
|
|---|
| 258 | * Relocating the section contents::
|
|---|
| 259 | * Writing the symbol table::
|
|---|
| 260 |
|
|---|
| 261 |
|
|---|
| 262 | File: bfd.info, Node: Information provided by the linker, Next: Relocating the section contents, Prev: Performing the Final Link, Up: Performing the Final Link
|
|---|
| 263 |
|
|---|
| 264 | Information provided by the linker
|
|---|
| 265 | ..................................
|
|---|
| 266 |
|
|---|
| 267 | Before the linker calls the `_bfd_final_link' entry point, it sets
|
|---|
| 268 | up some data structures for the function to use.
|
|---|
| 269 |
|
|---|
| 270 | The `input_bfds' field of the `bfd_link_info' structure will point
|
|---|
| 271 | to a list of all the input files included in the link. These files are
|
|---|
| 272 | linked through the `link_next' field of the `bfd' structure.
|
|---|
| 273 |
|
|---|
| 274 | Each section in the output file will have a list of `link_order'
|
|---|
| 275 | structures attached to the `link_order_head' field (the `link_order'
|
|---|
| 276 | structure is defined in `bfdlink.h'). These structures describe how to
|
|---|
| 277 | create the contents of the output section in terms of the contents of
|
|---|
| 278 | various input sections, fill constants, and, eventually, other types of
|
|---|
| 279 | information. They also describe relocs that must be created by the BFD
|
|---|
| 280 | backend, but do not correspond to any input file; this is used to
|
|---|
| 281 | support -Ur, which builds constructors while generating a relocateable
|
|---|
| 282 | object file.
|
|---|
| 283 |
|
|---|
| 284 |
|
|---|
| 285 | File: bfd.info, Node: Relocating the section contents, Next: Writing the symbol table, Prev: Information provided by the linker, Up: Performing the Final Link
|
|---|
| 286 |
|
|---|
| 287 | Relocating the section contents
|
|---|
| 288 | ...............................
|
|---|
| 289 |
|
|---|
| 290 | The `_bfd_final_link' function should look through the `link_order'
|
|---|
| 291 | structures attached to each section of the output file. Each
|
|---|
| 292 | `link_order' structure should either be handled specially, or it should
|
|---|
| 293 | be passed to the function `_bfd_default_link_order' which will do the
|
|---|
| 294 | right thing (`_bfd_default_link_order' is defined in `linker.c').
|
|---|
| 295 |
|
|---|
| 296 | For efficiency, a `link_order' of type `bfd_indirect_link_order'
|
|---|
| 297 | whose associated section belongs to a BFD of the same format as the
|
|---|
| 298 | output BFD must be handled specially. This type of `link_order'
|
|---|
| 299 | describes part of an output section in terms of a section belonging to
|
|---|
| 300 | one of the input files. The `_bfd_final_link' function should read the
|
|---|
| 301 | contents of the section and any associated relocs, apply the relocs to
|
|---|
| 302 | the section contents, and write out the modified section contents. If
|
|---|
| 303 | performing a relocateable link, the relocs themselves must also be
|
|---|
| 304 | modified and written out.
|
|---|
| 305 |
|
|---|
| 306 | The functions `_bfd_relocate_contents' and
|
|---|
| 307 | `_bfd_final_link_relocate' provide some general support for performing
|
|---|
| 308 | the actual relocations, notably overflow checking. Their arguments
|
|---|
| 309 | include information about the symbol the relocation is against and a
|
|---|
| 310 | `reloc_howto_type' argument which describes the relocation to perform.
|
|---|
| 311 | These functions are defined in `reloc.c'.
|
|---|
| 312 |
|
|---|
| 313 | The a.out function which handles reading, relocating, and writing
|
|---|
| 314 | section contents is `aout_link_input_section'. The actual relocation
|
|---|
| 315 | is done in `aout_link_input_section_std' and
|
|---|
| 316 | `aout_link_input_section_ext'.
|
|---|
| 317 |
|
|---|
| 318 |
|
|---|
| 319 | File: bfd.info, Node: Writing the symbol table, Prev: Relocating the section contents, Up: Performing the Final Link
|
|---|
| 320 |
|
|---|
| 321 | Writing the symbol table
|
|---|
| 322 | ........................
|
|---|
| 323 |
|
|---|
| 324 | The `_bfd_final_link' function must gather all the symbols in the
|
|---|
| 325 | input files and write them out. It must also write out all the symbols
|
|---|
| 326 | in the global hash table. This must be controlled by the `strip' and
|
|---|
| 327 | `discard' fields of the `bfd_link_info' structure.
|
|---|
| 328 |
|
|---|
| 329 | The local symbols of the input files will not have been entered into
|
|---|
| 330 | the linker hash table. The `_bfd_final_link' routine must consider
|
|---|
| 331 | each input file and include the symbols in the output file. It may be
|
|---|
| 332 | convenient to do this when looking through the `link_order' structures,
|
|---|
| 333 | or it may be done by stepping through the `input_bfds' list.
|
|---|
| 334 |
|
|---|
| 335 | The `_bfd_final_link' routine must also traverse the global hash
|
|---|
| 336 | table to gather all the externally visible symbols. It is possible
|
|---|
| 337 | that most of the externally visible symbols may be written out when
|
|---|
| 338 | considering the symbols of each input file, but it is still necessary
|
|---|
| 339 | to traverse the hash table since the linker script may have defined
|
|---|
| 340 | some symbols that are not in any of the input files.
|
|---|
| 341 |
|
|---|
| 342 | The `strip' field of the `bfd_link_info' structure controls which
|
|---|
| 343 | symbols are written out. The possible values are listed in
|
|---|
| 344 | `bfdlink.h'. If the value is `strip_some', then the `keep_hash' field
|
|---|
| 345 | of the `bfd_link_info' structure is a hash table of symbols to keep;
|
|---|
| 346 | each symbol should be looked up in this hash table, and only symbols
|
|---|
| 347 | which are present should be included in the output file.
|
|---|
| 348 |
|
|---|
| 349 | If the `strip' field of the `bfd_link_info' structure permits local
|
|---|
| 350 | symbols to be written out, the `discard' field is used to further
|
|---|
| 351 | controls which local symbols are included in the output file. If the
|
|---|
| 352 | value is `discard_l', then all local symbols which begin with a certain
|
|---|
| 353 | prefix are discarded; this is controlled by the
|
|---|
| 354 | `bfd_is_local_label_name' entry point.
|
|---|
| 355 |
|
|---|
| 356 | The a.out backend handles symbols by calling
|
|---|
| 357 | `aout_link_write_symbols' on each input BFD and then traversing the
|
|---|
| 358 | global hash table with the function `aout_link_write_other_symbol'. It
|
|---|
| 359 | builds a string table while writing out the symbols, which is written
|
|---|
| 360 | to the output file at the end of `NAME(aout,final_link)'.
|
|---|
| 361 |
|
|---|
| 362 | `bfd_link_split_section'
|
|---|
| 363 | ........................
|
|---|
| 364 |
|
|---|
| 365 | *Synopsis*
|
|---|
| 366 | boolean bfd_link_split_section(bfd *abfd, asection *sec);
|
|---|
| 367 | *Description*
|
|---|
| 368 | Return nonzero if SEC should be split during a reloceatable or final
|
|---|
| 369 | link.
|
|---|
| 370 | #define bfd_link_split_section(abfd, sec) \
|
|---|
| 371 | BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
|
|---|
| 372 |
|
|---|
| 373 |
|
|---|
| 374 | File: bfd.info, Node: Hash Tables, Prev: Linker Functions, Up: BFD front end
|
|---|
| 375 |
|
|---|
| 376 | Hash Tables
|
|---|
| 377 | ===========
|
|---|
| 378 |
|
|---|
| 379 | BFD provides a simple set of hash table functions. Routines are
|
|---|
| 380 | provided to initialize a hash table, to free a hash table, to look up a
|
|---|
| 381 | string in a hash table and optionally create an entry for it, and to
|
|---|
| 382 | traverse a hash table. There is currently no routine to delete an
|
|---|
| 383 | string from a hash table.
|
|---|
| 384 |
|
|---|
| 385 | The basic hash table does not permit any data to be stored with a
|
|---|
| 386 | string. However, a hash table is designed to present a base class from
|
|---|
| 387 | which other types of hash tables may be derived. These derived types
|
|---|
| 388 | may store additional information with the string. Hash tables were
|
|---|
| 389 | implemented in this way, rather than simply providing a data pointer in
|
|---|
| 390 | a hash table entry, because they were designed for use by the linker
|
|---|
| 391 | back ends. The linker may create thousands of hash table entries, and
|
|---|
| 392 | the overhead of allocating private data and storing and following
|
|---|
| 393 | pointers becomes noticeable.
|
|---|
| 394 |
|
|---|
| 395 | The basic hash table code is in `hash.c'.
|
|---|
| 396 |
|
|---|
| 397 | * Menu:
|
|---|
| 398 |
|
|---|
| 399 | * Creating and Freeing a Hash Table::
|
|---|
| 400 | * Looking Up or Entering a String::
|
|---|
| 401 | * Traversing a Hash Table::
|
|---|
| 402 | * Deriving a New Hash Table Type::
|
|---|
| 403 |
|
|---|
| 404 |
|
|---|
| 405 | File: bfd.info, Node: Creating and Freeing a Hash Table, Next: Looking Up or Entering a String, Prev: Hash Tables, Up: Hash Tables
|
|---|
| 406 |
|
|---|
| 407 | Creating and freeing a hash table
|
|---|
| 408 | ---------------------------------
|
|---|
| 409 |
|
|---|
| 410 | To create a hash table, create an instance of a `struct
|
|---|
| 411 | bfd_hash_table' (defined in `bfd.h') and call `bfd_hash_table_init' (if
|
|---|
| 412 | you know approximately how many entries you will need, the function
|
|---|
| 413 | `bfd_hash_table_init_n', which takes a SIZE argument, may be used).
|
|---|
| 414 | `bfd_hash_table_init' returns `false' if some sort of error occurs.
|
|---|
| 415 |
|
|---|
| 416 | The function `bfd_hash_table_init' take as an argument a function to
|
|---|
| 417 | use to create new entries. For a basic hash table, use the function
|
|---|
| 418 | `bfd_hash_newfunc'. *Note Deriving a New Hash Table Type::, for why
|
|---|
| 419 | you would want to use a different value for this argument.
|
|---|
| 420 |
|
|---|
| 421 | `bfd_hash_table_init' will create an objalloc which will be used to
|
|---|
| 422 | allocate new entries. You may allocate memory on this objalloc using
|
|---|
| 423 | `bfd_hash_allocate'.
|
|---|
| 424 |
|
|---|
| 425 | Use `bfd_hash_table_free' to free up all the memory that has been
|
|---|
| 426 | allocated for a hash table. This will not free up the `struct
|
|---|
| 427 | bfd_hash_table' itself, which you must provide.
|
|---|
| 428 |
|
|---|
| 429 |
|
|---|
| 430 | 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
|
|---|
| 431 |
|
|---|
| 432 | Looking up or entering a string
|
|---|
| 433 | -------------------------------
|
|---|
| 434 |
|
|---|
| 435 | The function `bfd_hash_lookup' is used both to look up a string in
|
|---|
| 436 | the hash table and to create a new entry.
|
|---|
| 437 |
|
|---|
| 438 | If the CREATE argument is `false', `bfd_hash_lookup' will look up a
|
|---|
| 439 | string. If the string is found, it will returns a pointer to a `struct
|
|---|
| 440 | bfd_hash_entry'. If the string is not found in the table
|
|---|
| 441 | `bfd_hash_lookup' will return `NULL'. You should not modify any of the
|
|---|
| 442 | fields in the returns `struct bfd_hash_entry'.
|
|---|
| 443 |
|
|---|
| 444 | If the CREATE argument is `true', the string will be entered into
|
|---|
| 445 | the hash table if it is not already there. Either way a pointer to a
|
|---|
| 446 | `struct bfd_hash_entry' will be returned, either to the existing
|
|---|
| 447 | structure or to a newly created one. In this case, a `NULL' return
|
|---|
| 448 | means that an error occurred.
|
|---|
| 449 |
|
|---|
| 450 | If the CREATE argument is `true', and a new entry is created, the
|
|---|
| 451 | COPY argument is used to decide whether to copy the string onto the
|
|---|
| 452 | hash table objalloc or not. If COPY is passed as `false', you must be
|
|---|
| 453 | careful not to deallocate or modify the string as long as the hash table
|
|---|
| 454 | exists.
|
|---|
| 455 |
|
|---|
| 456 |
|
|---|
| 457 | 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
|
|---|
| 458 |
|
|---|
| 459 | Traversing a hash table
|
|---|
| 460 | -----------------------
|
|---|
| 461 |
|
|---|
| 462 | The function `bfd_hash_traverse' may be used to traverse a hash
|
|---|
| 463 | table, calling a function on each element. The traversal is done in a
|
|---|
| 464 | random order.
|
|---|
| 465 |
|
|---|
| 466 | `bfd_hash_traverse' takes as arguments a function and a generic
|
|---|
| 467 | `void *' pointer. The function is called with a hash table entry (a
|
|---|
| 468 | `struct bfd_hash_entry *') and the generic pointer passed to
|
|---|
| 469 | `bfd_hash_traverse'. The function must return a `boolean' value, which
|
|---|
| 470 | indicates whether to continue traversing the hash table. If the
|
|---|
| 471 | function returns `false', `bfd_hash_traverse' will stop the traversal
|
|---|
| 472 | and return immediately.
|
|---|
| 473 |
|
|---|
| 474 |
|
|---|
| 475 | File: bfd.info, Node: Deriving a New Hash Table Type, Prev: Traversing a Hash Table, Up: Hash Tables
|
|---|
| 476 |
|
|---|
| 477 | Deriving a new hash table type
|
|---|
| 478 | ------------------------------
|
|---|
| 479 |
|
|---|
| 480 | Many uses of hash tables want to store additional information which
|
|---|
| 481 | each entry in the hash table. Some also find it convenient to store
|
|---|
| 482 | additional information with the hash table itself. This may be done
|
|---|
| 483 | using a derived hash table.
|
|---|
| 484 |
|
|---|
| 485 | Since C is not an object oriented language, creating a derived hash
|
|---|
| 486 | table requires sticking together some boilerplate routines with a few
|
|---|
| 487 | differences specific to the type of hash table you want to create.
|
|---|
| 488 |
|
|---|
| 489 | An example of a derived hash table is the linker hash table. The
|
|---|
| 490 | structures for this are defined in `bfdlink.h'. The functions are in
|
|---|
| 491 | `linker.c'.
|
|---|
| 492 |
|
|---|
| 493 | You may also derive a hash table from an already derived hash table.
|
|---|
| 494 | For example, the a.out linker backend code uses a hash table derived
|
|---|
| 495 | from the linker hash table.
|
|---|
| 496 |
|
|---|
| 497 | * Menu:
|
|---|
| 498 |
|
|---|
| 499 | * Define the Derived Structures::
|
|---|
| 500 | * Write the Derived Creation Routine::
|
|---|
| 501 | * Write Other Derived Routines::
|
|---|
| 502 |
|
|---|
| 503 |
|
|---|
| 504 | 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
|
|---|
| 505 |
|
|---|
| 506 | Define the derived structures
|
|---|
| 507 | .............................
|
|---|
| 508 |
|
|---|
| 509 | You must define a structure for an entry in the hash table, and a
|
|---|
| 510 | structure for the hash table itself.
|
|---|
| 511 |
|
|---|
| 512 | The first field in the structure for an entry in the hash table must
|
|---|
| 513 | be of the type used for an entry in the hash table you are deriving
|
|---|
| 514 | from. If you are deriving from a basic hash table this is `struct
|
|---|
| 515 | bfd_hash_entry', which is defined in `bfd.h'. The first field in the
|
|---|
| 516 | structure for the hash table itself must be of the type of the hash
|
|---|
| 517 | table you are deriving from itself. If you are deriving from a basic
|
|---|
| 518 | hash table, this is `struct bfd_hash_table'.
|
|---|
| 519 |
|
|---|
| 520 | For example, the linker hash table defines `struct
|
|---|
| 521 | bfd_link_hash_entry' (in `bfdlink.h'). The first field, `root', is of
|
|---|
| 522 | type `struct bfd_hash_entry'. Similarly, the first field in `struct
|
|---|
| 523 | bfd_link_hash_table', `table', is of type `struct bfd_hash_table'.
|
|---|
| 524 |
|
|---|
| 525 |
|
|---|
| 526 | 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
|
|---|
| 527 |
|
|---|
| 528 | Write the derived creation routine
|
|---|
| 529 | ..................................
|
|---|
| 530 |
|
|---|
| 531 | You must write a routine which will create and initialize an entry
|
|---|
| 532 | in the hash table. This routine is passed as the function argument to
|
|---|
| 533 | `bfd_hash_table_init'.
|
|---|
| 534 |
|
|---|
| 535 | In order to permit other hash tables to be derived from the hash
|
|---|
| 536 | table you are creating, this routine must be written in a standard way.
|
|---|
| 537 |
|
|---|
| 538 | The first argument to the creation routine is a pointer to a hash
|
|---|
| 539 | table entry. This may be `NULL', in which case the routine should
|
|---|
| 540 | allocate the right amount of space. Otherwise the space has already
|
|---|
| 541 | been allocated by a hash table type derived from this one.
|
|---|
| 542 |
|
|---|
| 543 | After allocating space, the creation routine must call the creation
|
|---|
| 544 | routine of the hash table type it is derived from, passing in a pointer
|
|---|
| 545 | to the space it just allocated. This will initialize any fields used
|
|---|
| 546 | by the base hash table.
|
|---|
| 547 |
|
|---|
| 548 | Finally the creation routine must initialize any local fields for
|
|---|
| 549 | the new hash table type.
|
|---|
| 550 |
|
|---|
| 551 | Here is a boilerplate example of a creation routine. FUNCTION_NAME
|
|---|
| 552 | is the name of the routine. ENTRY_TYPE is the type of an entry in the
|
|---|
| 553 | hash table you are creating. BASE_NEWFUNC is the name of the creation
|
|---|
| 554 | routine of the hash table type your hash table is derived from.
|
|---|
| 555 |
|
|---|
| 556 | struct bfd_hash_entry *
|
|---|
| 557 | FUNCTION_NAME (entry, table, string)
|
|---|
| 558 | struct bfd_hash_entry *entry;
|
|---|
| 559 | struct bfd_hash_table *table;
|
|---|
| 560 | const char *string;
|
|---|
| 561 | {
|
|---|
| 562 | struct ENTRY_TYPE *ret = (ENTRY_TYPE *) entry;
|
|---|
| 563 |
|
|---|
| 564 | /* Allocate the structure if it has not already been allocated by a
|
|---|
| 565 | derived class. */
|
|---|
| 566 | if (ret == (ENTRY_TYPE *) NULL)
|
|---|
| 567 | {
|
|---|
| 568 | ret = ((ENTRY_TYPE *)
|
|---|
| 569 | bfd_hash_allocate (table, sizeof (ENTRY_TYPE)));
|
|---|
| 570 | if (ret == (ENTRY_TYPE *) NULL)
|
|---|
| 571 | return NULL;
|
|---|
| 572 | }
|
|---|
| 573 |
|
|---|
| 574 | /* Call the allocation method of the base class. */
|
|---|
| 575 | ret = ((ENTRY_TYPE *)
|
|---|
| 576 | BASE_NEWFUNC ((struct bfd_hash_entry *) ret, table, string));
|
|---|
| 577 |
|
|---|
| 578 | /* Initialize the local fields here. */
|
|---|
| 579 |
|
|---|
| 580 | return (struct bfd_hash_entry *) ret;
|
|---|
| 581 | }
|
|---|
| 582 | *Description*
|
|---|
| 583 | The creation routine for the linker hash table, which is in `linker.c',
|
|---|
| 584 | looks just like this example. FUNCTION_NAME is
|
|---|
| 585 | `_bfd_link_hash_newfunc'. ENTRY_TYPE is `struct bfd_link_hash_entry'.
|
|---|
| 586 | BASE_NEWFUNC is `bfd_hash_newfunc', the creation routine for a basic
|
|---|
| 587 | hash table.
|
|---|
| 588 |
|
|---|
| 589 | `_bfd_link_hash_newfunc' also initializes the local fields in a
|
|---|
| 590 | linker hash table entry: `type', `written' and `next'.
|
|---|
| 591 |
|
|---|
| 592 |
|
|---|
| 593 | File: bfd.info, Node: Write Other Derived Routines, Prev: Write the Derived Creation Routine, Up: Deriving a New Hash Table Type
|
|---|
| 594 |
|
|---|
| 595 | Write other derived routines
|
|---|
| 596 | ............................
|
|---|
| 597 |
|
|---|
| 598 | You will want to write other routines for your new hash table, as
|
|---|
| 599 | well.
|
|---|
| 600 |
|
|---|
| 601 | You will want an initialization routine which calls the
|
|---|
| 602 | initialization routine of the hash table you are deriving from and
|
|---|
| 603 | initializes any other local fields. For the linker hash table, this is
|
|---|
| 604 | `_bfd_link_hash_table_init' in `linker.c'.
|
|---|
| 605 |
|
|---|
| 606 | You will want a lookup routine which calls the lookup routine of the
|
|---|
| 607 | hash table you are deriving from and casts the result. The linker hash
|
|---|
| 608 | table uses `bfd_link_hash_lookup' in `linker.c' (this actually takes an
|
|---|
| 609 | additional argument which it uses to decide how to return the looked up
|
|---|
| 610 | value).
|
|---|
| 611 |
|
|---|
| 612 | You may want a traversal routine. This should just call the
|
|---|
| 613 | traversal routine of the hash table you are deriving from with
|
|---|
| 614 | appropriate casts. The linker hash table uses `bfd_link_hash_traverse'
|
|---|
| 615 | in `linker.c'.
|
|---|
| 616 |
|
|---|
| 617 | These routines may simply be defined as macros. For example, the
|
|---|
| 618 | a.out backend linker hash table, which is derived from the linker hash
|
|---|
| 619 | table, uses macros for the lookup and traversal routines. These are
|
|---|
| 620 | `aout_link_hash_lookup' and `aout_link_hash_traverse' in aoutx.h.
|
|---|
| 621 |
|
|---|
| 622 |
|
|---|
| 623 | File: bfd.info, Node: BFD back ends, Next: GNU Free Documentation License, Prev: BFD front end, Up: Top
|
|---|
| 624 |
|
|---|
| 625 | BFD back ends
|
|---|
| 626 | *************
|
|---|
| 627 |
|
|---|
| 628 | * Menu:
|
|---|
| 629 |
|
|---|
| 630 | * What to Put Where::
|
|---|
| 631 | * aout :: a.out backends
|
|---|
| 632 | * coff :: coff backends
|
|---|
| 633 | * elf :: elf backends
|
|---|
| 634 |
|
|---|
| 635 |
|
|---|
| 636 | File: bfd.info, Node: What to Put Where, Next: aout, Prev: BFD back ends, Up: BFD back ends
|
|---|
| 637 |
|
|---|
| 638 | All of BFD lives in one directory.
|
|---|
| 639 |
|
|---|
| 640 |
|
|---|
| 641 | File: bfd.info, Node: aout, Next: coff, Prev: What to Put Where, Up: BFD back ends
|
|---|
| 642 |
|
|---|
| 643 | a.out backends
|
|---|
| 644 | ==============
|
|---|
| 645 |
|
|---|
| 646 | *Description*
|
|---|
| 647 | BFD supports a number of different flavours of a.out format, though the
|
|---|
| 648 | major differences are only the sizes of the structures on disk, and the
|
|---|
| 649 | shape of the relocation information.
|
|---|
| 650 |
|
|---|
| 651 | The support is split into a basic support file `aoutx.h' and other
|
|---|
| 652 | files which derive functions from the base. One derivation file is
|
|---|
| 653 | `aoutf1.h' (for a.out flavour 1), and adds to the basic a.out functions
|
|---|
| 654 | support for sun3, sun4, 386 and 29k a.out files, to create a target
|
|---|
| 655 | jump vector for a specific target.
|
|---|
| 656 |
|
|---|
| 657 | This information is further split out into more specific files for
|
|---|
| 658 | each machine, including `sunos.c' for sun3 and sun4, `newsos3.c' for
|
|---|
| 659 | the Sony NEWS, and `demo64.c' for a demonstration of a 64 bit a.out
|
|---|
| 660 | format.
|
|---|
| 661 |
|
|---|
| 662 | The base file `aoutx.h' defines general mechanisms for reading and
|
|---|
| 663 | writing records to and from disk and various other methods which BFD
|
|---|
| 664 | requires. It is included by `aout32.c' and `aout64.c' to form the names
|
|---|
| 665 | `aout_32_swap_exec_header_in', `aout_64_swap_exec_header_in', etc.
|
|---|
| 666 |
|
|---|
| 667 | As an example, this is what goes on to make the back end for a sun4,
|
|---|
| 668 | from `aout32.c':
|
|---|
| 669 |
|
|---|
| 670 | #define ARCH_SIZE 32
|
|---|
| 671 | #include "aoutx.h"
|
|---|
| 672 |
|
|---|
| 673 | Which exports names:
|
|---|
| 674 |
|
|---|
| 675 | ...
|
|---|
| 676 | aout_32_canonicalize_reloc
|
|---|
| 677 | aout_32_find_nearest_line
|
|---|
| 678 | aout_32_get_lineno
|
|---|
| 679 | aout_32_get_reloc_upper_bound
|
|---|
| 680 | ...
|
|---|
| 681 |
|
|---|
| 682 | from `sunos.c':
|
|---|
| 683 |
|
|---|
| 684 | #define TARGET_NAME "a.out-sunos-big"
|
|---|
| 685 | #define VECNAME sunos_big_vec
|
|---|
| 686 | #include "aoutf1.h"
|
|---|
| 687 |
|
|---|
| 688 | requires all the names from `aout32.c', and produces the jump vector
|
|---|
| 689 |
|
|---|
| 690 | sunos_big_vec
|
|---|
| 691 |
|
|---|
| 692 | The file `host-aout.c' is a special case. It is for a large set of
|
|---|
| 693 | hosts that use "more or less standard" a.out files, and for which
|
|---|
| 694 | cross-debugging is not interesting. It uses the standard 32-bit a.out
|
|---|
| 695 | support routines, but determines the file offsets and addresses of the
|
|---|
| 696 | text, data, and BSS sections, the machine architecture and machine
|
|---|
| 697 | type, and the entry point address, in a host-dependent manner. Once
|
|---|
| 698 | these values have been determined, generic code is used to handle the
|
|---|
| 699 | object file.
|
|---|
| 700 |
|
|---|
| 701 | When porting it to run on a new system, you must supply:
|
|---|
| 702 |
|
|---|
| 703 | HOST_PAGE_SIZE
|
|---|
| 704 | HOST_SEGMENT_SIZE
|
|---|
| 705 | HOST_MACHINE_ARCH (optional)
|
|---|
| 706 | HOST_MACHINE_MACHINE (optional)
|
|---|
| 707 | HOST_TEXT_START_ADDR
|
|---|
| 708 | HOST_STACK_END_ADDR
|
|---|
| 709 |
|
|---|
| 710 | in the file `../include/sys/h-XXX.h' (for your host). These values,
|
|---|
| 711 | plus the structures and macros defined in `a.out.h' on your host
|
|---|
| 712 | system, will produce a BFD target that will access ordinary a.out files
|
|---|
| 713 | on your host. To configure a new machine to use `host-aout.c', specify:
|
|---|
| 714 |
|
|---|
| 715 | TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec
|
|---|
| 716 | TDEPFILES= host-aout.o trad-core.o
|
|---|
| 717 |
|
|---|
| 718 | in the `config/XXX.mt' file, and modify `configure.in' to use the
|
|---|
| 719 | `XXX.mt' file (by setting "`bfd_target=XXX'") when your configuration
|
|---|
| 720 | is selected.
|
|---|
| 721 |
|
|---|
| 722 | Relocations
|
|---|
| 723 | -----------
|
|---|
| 724 |
|
|---|
| 725 | *Description*
|
|---|
| 726 | The file `aoutx.h' provides for both the _standard_ and _extended_
|
|---|
| 727 | forms of a.out relocation records.
|
|---|
| 728 |
|
|---|
| 729 | The standard records contain only an address, a symbol index, and a
|
|---|
| 730 | type field. The extended records (used on 29ks and sparcs) also have a
|
|---|
| 731 | full integer for an addend.
|
|---|
| 732 |
|
|---|
| 733 | Internal entry points
|
|---|
| 734 | ---------------------
|
|---|
| 735 |
|
|---|
| 736 | *Description*
|
|---|
| 737 | `aoutx.h' exports several routines for accessing the contents of an
|
|---|
| 738 | a.out file, which are gathered and exported in turn by various format
|
|---|
| 739 | specific files (eg sunos.c).
|
|---|
| 740 |
|
|---|
| 741 | `aout_SIZE_swap_exec_header_in'
|
|---|
| 742 | ...............................
|
|---|
| 743 |
|
|---|
| 744 | *Synopsis*
|
|---|
| 745 | void aout_SIZE_swap_exec_header_in,
|
|---|
| 746 | (bfd *abfd,
|
|---|
| 747 | struct external_exec *raw_bytes,
|
|---|
| 748 | struct internal_exec *execp);
|
|---|
| 749 | *Description*
|
|---|
| 750 | Swap the information in an executable header RAW_BYTES taken from a raw
|
|---|
| 751 | byte stream memory image into the internal exec header structure EXECP.
|
|---|
| 752 |
|
|---|
| 753 | `aout_SIZE_swap_exec_header_out'
|
|---|
| 754 | ................................
|
|---|
| 755 |
|
|---|
| 756 | *Synopsis*
|
|---|
| 757 | void aout_SIZE_swap_exec_header_out
|
|---|
| 758 | (bfd *abfd,
|
|---|
| 759 | struct internal_exec *execp,
|
|---|
| 760 | struct external_exec *raw_bytes);
|
|---|
| 761 | *Description*
|
|---|
| 762 | Swap the information in an internal exec header structure EXECP into
|
|---|
| 763 | the buffer RAW_BYTES ready for writing to disk.
|
|---|
| 764 |
|
|---|
| 765 | `aout_SIZE_some_aout_object_p'
|
|---|
| 766 | ..............................
|
|---|
| 767 |
|
|---|
| 768 | *Synopsis*
|
|---|
| 769 | const bfd_target *aout_SIZE_some_aout_object_p
|
|---|
| 770 | (bfd *abfd,
|
|---|
| 771 | const bfd_target *(*callback_to_real_object_p) ());
|
|---|
| 772 | *Description*
|
|---|
| 773 | Some a.out variant thinks that the file open in ABFD checking is an
|
|---|
| 774 | a.out file. Do some more checking, and set up for access if it really
|
|---|
| 775 | is. Call back to the calling environment's "finish up" function just
|
|---|
| 776 | before returning, to handle any last-minute setup.
|
|---|
| 777 |
|
|---|
| 778 | `aout_SIZE_mkobject'
|
|---|
| 779 | ....................
|
|---|
| 780 |
|
|---|
| 781 | *Synopsis*
|
|---|
| 782 | boolean aout_SIZE_mkobject, (bfd *abfd);
|
|---|
| 783 | *Description*
|
|---|
| 784 | Initialize BFD ABFD for use with a.out files.
|
|---|
| 785 |
|
|---|
| 786 | `aout_SIZE_machine_type'
|
|---|
| 787 | ........................
|
|---|
| 788 |
|
|---|
| 789 | *Synopsis*
|
|---|
| 790 | enum machine_type aout_SIZE_machine_type
|
|---|
| 791 | (enum bfd_architecture arch,
|
|---|
| 792 | unsigned long machine));
|
|---|
| 793 | *Description*
|
|---|
| 794 | Keep track of machine architecture and machine type for a.out's. Return
|
|---|
| 795 | the `machine_type' for a particular architecture and machine, or
|
|---|
| 796 | `M_UNKNOWN' if that exact architecture and machine can't be represented
|
|---|
| 797 | in a.out format.
|
|---|
| 798 |
|
|---|
| 799 | If the architecture is understood, machine type 0 (default) is
|
|---|
| 800 | always understood.
|
|---|
| 801 |
|
|---|
| 802 | `aout_SIZE_set_arch_mach'
|
|---|
| 803 | .........................
|
|---|
| 804 |
|
|---|
| 805 | *Synopsis*
|
|---|
| 806 | boolean aout_SIZE_set_arch_mach,
|
|---|
| 807 | (bfd *,
|
|---|
| 808 | enum bfd_architecture arch,
|
|---|
| 809 | unsigned long machine));
|
|---|
| 810 | *Description*
|
|---|
| 811 | Set the architecture and the machine of the BFD ABFD to the values ARCH
|
|---|
| 812 | and MACHINE. Verify that ABFD's format can support the architecture
|
|---|
| 813 | required.
|
|---|
| 814 |
|
|---|
| 815 | `aout_SIZE_new_section_hook'
|
|---|
| 816 | ............................
|
|---|
| 817 |
|
|---|
| 818 | *Synopsis*
|
|---|
| 819 | boolean aout_SIZE_new_section_hook,
|
|---|
| 820 | (bfd *abfd,
|
|---|
| 821 | asection *newsect));
|
|---|
| 822 | *Description*
|
|---|
| 823 | Called by the BFD in response to a `bfd_make_section' request.
|
|---|
| 824 |
|
|---|