Changeset 609 for branches/GNU/src/binutils/bfd/elf-bfd.h
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/bfd/elf-bfd.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* BFD back-end data structures for ELF files. 2 Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 3 Free Software Foundation, Inc.2 Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 3 2002, 2003 Free Software Foundation, Inc. 4 4 Written by Cygnus Support. 5 5 6 This file is part of BFD, the Binary File Descriptor library.7 8 This program is free software; you can redistribute it and/or modify9 it under the terms of the GNU General Public License as published by10 the Free Software Foundation; either version 2 of the License, or11 (at your option) any later version.12 13 This program is distributed in the hope that it will be useful,14 but WITHOUT ANY WARRANTY; without even the implied warranty of15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16 GNU General Public License for more details.17 18 You should have received a copy of the GNU General Public License19 along with this program; if not, write to the Free Software20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */6 This file is part of BFD, the Binary File Descriptor library. 7 8 This program is free software; you can redistribute it and/or modify 9 it under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2 of the License, or 11 (at your option) any later version. 12 13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 21 21 22 22 #ifndef _LIBELF_H_ … … 29 29 30 30 /* The number of entries in a section is its size divided by the size 31 of a single entry. This is normally only applica able to reloc and31 of a single entry. This is normally only applicable to reloc and 32 32 symbol table sections. */ 33 33 #define NUM_SHDR_ENTRIES(shdr) ((shdr)->sh_size / (shdr)->sh_entsize) 34 34 35 35 /* If size isn't specified as 64 or 32, NAME macro should fail. */ 36 /* Do not "beautify" the CONCAT* macro args. Traditional C will not 37 remove whitespace added here, and thus will fail to concatenate 38 the tokens. */ 36 39 #ifndef NAME 37 40 #if ARCH_SIZE==64 38 #define NAME(x,y) C AT4(x,64,_,y)41 #define NAME(x,y) CONCAT4 (x,64,_,y) 39 42 #endif 40 43 #if ARCH_SIZE==32 41 #define NAME(x,y) C AT4(x,32,_,y)44 #define NAME(x,y) CONCAT4 (x,32,_,y) 42 45 #endif 43 46 #endif 44 47 45 48 #ifndef NAME 46 #define NAME(x,y) C AT4(x,NOSIZE,_,y)49 #define NAME(x,y) CONCAT4 (x,NOSIZE,_,y) 47 50 #endif 48 51 … … 78 81 79 82 83 struct elf_strtab_hash; 84 struct got_entry; 85 struct plt_entry; 86 80 87 /* ELF linker hash table entries. */ 81 88 … … 87 94 set to -2 if the symbol is used by a reloc. */ 88 95 long indx; 89 90 /* Symbol size. */91 bfd_size_type size;92 96 93 97 /* Symbol index as a dynamic symbol. Initialized to -1, and remains … … 108 112 unsigned long dynstr_index; 109 113 114 /* Hash value of the name computed using the ELF hash function. */ 115 unsigned long elf_hash_value; 116 110 117 /* If this is a weak defined symbol from a dynamic object, this 111 118 field points to a defined symbol with the same value, if there is 112 119 one. Otherwise it is NULL. */ 113 120 struct elf_link_hash_entry *weakdef; 114 115 /* If this symbol requires an entry in the global offset table, the116 processor specific backend uses this field to track usage and117 final offset. We use a union and two names primarily to document118 the intent of any particular piece of code. The field should be119 used as a count until size_dynamic_sections, at which point the120 contents of the .got is fixed. Afterward, if this field is -1,121 then the symbol does not require a global offset table entry. */122 union123 {124 bfd_signed_vma refcount;125 bfd_vma offset;126 } got;127 128 /* Same, but tracks a procedure linkage table entry. */129 union130 {131 bfd_signed_vma refcount;132 bfd_vma offset;133 } plt;134 121 135 122 /* If this symbol is used in the linker created sections, the processor … … 156 143 via offset/sizeof(target_void_pointer). */ 157 144 size_t vtable_entries_size; 158 b oolean *vtable_entries_used;145 bfd_boolean *vtable_entries_used; 159 146 160 147 /* Virtual table derivation info. */ 161 148 struct elf_link_hash_entry *vtable_parent; 162 149 150 /* If this symbol requires an entry in the global offset table, the 151 processor specific backend uses this field to track usage and 152 final offset. Two schemes are supported: The first assumes that 153 a symbol may only have one GOT entry, and uses REFCOUNT until 154 size_dynamic_sections, at which point the contents of the .got is 155 fixed. Afterward, if OFFSET is -1, then the symbol does not 156 require a global offset table entry. The second scheme allows 157 multiple GOT entries per symbol, managed via a linked list 158 pointed to by GLIST. */ 159 union gotplt_union 160 { 161 bfd_signed_vma refcount; 162 bfd_vma offset; 163 struct got_entry *glist; 164 struct plt_entry *plist; 165 } got; 166 167 /* Same, but tracks a procedure linkage table entry. */ 168 union gotplt_union plt; 169 170 /* Symbol size. */ 171 bfd_size_type size; 172 163 173 /* Symbol type (STT_NOTYPE, STT_OBJECT, etc.). */ 164 174 char type; … … 166 176 /* Symbol st_other value, symbol visibility. */ 167 177 unsigned char other; 168 169 /* Hash value of the name computed using the ELF hash function. */170 unsigned long elf_hash_value;171 178 172 179 /* Some flags; legal values follow. */ … … 199 206 not currently set by all the backends. */ 200 207 #define ELF_LINK_NON_GOT_REF 010000 208 /* Symbol has a definition in a shared object. */ 209 #define ELF_LINK_DYNAMIC_DEF 020000 210 /* Symbol is weak in all shared objects. */ 211 #define ELF_LINK_DYNAMIC_WEAK 040000 201 212 }; 202 213 … … 220 231 }; 221 232 233 struct elf_link_loaded_list 234 { 235 struct elf_link_loaded_list *next; 236 bfd *abfd; 237 }; 238 239 /* Structures used by the eh_frame optimization code. */ 240 struct cie_header 241 { 242 unsigned int length; 243 unsigned int id; 244 }; 245 246 struct cie 247 { 248 struct cie_header hdr; 249 unsigned char version; 250 unsigned char augmentation[20]; 251 unsigned int code_align; 252 int data_align; 253 unsigned int ra_column; 254 unsigned int augmentation_size; 255 struct elf_link_hash_entry *personality; 256 unsigned char per_encoding; 257 unsigned char lsda_encoding; 258 unsigned char fde_encoding; 259 unsigned char initial_insn_length; 260 unsigned char make_relative; 261 unsigned char make_lsda_relative; 262 unsigned char initial_instructions[50]; 263 }; 264 265 struct eh_cie_fde 266 { 267 unsigned int offset; 268 unsigned int size; 269 asection *sec; 270 unsigned int new_offset; 271 unsigned char fde_encoding; 272 unsigned char lsda_encoding; 273 unsigned char lsda_offset; 274 unsigned char cie : 1; 275 unsigned char removed : 1; 276 unsigned char make_relative : 1; 277 unsigned char make_lsda_relative : 1; 278 unsigned char per_encoding_relative : 1; 279 }; 280 281 struct eh_frame_sec_info 282 { 283 unsigned int count; 284 unsigned int alloced; 285 struct eh_cie_fde entry[1]; 286 }; 287 288 struct eh_frame_array_ent 289 { 290 bfd_vma initial_loc; 291 bfd_vma fde; 292 }; 293 294 struct eh_frame_hdr_info 295 { 296 struct cie last_cie; 297 asection *last_cie_sec; 298 asection *hdr_sec; 299 unsigned int last_cie_offset; 300 unsigned int fde_count, array_count; 301 struct eh_frame_array_ent *array; 302 /* TRUE if .eh_frame_hdr should contain the sorted search table. 303 We build it if we successfully read all .eh_frame input sections 304 and recognize them. */ 305 bfd_boolean table; 306 }; 307 308 /* Cached start, size and alignment of PT_TLS segment. */ 309 struct elf_link_tls_segment 310 { 311 bfd_vma start; 312 bfd_size_type size; 313 unsigned int align; 314 }; 315 222 316 /* ELF linker hash table. */ 223 317 … … 225 319 { 226 320 struct bfd_link_hash_table root; 321 227 322 /* Whether we have created the special dynamic sections required 228 323 when linking against or generating a shared object. */ 229 boolean dynamic_sections_created; 324 bfd_boolean dynamic_sections_created; 325 230 326 /* The BFD used to hold special sections created by the linker. 231 327 This will be the first BFD found which requires these sections to 232 328 be created. */ 233 329 bfd *dynobj; 330 331 /* The value to use when initialising got.refcount/offset and 332 plt.refcount/offset in an elf_link_hash_entry. Set to zero when 333 the values are refcounts. Set to init_offset in 334 size_dynamic_sections when the values may be offsets. */ 335 union gotplt_union init_refcount; 336 337 /* The value to use for got.refcount/offset and plt.refcount/offset 338 when the values may be offsets. Normally (bfd_vma) -1. */ 339 union gotplt_union init_offset; 340 234 341 /* The number of symbols found in the link which must be put into 235 342 the .dynsym section. */ 236 343 bfd_size_type dynsymcount; 344 237 345 /* The string table of dynamic symbols, which becomes the .dynstr 238 346 section. */ 239 struct bfd_strtab_hash *dynstr; 347 struct elf_strtab_hash *dynstr; 348 240 349 /* The number of buckets in the hash table in the .hash section. 241 350 This is based on the number of dynamic symbols. */ 242 351 bfd_size_type bucketcount; 352 243 353 /* A linked list of DT_NEEDED names found in dynamic objects 244 354 included in the link. */ 245 355 struct bfd_link_needed_list *needed; 356 246 357 /* The _GLOBAL_OFFSET_TABLE_ symbol. */ 247 358 struct elf_link_hash_entry *hgot; 359 248 360 /* A pointer to information used to link stabs in sections. */ 249 361 PTR stab_info; 362 363 /* A pointer to information used to merge SEC_MERGE sections. */ 364 PTR merge_info; 365 366 /* Used by eh_frame code when editing .eh_frame. */ 367 struct eh_frame_hdr_info eh_info; 368 250 369 /* A linked list of local symbols to be added to .dynsym. */ 251 370 struct elf_link_local_dynamic_entry *dynlocal; 371 252 372 /* A linked list of DT_RPATH/DT_RUNPATH names found in dynamic 253 373 objects included in the link. */ 254 374 struct bfd_link_needed_list *runpath; 375 376 /* Cached start, size and alignment of PT_TLS segment. */ 377 struct elf_link_tls_segment *tls_segment; 378 379 /* A linked list of BFD's loaded in the link. */ 380 struct elf_link_loaded_list *loaded; 255 381 }; 256 382 … … 267 393 (bfd_link_hash_traverse \ 268 394 (&(table)->root, \ 269 (b oolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func),\395 (bfd_boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \ 270 396 (info))) 271 397 … … 273 399 274 400 #define elf_hash_table(p) ((struct elf_link_hash_table *) ((p)->hash)) 401 402 /* Returns TRUE if the hash table is a struct elf_link_hash_table. */ 403 #define is_elf_hash_table(p) \ 404 ((p)->hash->type == bfd_link_elf_hash_table) 405 406 /* Used by bfd_section_from_r_symndx to cache a small number of local 407 symbol to section mappings. */ 408 #define LOCAL_SYM_CACHE_SIZE 32 409 struct sym_sec_cache 410 { 411 bfd *abfd; 412 unsigned long indx[LOCAL_SYM_CACHE_SIZE]; 413 asection *sec[LOCAL_SYM_CACHE_SIZE]; 414 }; 275 415 276 416 … … 287 427 relocation entry. */ 288 428 unsigned char int_rels_per_ext_rel; 429 /* We use some fixed size arrays. This should be large enough to 430 handle all back-ends. */ 431 #define MAX_INT_RELS_PER_EXT_REL 3 289 432 290 433 unsigned char arch_size, file_align; 291 434 unsigned char elfclass, ev_current; 292 int (*write_out_phdrs) PARAMS ((bfd *, const Elf_Internal_Phdr *, int)); 293 boolean (*write_shdrs_and_ehdr) PARAMS ((bfd *)); 294 void (*write_relocs) PARAMS ((bfd *, asection *, PTR)); 295 void (*swap_symbol_out) PARAMS ((bfd *, const Elf_Internal_Sym *, PTR)); 296 boolean (*slurp_reloc_table) 297 PARAMS ((bfd *, asection *, asymbol **, boolean)); 298 long (*slurp_symbol_table) PARAMS ((bfd *, asymbol **, boolean)); 299 void (*swap_dyn_in) PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *)); 300 void (*swap_dyn_out) PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR)); 301 302 /* This function, if defined, is called to swap in a REL 303 relocation. If an external relocation corresponds to more than 304 one internal relocation, then all relocations are swapped in at 305 once. */ 435 int (*write_out_phdrs) 436 PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int)); 437 bfd_boolean (*write_shdrs_and_ehdr) 438 PARAMS ((bfd *)); 439 void (*write_relocs) 440 PARAMS ((bfd *, asection *, PTR)); 441 void (*swap_symbol_in) 442 PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *)); 443 void (*swap_symbol_out) 444 PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR)); 445 bfd_boolean (*slurp_reloc_table) 446 PARAMS ((bfd *, asection *, asymbol **, bfd_boolean)); 447 long (*slurp_symbol_table) 448 PARAMS ((bfd *, asymbol **, bfd_boolean)); 449 void (*swap_dyn_in) 450 PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *)); 451 void (*swap_dyn_out) 452 PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR)); 453 454 /* This function is called to swap in a REL relocation. If an 455 external relocation corresponds to more than one internal 456 relocation, then all relocations are swapped in at once. */ 306 457 void (*swap_reloc_in) 307 PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rel *)); 308 309 /* This function, if defined, is called to swap out a REL 310 relocation. */ 458 PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); 459 460 /* This function is called to swap out a REL relocation. */ 311 461 void (*swap_reloc_out) 312 PARAMS ((bfd *, const Elf_Internal_Rel *, bfd_byte *)); 313 314 /* This function, if defined, is called to swap in a RELA 315 relocation. If an external relocation corresponds to more than 316 one internal relocation, then all relocations are swapped in at 317 once. */ 462 PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); 463 464 /* This function is called to swap in a RELA relocation. If an 465 external relocation corresponds to more than one internal 466 relocation, then all relocations are swapped in at once. */ 318 467 void (*swap_reloca_in) 319 468 PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); 320 469 321 /* This function, if defined, is called to swap out a RELA 322 relocation. */ 470 /* This function is called to swap out a RELA relocation. */ 323 471 void (*swap_reloca_out) 324 472 PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); 325 326 473 }; 327 474 … … 332 479 : 0) 333 480 481 enum elf_reloc_type_class { 482 reloc_class_normal, 483 reloc_class_relative, 484 reloc_class_plt, 485 reloc_class_copy 486 }; 487 488 struct elf_reloc_cookie 489 { 490 Elf_Internal_Rela *rels, *rel, *relend; 491 Elf_Internal_Sym *locsyms; 492 bfd *abfd; 493 size_t locsymcount; 494 size_t extsymoff; 495 struct elf_link_hash_entry **sym_hashes; 496 bfd_boolean bad_symtab; 497 }; 498 499 /* The level of IRIX compatibility we're striving for. */ 500 501 typedef enum { 502 ict_none, 503 ict_irix5, 504 ict_irix6 505 } irix_compat_t; 506 334 507 struct elf_backend_data 335 508 { … … 345 518 /* A function to translate an ELF RELA relocation to a BFD arelent 346 519 structure. */ 347 void (*elf_info_to_howto) PARAMS ((bfd *, arelent *,348 520 void (*elf_info_to_howto) 521 PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); 349 522 350 523 /* A function to translate an ELF REL relocation to a BFD arelent 351 524 structure. */ 352 void (*elf_info_to_howto_rel) PARAMS ((bfd *, arelent *,353 Elf_Internal_Rel*));525 void (*elf_info_to_howto_rel) 526 PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); 354 527 355 528 /* A function to determine whether a symbol is global when … … 358 531 thing will be done. MIPS ELF, at least on the Irix 5, has 359 532 special requirements. */ 360 boolean (*elf_backend_sym_is_global) PARAMS ((bfd *, asymbol *)); 533 bfd_boolean (*elf_backend_sym_is_global) 534 PARAMS ((bfd *, asymbol *)); 361 535 362 536 /* The remaining functions are hooks which are called only if they … … 367 541 permit the backend to set any global information it wishes. When 368 542 this is called elf_elfheader is set, but anything else should be 369 used with caution. If this returns false, the check_format543 used with caution. If this returns FALSE, the check_format 370 544 routine will return a bfd_error_wrong_format error. */ 371 boolean (*elf_backend_object_p) PARAMS ((bfd *)); 545 bfd_boolean (*elf_backend_object_p) 546 PARAMS ((bfd *)); 372 547 373 548 /* A function to do additional symbol processing when reading the 374 549 ELF symbol table. This is where any processor-specific special 375 550 section indices are handled. */ 376 void (*elf_backend_symbol_processing) PARAMS ((bfd *, asymbol *)); 551 void (*elf_backend_symbol_processing) 552 PARAMS ((bfd *, asymbol *)); 377 553 378 554 /* A function to do additional symbol processing after reading the 379 555 entire ELF symbol table. */ 380 boolean (*elf_backend_symbol_table_processing) PARAMS ((bfd *, 381 elf_symbol_type *, 382 unsigned int)); 556 bfd_boolean (*elf_backend_symbol_table_processing) 557 PARAMS ((bfd *, elf_symbol_type *, unsigned int)); 383 558 384 559 /* A function to set the type of the info field. Processor-specific 385 560 types should be handled here. */ 386 int (*elf_backend_get_symbol_type) PARAMS (( Elf_Internal_Sym *, int)); 561 int (*elf_backend_get_symbol_type) 562 PARAMS (( Elf_Internal_Sym *, int)); 387 563 388 564 /* A function to do additional processing on the ELF section header … … 390 566 type fields for some sections, or to actually write out data for 391 567 unusual sections. */ 392 b oolean (*elf_backend_section_processing) PARAMS ((bfd *,393 Elf32_Internal_Shdr *));568 bfd_boolean (*elf_backend_section_processing) 569 PARAMS ((bfd *, Elf_Internal_Shdr *)); 394 570 395 571 /* A function to handle unusual section types when creating BFD 396 572 sections from ELF sections. */ 397 boolean (*elf_backend_section_from_shdr) PARAMS ((bfd *, 398 Elf32_Internal_Shdr *, 399 char *)); 573 bfd_boolean (*elf_backend_section_from_shdr) 574 PARAMS ((bfd *, Elf_Internal_Shdr *, const char *)); 400 575 401 576 /* A function to convert machine dependent section header flags to 402 577 BFD internal section header flags. */ 403 b oolean (*elf_backend_section_flags) PARAMS ((flagword *,404 Elf32_Internal_Shdr *));578 bfd_boolean (*elf_backend_section_flags) 579 PARAMS ((flagword *, Elf_Internal_Shdr *)); 405 580 406 581 /* A function to handle unusual program segment types when creating BFD 407 582 sections from ELF program segments. */ 408 boolean (*elf_backend_section_from_phdr) PARAMS ((bfd *, 409 Elf32_Internal_Phdr *, 410 int)); 583 bfd_boolean (*elf_backend_section_from_phdr) 584 PARAMS ((bfd *, Elf_Internal_Phdr *, int)); 411 585 412 586 /* A function to set up the ELF section header for a BFD section in 413 587 preparation for writing it out. This is where the flags and type 414 588 fields are set for unusual sections. */ 415 b oolean (*elf_backend_fake_sections) PARAMS ((bfd *, Elf32_Internal_Shdr *,416 589 bfd_boolean (*elf_backend_fake_sections) 590 PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); 417 591 418 592 /* A function to get the ELF section index for a BFD section. If 419 this returns true, the section was found. If it is a normal ELF593 this returns TRUE, the section was found. If it is a normal ELF 420 594 section, *RETVAL should be left unchanged. If it is not a normal 421 595 ELF section *RETVAL should be set to the SHN_xxxx index. */ 422 b oolean (*elf_backend_section_from_bfd_section)423 PARAMS ((bfd *, Elf32_Internal_Shdr *,asection *, int *retval));596 bfd_boolean (*elf_backend_section_from_bfd_section) 597 PARAMS ((bfd *, asection *, int *retval)); 424 598 425 599 /* If this field is not NULL, it is called by the add_symbols phase … … 431 605 indices, and must set at least *FLAGS and *SEC for each processor 432 606 dependent case; failure to do so will cause a link error. */ 433 b oolean (*elf_add_symbol_hook)607 bfd_boolean (*elf_add_symbol_hook) 434 608 PARAMS ((bfd *abfd, struct bfd_link_info *info, 435 609 const Elf_Internal_Sym *, const char **name, … … 438 612 /* If this field is not NULL, it is called by the elf_link_output_sym 439 613 phase of a link for each symbol which will appear in the object file. */ 440 b oolean (*elf_backend_link_output_symbol_hook)614 bfd_boolean (*elf_backend_link_output_symbol_hook) 441 615 PARAMS ((bfd *, struct bfd_link_info *info, const char *, 442 616 Elf_Internal_Sym *, asection *)); … … 450 624 desired. This function will normally create the .got and .plt 451 625 sections, but different backends have different requirements. */ 452 b oolean (*elf_backend_create_dynamic_sections)626 bfd_boolean (*elf_backend_create_dynamic_sections) 453 627 PARAMS ((bfd *abfd, struct bfd_link_info *info)); 454 628 … … 463 637 actually uses Rel structures, the r_addend field will always be 464 638 zero. */ 465 b oolean (*check_relocs)639 bfd_boolean (*check_relocs) 466 640 PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *o, 467 641 const Elf_Internal_Rela *relocs)); … … 479 653 entry to the .plt or .got or some such section, and setting the 480 654 symbol to point to that. */ 481 b oolean (*elf_backend_adjust_dynamic_symbol)655 bfd_boolean (*elf_backend_adjust_dynamic_symbol) 482 656 PARAMS ((struct bfd_link_info *info, struct elf_link_hash_entry *h)); 483 657 … … 486 660 section sizes have been set. This is called after 487 661 ADJUST_DYNAMIC_SYMBOL, but before SIZE_DYNAMIC_SECTIONS. */ 488 b oolean (*elf_backend_always_size_sections)662 bfd_boolean (*elf_backend_always_size_sections) 489 663 PARAMS ((bfd *output_bfd, struct bfd_link_info *info)); 490 664 … … 499 673 .interp section and any sections created by the 500 674 CREATE_DYNAMIC_SECTIONS entry point. */ 501 b oolean (*elf_backend_size_dynamic_sections)675 bfd_boolean (*elf_backend_size_dynamic_sections) 502 676 PARAMS ((bfd *output_bfd, struct bfd_link_info *info)); 503 677 … … 530 704 section, which means that the addend must be adjusted 531 705 accordingly. */ 532 b oolean (*elf_backend_relocate_section)706 bfd_boolean (*elf_backend_relocate_section) 533 707 PARAMS ((bfd *output_bfd, struct bfd_link_info *info, 534 708 bfd *input_bfd, asection *input_section, bfd_byte *contents, … … 543 717 all .dynsym symbols, while ADJUST_DYNAMIC_SYMBOL is only called 544 718 on those symbols which are defined by a dynamic object. */ 545 b oolean (*elf_backend_finish_dynamic_symbol)719 bfd_boolean (*elf_backend_finish_dynamic_symbol) 546 720 PARAMS ((bfd *output_bfd, struct bfd_link_info *info, 547 721 struct elf_link_hash_entry *h, Elf_Internal_Sym *sym)); … … 551 725 output file. The FINISH_DYNAMIC_SYMBOL will have been called on 552 726 all dynamic symbols. */ 553 b oolean (*elf_backend_finish_dynamic_sections)727 bfd_boolean (*elf_backend_finish_dynamic_sections) 554 728 PARAMS ((bfd *output_bfd, struct bfd_link_info *info)); 555 729 … … 560 734 561 735 /* A function to do any final processing needed for the ELF file 562 before writing it out. The LINKER argument is trueif this BFD736 before writing it out. The LINKER argument is TRUE if this BFD 563 737 was created by the ELF backend linker. */ 564 738 void (*elf_backend_final_write_processing) 565 PARAMS ((bfd *, b oolean linker));739 PARAMS ((bfd *, bfd_boolean linker)); 566 740 567 741 /* This function is called by get_program_header_size. It should 568 742 return the number of additional program segments which this BFD 569 743 will need. It should return -1 on error. */ 570 int (*elf_backend_additional_program_headers) PARAMS ((bfd *)); 744 int (*elf_backend_additional_program_headers) 745 PARAMS ((bfd *)); 571 746 572 747 /* This function is called to modify an existing segment map in a 573 748 backend specific fashion. */ 574 boolean (*elf_backend_modify_segment_map) PARAMS ((bfd *)); 749 bfd_boolean (*elf_backend_modify_segment_map) 750 PARAMS ((bfd *)); 575 751 576 752 /* This function is called during section gc to discover the section a 577 particular relocation refers to. It need not be defined for hosts 578 that have no queer relocation types. */ 753 particular relocation refers to. */ 579 754 asection * (*gc_mark_hook) 580 PARAMS (( bfd *abfd, struct bfd_link_info *, Elf_Internal_Rela *,755 PARAMS ((asection *sec, struct bfd_link_info *, Elf_Internal_Rela *, 581 756 struct elf_link_hash_entry *h, Elf_Internal_Sym *)); 582 757 … … 584 759 in order that a backend might update any data structures it might 585 760 be maintaining. */ 586 b oolean (*gc_sweep_hook)761 bfd_boolean (*gc_sweep_hook) 587 762 PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *o, 588 763 const Elf_Internal_Rela *relocs)); … … 604 779 section. It allows the backend to emit special global symbols 605 780 not handled in the hash table. */ 606 b oolean (*elf_backend_output_arch_syms)781 bfd_boolean (*elf_backend_output_arch_syms) 607 782 PARAMS ((bfd *, struct bfd_link_info *, PTR, 608 boolean (*) PARAMS ((PTR, const char *, 609 Elf_Internal_Sym *, asection *)))); 783 bfd_boolean (*) (PTR, const char *, Elf_Internal_Sym *, asection *))); 610 784 611 785 /* Copy any information related to dynamic linking from a pre-existing 612 symbol IND to a newly created symbol DIR. */ 786 symbol to a newly created symbol. Also called to copy flags and 787 other back-end info to a weakdef, in which case the symbol is not 788 newly created and plt/got refcounts and dynamic indices should not 789 be copied. */ 613 790 void (*elf_backend_copy_indirect_symbol) 614 PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); 791 PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, 792 struct elf_link_hash_entry *)); 615 793 616 794 /* Modify any information related to dynamic linking such that the 617 795 symbol is not exported. */ 618 796 void (*elf_backend_hide_symbol) 619 PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); 797 PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean)); 798 799 /* Emit relocations. Overrides default routine for emitting relocs, 800 except during a relocatable link, or if all relocs are being emitted. */ 801 bfd_boolean (*elf_backend_emit_relocs) 802 PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *)); 803 804 /* Count relocations. Not called for relocatable links 805 or if all relocs are being preserved in the output. */ 806 unsigned int (*elf_backend_count_relocs) 807 PARAMS ((asection *, Elf_Internal_Rela *)); 808 809 /* This function, if defined, is called when an NT_PRSTATUS note is found 810 in a core file. */ 811 bfd_boolean (*elf_backend_grok_prstatus) 812 PARAMS ((bfd *, Elf_Internal_Note *)); 813 814 /* This function, if defined, is called when an NT_PSINFO or NT_PRPSINFO 815 note is found in a core file. */ 816 bfd_boolean (*elf_backend_grok_psinfo) 817 PARAMS ((bfd *, Elf_Internal_Note *)); 818 819 /* Functions to print VMAs. Special code to handle 64 bit ELF files. */ 820 void (* elf_backend_sprintf_vma) 821 PARAMS ((bfd *, char *, bfd_vma)); 822 void (* elf_backend_fprintf_vma) 823 PARAMS ((bfd *, PTR, bfd_vma)); 824 825 /* This function returns class of a reloc type. */ 826 enum elf_reloc_type_class (*elf_backend_reloc_type_class) 827 PARAMS ((const Elf_Internal_Rela *)); 828 829 /* This function, if defined, removes information about discarded functions 830 from other sections which mention them. */ 831 bfd_boolean (*elf_backend_discard_info) 832 PARAMS ((bfd *, struct elf_reloc_cookie *, struct bfd_link_info *)); 833 834 /* This function, if defined, signals that the function above has removed 835 the discarded relocations for this section. */ 836 bfd_boolean (*elf_backend_ignore_discarded_relocs) 837 PARAMS ((asection *)); 838 839 /* This function, if defined, may write out the given section. 840 Returns TRUE if it did so and FALSE if the caller should. */ 841 bfd_boolean (*elf_backend_write_section) 842 PARAMS ((bfd *, asection *, bfd_byte *)); 843 844 /* The level of IRIX compatibility we're striving for. 845 MIPS ELF specific function. */ 846 irix_compat_t (*elf_backend_mips_irix_compat) 847 PARAMS ((bfd *)); 848 849 reloc_howto_type *(*elf_backend_mips_rtype_to_howto) 850 PARAMS ((unsigned int, bfd_boolean)); 620 851 621 852 /* The swapping table to use when dealing with ECOFF information. … … 638 869 bfd_vma plt_header_size; 639 870 640 /* This is trueif the linker should act like collect and gather641 global constructors and destructors by name. This is truefor871 /* This is TRUE if the linker should act like collect and gather 872 global constructors and destructors by name. This is TRUE for 642 873 MIPS ELF because the Irix 5 tools can not handle the .init 643 874 section. */ 644 875 unsigned collect : 1; 645 876 646 /* This is trueif the linker should ignore changes to the type of a647 symbol. This is truefor MIPS ELF because some Irix 5 objects877 /* This is TRUE if the linker should ignore changes to the type of a 878 symbol. This is TRUE for MIPS ELF because some Irix 5 objects 648 879 record undefined functions as STT_OBJECT although the definitions 649 880 are STT_FUNC. */ … … 667 898 unsigned default_use_rela_p : 1; 668 899 669 /* True if addresses "naturally" sign extend. This is used when 900 /* Set if RELA relocations for a relocatable link can be handled by 901 generic code. Backends that set this flag need do nothing in the 902 backend relocate_section routine for relocatable linking. */ 903 unsigned rela_normal : 1; 904 905 /* TRUE if addresses "naturally" sign extend. This is used when 670 906 swapping in from Elf32 when BFD64. */ 671 907 unsigned sign_extend_vma : 1; … … 677 913 unsigned plt_alignment : 4; 678 914 unsigned can_gc_sections : 1; 915 unsigned can_refcount : 1; 916 unsigned want_got_sym : 1; 679 917 unsigned want_dynbss : 1; 918 /* Targets which do not support physical addressing often require 919 that the p_paddr field in the section header to be set to zero. 920 This field indicates whether this behavior is required. */ 921 unsigned want_p_paddr_set_to_zero : 1; 680 922 }; 681 923 … … 687 929 /* The ELF header for this section. */ 688 930 Elf_Internal_Shdr this_hdr; 931 689 932 /* The ELF header for the reloc section associated with this 690 933 section, if any. */ 691 934 Elf_Internal_Shdr rel_hdr; 935 692 936 /* If there is a second reloc section associated with this section, 693 937 as can happen on Irix 6, this field points to the header. */ 694 938 Elf_Internal_Shdr *rel_hdr2; 939 695 940 /* The number of relocations currently assigned to REL_HDR. */ 696 941 unsigned int rel_count; 942 697 943 /* The number of relocations currently assigned to REL_HDR2. */ 698 944 unsigned int rel_count2; 945 699 946 /* The ELF section number of this section. Only used for an output 700 947 file. */ 701 948 int this_idx; 949 702 950 /* The ELF section number of the reloc section indicated by 703 951 REL_HDR if any. Only used for an output file. */ 704 952 int rel_idx; 953 705 954 /* The ELF section number of the reloc section indicated by 706 955 REL_HDR2 if any. Only used for an output file. */ 707 956 int rel_idx2; 957 958 /* Used by the backend linker when generating a shared library to 959 record the dynamic symbol index for a section symbol 960 corresponding to this section. A value of 0 means that there is 961 no dynamic symbol for this section. */ 962 int dynindx; 963 708 964 /* Used by the backend linker to store the symbol hash table entries 709 965 associated with relocs against global symbols. */ 710 966 struct elf_link_hash_entry **rel_hashes; 967 711 968 /* A pointer to the swapped relocs. If the section uses REL relocs, 712 969 rather than RELA, all the r_addend fields will be zero. This 713 970 pointer may be NULL. It is used by the backend linker. */ 714 971 Elf_Internal_Rela *relocs; 715 /* Used by the backend linker when generating a shared library to 716 record the dynamic symbol index for a section symbol 717 corresponding to this section. A value of 0 means that there is 718 no dynamic symbol for this section. */ 719 long dynindx; 720 /* A pointer used for .stab linking optimizations. */ 721 PTR stab_info; 722 /* A pointer available for the processor specific ELF backend. */ 723 PTR tdata; 724 /* Nonzero if this section uses RELA relocations, rather than REL. */ 725 unsigned int use_rela_p:1; 972 973 /* A pointer to a linked list tracking dynamic relocs copied for 974 local symbols. */ 975 PTR local_dynrel; 976 977 /* A pointer to the bfd section used for dynamic relocs. */ 978 asection *sreloc; 979 980 union { 981 /* Group name, if this section is a member of a group. */ 982 const char *name; 983 984 /* Group signature sym, if this is the SHT_GROUP section. */ 985 struct symbol_cache_entry *id; 986 } group; 987 988 /* A linked list of sections in the group. Circular when used by 989 the linker. */ 990 asection *next_in_group; 991 992 /* A pointer used for various section optimizations. */ 993 PTR sec_info; 726 994 }; 727 995 728 996 #define elf_section_data(sec) ((struct bfd_elf_section_data*)sec->used_by_bfd) 997 #define elf_group_name(sec) (elf_section_data(sec)->group.name) 998 #define elf_group_id(sec) (elf_section_data(sec)->group.id) 999 #define elf_next_in_group(sec) (elf_section_data(sec)->next_in_group) 1000 1001 /* Return TRUE if section has been discarded. */ 1002 #define elf_discarded_section(sec) \ 1003 (!bfd_is_abs_section (sec) \ 1004 && bfd_is_abs_section ((sec)->output_section) \ 1005 && sec->sec_info_type != ELF_INFO_TYPE_MERGE \ 1006 && sec->sec_info_type != ELF_INFO_TYPE_JUST_SYMS) 729 1007 730 1008 #define get_elf_backend_data(abfd) \ … … 760 1038 bfd_vma max_hole_offset; /* maximum offset for the hole */ 761 1039 elf_linker_section_enum_t which; /* which section this is */ 762 b oolean hole_written_p; /* whether the hole has been initialized */1040 bfd_boolean hole_written_p; /* whether the hole has been initialized */ 763 1041 unsigned int alignment; /* alignment for the section */ 764 1042 flagword flags; /* flags to use to create the section */ … … 772 1050 struct elf_linker_section_pointers *next; /* next allocated pointer for this symbol */ 773 1051 bfd_vma offset; /* offset of pointer from beginning of section */ 774 bfd_ signed_vma addend;/* addend used */1052 bfd_vma addend; /* addend used */ 775 1053 elf_linker_section_enum_t which; /* which linker section this is */ 776 b oolean written_address_p;/* whether address was written yet */1054 bfd_boolean written_address_p; /* whether address was written yet */ 777 1055 } elf_linker_section_pointers_t; 778 1056 … … 786 1064 Elf_Internal_Phdr *phdr; 787 1065 struct elf_segment_map *segment_map; 788 struct bfd_strtab_hash *strtab_ptr;1066 struct elf_strtab_hash *strtab_ptr; 789 1067 int num_locals; 790 1068 int num_globals; 1069 unsigned int num_elf_sections; /* elf_sect_ptr size */ 1070 int num_section_syms; 791 1071 asymbol **section_syms; /* STT_SECTION symbols for each section */ 792 1072 Elf_Internal_Shdr symtab_hdr; … … 798 1078 Elf_Internal_Shdr dynverref_hdr; 799 1079 Elf_Internal_Shdr dynverdef_hdr; 1080 Elf_Internal_Shdr symtab_shndx_hdr; 800 1081 unsigned int symtab_section, shstrtab_section; 801 1082 unsigned int strtab_section, dynsymtab_section; 1083 unsigned int symtab_shndx_section; 802 1084 unsigned int dynversym_section, dynverdef_section, dynverref_section; 803 1085 file_ptr next_file_pos; … … 808 1090 void *prpsinfo; /* The raw /proc prpsinfo structure */ 809 1091 #endif 810 bfd_vma gp; /* The gp value (MIPS only, for now) */ 811 unsigned int gp_size; /* The gp size (MIPS only, for now) */ 1092 bfd_vma gp; /* The gp value */ 1093 unsigned int gp_size; /* The gp size */ 1094 1095 Elf_Internal_Shdr **group_sect_ptr; 1096 int num_group; 812 1097 813 1098 /* Information grabbed from an elf core file. */ … … 818 1103 char* core_command; 819 1104 820 /* This is set to trueif the object was created by the backend1105 /* This is set to TRUE if the object was created by the backend 821 1106 linker. */ 822 b oolean linker;1107 bfd_boolean linker; 823 1108 824 1109 /* A mapping from external symbols to entries in the linker hash … … 827 1112 struct elf_link_hash_entry **sym_hashes; 828 1113 829 /* A mapping from local symbols to offsets into the global offset 830 table, used when linking. This is indexed by the symbol index. 831 Like for the globals, we use a union and two names primarily to 832 document the intent of any particular piece of code. The field 833 should be used as a count until size_dynamic_sections, at which 834 point the contents of the .got is fixed. Afterward, if an entry 835 is -1, then the symbol does not require a global offset table entry. */ 1114 /* Track usage and final offsets of GOT entries for local symbols. 1115 This array is indexed by symbol index. Elements are used 1116 identically to "got" in struct elf_link_hash_entry. */ 836 1117 union 837 1118 { 838 1119 bfd_signed_vma *refcounts; 839 1120 bfd_vma *offsets; 1121 struct got_entry **ents; 840 1122 } local_got; 841 1123 … … 867 1149 sh_info field in the symbol table header, and always read all the 868 1150 symbols. */ 869 b oolean bad_symtab;1151 bfd_boolean bad_symtab; 870 1152 871 1153 /* Records the result of `get_program_header_size'. */ … … 892 1174 asection **local_stubs; 893 1175 1176 /* Used to determine if PT_GNU_EH_FRAME segment header should be 1177 created. */ 1178 asection *eh_frame_hdr; 1179 894 1180 /* Used to determine if the e_flags field has been initialized */ 895 b oolean flags_init;1181 bfd_boolean flags_init; 896 1182 897 1183 /* Number of symbol version definitions we are about to emit. */ … … 921 1207 #define elf_elfheader(bfd) (elf_tdata(bfd) -> elf_header) 922 1208 #define elf_elfsections(bfd) (elf_tdata(bfd) -> elf_sect_ptr) 1209 #define elf_numsections(bfd) (elf_tdata(bfd) -> num_elf_sections) 923 1210 #define elf_shstrtab(bfd) (elf_tdata(bfd) -> strtab_ptr) 924 1211 #define elf_onesymtab(bfd) (elf_tdata(bfd) -> symtab_section) 1212 #define elf_symtab_shndx(bfd) (elf_tdata(bfd) -> symtab_shndx_section) 925 1213 #define elf_dynsymtab(bfd) (elf_tdata(bfd) -> dynsymtab_section) 926 1214 #define elf_dynversym(bfd) (elf_tdata(bfd) -> dynversym_section) … … 930 1218 #define elf_num_globals(bfd) (elf_tdata(bfd) -> num_globals) 931 1219 #define elf_section_syms(bfd) (elf_tdata(bfd) -> section_syms) 1220 #define elf_num_section_syms(bfd) (elf_tdata(bfd) -> num_section_syms) 932 1221 #define core_prpsinfo(bfd) (elf_tdata(bfd) -> prpsinfo) 933 1222 #define core_prstatus(bfd) (elf_tdata(bfd) -> prstatus) … … 937 1226 #define elf_local_got_refcounts(bfd) (elf_tdata(bfd) -> local_got.refcounts) 938 1227 #define elf_local_got_offsets(bfd) (elf_tdata(bfd) -> local_got.offsets) 1228 #define elf_local_got_ents(bfd) (elf_tdata(bfd) -> local_got.ents) 939 1229 #define elf_local_ptr_offsets(bfd) (elf_tdata(bfd) -> linker_section_pointers) 940 1230 #define elf_dt_name(bfd) (elf_tdata(bfd) -> dt_name) … … 966 1256 PARAMS ((bfd *, const Elf_Internal_Versym *, Elf_External_Versym *)); 967 1257 968 extern int _bfd_elf_section_from_bfd_section PARAMS ((bfd *, asection *)); 1258 extern int _bfd_elf_section_from_bfd_section 1259 PARAMS ((bfd *, asection *)); 969 1260 extern char *bfd_elf_string_from_elf_section 970 1261 PARAMS ((bfd *, unsigned, unsigned)); 971 extern char *bfd_elf_get_str_section PARAMS ((bfd *, unsigned)); 972 973 extern boolean _bfd_elf_print_private_bfd_data PARAMS ((bfd *, PTR)); 974 extern void bfd_elf_print_symbol PARAMS ((bfd *, PTR, asymbol *, 975 bfd_print_symbol_type)); 976 #define elf_string_from_elf_strtab(abfd,strindex) \ 977 bfd_elf_string_from_elf_section(abfd,elf_elfheader(abfd)->e_shstrndx,strindex) 1262 extern char *bfd_elf_get_str_section 1263 PARAMS ((bfd *, unsigned)); 1264 extern Elf_Internal_Sym *bfd_elf_get_elf_syms 1265 PARAMS ((bfd *, Elf_Internal_Shdr *, size_t, size_t, 1266 Elf_Internal_Sym *, PTR, Elf_External_Sym_Shndx *)); 1267 extern const char *bfd_elf_local_sym_name 1268 PARAMS ((bfd *, Elf_Internal_Sym *)); 1269 1270 extern bfd_boolean _bfd_elf_copy_private_bfd_data 1271 PARAMS ((bfd *, bfd *)); 1272 extern bfd_boolean _bfd_elf_print_private_bfd_data 1273 PARAMS ((bfd *, PTR)); 1274 extern void bfd_elf_print_symbol 1275 PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type)); 1276 1277 #define elf_string_from_elf_strtab(abfd, strindex) \ 1278 bfd_elf_string_from_elf_section(abfd, elf_elfheader(abfd)->e_shstrndx, \ 1279 strindex) 978 1280 979 1281 #define bfd_elf32_print_symbol bfd_elf_print_symbol 980 1282 #define bfd_elf64_print_symbol bfd_elf_print_symbol 981 1283 982 extern unsigned long bfd_elf_hash PARAMS ((const char *)); 983 984 extern bfd_reloc_status_type bfd_elf_generic_reloc PARAMS ((bfd *, 985 arelent *, 986 asymbol *, 987 PTR, 988 asection *, 989 bfd *, 990 char **)); 991 extern boolean bfd_elf_mkobject PARAMS ((bfd *)); 992 extern boolean bfd_elf_mkcorefile PARAMS ((bfd *)); 993 extern Elf_Internal_Shdr *bfd_elf_find_section PARAMS ((bfd *, char *)); 994 extern boolean _bfd_elf_make_section_from_shdr 995 PARAMS ((bfd *abfd, Elf_Internal_Shdr *hdr, const char *name)); 996 extern boolean _bfd_elf_make_section_from_phdr 997 PARAMS ((bfd *abfd, Elf_Internal_Phdr *hdr, int index, const char *typename)); 1284 extern void _bfd_elf_sprintf_vma 1285 PARAMS ((bfd *, char *, bfd_vma)); 1286 extern void _bfd_elf_fprintf_vma 1287 PARAMS ((bfd *, PTR, bfd_vma)); 1288 1289 extern enum elf_reloc_type_class _bfd_elf_reloc_type_class 1290 PARAMS ((const Elf_Internal_Rela *)); 1291 extern bfd_vma _bfd_elf_rela_local_sym 1292 PARAMS ((bfd *, Elf_Internal_Sym *, asection *, Elf_Internal_Rela *)); 1293 extern bfd_vma _bfd_elf_rel_local_sym 1294 PARAMS ((bfd *, Elf_Internal_Sym *, asection **, bfd_vma)); 1295 extern bfd_vma _bfd_elf_section_offset 1296 PARAMS ((bfd *, struct bfd_link_info *, asection *, bfd_vma)); 1297 1298 extern unsigned long bfd_elf_hash 1299 PARAMS ((const char *)); 1300 1301 extern bfd_reloc_status_type bfd_elf_generic_reloc 1302 PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); 1303 extern bfd_boolean bfd_elf_mkobject 1304 PARAMS ((bfd *)); 1305 extern bfd_boolean bfd_elf_mkcorefile 1306 PARAMS ((bfd *)); 1307 extern Elf_Internal_Shdr *bfd_elf_find_section 1308 PARAMS ((bfd *, char *)); 1309 extern bfd_boolean _bfd_elf_make_section_from_shdr 1310 PARAMS ((bfd *, Elf_Internal_Shdr *, const char *)); 1311 extern bfd_boolean _bfd_elf_make_section_from_phdr 1312 PARAMS ((bfd *, Elf_Internal_Phdr *, int, const char *)); 998 1313 extern struct bfd_hash_entry *_bfd_elf_link_hash_newfunc 999 1314 PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); … … 1001 1316 PARAMS ((bfd *)); 1002 1317 extern void _bfd_elf_link_hash_copy_indirect 1003 PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *)); 1318 PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, 1319 struct elf_link_hash_entry *)); 1004 1320 extern void _bfd_elf_link_hash_hide_symbol 1005 PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry * ));1006 extern b oolean _bfd_elf_link_hash_table_init1321 PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean)); 1322 extern bfd_boolean _bfd_elf_link_hash_table_init 1007 1323 PARAMS ((struct elf_link_hash_table *, bfd *, 1008 1324 struct bfd_hash_entry *(*) (struct bfd_hash_entry *, 1009 1325 struct bfd_hash_table *, 1010 1326 const char *))); 1011 extern boolean _bfd_elf_slurp_version_tables PARAMS ((bfd *)); 1012 1013 extern boolean _bfd_elf_copy_private_symbol_data 1327 extern bfd_boolean _bfd_elf_slurp_version_tables 1328 PARAMS ((bfd *)); 1329 extern bfd_boolean _bfd_elf_merge_sections 1330 PARAMS ((bfd *, struct bfd_link_info *)); 1331 extern bfd_boolean bfd_elf_discard_group 1332 PARAMS ((bfd *, struct sec *)); 1333 extern void bfd_elf_set_group_contents 1334 PARAMS ((bfd *, asection *, PTR)); 1335 extern void _bfd_elf_link_just_syms 1336 PARAMS ((asection *, struct bfd_link_info *)); 1337 extern bfd_boolean _bfd_elf_copy_private_symbol_data 1014 1338 PARAMS ((bfd *, asymbol *, bfd *, asymbol *)); 1015 extern b oolean _bfd_elf_copy_private_section_data1339 extern bfd_boolean _bfd_elf_copy_private_section_data 1016 1340 PARAMS ((bfd *, asection *, bfd *, asection *)); 1017 extern boolean _bfd_elf_write_object_contents PARAMS ((bfd *)); 1018 extern boolean _bfd_elf_write_corefile_contents PARAMS ((bfd *)); 1019 extern boolean _bfd_elf_set_section_contents PARAMS ((bfd *, sec_ptr, PTR, 1020 file_ptr, 1021 bfd_size_type)); 1022 extern long _bfd_elf_get_symtab_upper_bound PARAMS ((bfd *)); 1023 extern long _bfd_elf_get_symtab PARAMS ((bfd *, asymbol **)); 1024 extern long _bfd_elf_get_dynamic_symtab_upper_bound PARAMS ((bfd *)); 1025 extern long _bfd_elf_canonicalize_dynamic_symtab PARAMS ((bfd *, asymbol **)); 1026 extern long _bfd_elf_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr)); 1027 extern long _bfd_elf_canonicalize_reloc PARAMS ((bfd *, sec_ptr, 1028 arelent **, asymbol **)); 1029 extern long _bfd_elf_get_dynamic_reloc_upper_bound PARAMS ((bfd *)); 1030 extern long _bfd_elf_canonicalize_dynamic_reloc PARAMS ((bfd *, arelent **, 1031 asymbol **)); 1032 extern asymbol *_bfd_elf_make_empty_symbol PARAMS ((bfd *)); 1033 extern void _bfd_elf_get_symbol_info PARAMS ((bfd *, asymbol *, 1034 symbol_info *)); 1035 extern boolean _bfd_elf_is_local_label_name PARAMS ((bfd *, const char *)); 1036 extern alent *_bfd_elf_get_lineno PARAMS ((bfd *, asymbol *)); 1037 extern boolean _bfd_elf_set_arch_mach PARAMS ((bfd *, enum bfd_architecture, 1038 unsigned long)); 1039 extern boolean _bfd_elf_find_nearest_line PARAMS ((bfd *, asection *, 1040 asymbol **, 1041 bfd_vma, const char **, 1042 const char **, 1043 unsigned int *)); 1341 extern bfd_boolean _bfd_elf_write_object_contents 1342 PARAMS ((bfd *)); 1343 extern bfd_boolean _bfd_elf_write_corefile_contents 1344 PARAMS ((bfd *)); 1345 extern bfd_boolean _bfd_elf_set_section_contents 1346 PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); 1347 extern long _bfd_elf_get_symtab_upper_bound 1348 PARAMS ((bfd *)); 1349 extern long _bfd_elf_get_symtab 1350 PARAMS ((bfd *, asymbol **)); 1351 extern long _bfd_elf_get_dynamic_symtab_upper_bound 1352 PARAMS ((bfd *)); 1353 extern long _bfd_elf_canonicalize_dynamic_symtab 1354 PARAMS ((bfd *, asymbol **)); 1355 extern long _bfd_elf_get_reloc_upper_bound 1356 PARAMS ((bfd *, sec_ptr)); 1357 extern long _bfd_elf_canonicalize_reloc 1358 PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); 1359 extern long _bfd_elf_get_dynamic_reloc_upper_bound 1360 PARAMS ((bfd *)); 1361 extern long _bfd_elf_canonicalize_dynamic_reloc 1362 PARAMS ((bfd *, arelent **, asymbol **)); 1363 extern asymbol *_bfd_elf_make_empty_symbol 1364 PARAMS ((bfd *)); 1365 extern void _bfd_elf_get_symbol_info 1366 PARAMS ((bfd *, asymbol *, symbol_info *)); 1367 extern bfd_boolean _bfd_elf_is_local_label_name 1368 PARAMS ((bfd *, const char *)); 1369 extern alent *_bfd_elf_get_lineno 1370 PARAMS ((bfd *, asymbol *)); 1371 extern bfd_boolean _bfd_elf_set_arch_mach 1372 PARAMS ((bfd *, enum bfd_architecture, unsigned long)); 1373 extern bfd_boolean _bfd_elf_find_nearest_line 1374 PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, 1375 const char **, unsigned int *)); 1044 1376 #define _bfd_elf_read_minisymbols _bfd_generic_read_minisymbols 1045 1377 #define _bfd_elf_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol 1046 extern int _bfd_elf_sizeof_headers PARAMS ((bfd *, boolean)); 1047 extern boolean _bfd_elf_new_section_hook PARAMS ((bfd *, asection *)); 1048 extern boolean _bfd_elf_init_reloc_shdr 1049 PARAMS ((bfd *, Elf_Internal_Shdr *, asection *, boolean)); 1378 extern int _bfd_elf_sizeof_headers 1379 PARAMS ((bfd *, bfd_boolean)); 1380 extern bfd_boolean _bfd_elf_new_section_hook 1381 PARAMS ((bfd *, asection *)); 1382 extern bfd_boolean _bfd_elf_init_reloc_shdr 1383 PARAMS ((bfd *, Elf_Internal_Shdr *, asection *, bfd_boolean)); 1050 1384 1051 1385 /* If the target doesn't have reloc handling written yet: */ 1052 extern void _bfd_elf_no_info_to_howto PARAMS ((bfd *, arelent *, 1053 Elf_Internal_Rela *)); 1054 1055 extern boolean bfd_section_from_shdr PARAMS ((bfd *, unsigned int shindex)); 1056 extern boolean bfd_section_from_phdr PARAMS ((bfd *, Elf_Internal_Phdr *, int)); 1057 1058 extern int _bfd_elf_symbol_from_bfd_symbol PARAMS ((bfd *, asymbol **)); 1059 1060 asection *bfd_section_from_elf_index PARAMS ((bfd *, unsigned int)); 1061 boolean _bfd_elf_create_dynamic_sections PARAMS ((bfd *, 1062 struct bfd_link_info *)); 1063 struct bfd_strtab_hash *_bfd_elf_stringtab_init PARAMS ((void)); 1064 boolean 1065 _bfd_elf_link_record_dynamic_symbol PARAMS ((struct bfd_link_info *, 1066 struct elf_link_hash_entry *)); 1067 long 1068 _bfd_elf_link_lookup_local_dynindx PARAMS ((struct bfd_link_info *, 1069 bfd *, long)); 1070 boolean 1071 _bfd_elf_compute_section_file_positions PARAMS ((bfd *, 1072 struct bfd_link_info *)); 1073 void _bfd_elf_assign_file_positions_for_relocs PARAMS ((bfd *)); 1074 file_ptr _bfd_elf_assign_file_position_for_section PARAMS ((Elf_Internal_Shdr *, 1075 file_ptr, 1076 boolean)); 1077 1078 extern boolean _bfd_elf_validate_reloc PARAMS ((bfd *, arelent *)); 1079 1080 boolean _bfd_elf_create_dynamic_sections PARAMS ((bfd *, 1081 struct bfd_link_info *)); 1082 boolean _bfd_elf_create_got_section PARAMS ((bfd *, 1083 struct bfd_link_info *)); 1084 unsigned long _bfd_elf_link_renumber_dynsyms PARAMS ((bfd *, 1085 struct bfd_link_info *)); 1086 1087 elf_linker_section_t *_bfd_elf_create_linker_section 1088 PARAMS ((bfd *abfd, 1089 struct bfd_link_info *info, 1090 enum elf_linker_section_enum, 1091 elf_linker_section_t *defaults)); 1092 1093 elf_linker_section_pointers_t *_bfd_elf_find_pointer_linker_section 1094 PARAMS ((elf_linker_section_pointers_t *linker_pointers, 1095 bfd_signed_vma addend, 1096 elf_linker_section_enum_t which)); 1097 1098 boolean bfd_elf32_create_pointer_linker_section 1099 PARAMS ((bfd *abfd, 1100 struct bfd_link_info *info, 1101 elf_linker_section_t *lsect, 1102 struct elf_link_hash_entry *h, 1103 const Elf32_Internal_Rela *rel)); 1104 1105 bfd_vma bfd_elf32_finish_pointer_linker_section 1106 PARAMS ((bfd *output_abfd, 1107 bfd *input_bfd, 1108 struct bfd_link_info *info, 1109 elf_linker_section_t *lsect, 1110 struct elf_link_hash_entry *h, 1111 bfd_vma relocation, 1112 const Elf32_Internal_Rela *rel, 1113 int relative_reloc)); 1114 1115 boolean bfd_elf64_create_pointer_linker_section 1116 PARAMS ((bfd *abfd, 1117 struct bfd_link_info *info, 1118 elf_linker_section_t *lsect, 1119 struct elf_link_hash_entry *h, 1120 const Elf64_Internal_Rela *rel)); 1121 1122 bfd_vma bfd_elf64_finish_pointer_linker_section 1123 PARAMS ((bfd *output_abfd, 1124 bfd *input_bfd, 1125 struct bfd_link_info *info, 1126 elf_linker_section_t *lsect, 1127 struct elf_link_hash_entry *h, 1128 bfd_vma relocation, 1129 const Elf64_Internal_Rela *rel, 1130 int relative_reloc)); 1131 1132 boolean _bfd_elf_make_linker_section_rela 1133 PARAMS ((bfd *dynobj, 1134 elf_linker_section_t *lsect, 1135 int alignment)); 1136 1137 boolean _bfd_elfcore_section_from_phdr 1386 extern void _bfd_elf_no_info_to_howto 1387 PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); 1388 1389 extern bfd_boolean bfd_section_from_shdr 1390 PARAMS ((bfd *, unsigned int shindex)); 1391 extern bfd_boolean bfd_section_from_phdr 1138 1392 PARAMS ((bfd *, Elf_Internal_Phdr *, int)); 1139 1393 1140 extern const bfd_target *bfd_elf32_object_p PARAMS ((bfd *)); 1141 extern const bfd_target *bfd_elf32_core_file_p PARAMS ((bfd *)); 1142 extern char *bfd_elf32_core_file_failing_command PARAMS ((bfd *)); 1143 extern int bfd_elf32_core_file_failing_signal PARAMS ((bfd *)); 1144 extern boolean bfd_elf32_core_file_matches_executable_p PARAMS ((bfd *, 1145 bfd *)); 1146 1147 extern boolean bfd_elf32_bfd_link_add_symbols 1148 PARAMS ((bfd *, struct bfd_link_info *)); 1149 extern boolean bfd_elf32_bfd_final_link 1394 extern int _bfd_elf_symbol_from_bfd_symbol 1395 PARAMS ((bfd *, asymbol **)); 1396 1397 extern asection *bfd_section_from_r_symndx 1398 PARAMS ((bfd *, struct sym_sec_cache *, asection *, unsigned long)); 1399 extern asection *bfd_section_from_elf_index 1400 PARAMS ((bfd *, unsigned int)); 1401 extern bfd_boolean _bfd_elf_create_dynamic_sections 1402 PARAMS ((bfd *, struct bfd_link_info *)); 1403 extern struct bfd_strtab_hash *_bfd_elf_stringtab_init 1404 PARAMS ((void)); 1405 1406 extern struct elf_strtab_hash * _bfd_elf_strtab_init 1407 PARAMS ((void)); 1408 extern void _bfd_elf_strtab_free 1409 PARAMS ((struct elf_strtab_hash *)); 1410 extern bfd_size_type _bfd_elf_strtab_add 1411 PARAMS ((struct elf_strtab_hash *, const char *, bfd_boolean)); 1412 extern void _bfd_elf_strtab_addref 1413 PARAMS ((struct elf_strtab_hash *, bfd_size_type)); 1414 extern void _bfd_elf_strtab_delref 1415 PARAMS ((struct elf_strtab_hash *, bfd_size_type)); 1416 extern void _bfd_elf_strtab_clear_all_refs 1417 PARAMS ((struct elf_strtab_hash *)); 1418 extern bfd_size_type _bfd_elf_strtab_size 1419 PARAMS ((struct elf_strtab_hash *)); 1420 extern bfd_size_type _bfd_elf_strtab_offset 1421 PARAMS ((struct elf_strtab_hash *, bfd_size_type)); 1422 extern bfd_boolean _bfd_elf_strtab_emit 1423 PARAMS ((bfd *, struct elf_strtab_hash *)); 1424 extern void _bfd_elf_strtab_finalize 1425 PARAMS ((struct elf_strtab_hash *)); 1426 1427 extern bfd_boolean _bfd_elf_discard_section_eh_frame 1428 PARAMS ((bfd *, struct bfd_link_info *, asection *, 1429 bfd_boolean (*) (bfd_vma, PTR), struct elf_reloc_cookie *)); 1430 extern bfd_boolean _bfd_elf_discard_section_eh_frame_hdr 1431 PARAMS ((bfd *, struct bfd_link_info *)); 1432 extern bfd_vma _bfd_elf_eh_frame_section_offset 1433 PARAMS ((bfd *, asection *, bfd_vma)); 1434 extern bfd_boolean _bfd_elf_write_section_eh_frame 1435 PARAMS ((bfd *, struct bfd_link_info *, asection *, bfd_byte *)); 1436 extern bfd_boolean _bfd_elf_write_section_eh_frame_hdr 1437 PARAMS ((bfd *, struct bfd_link_info *)); 1438 extern bfd_boolean _bfd_elf_maybe_strip_eh_frame_hdr 1439 PARAMS ((struct bfd_link_info *)); 1440 1441 extern bfd_boolean _bfd_elf_link_record_dynamic_symbol 1442 PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); 1443 extern long _bfd_elf_link_lookup_local_dynindx 1444 PARAMS ((struct bfd_link_info *, bfd *, long)); 1445 extern bfd_boolean _bfd_elf_compute_section_file_positions 1446 PARAMS ((bfd *, struct bfd_link_info *)); 1447 extern void _bfd_elf_assign_file_positions_for_relocs 1448 PARAMS ((bfd *)); 1449 extern file_ptr _bfd_elf_assign_file_position_for_section 1450 PARAMS ((Elf_Internal_Shdr *, file_ptr, bfd_boolean)); 1451 1452 extern bfd_boolean _bfd_elf_validate_reloc 1453 PARAMS ((bfd *, arelent *)); 1454 1455 extern bfd_boolean _bfd_elf_create_dynamic_sections 1456 PARAMS ((bfd *, struct bfd_link_info *)); 1457 extern bfd_boolean _bfd_elf_create_got_section 1458 PARAMS ((bfd *, struct bfd_link_info *)); 1459 extern unsigned long _bfd_elf_link_renumber_dynsyms 1460 PARAMS ((bfd *, struct bfd_link_info *)); 1461 1462 extern bfd_boolean _bfd_elfcore_make_pseudosection 1463 PARAMS ((bfd *, char *, size_t, ufile_ptr)); 1464 extern char *_bfd_elfcore_strndup 1465 PARAMS ((bfd *, char *, size_t)); 1466 1467 extern elf_linker_section_t *_bfd_elf_create_linker_section 1468 PARAMS ((bfd *, struct bfd_link_info *, enum elf_linker_section_enum, 1469 elf_linker_section_t *)); 1470 1471 extern elf_linker_section_pointers_t *_bfd_elf_find_pointer_linker_section 1472 PARAMS ((elf_linker_section_pointers_t *, bfd_vma, 1473 elf_linker_section_enum_t)); 1474 1475 extern bfd_boolean bfd_elf32_create_pointer_linker_section 1476 PARAMS ((bfd *, struct bfd_link_info *, elf_linker_section_t *, 1477 struct elf_link_hash_entry *, const Elf_Internal_Rela *)); 1478 1479 extern bfd_vma bfd_elf32_finish_pointer_linker_section 1480 PARAMS ((bfd *, bfd *, struct bfd_link_info *, elf_linker_section_t *, 1481 struct elf_link_hash_entry *, bfd_vma, 1482 const Elf_Internal_Rela *, int)); 1483 1484 extern bfd_boolean bfd_elf64_create_pointer_linker_section 1485 PARAMS ((bfd *, struct bfd_link_info *, elf_linker_section_t *, 1486 struct elf_link_hash_entry *, const Elf_Internal_Rela *)); 1487 1488 extern bfd_vma bfd_elf64_finish_pointer_linker_section 1489 PARAMS ((bfd *, bfd *, struct bfd_link_info *, elf_linker_section_t *, 1490 struct elf_link_hash_entry *, bfd_vma, 1491 const Elf_Internal_Rela *, int)); 1492 1493 extern bfd_boolean _bfd_elf_make_linker_section_rela 1494 PARAMS ((bfd *, elf_linker_section_t *, int)); 1495 1496 extern const bfd_target *bfd_elf32_object_p 1497 PARAMS ((bfd *)); 1498 extern const bfd_target *bfd_elf32_core_file_p 1499 PARAMS ((bfd *)); 1500 extern char *bfd_elf32_core_file_failing_command 1501 PARAMS ((bfd *)); 1502 extern int bfd_elf32_core_file_failing_signal 1503 PARAMS ((bfd *)); 1504 extern bfd_boolean bfd_elf32_core_file_matches_executable_p 1505 PARAMS ((bfd *, bfd *)); 1506 1507 extern bfd_boolean bfd_elf32_bfd_link_add_symbols 1508 PARAMS ((bfd *, struct bfd_link_info *)); 1509 extern bfd_boolean bfd_elf32_bfd_final_link 1150 1510 PARAMS ((bfd *, struct bfd_link_info *)); 1151 1511 1152 1512 extern void bfd_elf32_swap_symbol_in 1153 PARAMS ((bfd *, const Elf32_External_Sym *, Elf_Internal_Sym *));1513 PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *)); 1154 1514 extern void bfd_elf32_swap_symbol_out 1155 PARAMS ((bfd *, const Elf_Internal_Sym *, PTR ));1515 PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR)); 1156 1516 extern void bfd_elf32_swap_reloc_in 1157 PARAMS ((bfd *, const Elf32_External_Rel *, Elf_Internal_Rel*));1517 PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); 1158 1518 extern void bfd_elf32_swap_reloc_out 1159 PARAMS ((bfd *, const Elf_Internal_Rel *, Elf32_External_Rel*));1519 PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); 1160 1520 extern void bfd_elf32_swap_reloca_in 1161 PARAMS ((bfd *, const Elf32_External_Rela*, Elf_Internal_Rela *));1521 PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); 1162 1522 extern void bfd_elf32_swap_reloca_out 1163 PARAMS ((bfd *, const Elf_Internal_Rela *, Elf32_External_Rela*));1523 PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); 1164 1524 extern void bfd_elf32_swap_phdr_in 1165 1525 PARAMS ((bfd *, const Elf32_External_Phdr *, Elf_Internal_Phdr *)); … … 1171 1531 PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR)); 1172 1532 extern long bfd_elf32_slurp_symbol_table 1173 PARAMS ((bfd *, asymbol **, boolean)); 1174 extern boolean bfd_elf32_write_shdrs_and_ehdr PARAMS ((bfd *)); 1533 PARAMS ((bfd *, asymbol **, bfd_boolean)); 1534 extern bfd_boolean bfd_elf32_write_shdrs_and_ehdr 1535 PARAMS ((bfd *)); 1175 1536 extern int bfd_elf32_write_out_phdrs 1176 PARAMS ((bfd *, const Elf_Internal_Phdr *, int));1537 PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int)); 1177 1538 extern void bfd_elf32_write_relocs 1178 1539 PARAMS ((bfd *, asection *, PTR)); 1179 extern b oolean bfd_elf32_slurp_reloc_table1180 PARAMS ((bfd *, asection *, asymbol **, b oolean));1181 extern b oolean bfd_elf32_add_dynamic_entry1540 extern bfd_boolean bfd_elf32_slurp_reloc_table 1541 PARAMS ((bfd *, asection *, asymbol **, bfd_boolean)); 1542 extern bfd_boolean bfd_elf32_add_dynamic_entry 1182 1543 PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma)); 1183 extern b oolean bfd_elf32_link_create_dynamic_sections1544 extern bfd_boolean bfd_elf32_link_create_dynamic_sections 1184 1545 PARAMS ((bfd *, struct bfd_link_info *)); 1185 1546 extern Elf_Internal_Rela *_bfd_elf32_link_read_relocs 1186 PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, boolean)); 1187 1188 extern const bfd_target *bfd_elf64_object_p PARAMS ((bfd *)); 1189 extern const bfd_target *bfd_elf64_core_file_p PARAMS ((bfd *)); 1190 extern char *bfd_elf64_core_file_failing_command PARAMS ((bfd *)); 1191 extern int bfd_elf64_core_file_failing_signal PARAMS ((bfd *)); 1192 extern boolean bfd_elf64_core_file_matches_executable_p PARAMS ((bfd *, 1193 bfd *)); 1194 extern boolean bfd_elf64_bfd_link_add_symbols 1195 PARAMS ((bfd *, struct bfd_link_info *)); 1196 extern boolean bfd_elf64_bfd_final_link 1547 PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, bfd_boolean)); 1548 1549 extern const bfd_target *bfd_elf64_object_p 1550 PARAMS ((bfd *)); 1551 extern const bfd_target *bfd_elf64_core_file_p 1552 PARAMS ((bfd *)); 1553 extern char *bfd_elf64_core_file_failing_command 1554 PARAMS ((bfd *)); 1555 extern int bfd_elf64_core_file_failing_signal 1556 PARAMS ((bfd *)); 1557 extern bfd_boolean bfd_elf64_core_file_matches_executable_p 1558 PARAMS ((bfd *, bfd *)); 1559 extern bfd_boolean bfd_elf64_bfd_link_add_symbols 1560 PARAMS ((bfd *, struct bfd_link_info *)); 1561 extern bfd_boolean bfd_elf64_bfd_final_link 1197 1562 PARAMS ((bfd *, struct bfd_link_info *)); 1198 1563 1199 1564 extern void bfd_elf64_swap_symbol_in 1200 PARAMS ((bfd *, const Elf64_External_Sym *, Elf_Internal_Sym *));1565 PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *)); 1201 1566 extern void bfd_elf64_swap_symbol_out 1202 PARAMS ((bfd *, const Elf_Internal_Sym *, PTR ));1567 PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR)); 1203 1568 extern void bfd_elf64_swap_reloc_in 1204 PARAMS ((bfd *, const Elf64_External_Rel *, Elf_Internal_Rel*));1569 PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); 1205 1570 extern void bfd_elf64_swap_reloc_out 1206 PARAMS ((bfd *, const Elf_Internal_Rel *, Elf64_External_Rel*));1571 PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); 1207 1572 extern void bfd_elf64_swap_reloca_in 1208 PARAMS ((bfd *, const Elf64_External_Rela*, Elf_Internal_Rela *));1573 PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); 1209 1574 extern void bfd_elf64_swap_reloca_out 1210 PARAMS ((bfd *, const Elf_Internal_Rela *, Elf64_External_Rela*));1575 PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); 1211 1576 extern void bfd_elf64_swap_phdr_in 1212 1577 PARAMS ((bfd *, const Elf64_External_Phdr *, Elf_Internal_Phdr *)); … … 1218 1583 PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR)); 1219 1584 extern long bfd_elf64_slurp_symbol_table 1220 PARAMS ((bfd *, asymbol **, boolean)); 1221 extern boolean bfd_elf64_write_shdrs_and_ehdr PARAMS ((bfd *)); 1585 PARAMS ((bfd *, asymbol **, bfd_boolean)); 1586 extern bfd_boolean bfd_elf64_write_shdrs_and_ehdr 1587 PARAMS ((bfd *)); 1222 1588 extern int bfd_elf64_write_out_phdrs 1223 PARAMS ((bfd *, const Elf_Internal_Phdr *, int));1589 PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int)); 1224 1590 extern void bfd_elf64_write_relocs 1225 1591 PARAMS ((bfd *, asection *, PTR)); 1226 extern b oolean bfd_elf64_slurp_reloc_table1227 PARAMS ((bfd *, asection *, asymbol **, b oolean));1228 extern b oolean bfd_elf64_add_dynamic_entry1592 extern bfd_boolean bfd_elf64_slurp_reloc_table 1593 PARAMS ((bfd *, asection *, asymbol **, bfd_boolean)); 1594 extern bfd_boolean bfd_elf64_add_dynamic_entry 1229 1595 PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma)); 1230 extern b oolean bfd_elf64_link_create_dynamic_sections1596 extern bfd_boolean bfd_elf64_link_create_dynamic_sections 1231 1597 PARAMS ((bfd *, struct bfd_link_info *)); 1232 1598 extern Elf_Internal_Rela *_bfd_elf64_link_read_relocs 1233 PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, b oolean));1599 PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, bfd_boolean)); 1234 1600 1235 1601 #define bfd_elf32_link_record_dynamic_symbol \ … … 1238 1604 _bfd_elf_link_record_dynamic_symbol 1239 1605 1240 boolean _bfd_elf32_link_record_local_dynamic_symbol1606 extern int elf_link_record_local_dynamic_symbol 1241 1607 PARAMS ((struct bfd_link_info *, bfd *, long)); 1242 boolean _bfd_elf64_link_record_local_dynamic_symbol 1243 PARAMS ((struct bfd_link_info *, bfd *, long)); 1244 1245 extern boolean _bfd_elf_close_and_cleanup PARAMS ((bfd *)); 1608 #define _bfd_elf32_link_record_local_dynamic_symbol \ 1609 elf_link_record_local_dynamic_symbol 1610 #define _bfd_elf64_link_record_local_dynamic_symbol \ 1611 elf_link_record_local_dynamic_symbol 1612 1613 extern bfd_boolean _bfd_elf_close_and_cleanup 1614 PARAMS ((bfd *)); 1246 1615 extern bfd_reloc_status_type _bfd_elf_rel_vtable_reloc_fn 1247 1616 PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, 1248 1617 asection *, bfd *, char **)); 1249 1618 1250 boolean _bfd_elf32_gc_sections1251 PARAMS ((bfd * abfd, struct bfd_link_info *info));1252 boolean _bfd_elf32_gc_common_finalize_got_offsets1253 PARAMS ((bfd * abfd, struct bfd_link_info *info));1254 boolean _bfd_elf32_gc_common_final_link1255 PARAMS ((bfd *, struct bfd_link_info *)); 1256 boolean _bfd_elf32_gc_record_vtinherit1619 extern bfd_boolean _bfd_elf32_gc_sections 1620 PARAMS ((bfd *, struct bfd_link_info *)); 1621 extern bfd_boolean _bfd_elf32_gc_common_finalize_got_offsets 1622 PARAMS ((bfd *, struct bfd_link_info *)); 1623 extern bfd_boolean _bfd_elf32_gc_common_final_link 1624 PARAMS ((bfd *, struct bfd_link_info *)); 1625 extern bfd_boolean _bfd_elf32_gc_record_vtinherit 1257 1626 PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma)); 1258 boolean _bfd_elf32_gc_record_vtentry1627 extern bfd_boolean _bfd_elf32_gc_record_vtentry 1259 1628 PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma)); 1260 1629 1261 boolean _bfd_elf64_gc_sections1262 PARAMS ((bfd * abfd, struct bfd_link_info *info));1263 boolean _bfd_elf64_gc_common_finalize_got_offsets1264 PARAMS ((bfd * abfd, struct bfd_link_info *info));1265 boolean _bfd_elf64_gc_common_final_link1266 PARAMS ((bfd *, struct bfd_link_info *)); 1267 boolean _bfd_elf64_gc_record_vtinherit1630 extern bfd_boolean _bfd_elf64_gc_sections 1631 PARAMS ((bfd *, struct bfd_link_info *)); 1632 extern bfd_boolean _bfd_elf64_gc_common_finalize_got_offsets 1633 PARAMS ((bfd *, struct bfd_link_info *)); 1634 extern bfd_boolean _bfd_elf64_gc_common_final_link 1635 PARAMS ((bfd *, struct bfd_link_info *)); 1636 extern bfd_boolean _bfd_elf64_gc_record_vtinherit 1268 1637 PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma)); 1269 boolean _bfd_elf64_gc_record_vtentry1638 extern bfd_boolean _bfd_elf64_gc_record_vtentry 1270 1639 PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma)); 1271 1640 1272 /* MIPS ELF specific routines. */ 1273 1274 extern boolean _bfd_mips_elf_object_p PARAMS ((bfd *)); 1275 extern boolean _bfd_mips_elf_section_from_shdr 1276 PARAMS ((bfd *, Elf_Internal_Shdr *, char *)); 1277 extern boolean _bfd_mips_elf_fake_sections 1278 PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); 1279 extern boolean _bfd_mips_elf_section_from_bfd_section 1280 PARAMS ((bfd *, Elf_Internal_Shdr *, asection *, int *)); 1281 extern boolean _bfd_mips_elf_section_processing 1282 PARAMS ((bfd *, Elf_Internal_Shdr *)); 1283 extern void _bfd_mips_elf_symbol_processing PARAMS ((bfd *, asymbol *)); 1284 extern boolean _bfd_mips_elf_read_ecoff_info 1285 PARAMS ((bfd *, asection *, struct ecoff_debug_info *)); 1286 extern void _bfd_mips_elf_final_write_processing PARAMS ((bfd *, boolean)); 1287 extern bfd_reloc_status_type _bfd_mips_elf_hi16_reloc 1288 PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); 1289 extern bfd_reloc_status_type _bfd_mips_elf_lo16_reloc 1290 PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); 1291 extern bfd_reloc_status_type _bfd_mips_elf_gprel16_reloc 1292 PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); 1293 extern bfd_reloc_status_type _bfd_mips_elf_got16_reloc 1294 PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); 1295 extern bfd_reloc_status_type _bfd_mips_elf_gprel32_reloc 1296 PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); 1297 extern boolean _bfd_mips_elf_set_private_flags PARAMS ((bfd *, flagword)); 1298 extern boolean _bfd_mips_elf_copy_private_bfd_data PARAMS ((bfd *, bfd *)); 1299 extern boolean _bfd_mips_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); 1300 extern boolean _bfd_mips_elf_find_nearest_line 1301 PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, 1302 const char **, unsigned int *)); 1303 extern boolean _bfd_mips_elf_set_section_contents 1304 PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); 1305 extern boolean _bfd_mips_elf_create_dynamic_sections 1306 PARAMS ((bfd *, struct bfd_link_info *)); 1307 extern boolean _bfd_mips_elf_add_symbol_hook 1308 PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, 1309 const char **, flagword *, asection **, bfd_vma *)); 1310 extern boolean _bfd_mips_elf_adjust_dynamic_symbol 1311 PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); 1312 extern boolean _bfd_mips_elf_finish_dynamic_symbol 1313 PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, 1314 Elf_Internal_Sym *)); 1315 extern boolean _bfd_mips_elf_finish_dynamic_sections 1316 PARAMS ((bfd *, struct bfd_link_info *)); 1317 extern asection * _bfd_mips_elf_gc_mark_hook 1318 PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, 1319 struct elf_link_hash_entry *, Elf_Internal_Sym *)); 1320 extern boolean _bfd_mips_elf_gc_sweep_hook 1321 PARAMS ((bfd *, struct bfd_link_info *, asection *, 1322 const Elf_Internal_Rela *)); 1323 extern boolean _bfd_mips_elf_always_size_sections 1324 PARAMS ((bfd *, struct bfd_link_info *)); 1325 extern boolean _bfd_mips_elf_size_dynamic_sections 1326 PARAMS ((bfd *, struct bfd_link_info *)); 1327 extern boolean _bfd_mips_elf_check_relocs 1328 PARAMS ((bfd *, struct bfd_link_info *, asection *, 1329 const Elf_Internal_Rela *)); 1330 extern struct bfd_link_hash_table *_bfd_mips_elf_link_hash_table_create 1331 PARAMS ((bfd *)); 1332 extern boolean _bfd_mips_elf_print_private_bfd_data 1333 PARAMS ((bfd *, PTR)); 1334 extern boolean _bfd_mips_elf_link_output_symbol_hook 1335 PARAMS ((bfd *, struct bfd_link_info *, const char *, Elf_Internal_Sym *, 1336 asection *)); 1337 extern boolean _bfd_mips_elf_final_link 1338 PARAMS ((bfd *, struct bfd_link_info *)); 1339 extern int _bfd_mips_elf_additional_program_headers PARAMS ((bfd *)); 1340 extern boolean _bfd_mips_elf_modify_segment_map PARAMS ((bfd *)); 1341 extern boolean _bfd_mips_elf_relocate_section 1342 PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, 1343 Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); 1641 extern bfd_boolean _bfd_elf32_reloc_symbol_deleted_p 1642 PARAMS ((bfd_vma, PTR)); 1643 extern bfd_boolean _bfd_elf64_reloc_symbol_deleted_p 1644 PARAMS ((bfd_vma, PTR)); 1645 1646 /* Exported interface for writing elf corefile notes. */ 1647 extern char *elfcore_write_note 1648 PARAMS ((bfd *, char *, int *, const char *, int, const PTR, int)); 1649 extern char *elfcore_write_prpsinfo 1650 PARAMS ((bfd *, char *, int *, const char *, const char *)); 1651 extern char *elfcore_write_prstatus 1652 PARAMS ((bfd *, char *, int *, long, int, const PTR)); 1653 extern char * elfcore_write_pstatus 1654 PARAMS ((bfd *, char *, int *, long, int, const PTR)); 1655 extern char *elfcore_write_prfpreg 1656 PARAMS ((bfd *, char *, int *, const PTR, int)); 1657 extern char *elfcore_write_prxfpreg 1658 PARAMS ((bfd *, char *, int *, const PTR, int)); 1659 extern char *elfcore_write_lwpstatus 1660 PARAMS ((bfd *, char *, int *, long, int, const PTR)); 1344 1661 1345 1662 /* SH ELF specific routine. */ 1346 1663 1347 extern boolean _sh_elf_set_mach_from_flags PARAMS ((bfd *)); 1664 extern bfd_boolean _sh_elf_set_mach_from_flags 1665 PARAMS ((bfd *)); 1348 1666 1349 1667 #endif /* _LIBELF_H_ */ -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.