Changeset 609 for branches/GNU/src/binutils/bfd/bfd-in2.h
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/bfd/bfd-in2.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 /* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically 2 generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", 3 "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", 4 "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", 5 "linker.c" and "simple.c". 6 Run "make headers" in your build bfd/ to regenerate. */ 7 1 8 /* Main header file for the bfd library -- portable access to object files. 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 3 2000, 2001 4 Free Software Foundation, Inc. 9 10 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 11 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 12 5 13 Contributed by Cygnus Support. 6 14 7 ** NOTE: bfd.h and bfd-in2.h are GENERATED files. Don't change them; 8 ** instead, change bfd-in.h or the other BFD source files processed to 9 ** generate these files. 10 11 This file is part of BFD, the Binary File Descriptor library. 12 13 This program is free software; you can redistribute it and/or modify 14 it under the terms of the GNU General Public License as published by 15 the Free Software Foundation; either version 2 of the License, or 16 (at your option) any later version. 17 18 This program is distributed in the hope that it will be useful, 19 but WITHOUT ANY WARRANTY; without even the implied warranty of 20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 GNU General Public License for more details. 22 23 You should have received a copy of the GNU General Public License 24 along with this program; if not, write to the Free Software 25 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 26 27 /* bfd.h -- The only header file required by users of the bfd library 28 29 The bfd.h file is generated from bfd-in.h and various .c files; if you 30 change it, your changes will probably be lost. 31 32 All the prototypes and definitions following the comment "THE FOLLOWING 33 IS EXTRACTED FROM THE SOURCE" are extracted from the source files for 34 BFD. If you change it, someone oneday will extract it from the source 35 again, and your changes will be lost. To save yourself from this bind, 36 change the definitions in the source in the bfd directory. Type "make 37 docs" and then "make headers" in that directory, and magically this file 38 will change to reflect your changes. 39 40 If you don't have the tools to perform the extraction, then you are 41 safe from someone on your system trampling over your header files. 42 You should still maintain the equivalence between the source and this 43 file though; every change you make to the .c file should be reflected 44 here. */ 15 This file is part of BFD, the Binary File Descriptor library. 16 17 This program is free software; you can redistribute it and/or modify 18 it under the terms of the GNU General Public License as published by 19 the Free Software Foundation; either version 2 of the License, or 20 (at your option) any later version. 21 22 This program is distributed in the hope that it will be useful, 23 but WITHOUT ANY WARRANTY; without even the implied warranty of 24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 GNU General Public License for more details. 26 27 You should have received a copy of the GNU General Public License 28 along with this program; if not, write to the Free Software 29 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 45 30 46 31 #ifndef __BFD_H_SEEN__ … … 52 37 53 38 #include "ansidecl.h" 54 55 /* These two lines get substitutions done by commands in Makefile.in. */ 56 #define BFD_VERSION "@VERSION@" 39 #include "symcat.h" 40 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) 41 #ifndef SABER 42 /* This hack is to avoid a problem with some strict ANSI C preprocessors. 43 The problem is, "32_" is not a valid preprocessing token, and we don't 44 want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will 45 cause the inner CONCAT2 macros to be evaluated first, producing 46 still-valid pp-tokens. Then the final concatenation can be done. */ 47 #undef CONCAT4 48 #define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d)) 49 #endif 50 #endif 51 52 /* The word size used by BFD on the host. This may be 64 with a 32 53 bit target if the host is 64 bit, or if other 64 bit targets have 54 been selected with --enable-targets, or if --enable-64-bit-bfd. */ 57 55 #define BFD_ARCH_SIZE @wordsize@ 56 57 /* The word size of the default bfd target. */ 58 #define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@ 59 58 60 #define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@ 59 61 #if @BFD_HOST_64_BIT_DEFINED@ … … 74 76 #endif 75 77 76 /* forward declaration */ 77 typedef struct _bfd bfd; 78 79 /* To squelch erroneous compiler warnings ("illegal pointer 80 combination") from the SVR3 compiler, we would like to typedef 81 boolean to int (it doesn't like functions which return boolean. 82 Making sure they are never implicitly declared to return int 83 doesn't seem to help). But this file is not configured based on 84 the host. */ 85 /* General rules: functions which are boolean return true on success 86 and false on failure (unless they're a predicate). -- bfd.doc */ 87 /* I'm sure this is going to break something and someone is going to 88 force me to change it. */ 89 /* typedef enum boolean {false, true} boolean; */ 90 /* Yup, SVR4 has a "typedef enum boolean" in <sys/types.h> -fnf */ 91 /* It gets worse if the host also defines a true/false enum... -sts */ 92 /* And even worse if your compiler has built-in boolean types... -law */ 93 #if defined (__GNUG__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6)) 94 #define TRUE_FALSE_ALREADY_DEFINED 78 /* Forward declaration. */ 79 typedef struct bfd bfd; 80 81 /* Boolean type used in bfd. Too many systems define their own 82 versions of "boolean" for us to safely typedef a "boolean" of 83 our own. Using an enum for "bfd_boolean" has its own set of 84 problems, with strange looking casts required to avoid warnings 85 on some older compilers. Thus we just use an int. 86 87 General rule: Functions which are bfd_boolean return TRUE on 88 success and FALSE on failure (unless they're a predicate). */ 89 90 typedef int bfd_boolean; 91 #undef FALSE 92 #undef TRUE 93 #define FALSE 0 94 #define TRUE 1 95 96 #if 0 97 /* Poison. */ 98 #undef false 99 #undef true 100 #define false dont_use_false_in_bfd 101 #define true dont_use_true_in_bfd 95 102 #endif 96 #ifdef MPW97 /* Pre-emptive strike - get the file with the enum. */98 #include <Types.h>99 #define TRUE_FALSE_ALREADY_DEFINED100 #endif /* MPW */101 #ifndef TRUE_FALSE_ALREADY_DEFINED102 typedef enum bfd_boolean {false, true} boolean;103 #define BFD_TRUE_FALSE104 #else105 /* Use enum names that will appear nowhere else. */106 typedef enum bfd_boolean {bfd_fffalse, bfd_tttrue} boolean;107 #endif108 109 /* A pointer to a position in a file. */110 /* FIXME: This should be using off_t from <sys/types.h>.111 For now, try to avoid breaking stuff by not including <sys/types.h> here.112 This will break on systems with 64-bit file offsets (e.g. 4.4BSD).113 Probably the best long-term answer is to avoid using file_ptr AND off_t114 in this header file, and to handle this in the BFD implementation115 rather than in its interface. */116 /* typedef off_t file_ptr; */117 typedef long int file_ptr;118 103 119 104 /* Support for different sizes of target format ints and addresses. … … 184 169 #endif /* not BFD64 */ 185 170 171 /* A pointer to a position in a file. */ 172 /* FIXME: This should be using off_t from <sys/types.h>. 173 For now, try to avoid breaking stuff by not including <sys/types.h> here. 174 This will break on systems with 64-bit file offsets (e.g. 4.4BSD). 175 Probably the best long-term answer is to avoid using file_ptr AND off_t 176 in this header file, and to handle this in the BFD implementation 177 rather than in its interface. */ 178 /* typedef off_t file_ptr; */ 179 typedef bfd_signed_vma file_ptr; 180 typedef bfd_vma ufile_ptr; 181 182 extern void bfd_sprintf_vma 183 PARAMS ((bfd *, char *, bfd_vma)); 184 extern void bfd_fprintf_vma 185 PARAMS ((bfd *, PTR, bfd_vma)); 186 186 187 #define printf_vma(x) fprintf_vma(stdout,x) 188 #define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x) 187 189 188 190 typedef unsigned int flagword; /* 32 bits of flags */ … … 190 192 191 193 192 /** File formats */ 193 194 typedef enum bfd_format { 195 bfd_unknown = 0, /* file format is unknown */ 196 bfd_object, /* linker/assember/compiler output */ 197 bfd_archive, /* object archive file */ 198 bfd_core, /* core dump */ 199 bfd_type_end} /* marks the end; don't use it! */ 200 bfd_format; 194 /* File formats. */ 195 196 typedef enum bfd_format 197 { 198 bfd_unknown = 0, /* File format is unknown. */ 199 bfd_object, /* Linker/assember/compiler output. */ 200 bfd_archive, /* Object archive file. */ 201 bfd_core, /* Core dump. */ 202 bfd_type_end /* Marks the end; don't use it! */ 203 } 204 bfd_format; 201 205 202 206 /* Values that may appear in the flags field of a BFD. These also … … 257 261 #define BFD_IN_MEMORY 0x800 258 262 259 260 /* symbols and relocation */ 263 /* The sections in this BFD specify a memory page. */ 264 #define HAS_LOAD_PAGE 0x1000 265 266 267 /* Symbols and relocation. */ 261 268 262 269 /* A count of carsyms (canonical archive symbols). */ … … 282 289 283 290 /* A canonical archive symbol. */ 284 /* This is a type pun with struct ranlib on purpose! */ 285 typedef struct carsym { 291 /* This is a type pun with struct ranlib on purpose! */ 292 typedef struct carsym 293 { 286 294 char *name; 287 file_ptr file_offset; /* look here to find the file */ 288 } carsym; /* to make these you call a carsymogen */ 295 file_ptr file_offset; /* Look here to find the file. */ 296 } 297 carsym; /* To make these you call a carsymogen. */ 289 298 290 299 /* Used in generating armaps (archive tables of contents). 291 Perhaps just a forward definition would do? */ 292 struct orl { /* output ranlib */ 293 char **name; /* symbol name */ 294 file_ptr pos; /* bfd* or file position */ 295 int namidx; /* index into string table */ 300 Perhaps just a forward definition would do? */ 301 struct orl /* Output ranlib. */ 302 { 303 char **name; /* Symbol name. */ 304 union 305 { 306 file_ptr pos; 307 bfd *abfd; 308 } u; /* bfd* or file position. */ 309 int namidx; /* Index into string table. */ 296 310 }; 297 311 298 312 299 /* Linenumber stuff */ 300 typedef struct lineno_cache_entry { 301 unsigned int line_number; /* Linenumber from start of function*/ 302 union { 303 struct symbol_cache_entry *sym; /* Function name */ 304 unsigned long offset; /* Offset into section */ 313 /* Linenumber stuff. */ 314 typedef struct lineno_cache_entry 315 { 316 unsigned int line_number; /* Linenumber from start of function. */ 317 union 318 { 319 struct symbol_cache_entry *sym; /* Function name. */ 320 bfd_vma offset; /* Offset into section. */ 305 321 } u; 306 } alent; 307 308 309 /* object and core file sections */ 322 } 323 alent; 324 325 326 /* Object and core file sections. */ 310 327 311 328 #define align_power(addr, align) \ 312 ( ((addr) + ((1<<(align))-1)) & (-1 << (align)))329 (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) 313 330 314 331 typedef struct sec *sec_ptr; … … 316 333 #define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0) 317 334 #define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0) 335 #define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0) 318 336 #define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0) 319 337 #define bfd_section_name(bfd, ptr) ((ptr)->name) … … 327 345 #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) 328 346 329 #define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = (boolean)true), true)330 #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)), true)331 #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)), true)347 #define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) 348 #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) 349 #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) 332 350 333 351 typedef struct stat stat_type; … … 347 365 symvalue value; 348 366 char type; 349 CONSTchar *name; /* Symbol name. */367 const char *name; /* Symbol name. */ 350 368 unsigned char stab_type; /* Stab type. */ 351 369 char stab_other; /* Stab other. */ 352 370 short stab_desc; /* Stab desc. */ 353 CONSTchar *stab_name; /* String for stab type. */371 const char *stab_name; /* String for stab type. */ 354 372 } symbol_info; 355 373 356 374 /* Get the name of a stabs type code. */ 357 375 358 extern const char *bfd_get_stab_name PARAMS ((int)); 376 extern const char *bfd_get_stab_name 377 PARAMS ((int)); 359 378 360 379 … … 390 409 each function should be written to allocate a new block of memory 391 410 only if the argument is NULL. */ 392 struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *, 393 struct bfd_hash_table *, 394 const char *)); 411 struct bfd_hash_entry *(*newfunc) 412 PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); 395 413 /* An objalloc for this hash table. This is a struct objalloc *, 396 414 but we use PTR to avoid requiring the inclusion of objalloc.h. */ … … 399 417 400 418 /* Initialize a hash table. */ 401 extern b oolean bfd_hash_table_init419 extern bfd_boolean bfd_hash_table_init 402 420 PARAMS ((struct bfd_hash_table *, 403 421 struct bfd_hash_entry *(*) (struct bfd_hash_entry *, … … 406 424 407 425 /* Initialize a hash table specifying a size. */ 408 extern b oolean bfd_hash_table_init_n426 extern bfd_boolean bfd_hash_table_init_n 409 427 PARAMS ((struct bfd_hash_table *, 410 428 struct bfd_hash_entry *(*) (struct bfd_hash_entry *, … … 414 432 415 433 /* Free up a hash table. */ 416 extern void bfd_hash_table_free PARAMS ((struct bfd_hash_table *)); 417 418 /* Look up a string in a hash table. If CREATE is true, a new entry 434 extern void bfd_hash_table_free 435 PARAMS ((struct bfd_hash_table *)); 436 437 /* Look up a string in a hash table. If CREATE is TRUE, a new entry 419 438 will be created for this string if one does not already exist. The 420 COPY argument must be trueif this routine should copy the string439 COPY argument must be TRUE if this routine should copy the string 421 440 into newly allocated memory when adding an entry. */ 422 441 extern struct bfd_hash_entry *bfd_hash_lookup 423 PARAMS ((struct bfd_hash_table *, const char *, b oolean create,424 b oolean copy));442 PARAMS ((struct bfd_hash_table *, const char *, bfd_boolean create, 443 bfd_boolean copy)); 425 444 426 445 /* Replace an entry in a hash table. */ … … 435 454 436 455 /* Grab some space for a hash table entry. */ 437 extern PTR bfd_hash_allocate PARAMS ((struct bfd_hash_table *,438 456 extern PTR bfd_hash_allocate 457 PARAMS ((struct bfd_hash_table *, unsigned int)); 439 458 440 459 /* Traverse a hash table in a random order, calling a function on each 441 element. If the function returns false, the traversal stops. The460 element. If the function returns FALSE, the traversal stops. The 442 461 INFO argument is passed to the function. */ 443 extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *, 444 boolean (*) (struct bfd_hash_entry *, 445 PTR), 446 PTR info)); 447 448 449 /* Semi-portable string concatenation in cpp. 450 The CAT4 hack is to avoid a problem with some strict ANSI C preprocessors. 451 The problem is, "32_" is not a valid preprocessing token, and we don't 452 want extra underscores (e.g., "nlm_32_"). The XCAT2 macro will cause the 453 inner CAT macros to be evaluated first, producing still-valid pp-tokens. 454 Then the final concatenation can be done. (Sigh.) */ 455 #ifndef CAT 456 #ifdef SABER 457 #define CAT(a,b) a##b 458 #define CAT3(a,b,c) a##b##c 459 #define CAT4(a,b,c,d) a##b##c##d 460 #else 461 #if defined(__STDC__) || defined(ALMOST_STDC) 462 #define CAT(a,b) a##b 463 #define CAT3(a,b,c) a##b##c 464 #define XCAT2(a,b) CAT(a,b) 465 #define CAT4(a,b,c,d) XCAT2(CAT(a,b),CAT(c,d)) 466 #else 467 #define CAT(a,b) a/**/b 468 #define CAT3(a,b,c) a/**/b/**/c 469 #define CAT4(a,b,c,d) a/**/b/**/c/**/d 470 #endif 471 #endif 472 #endif 462 extern void bfd_hash_traverse 463 PARAMS ((struct bfd_hash_table *, 464 bfd_boolean (*) (struct bfd_hash_entry *, PTR), 465 PTR info)); 473 466 474 467 #define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table 475 468 476 477 /* User program access to BFD facilities */ 469 /* User program access to BFD facilities. */ 478 470 479 471 /* Direct I/O routines, for programs which know more about the object 480 472 file than BFD does. Use higher level routines if possible. */ 481 473 482 extern bfd_size_type bfd_read 483 PARAMS ((PTR, bfd_size_type size, bfd_size_type nitems, bfd *abfd)); 484 extern bfd_size_type bfd_write 485 PARAMS ((const PTR, bfd_size_type size, bfd_size_type nitems, bfd *abfd)); 486 extern int bfd_seek PARAMS ((bfd *abfd, file_ptr fp, int direction)); 487 extern long bfd_tell PARAMS ((bfd *abfd)); 488 extern int bfd_flush PARAMS ((bfd *abfd)); 489 extern int bfd_stat PARAMS ((bfd *abfd, struct stat *)); 474 extern bfd_size_type bfd_bread 475 PARAMS ((PTR, bfd_size_type, bfd *)); 476 extern bfd_size_type bfd_bwrite 477 PARAMS ((const PTR, bfd_size_type, bfd *)); 478 extern int bfd_seek 479 PARAMS ((bfd *, file_ptr, int)); 480 extern ufile_ptr bfd_tell 481 PARAMS ((bfd *)); 482 extern int bfd_flush 483 PARAMS ((bfd *)); 484 extern int bfd_stat 485 PARAMS ((bfd *, struct stat *)); 486 487 /* Deprecated old routines. */ 488 #if __GNUC__ 489 #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ 490 (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ 491 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) 492 #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ 493 (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ 494 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) 495 #else 496 #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ 497 (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ 498 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) 499 #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ 500 (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ 501 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) 502 #endif 503 extern void warn_deprecated 504 PARAMS ((const char *, const char *, int, const char *)); 490 505 491 506 /* Cast from const char * to char * so that caller can assign to … … 519 534 #define bfd_count_sections(abfd) ((abfd)->section_count) 520 535 536 #define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) 537 521 538 #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) 522 539 523 #define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean) (bool)), true) 524 525 extern boolean bfd_record_phdr 526 PARAMS ((bfd *, unsigned long, boolean, flagword, boolean, bfd_vma, 527 boolean, boolean, unsigned int, struct sec **)); 540 #define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) 541 542 extern bfd_boolean bfd_cache_close 543 PARAMS ((bfd *abfd)); 544 /* NB: This declaration should match the autogenerated one in libbfd.h. */ 545 546 extern bfd_boolean bfd_record_phdr 547 PARAMS ((bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma, 548 bfd_boolean, bfd_boolean, unsigned int, struct sec **)); 528 549 529 550 /* Byte swapping routines. */ 530 551 531 bfd_vma bfd_getb64 PARAMS ((const unsigned char *)); 532 bfd_vma bfd_getl64 PARAMS ((const unsigned char *)); 533 bfd_signed_vma bfd_getb_signed_64 PARAMS ((const unsigned char *)); 534 bfd_signed_vma bfd_getl_signed_64 PARAMS ((const unsigned char *)); 535 bfd_vma bfd_getb32 PARAMS ((const unsigned char *)); 536 bfd_vma bfd_getl32 PARAMS ((const unsigned char *)); 537 bfd_signed_vma bfd_getb_signed_32 PARAMS ((const unsigned char *)); 538 bfd_signed_vma bfd_getl_signed_32 PARAMS ((const unsigned char *)); 539 bfd_vma bfd_getb16 PARAMS ((const unsigned char *)); 540 bfd_vma bfd_getl16 PARAMS ((const unsigned char *)); 541 bfd_signed_vma bfd_getb_signed_16 PARAMS ((const unsigned char *)); 542 bfd_signed_vma bfd_getl_signed_16 PARAMS ((const unsigned char *)); 543 void bfd_putb64 PARAMS ((bfd_vma, unsigned char *)); 544 void bfd_putl64 PARAMS ((bfd_vma, unsigned char *)); 545 void bfd_putb32 PARAMS ((bfd_vma, unsigned char *)); 546 void bfd_putl32 PARAMS ((bfd_vma, unsigned char *)); 547 void bfd_putb16 PARAMS ((bfd_vma, unsigned char *)); 548 void bfd_putl16 PARAMS ((bfd_vma, unsigned char *)); 552 bfd_vma bfd_getb64 553 PARAMS ((const unsigned char *)); 554 bfd_vma bfd_getl64 555 PARAMS ((const unsigned char *)); 556 bfd_signed_vma bfd_getb_signed_64 557 PARAMS ((const unsigned char *)); 558 bfd_signed_vma bfd_getl_signed_64 559 PARAMS ((const unsigned char *)); 560 bfd_vma bfd_getb32 561 PARAMS ((const unsigned char *)); 562 bfd_vma bfd_getl32 563 PARAMS ((const unsigned char *)); 564 bfd_signed_vma bfd_getb_signed_32 565 PARAMS ((const unsigned char *)); 566 bfd_signed_vma bfd_getl_signed_32 567 PARAMS ((const unsigned char *)); 568 bfd_vma bfd_getb16 569 PARAMS ((const unsigned char *)); 570 bfd_vma bfd_getl16 571 PARAMS ((const unsigned char *)); 572 bfd_signed_vma bfd_getb_signed_16 573 PARAMS ((const unsigned char *)); 574 bfd_signed_vma bfd_getl_signed_16 575 PARAMS ((const unsigned char *)); 576 void bfd_putb64 577 PARAMS ((bfd_vma, unsigned char *)); 578 void bfd_putl64 579 PARAMS ((bfd_vma, unsigned char *)); 580 void bfd_putb32 581 PARAMS ((bfd_vma, unsigned char *)); 582 void bfd_putl32 583 PARAMS ((bfd_vma, unsigned char *)); 584 void bfd_putb16 585 PARAMS ((bfd_vma, unsigned char *)); 586 void bfd_putl16 587 PARAMS ((bfd_vma, unsigned char *)); 549 588 550 589 /* Byte swapping routines which take size and endiannes as arguments. */ 551 590 552 bfd_vma bfd_get_bits PARAMS ((bfd_byte *, int, boolean)); 553 void bfd_put_bits PARAMS ((bfd_vma, bfd_byte *, int, boolean)); 591 bfd_vma bfd_get_bits 592 PARAMS ((bfd_byte *, int, bfd_boolean)); 593 void bfd_put_bits 594 PARAMS ((bfd_vma, bfd_byte *, int, bfd_boolean)); 554 595 555 596 … … 565 606 struct bfd_elf_version_tree; 566 607 #endif 567 extern bfd_vma bfd_ecoff_get_gp_value PARAMS ((bfd * abfd)); 568 extern boolean bfd_ecoff_set_gp_value PARAMS ((bfd *abfd, bfd_vma gp_value)); 569 extern boolean bfd_ecoff_set_regmasks 608 extern bfd_vma bfd_ecoff_get_gp_value 609 PARAMS ((bfd * abfd)); 610 extern bfd_boolean bfd_ecoff_set_gp_value 611 PARAMS ((bfd *abfd, bfd_vma gp_value)); 612 extern bfd_boolean bfd_ecoff_set_regmasks 570 613 PARAMS ((bfd *abfd, unsigned long gprmask, unsigned long fprmask, 571 614 unsigned long *cprmask)); … … 578 621 const struct ecoff_debug_swap *output_swap, 579 622 struct bfd_link_info *)); 580 extern b oolean bfd_ecoff_debug_accumulate623 extern bfd_boolean bfd_ecoff_debug_accumulate 581 624 PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, 582 625 const struct ecoff_debug_swap *output_swap, … … 584 627 const struct ecoff_debug_swap *input_swap, 585 628 struct bfd_link_info *)); 586 extern b oolean bfd_ecoff_debug_accumulate_other629 extern bfd_boolean bfd_ecoff_debug_accumulate_other 587 630 PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, 588 631 const struct ecoff_debug_swap *output_swap, bfd *input_bfd, 589 632 struct bfd_link_info *)); 590 extern b oolean bfd_ecoff_debug_externals633 extern bfd_boolean bfd_ecoff_debug_externals 591 634 PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, 592 635 const struct ecoff_debug_swap *swap, 593 b oolean relocateable,594 b oolean (*get_extr) (struct symbol_cache_entry *,595 struct ecoff_extr *),636 bfd_boolean relocateable, 637 bfd_boolean (*get_extr) (struct symbol_cache_entry *, 638 struct ecoff_extr *), 596 639 void (*set_index) (struct symbol_cache_entry *, 597 640 bfd_size_type))); 598 extern b oolean bfd_ecoff_debug_one_external641 extern bfd_boolean bfd_ecoff_debug_one_external 599 642 PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, 600 643 const struct ecoff_debug_swap *swap, … … 603 646 PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, 604 647 const struct ecoff_debug_swap *swap)); 605 extern b oolean bfd_ecoff_write_debug648 extern bfd_boolean bfd_ecoff_write_debug 606 649 PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, 607 650 const struct ecoff_debug_swap *swap, file_ptr where)); 608 extern b oolean bfd_ecoff_write_accumulated_debug651 extern bfd_boolean bfd_ecoff_write_accumulated_debug 609 652 PARAMS ((PTR handle, bfd *abfd, struct ecoff_debug_info *debug, 610 653 const struct ecoff_debug_swap *swap, 611 654 struct bfd_link_info *info, file_ptr where)); 612 extern b oolean bfd_mips_ecoff_create_embedded_relocs655 extern bfd_boolean bfd_mips_ecoff_create_embedded_relocs 613 656 PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, 614 657 char **)); … … 623 666 }; 624 667 625 extern b oolean bfd_elf32_record_link_assignment626 PARAMS ((bfd *, struct bfd_link_info *, const char *, b oolean));627 extern b oolean bfd_elf64_record_link_assignment628 PARAMS ((bfd *, struct bfd_link_info *, const char *, b oolean));668 extern bfd_boolean bfd_elf32_record_link_assignment 669 PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean)); 670 extern bfd_boolean bfd_elf64_record_link_assignment 671 PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean)); 629 672 extern struct bfd_link_needed_list *bfd_elf_get_needed_list 630 673 PARAMS ((bfd *, struct bfd_link_info *)); 631 extern b oolean bfd_elf_get_bfd_needed_list674 extern bfd_boolean bfd_elf_get_bfd_needed_list 632 675 PARAMS ((bfd *, struct bfd_link_needed_list **)); 633 extern b oolean bfd_elf32_size_dynamic_sections634 PARAMS ((bfd *, const char *, const char *, boolean,const char *,676 extern bfd_boolean bfd_elf32_size_dynamic_sections 677 PARAMS ((bfd *, const char *, const char *, const char *, 635 678 const char * const *, struct bfd_link_info *, struct sec **, 636 679 struct bfd_elf_version_tree *)); 637 extern b oolean bfd_elf64_size_dynamic_sections638 PARAMS ((bfd *, const char *, const char *, boolean,const char *,680 extern bfd_boolean bfd_elf64_size_dynamic_sections 681 PARAMS ((bfd *, const char *, const char *, const char *, 639 682 const char * const *, struct bfd_link_info *, struct sec **, 640 683 struct bfd_elf_version_tree *)); 641 extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *)); 642 extern void bfd_elf_set_dt_needed_soname PARAMS ((bfd *, const char *)); 643 extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *)); 684 extern void bfd_elf_set_dt_needed_name 685 PARAMS ((bfd *, const char *)); 686 extern void bfd_elf_set_dt_needed_soname 687 PARAMS ((bfd *, const char *)); 688 extern const char *bfd_elf_get_dt_soname 689 PARAMS ((bfd *)); 644 690 extern struct bfd_link_needed_list *bfd_elf_get_runpath_list 691 PARAMS ((bfd *, struct bfd_link_info *)); 692 extern bfd_boolean bfd_elf32_discard_info 693 PARAMS ((bfd *, struct bfd_link_info *)); 694 extern bfd_boolean bfd_elf64_discard_info 645 695 PARAMS ((bfd *, struct bfd_link_info *)); 646 696 … … 648 698 copy of ABFD's program header table entries. Return -1 if an error 649 699 occurs; bfd_get_error will return an appropriate code. */ 650 extern long bfd_get_elf_phdr_upper_bound PARAMS ((bfd *abfd)); 700 extern long bfd_get_elf_phdr_upper_bound 701 PARAMS ((bfd *abfd)); 651 702 652 703 /* Copy ABFD's program header table entries to *PHDRS. The entries … … 657 708 Return the number of program header table entries read, or -1 if an 658 709 error occurs; bfd_get_error will return an appropriate code. */ 659 extern int bfd_get_elf_phdrs PARAMS ((bfd *abfd, void *phdrs)); 710 extern int bfd_get_elf_phdrs 711 PARAMS ((bfd *abfd, void *phdrs)); 660 712 661 713 /* Return the arch_size field of an elf bfd, or -1 if not elf. */ 662 extern int bfd_get_arch_size PARAMS ((bfd *)); 663 664 /* Return true if address "naturally" sign extends, or -1 if not elf. */ 665 extern int bfd_get_sign_extend_vma PARAMS ((bfd *)); 666 667 extern boolean bfd_m68k_elf32_create_embedded_relocs 714 extern int bfd_get_arch_size 715 PARAMS ((bfd *)); 716 717 /* Return TRUE if address "naturally" sign extends, or -1 if not elf. */ 718 extern int bfd_get_sign_extend_vma 719 PARAMS ((bfd *)); 720 721 extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs 668 722 PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, 669 723 char **)); 724 extern bfd_boolean bfd_mips_elf32_create_embedded_relocs 725 PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, 726 char **)); 670 727 671 728 /* SunOS shared library support routines for the linker. */ … … 673 730 extern struct bfd_link_needed_list *bfd_sunos_get_needed_list 674 731 PARAMS ((bfd *, struct bfd_link_info *)); 675 extern b oolean bfd_sunos_record_link_assignment732 extern bfd_boolean bfd_sunos_record_link_assignment 676 733 PARAMS ((bfd *, struct bfd_link_info *, const char *)); 677 extern b oolean bfd_sunos_size_dynamic_sections734 extern bfd_boolean bfd_sunos_size_dynamic_sections 678 735 PARAMS ((bfd *, struct bfd_link_info *, struct sec **, struct sec **, 679 736 struct sec **)); … … 681 738 /* Linux shared library support routines for the linker. */ 682 739 683 extern b oolean bfd_i386linux_size_dynamic_sections740 extern bfd_boolean bfd_i386linux_size_dynamic_sections 684 741 PARAMS ((bfd *, struct bfd_link_info *)); 685 extern b oolean bfd_m68klinux_size_dynamic_sections742 extern bfd_boolean bfd_m68klinux_size_dynamic_sections 686 743 PARAMS ((bfd *, struct bfd_link_info *)); 687 extern b oolean bfd_sparclinux_size_dynamic_sections744 extern bfd_boolean bfd_sparclinux_size_dynamic_sections 688 745 PARAMS ((bfd *, struct bfd_link_info *)); 689 746 … … 693 750 typedef struct _bfd_window_internal bfd_window_internal; 694 751 695 typedef struct _bfd_window { 752 typedef struct _bfd_window 753 { 696 754 /* What the user asked for. */ 697 755 PTR data; … … 704 762 application wants two writable copies! */ 705 763 struct _bfd_window_internal *i; 706 } bfd_window; 707 708 extern void bfd_init_window PARAMS ((bfd_window *)); 709 extern void bfd_free_window PARAMS ((bfd_window *)); 710 extern boolean bfd_get_file_window 711 PARAMS ((bfd *, file_ptr, bfd_size_type, bfd_window *, boolean)); 764 } 765 bfd_window; 766 767 extern void bfd_init_window 768 PARAMS ((bfd_window *)); 769 extern void bfd_free_window 770 PARAMS ((bfd_window *)); 771 extern bfd_boolean bfd_get_file_window 772 PARAMS ((bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean)); 712 773 713 774 /* XCOFF support routines for the linker. */ 714 775 715 extern b oolean bfd_xcoff_link_record_set776 extern bfd_boolean bfd_xcoff_link_record_set 716 777 PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, 717 778 bfd_size_type)); 718 extern b oolean bfd_xcoff_import_symbol779 extern bfd_boolean bfd_xcoff_import_symbol 719 780 PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, 720 bfd_vma, const char *, const char *, const char *)); 721 extern boolean bfd_xcoff_export_symbol 722 PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, 723 boolean)); 724 extern boolean bfd_xcoff_link_count_reloc 781 bfd_vma, const char *, const char *, const char *, unsigned int)); 782 extern bfd_boolean bfd_xcoff_export_symbol 783 PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *)); 784 extern bfd_boolean bfd_xcoff_link_count_reloc 725 785 PARAMS ((bfd *, struct bfd_link_info *, const char *)); 726 extern b oolean bfd_xcoff_record_link_assignment786 extern bfd_boolean bfd_xcoff_record_link_assignment 727 787 PARAMS ((bfd *, struct bfd_link_info *, const char *)); 728 extern b oolean bfd_xcoff_size_dynamic_sections788 extern bfd_boolean bfd_xcoff_size_dynamic_sections 729 789 PARAMS ((bfd *, struct bfd_link_info *, const char *, const char *, 730 unsigned long, unsigned long, unsigned long, boolean, 731 int, boolean, boolean, struct sec **)); 790 unsigned long, unsigned long, unsigned long, bfd_boolean, 791 int, bfd_boolean, bfd_boolean, struct sec **, bfd_boolean)); 792 extern bfd_boolean bfd_xcoff_link_generate_rtinit 793 PARAMS ((bfd *, const char *, const char *, bfd_boolean)); 794 795 /* XCOFF support routines for ar. */ 796 extern bfd_boolean bfd_xcoff_ar_archive_set_magic 797 PARAMS ((bfd *, char *)); 732 798 733 799 /* Externally visible COFF routines. */ … … 738 804 #endif 739 805 740 extern b oolean bfd_coff_get_syment806 extern bfd_boolean bfd_coff_get_syment 741 807 PARAMS ((bfd *, struct symbol_cache_entry *, struct internal_syment *)); 742 808 743 extern b oolean bfd_coff_get_auxent809 extern bfd_boolean bfd_coff_get_auxent 744 810 PARAMS ((bfd *, struct symbol_cache_entry *, int, union internal_auxent *)); 745 811 746 extern b oolean bfd_coff_set_symbol_class812 extern bfd_boolean bfd_coff_set_symbol_class 747 813 PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int)); 748 814 749 extern b oolean bfd_m68k_coff_create_embedded_relocs815 extern bfd_boolean bfd_m68k_coff_create_embedded_relocs 750 816 PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, 751 817 char **)); 752 818 753 819 /* ARM Interworking support. Called from linker. */ 754 extern b oolean bfd_arm_allocate_interworking_sections820 extern bfd_boolean bfd_arm_allocate_interworking_sections 755 821 PARAMS ((struct bfd_link_info *)); 756 822 757 extern b oolean bfd_arm_process_before_allocation823 extern bfd_boolean bfd_arm_process_before_allocation 758 824 PARAMS ((bfd *, struct bfd_link_info *, int)); 759 825 760 extern b oolean bfd_arm_get_bfd_for_interworking826 extern bfd_boolean bfd_arm_get_bfd_for_interworking 761 827 PARAMS ((bfd *, struct bfd_link_info *)); 762 828 763 829 /* PE ARM Interworking support. Called from linker. */ 764 extern b oolean bfd_arm_pe_allocate_interworking_sections830 extern bfd_boolean bfd_arm_pe_allocate_interworking_sections 765 831 PARAMS ((struct bfd_link_info *)); 766 832 767 extern b oolean bfd_arm_pe_process_before_allocation833 extern bfd_boolean bfd_arm_pe_process_before_allocation 768 834 PARAMS ((bfd *, struct bfd_link_info *, int)); 769 835 770 extern b oolean bfd_arm_pe_get_bfd_for_interworking836 extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking 771 837 PARAMS ((bfd *, struct bfd_link_info *)); 772 838 773 839 /* ELF ARM Interworking support. Called from linker. */ 774 extern b oolean bfd_elf32_arm_allocate_interworking_sections840 extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections 775 841 PARAMS ((struct bfd_link_info *)); 776 842 777 extern b oolean bfd_elf32_arm_process_before_allocation843 extern bfd_boolean bfd_elf32_arm_process_before_allocation 778 844 PARAMS ((bfd *, struct bfd_link_info *, int)); 779 845 780 extern b oolean bfd_elf32_arm_get_bfd_for_interworking846 extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking 781 847 PARAMS ((bfd *, struct bfd_link_info *)); 848 849 extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd 850 PARAMS ((bfd *, struct bfd_link_info *)); 851 852 /* ARM Note section processing. */ 853 extern bfd_boolean bfd_arm_merge_machines 854 PARAMS ((bfd *, bfd *)); 855 856 extern bfd_boolean bfd_arm_update_notes 857 PARAMS ((bfd *, const char *)); 858 859 extern unsigned int bfd_arm_get_mach_from_notes 860 PARAMS ((bfd *, const char *)); 782 861 783 862 /* TI COFF load page support. */ … … 788 867 PARAMS ((struct sec *)); 789 868 790 /* And more from the source. */869 /* Extracted from init.c. */ 791 870 void 792 871 bfd_init PARAMS ((void)); 793 872 873 /* Extracted from opncls.c. */ 794 874 bfd * 795 bfd_openr PARAMS (( CONST char *filename, CONSTchar *target));875 bfd_openr PARAMS ((const char *filename, const char *target)); 796 876 797 877 bfd * 798 bfd_fdopenr PARAMS (( CONST char *filename, CONSTchar *target, int fd));878 bfd_fdopenr PARAMS ((const char *filename, const char *target, int fd)); 799 879 800 880 bfd * … … 802 882 803 883 bfd * 804 bfd_openw PARAMS (( CONST char *filename, CONSTchar *target));805 806 b oolean884 bfd_openw PARAMS ((const char *filename, const char *target)); 885 886 bfd_boolean 807 887 bfd_close PARAMS ((bfd *abfd)); 808 888 809 b oolean889 bfd_boolean 810 890 bfd_close_all_done PARAMS ((bfd *)); 811 891 812 892 bfd * 813 bfd_create PARAMS (( CONSTchar *filename, bfd *templ));814 815 b oolean893 bfd_create PARAMS ((const char *filename, bfd *templ)); 894 895 bfd_boolean 816 896 bfd_make_writable PARAMS ((bfd *abfd)); 817 897 818 b oolean898 bfd_boolean 819 899 bfd_make_readable PARAMS ((bfd *abfd)); 820 900 901 char * 902 bfd_follow_gnu_debuglink PARAMS ((bfd *abfd, const char *dir)); 903 904 /* Extracted from libbfd.c. */ 821 905 822 906 /* Byte swapping macros for user section data. */ … … 827 911 bfd_put_8 828 912 #define bfd_get_8(abfd, ptr) \ 829 (*(unsigned char *) (ptr) )913 (*(unsigned char *) (ptr) & 0xff) 830 914 #define bfd_get_signed_8(abfd, ptr) \ 831 (( *(unsigned char *) (ptr) ^ 0x80) - 0x80)915 (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) 832 916 833 917 #define bfd_put_16(abfd, val, ptr) \ … … 859 943 860 944 #define bfd_get(bits, abfd, ptr) \ 861 ( (bits) == 8 ? bfd_get_8 (abfd, ptr)\945 ( (bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ 862 946 : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ 863 947 : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ … … 866 950 867 951 #define bfd_put(bits, abfd, val, ptr) \ 868 ( (bits) == 8 ? bfd_put_8 (abfd, val, ptr)\952 ( (bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ 869 953 : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ 870 954 : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ … … 876 960 877 961 #define bfd_h_put_8(abfd, val, ptr) \ 878 962 bfd_put_8 (abfd, val, ptr) 879 963 #define bfd_h_put_signed_8(abfd, val, ptr) \ 880 964 bfd_put_8 (abfd, val, ptr) 881 965 #define bfd_h_get_8(abfd, ptr) \ 882 966 bfd_get_8 (abfd, ptr) 883 967 #define bfd_h_get_signed_8(abfd, ptr) \ 884 968 bfd_get_signed_8 (abfd, ptr) 885 969 886 970 #define bfd_h_put_16(abfd, val, ptr) \ 887 BFD_SEND(abfd, bfd_h_putx16,(val,ptr))971 BFD_SEND (abfd, bfd_h_putx16, (val, ptr)) 888 972 #define bfd_h_put_signed_16 \ 889 973 bfd_h_put_16 890 974 #define bfd_h_get_16(abfd, ptr) \ 891 BFD_SEND(abfd, bfd_h_getx16,(ptr))975 BFD_SEND (abfd, bfd_h_getx16, (ptr)) 892 976 #define bfd_h_get_signed_16(abfd, ptr) \ 893 BFD_SEND(abfd, bfd_h_getx_signed_16, (ptr))977 BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr)) 894 978 895 979 #define bfd_h_put_32(abfd, val, ptr) \ 896 BFD_SEND(abfd, bfd_h_putx32,(val,ptr))980 BFD_SEND (abfd, bfd_h_putx32, (val, ptr)) 897 981 #define bfd_h_put_signed_32 \ 898 982 bfd_h_put_32 899 983 #define bfd_h_get_32(abfd, ptr) \ 900 BFD_SEND(abfd, bfd_h_getx32,(ptr))984 BFD_SEND (abfd, bfd_h_getx32, (ptr)) 901 985 #define bfd_h_get_signed_32(abfd, ptr) \ 902 BFD_SEND(abfd, bfd_h_getx_signed_32, (ptr))986 BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr)) 903 987 904 988 #define bfd_h_put_64(abfd, val, ptr) \ 905 BFD_SEND(abfd, bfd_h_putx64,(val, ptr))989 BFD_SEND (abfd, bfd_h_putx64, (val, ptr)) 906 990 #define bfd_h_put_signed_64 \ 907 991 bfd_h_put_64 908 992 #define bfd_h_get_64(abfd, ptr) \ 909 BFD_SEND(abfd, bfd_h_getx64,(ptr))993 BFD_SEND (abfd, bfd_h_getx64, (ptr)) 910 994 #define bfd_h_get_signed_64(abfd, ptr) \ 911 BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr)) 912 995 BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr)) 996 997 /* Refinements on the above, which should eventually go away. Save 998 cluttering the source with (bfd_vma) and (bfd_byte *) casts. */ 999 1000 #define H_PUT_64(abfd, val, where) \ 1001 bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 1002 1003 #define H_PUT_32(abfd, val, where) \ 1004 bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 1005 1006 #define H_PUT_16(abfd, val, where) \ 1007 bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 1008 1009 #define H_PUT_8 bfd_h_put_8 1010 1011 #define H_PUT_S64(abfd, val, where) \ 1012 bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 1013 1014 #define H_PUT_S32(abfd, val, where) \ 1015 bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 1016 1017 #define H_PUT_S16(abfd, val, where) \ 1018 bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) 1019 1020 #define H_PUT_S8 bfd_h_put_signed_8 1021 1022 #define H_GET_64(abfd, where) \ 1023 bfd_h_get_64 ((abfd), (bfd_byte *) (where)) 1024 1025 #define H_GET_32(abfd, where) \ 1026 bfd_h_get_32 ((abfd), (bfd_byte *) (where)) 1027 1028 #define H_GET_16(abfd, where) \ 1029 bfd_h_get_16 ((abfd), (bfd_byte *) (where)) 1030 1031 #define H_GET_8 bfd_h_get_8 1032 1033 #define H_GET_S64(abfd, where) \ 1034 bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where)) 1035 1036 #define H_GET_S32(abfd, where) \ 1037 bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where)) 1038 1039 #define H_GET_S16(abfd, where) \ 1040 bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where)) 1041 1042 #define H_GET_S8 bfd_h_get_signed_8 1043 1044 1045 /* Extracted from bfdio.c. */ 1046 long 1047 bfd_get_mtime PARAMS ((bfd *abfd)); 1048 1049 long 1050 bfd_get_size PARAMS ((bfd *abfd)); 1051 1052 /* Extracted from bfdwin.c. */ 1053 /* Extracted from section.c. */ 913 1054 /* This structure is used for a comdat section, as in PE. A comdat 914 1055 section is associated with a particular symbol. When the linker … … 932 1073 /* The name of the section; the name isn't a copy, the pointer is 933 1074 the same as that passed to bfd_make_section. */ 934 935 1075 const char *name; 936 1076 937 1077 /* A unique sequence number. */ 938 939 1078 int id; 940 1079 941 /* Which section is it; 0..nth. */ 942 1080 /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ 943 1081 int index; 944 1082 945 1083 /* The next section in the list belonging to the BFD, or NULL. */ 946 947 1084 struct sec *next; 948 1085 … … 950 1087 flags are read in from the object file, and some are 951 1088 synthesized from other information. */ 952 953 1089 flagword flags; 954 1090 … … 967 1103 #define SEC_RELOC 0x004 968 1104 969 #if 0 /* Obsolete ? */ 970 #define SEC_BALIGN 0x008 971 #endif 1105 /* ELF reserves 4 processor specific bits and 8 operating system 1106 specific bits in sh_flags; at present we can get away with just 1107 one in communicating between the assembler and BFD, but this 1108 isn't a good long-term solution. */ 1109 #define SEC_ARCH_BIT_0 0x008 972 1110 973 1111 /* A signal to the OS that the section contains read only data. */ … … 995 1133 #define SEC_CONSTRUCTOR 0x100 996 1134 997 /* The section is a constructor, and should be placed at the998 end of the text, data, or bss section(?). */999 #define SEC_CONSTRUCTOR_TEXT 0x11001000 #define SEC_CONSTRUCTOR_DATA 0x21001001 #define SEC_CONSTRUCTOR_BSS 0x31001002 1003 1135 /* The section has contents - a data section could be 1004 1136 <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be … … 1021 1153 #define SEC_COFF_SHARED_LIBRARY 0x800 1022 1154 1155 /* The section contains thread local data. */ 1156 #define SEC_THREAD_LOCAL 0x1000 1157 1023 1158 /* The section has GOT references. This flag is only for the 1024 1159 linker, and is currently only used by the elf32-hppa back end. … … 1052 1187 #define SEC_EXCLUDE 0x40000 1053 1188 1054 /* The contents of this section are to be sorted by the 1055 based on the address specified in the associated symbol 1056 table. */ 1189 /* The contents of this section are to be sorted based on the sum of 1190 the symbol and addend values specified by the associated relocation 1191 entries. Entries without associated relocation entries will be 1192 appended to the end of the section in an unspecified order. */ 1057 1193 #define SEC_SORT_ENTRIES 0x80000 1058 1194 … … 1112 1248 #define SEC_CLINK 0x10000000 1113 1249 1250 /* Attempt to merge identical entities in the section. 1251 Entity size is given in the entsize field. */ 1252 #define SEC_MERGE 0x20000000 1253 1254 /* If given with SEC_MERGE, entities to merge are zero terminated 1255 strings where entsize specifies character size instead of fixed 1256 size entries. */ 1257 #define SEC_STRINGS 0x40000000 1258 1259 /* This section contains data about section groups. */ 1260 #define SEC_GROUP 0x80000000 1261 1114 1262 /* End of section flags. */ 1115 1263 … … 1126 1274 1127 1275 /* Another mark flag used by some of the linker backends. Set for 1128 output sections that have a input section. */1276 output sections that have an input section. */ 1129 1277 unsigned int linker_has_input : 1; 1130 1278 … … 1132 1280 unsigned int gc_mark : 1; 1133 1281 1134 /* Used by the ELF code to mark sections which have been allocated to segments. */ 1282 /* The following flags are used by the ELF linker. */ 1283 1284 /* Mark sections which have been allocated to segments. */ 1135 1285 unsigned int segment_mark : 1; 1286 1287 /* Type of sec_info information. */ 1288 unsigned int sec_info_type:3; 1289 #define ELF_INFO_TYPE_NONE 0 1290 #define ELF_INFO_TYPE_STABS 1 1291 #define ELF_INFO_TYPE_MERGE 2 1292 #define ELF_INFO_TYPE_EH_FRAME 3 1293 #define ELF_INFO_TYPE_JUST_SYMS 4 1294 1295 /* Nonzero if this section uses RELA relocations, rather than REL. */ 1296 unsigned int use_rela_p:1; 1297 1298 /* Bits used by various backends. */ 1299 unsigned int has_tls_reloc:1; 1300 1301 /* Nonzero if this section needs the relax finalize pass. */ 1302 unsigned int need_finalize_relax:1; 1303 1304 /* Usused bits. */ 1305 unsigned int flag12:1; 1306 unsigned int flag13:1; 1307 unsigned int flag14:1; 1308 unsigned int flag15:1; 1309 unsigned int flag16:4; 1310 unsigned int flag20:4; 1311 unsigned int flag24:8; 1136 1312 1137 1313 /* End of internal packed boolean fields. */ … … 1143 1319 the default address for <<.data>> is dependent on the specific 1144 1320 target and various flags). */ 1145 1146 1321 bfd_vma vma; 1147 1322 1148 1323 /* The load address of the section - where it would be in a 1149 1324 rom image; really only used for writing section header 1150 information. */ 1151 1325 information. */ 1152 1326 bfd_vma lma; 1153 1327 … … 1155 1329 Contains a value even if the section has no contents (e.g., the 1156 1330 size of <<.bss>>). This will be filled in after relocation. */ 1157 1158 1331 bfd_size_type _cooked_size; 1159 1332 … … 1161 1334 value is the same as the size, but if some relaxing has 1162 1335 been done, then this value will be bigger. */ 1163 1164 1336 bfd_size_type _raw_size; 1165 1337 … … 1171 1343 would be 100. However, if the target byte size is 16 bits 1172 1344 (bfd_octets_per_byte is "2"), this value would be 50. */ 1173 1174 1345 bfd_vma output_offset; 1175 1346 1176 1347 /* The output section through which to map on output. */ 1177 1178 1348 struct sec *output_section; 1179 1349 1180 1350 /* The alignment requirement of the section, as an exponent of 2 - 1181 1351 e.g., 3 aligns to 2^3 (or 8). */ 1182 1183 1352 unsigned int alignment_power; 1184 1353 1185 1354 /* If an input section, a pointer to a vector of relocation 1186 1355 records for the data in this section. */ 1187 1188 1356 struct reloc_cache_entry *relocation; 1189 1357 1190 1358 /* If an output section, a pointer to a vector of pointers to 1191 1359 relocation records for the data in this section. */ 1192 1193 1360 struct reloc_cache_entry **orelocation; 1194 1361 1195 /* The number of relocation records in one of the above */ 1196 1362 /* The number of relocation records in one of the above. */ 1197 1363 unsigned reloc_count; 1198 1364 … … 1201 1367 1202 1368 /* File position of section data. */ 1203 1204 1369 file_ptr filepos; 1205 1370 1206 1371 /* File position of relocation info. */ 1207 1208 1372 file_ptr rel_filepos; 1209 1373 1210 1374 /* File position of line data. */ 1211 1212 1375 file_ptr line_filepos; 1213 1376 1214 1377 /* Pointer to data for applications. */ 1215 1216 1378 PTR userdata; 1217 1379 … … 1221 1383 1222 1384 /* Attached line number information. */ 1223 1224 1385 alent *lineno; 1225 1386 1226 1387 /* Number of line number records. */ 1227 1228 1388 unsigned int lineno_count; 1229 1389 1390 /* Entity size for merging purposes. */ 1391 unsigned int entsize; 1392 1230 1393 /* Optional information about a COMDAT entry; NULL if not COMDAT. */ 1231 1232 1394 struct bfd_comdat_info *comdat; 1233 1234 /* Points to the kept section if this section is a link-once section,1235 and is discarded. */1236 struct sec *kept_section;1237 1395 1238 1396 /* When a section is being output, this value changes as more 1239 1397 linenumbers are written out. */ 1240 1241 1398 file_ptr moving_line_filepos; 1242 1399 1243 1400 /* What the section number is in the target world. */ 1244 1245 1401 int target_index; 1246 1402 … … 1249 1405 /* If this is a constructor section then here is a list of the 1250 1406 relocations created to relocate items within it. */ 1251 1252 1407 struct relent_chain *constructor_chain; 1253 1408 1254 1409 /* The BFD which owns the section. */ 1255 1256 1410 bfd *owner; 1257 1411 1258 /* A symbol which points at this section only */1412 /* A symbol which points at this section only. */ 1259 1413 struct symbol_cache_entry *symbol; 1260 1414 struct symbol_cache_entry **symbol_ptr_ptr; … … 1262 1416 struct bfd_link_order *link_order_head; 1263 1417 struct bfd_link_order *link_order_tail; 1264 } asection 1418 } asection; 1265 1419 1266 1420 /* These sections are global, and are managed by BFD. The application … … 1274 1428 #define BFD_IND_SECTION_NAME "*IND*" 1275 1429 1276 /* the absolute section*/1430 /* The absolute section. */ 1277 1431 extern const asection bfd_abs_section; 1278 1432 #define bfd_abs_section_ptr ((asection *) &bfd_abs_section) 1279 1433 #define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) 1280 /* Pointer to the undefined section */1434 /* Pointer to the undefined section. */ 1281 1435 extern const asection bfd_und_section; 1282 1436 #define bfd_und_section_ptr ((asection *) &bfd_und_section) 1283 1437 #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) 1284 /* Pointer to the common section */1438 /* Pointer to the common section. */ 1285 1439 extern const asection bfd_com_section; 1286 1440 #define bfd_com_section_ptr ((asection *) &bfd_com_section) 1287 /* Pointer to the indirect section */1441 /* Pointer to the indirect section. */ 1288 1442 extern const asection bfd_ind_section; 1289 1443 #define bfd_ind_section_ptr ((asection *) &bfd_ind_section) 1290 1444 #define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) 1445 1446 #define bfd_is_const_section(SEC) \ 1447 ( ((SEC) == bfd_abs_section_ptr) \ 1448 || ((SEC) == bfd_und_section_ptr) \ 1449 || ((SEC) == bfd_com_section_ptr) \ 1450 || ((SEC) == bfd_ind_section_ptr)) 1291 1451 1292 1452 extern const struct symbol_cache_entry * const bfd_abs_symbol; … … 1300 1460 ((section)->reloc_done ? (section)->_cooked_size \ 1301 1461 : (abort (), (bfd_size_type) 1)) 1462 1463 /* Macros to handle insertion and deletion of a bfd's sections. These 1464 only handle the list pointers, ie. do not adjust section_count, 1465 target_index etc. */ 1466 #define bfd_section_list_remove(ABFD, PS) \ 1467 do \ 1468 { \ 1469 asection **_ps = PS; \ 1470 asection *_s = *_ps; \ 1471 *_ps = _s->next; \ 1472 if (_s->next == NULL) \ 1473 (ABFD)->section_tail = _ps; \ 1474 } \ 1475 while (0) 1476 #define bfd_section_list_insert(ABFD, PS, S) \ 1477 do \ 1478 { \ 1479 asection **_ps = PS; \ 1480 asection *_s = S; \ 1481 _s->next = *_ps; \ 1482 *_ps = _s; \ 1483 if (_s->next == NULL) \ 1484 (ABFD)->section_tail = &_s->next; \ 1485 } \ 1486 while (0) 1487 1488 void 1489 bfd_section_list_clear PARAMS ((bfd *)); 1490 1302 1491 asection * 1303 1492 bfd_get_section_by_name PARAMS ((bfd *abfd, const char *name)); … … 1317 1506 bfd_make_section PARAMS ((bfd *, const char *name)); 1318 1507 1319 b oolean1508 bfd_boolean 1320 1509 bfd_set_section_flags PARAMS ((bfd *abfd, asection *sec, flagword flags)); 1321 1510 … … 1327 1516 PTR obj)); 1328 1517 1329 b oolean1518 bfd_boolean 1330 1519 bfd_set_section_size PARAMS ((bfd *abfd, asection *sec, bfd_size_type val)); 1331 1520 1332 boolean 1333 bfd_set_section_contents PARAMS ((bfd *abfd, 1334 asection *section, 1335 PTR data, 1336 file_ptr offset, 1521 bfd_boolean 1522 bfd_set_section_contents PARAMS ((bfd *abfd, asection *section, 1523 PTR data, file_ptr offset, 1337 1524 bfd_size_type count)); 1338 1525 1339 boolean 1340 bfd_get_section_contents PARAMS ((bfd *abfd, asection *section, PTR location, 1341 file_ptr offset, bfd_size_type count)); 1342 1343 boolean 1344 bfd_copy_private_section_data PARAMS ((bfd *ibfd, asection *isec, bfd *obfd, asection *osec)); 1526 bfd_boolean 1527 bfd_get_section_contents PARAMS ((bfd *abfd, asection *section, 1528 PTR location, file_ptr offset, 1529 bfd_size_type count)); 1530 1531 bfd_boolean 1532 bfd_copy_private_section_data PARAMS ((bfd *ibfd, asection *isec, 1533 bfd *obfd, asection *osec)); 1345 1534 1346 1535 #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ … … 1350 1539 _bfd_strip_section_from_output PARAMS ((struct bfd_link_info *info, asection *section)); 1351 1540 1541 bfd_boolean 1542 bfd_generic_discard_group PARAMS ((bfd *abfd, asection *group)); 1543 1544 /* Extracted from archures.c. */ 1352 1545 enum bfd_architecture 1353 1546 { 1354 bfd_arch_unknown, /* File arch not known */1355 bfd_arch_obscure, /* Arch known, not one of these */1547 bfd_arch_unknown, /* File arch not known. */ 1548 bfd_arch_obscure, /* Arch known, not one of these. */ 1356 1549 bfd_arch_m68k, /* Motorola 68xxx */ 1357 1550 #define bfd_mach_m68000 1 … … 1375 1568 The exception is the "ca", which is 1376 1569 incompatible with all other machines except 1377 "core". */1570 "core". */ 1378 1571 1379 1572 #define bfd_mach_i960_core 1 … … 1386 1579 #define bfd_mach_i960_hx 8 1387 1580 1581 bfd_arch_or32, /* OpenRISC 32 */ 1582 1388 1583 bfd_arch_a29k, /* AMD 29000 */ 1389 1584 bfd_arch_sparc, /* SPARC */ … … 1393 1588 #define bfd_mach_sparc_sparclite 3 1394 1589 #define bfd_mach_sparc_v8plus 4 1395 #define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */1590 #define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */ 1396 1591 #define bfd_mach_sparc_sparclite_le 6 1397 1592 #define bfd_mach_sparc_v9 7 1398 #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns */1399 #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns */1400 #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns */1593 #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ 1594 #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ 1595 #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ 1401 1596 /* Nonzero if MACH has the v9 instruction set. */ 1402 1597 #define bfd_mach_sparc_v9_p(mach) \ … … 1410 1605 #define bfd_mach_mips4100 4100 1411 1606 #define bfd_mach_mips4111 4111 1607 #define bfd_mach_mips4120 4120 1412 1608 #define bfd_mach_mips4300 4300 1413 1609 #define bfd_mach_mips4400 4400 … … 1415 1611 #define bfd_mach_mips4650 4650 1416 1612 #define bfd_mach_mips5000 5000 1613 #define bfd_mach_mips5400 5400 1614 #define bfd_mach_mips5500 5500 1417 1615 #define bfd_mach_mips6000 6000 1418 1616 #define bfd_mach_mips8000 8000 … … 1420 1618 #define bfd_mach_mips12000 12000 1421 1619 #define bfd_mach_mips16 16 1422 #define bfd_mach_mips32 321423 #define bfd_mach_mips32_4k 3204113 /* 32, 04, octal 'K' */1424 1620 #define bfd_mach_mips5 5 1425 #define bfd_mach_mips64 641426 1621 #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ 1622 #define bfd_mach_mipsisa32 32 1623 #define bfd_mach_mipsisa32r2 33 1624 #define bfd_mach_mipsisa64 64 1427 1625 bfd_arch_i386, /* Intel 386 */ 1428 #define bfd_mach_i386_i386 01429 #define bfd_mach_i386_i8086 11430 #define bfd_mach_i386_i386_intel_syntax 21431 #define bfd_mach_x86_64 31432 #define bfd_mach_x86_64_intel_syntax 41626 #define bfd_mach_i386_i386 1 1627 #define bfd_mach_i386_i8086 2 1628 #define bfd_mach_i386_i386_intel_syntax 3 1629 #define bfd_mach_x86_64 64 1630 #define bfd_mach_x86_64_intel_syntax 65 1433 1631 bfd_arch_we32k, /* AT&T WE32xxx */ 1434 1632 bfd_arch_tahoe, /* CCI/Harris Tahoe */ … … 1439 1637 bfd_arch_convex, /* Convex */ 1440 1638 bfd_arch_m88k, /* Motorola 88xxx */ 1639 bfd_arch_m98k, /* Motorola 98xxx */ 1441 1640 bfd_arch_pyramid, /* Pyramid Technology */ 1442 bfd_arch_h8300, /* Hitachi H8/300 */ 1443 #define bfd_mach_h8300 1 1444 #define bfd_mach_h8300h 2 1445 #define bfd_mach_h8300s 3 1641 bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ 1642 #define bfd_mach_h8300 1 1643 #define bfd_mach_h8300h 2 1644 #define bfd_mach_h8300s 3 1645 #define bfd_mach_h8300hn 4 1646 #define bfd_mach_h8300sn 5 1647 bfd_arch_pdp11, /* DEC PDP-11 */ 1446 1648 bfd_arch_powerpc, /* PowerPC */ 1447 #define bfd_mach_ppc 0 1649 #define bfd_mach_ppc 32 1650 #define bfd_mach_ppc64 64 1448 1651 #define bfd_mach_ppc_403 403 1449 1652 #define bfd_mach_ppc_403gc 4030 … … 1462 1665 #define bfd_mach_ppc_rs64iii 643 1463 1666 #define bfd_mach_ppc_7400 7400 1667 #define bfd_mach_ppc_e500 500 1464 1668 bfd_arch_rs6000, /* IBM RS/6000 */ 1465 #define bfd_mach_rs6k 01669 #define bfd_mach_rs6k 6000 1466 1670 #define bfd_mach_rs6k_rs1 6001 1467 1671 #define bfd_mach_rs6k_rsc 6003 … … 1469 1673 bfd_arch_hppa, /* HP PA RISC */ 1470 1674 bfd_arch_d10v, /* Mitsubishi D10V */ 1471 #define bfd_mach_d10v 01675 #define bfd_mach_d10v 1 1472 1676 #define bfd_mach_d10v_ts2 2 1473 1677 #define bfd_mach_d10v_ts3 3 1474 1678 bfd_arch_d30v, /* Mitsubishi D30V */ 1679 bfd_arch_dlx, /* DLX */ 1475 1680 bfd_arch_m68hc11, /* Motorola 68HC11 */ 1476 1681 bfd_arch_m68hc12, /* Motorola 68HC12 */ 1682 #define bfd_mach_m6812_default 0 1683 #define bfd_mach_m6812 1 1684 #define bfd_mach_m6812s 2 1477 1685 bfd_arch_z8k, /* Zilog Z8000 */ 1478 1686 #define bfd_mach_z8001 1 1479 1687 #define bfd_mach_z8002 2 1480 bfd_arch_h8500, /* Hitachi H8/500*/1481 bfd_arch_sh, /* Hitachi SH*/1482 #define bfd_mach_sh 01688 bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ 1689 bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ 1690 #define bfd_mach_sh 1 1483 1691 #define bfd_mach_sh2 0x20 1484 1692 #define bfd_mach_sh_dsp 0x2d 1693 #define bfd_mach_sh2e 0x2e 1485 1694 #define bfd_mach_sh3 0x30 1486 1695 #define bfd_mach_sh3_dsp 0x3d 1487 1696 #define bfd_mach_sh3e 0x3e 1488 1697 #define bfd_mach_sh4 0x40 1698 #define bfd_mach_sh5 0x50 1489 1699 bfd_arch_alpha, /* Dec Alpha */ 1490 1700 #define bfd_mach_alpha_ev4 0x10 1491 1701 #define bfd_mach_alpha_ev5 0x20 1492 1702 #define bfd_mach_alpha_ev6 0x30 1493 bfd_arch_arm, /* Advanced Risc Machines ARM */ 1703 bfd_arch_arm, /* Advanced Risc Machines ARM. */ 1704 #define bfd_mach_arm_unknown 0 1494 1705 #define bfd_mach_arm_2 1 1495 1706 #define bfd_mach_arm_2a 2 … … 1502 1713 #define bfd_mach_arm_5TE 9 1503 1714 #define bfd_mach_arm_XScale 10 1715 #define bfd_mach_arm_ep9312 11 1716 #define bfd_mach_arm_iWMMXt 12 1504 1717 bfd_arch_ns32k, /* National Semiconductors ns32000 */ 1505 1718 bfd_arch_w65, /* WDC 65816 */ 1506 1719 bfd_arch_tic30, /* Texas Instruments TMS320C30 */ 1720 bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ 1721 #define bfd_mach_tic3x 30 1722 #define bfd_mach_tic4x 40 1507 1723 bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ 1508 1724 bfd_arch_tic80, /* TI TMS320c80 (MVP) */ 1509 1725 bfd_arch_v850, /* NEC V850 */ 1510 #define bfd_mach_v850 01726 #define bfd_mach_v850 1 1511 1727 #define bfd_mach_v850e 'E' 1512 #define bfd_mach_v850ea 'A'1513 1728 bfd_arch_arc, /* ARC Cores */ 1514 #define bfd_mach_arc_5 01515 #define bfd_mach_arc_6 11516 #define bfd_mach_arc_7 21517 #define bfd_mach_arc_8 31518 bfd_arch_m32r, /* Mitsubishi M32R/D*/1519 #define bfd_mach_m32r 0 /* backwards compatibility*/1729 #define bfd_mach_arc_5 5 1730 #define bfd_mach_arc_6 6 1731 #define bfd_mach_arc_7 7 1732 #define bfd_mach_arc_8 8 1733 bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ 1734 #define bfd_mach_m32r 1 /* For backwards compatibility. */ 1520 1735 #define bfd_mach_m32rx 'x' 1521 1736 bfd_arch_mn10200, /* Matsushita MN10200 */ … … 1525 1740 bfd_arch_fr30, 1526 1741 #define bfd_mach_fr30 0x46523330 1742 bfd_arch_frv, 1743 #define bfd_mach_frv 1 1744 #define bfd_mach_frvsimple 2 1745 #define bfd_mach_fr300 300 1746 #define bfd_mach_fr400 400 1747 #define bfd_mach_frvtomcat 499 /* fr500 prototype */ 1748 #define bfd_mach_fr500 500 1527 1749 bfd_arch_mcore, 1528 1750 bfd_arch_ia64, /* HP/Intel ia64 */ 1529 #define bfd_mach_ia64_elf64 0 1530 #define bfd_mach_ia64_elf32 1 1751 #define bfd_mach_ia64_elf64 64 1752 #define bfd_mach_ia64_elf32 32 1753 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ 1754 #define bfd_mach_ip2022 1 1755 #define bfd_mach_ip2022ext 2 1756 bfd_arch_iq2000, /* Vitesse IQ2000. */ 1757 #define bfd_mach_iq2000 1 1758 #define bfd_mach_iq10 2 1531 1759 bfd_arch_pj, 1532 bfd_arch_avr, /* Atmel AVR microcontrollers */1760 bfd_arch_avr, /* Atmel AVR microcontrollers. */ 1533 1761 #define bfd_mach_avr1 1 1534 1762 #define bfd_mach_avr2 2 … … 1537 1765 #define bfd_mach_avr5 5 1538 1766 bfd_arch_cris, /* Axis CRIS */ 1767 bfd_arch_s390, /* IBM s390 */ 1768 #define bfd_mach_s390_31 31 1769 #define bfd_mach_s390_64 64 1770 bfd_arch_openrisc, /* OpenRISC */ 1771 bfd_arch_mmix, /* Donald Knuth's educational processor. */ 1772 bfd_arch_xstormy16, 1773 #define bfd_mach_xstormy16 1 1774 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ 1775 #define bfd_mach_msp110 110 1776 #define bfd_mach_msp11 11 1777 #define bfd_mach_msp12 12 1778 #define bfd_mach_msp13 13 1779 #define bfd_mach_msp14 14 1780 #define bfd_mach_msp41 41 1781 #define bfd_mach_msp31 31 1782 #define bfd_mach_msp32 32 1783 #define bfd_mach_msp33 33 1784 #define bfd_mach_msp43 43 1785 #define bfd_mach_msp44 44 1786 #define bfd_mach_msp15 15 1787 #define bfd_mach_msp16 16 1788 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ 1789 #define bfd_mach_xtensa 1 1539 1790 bfd_arch_last 1540 1791 }; … … 1550 1801 const char *printable_name; 1551 1802 unsigned int section_align_power; 1552 /* True if this is the default machine for the architecture. */ 1553 boolean the_default; 1803 /* TRUE if this is the default machine for the architecture. 1804 The default arch should be the first entry for an arch so that 1805 all the entries for that arch can be accessed via <<next>>. */ 1806 bfd_boolean the_default; 1554 1807 const struct bfd_arch_info * (*compatible) 1555 1808 PARAMS ((const struct bfd_arch_info *a, 1556 1809 const struct bfd_arch_info *b)); 1557 1810 1558 b oolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *));1811 bfd_boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *)); 1559 1812 1560 1813 const struct bfd_arch_info *next; 1561 } bfd_arch_info_type; 1814 } 1815 bfd_arch_info_type; 1816 1562 1817 const char * 1563 1818 bfd_printable_name PARAMS ((bfd *abfd)); … … 1572 1827 bfd_arch_get_compatible PARAMS (( 1573 1828 const bfd *abfd, 1574 const bfd *bbfd)); 1829 const bfd *bbfd, 1830 bfd_boolean accept_unknowns)); 1575 1831 1576 1832 void … … 1607 1863 unsigned long machine)); 1608 1864 1865 /* Extracted from reloc.c. */ 1609 1866 typedef enum bfd_reloc_status 1610 1867 { 1611 /* No errors detected*/1868 /* No errors detected. */ 1612 1869 bfd_reloc_ok, 1613 1870 1614 /* The relocation was performed, but there was an overflow.*/1871 /* The relocation was performed, but there was an overflow. */ 1615 1872 bfd_reloc_overflow, 1616 1873 1617 /* The address to relocate was not within the section supplied.*/1874 /* The address to relocate was not within the section supplied. */ 1618 1875 bfd_reloc_outofrange, 1619 1876 1620 /* Used by special functions*/1877 /* Used by special functions. */ 1621 1878 bfd_reloc_continue, 1622 1879 1623 /* Unsupported relocation size requested.*/1880 /* Unsupported relocation size requested. */ 1624 1881 bfd_reloc_notsupported, 1625 1882 1626 /* Unused*/1883 /* Unused. */ 1627 1884 bfd_reloc_other, 1628 1885 1629 /* The symbol to relocate against was undefined.*/1886 /* The symbol to relocate against was undefined. */ 1630 1887 bfd_reloc_undefined, 1631 1888 1632 1633 1634 1635 1889 /* The relocation was performed, but may not be ok - presently 1890 generated only when linking i960 coff files with i960 b.out 1891 symbols. If this type is returned, the error_message argument 1892 to bfd_perform_relocation will be set. */ 1636 1893 bfd_reloc_dangerous 1637 1894 } … … 1641 1898 typedef struct reloc_cache_entry 1642 1899 { 1643 /* A pointer into the canonical table of pointers*/1900 /* A pointer into the canonical table of pointers. */ 1644 1901 struct symbol_cache_entry **sym_ptr_ptr; 1645 1902 1646 /* offset in section*/1903 /* offset in section. */ 1647 1904 bfd_size_type address; 1648 1905 1649 /* addend for relocation value*/1906 /* addend for relocation value. */ 1650 1907 bfd_vma addend; 1651 1908 1652 /* Pointer to how to perform the required relocation*/1909 /* Pointer to how to perform the required relocation. */ 1653 1910 reloc_howto_type *howto; 1654 1911 1655 } arelent; 1912 } 1913 arelent; 1914 1656 1915 enum complain_overflow 1657 1916 { 1658 /* Do not complain on overflow.*/1917 /* Do not complain on overflow. */ 1659 1918 complain_overflow_dont, 1660 1919 1661 1662 as signed or unsigned.*/1920 /* Complain if the bitfield overflows, whether it is considered 1921 as signed or unsigned. */ 1663 1922 complain_overflow_bitfield, 1664 1923 1665 1666 number.*/1924 /* Complain if the value overflows when considered as signed 1925 number. */ 1667 1926 complain_overflow_signed, 1668 1927 1669 1670 unsigned number.*/1928 /* Complain if the value overflows when considered as an 1929 unsigned number. */ 1671 1930 complain_overflow_unsigned 1672 1931 }; … … 1674 1933 struct reloc_howto_struct 1675 1934 { 1676 1677 1678 1679 in this field.For example, a PC relative word relocation1680 1681 what the outside world calls a R_PCRWORD reloc.*/1935 /* The type field has mainly a documentary use - the back end can 1936 do what it wants with it, though normally the back end's 1937 external idea of what a reloc number is stored 1938 in this field. For example, a PC relative word relocation 1939 in a coff environment has the type 023 - because that's 1940 what the outside world calls a R_PCRWORD reloc. */ 1682 1941 unsigned int type; 1683 1942 1684 /* The value the final relocation is shifted right by.This drops1685 1943 /* The value the final relocation is shifted right by. This drops 1944 unwanted data from the relocation. */ 1686 1945 unsigned int rightshift; 1687 1946 1688 1689 1690 1947 /* The size of the item to be relocated. This is *not* a 1948 power-of-two measure. To get the number of bytes operated 1949 on by a type of relocation, use bfd_get_reloc_size. */ 1691 1950 int size; 1692 1951 1693 1694 1952 /* The number of bits in the item to be relocated. This is used 1953 when doing overflow checking. */ 1695 1954 unsigned int bitsize; 1696 1955 1697 1698 data section of the addend.The relocation function will1699 1700 being relocated.*/1701 b oolean pc_relative;1702 1703 1704 The relocated value is left shifted by this amount.*/1956 /* Notes that the relocation is relative to the location in the 1957 data section of the addend. The relocation function will 1958 subtract from the relocation value the address of the location 1959 being relocated. */ 1960 bfd_boolean pc_relative; 1961 1962 /* The bit position of the reloc value in the destination. 1963 The relocated value is left shifted by this amount. */ 1705 1964 unsigned int bitpos; 1706 1965 1707 1708 relocating.*/1966 /* What type of overflow error should be checked for when 1967 relocating. */ 1709 1968 enum complain_overflow complain_on_overflow; 1710 1969 1711 1712 called rather than the normal function.This allows really1713 1714 instructions).*/1970 /* If this field is non null, then the supplied function is 1971 called rather than the normal function. This allows really 1972 strange relocation methods to be accomodated (e.g., i960 callj 1973 instructions). */ 1715 1974 bfd_reloc_status_type (*special_function) 1716 PARAMS ((bfd *abfd, 1717 arelent *reloc_entry, 1718 struct symbol_cache_entry *symbol, 1719 PTR data, 1720 asection *input_section, 1721 bfd *output_bfd, 1722 char **error_message)); 1723 1724 /* The textual name of the relocation type. */ 1975 PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *, 1976 bfd *, char **)); 1977 1978 /* The textual name of the relocation type. */ 1725 1979 char *name; 1726 1980 1727 /* Some formats record a relocation addend in the section contents 1728 rather than with the relocation. For ELF formats this is the 1729 distinction between USE_REL and USE_RELA (though the code checks 1730 for USE_REL == 1/0). The value of this field is TRUE if the 1731 addend is recorded with the section contents; when performing a 1732 partial link (ld -r) the section contents (the data) will be 1733 modified. The value of this field is FALSE if addends are 1734 recorded with the relocation (in arelent.addend); when performing 1735 a partial link the relocation will be modified. 1736 All relocations for all ELF USE_RELA targets should set this field 1737 to FALSE (values of TRUE should be looked on with suspicion). 1738 However, the converse is not true: not all relocations of all ELF 1739 USE_REL targets set this field to TRUE. Why this is so is peculiar 1740 to each particular target. For relocs that aren't used in partial 1741 links (e.g. GOT stuff) it doesn't matter what this is set to. */ 1742 boolean partial_inplace; 1743 1744 /* The src_mask selects which parts of the read in data 1745 are to be used in the relocation sum. E.g., if this was an 8 bit 1746 byte of data which we read and relocated, this would be 1747 0x000000ff. When we have relocs which have an addend, such as 1748 sun4 extended relocs, the value in the offset part of a 1749 relocating field is garbage so we never use it. In this case 1750 the mask would be 0x00000000. */ 1981 /* Some formats record a relocation addend in the section contents 1982 rather than with the relocation. For ELF formats this is the 1983 distinction between USE_REL and USE_RELA (though the code checks 1984 for USE_REL == 1/0). The value of this field is TRUE if the 1985 addend is recorded with the section contents; when performing a 1986 partial link (ld -r) the section contents (the data) will be 1987 modified. The value of this field is FALSE if addends are 1988 recorded with the relocation (in arelent.addend); when performing 1989 a partial link the relocation will be modified. 1990 All relocations for all ELF USE_RELA targets should set this field 1991 to FALSE (values of TRUE should be looked on with suspicion). 1992 However, the converse is not true: not all relocations of all ELF 1993 USE_REL targets set this field to TRUE. Why this is so is peculiar 1994 to each particular target. For relocs that aren't used in partial 1995 links (e.g. GOT stuff) it doesn't matter what this is set to. */ 1996 bfd_boolean partial_inplace; 1997 1998 /* src_mask selects the part of the instruction (or data) to be used 1999 in the relocation sum. If the target relocations don't have an 2000 addend in the reloc, eg. ELF USE_REL, src_mask will normally equal 2001 dst_mask to extract the addend from the section contents. If 2002 relocations do have an addend in the reloc, eg. ELF USE_RELA, this 2003 field should be zero. Non-zero values for ELF USE_RELA targets are 2004 bogus as in those cases the value in the dst_mask part of the 2005 section contents should be treated as garbage. */ 1751 2006 bfd_vma src_mask; 1752 2007 1753 /* The dst_mask selects which parts of the instruction are replaced 1754 into the instruction. In most cases src_mask == dst_mask, 1755 except in the above special case, where dst_mask would be 1756 0x000000ff, and src_mask would be 0x00000000. */ 2008 /* dst_mask selects which parts of the instruction (or data) are 2009 replaced with a relocated value. */ 1757 2010 bfd_vma dst_mask; 1758 2011 1759 /* When some formats create PC relative instructions, they leave 1760 the value of the pc of the place being relocated in the offset 1761 slot of the instruction, so that a PC relative relocation can 1762 be made just by adding in an ordinary offset (e.g., sun3 a.out). 1763 Some formats leave the displacement part of an instruction 1764 empty (e.g., m88k bcs); this flag signals the fact.*/ 1765 boolean pcrel_offset; 1766 2012 /* When some formats create PC relative instructions, they leave 2013 the value of the pc of the place being relocated in the offset 2014 slot of the instruction, so that a PC relative relocation can 2015 be made just by adding in an ordinary offset (e.g., sun3 a.out). 2016 Some formats leave the displacement part of an instruction 2017 empty (e.g., m88k bcs); this flag signals the fact. */ 2018 bfd_boolean pcrel_offset; 1767 2019 }; 1768 #define HOWTO(C, R,S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ 1769 {(unsigned)C,R,S,B, P, BI, O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC} 1770 #define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN) 2020 2021 #define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ 2022 { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } 2023 #define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ 2024 HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ 2025 NAME, FALSE, 0, 0, IN) 1771 2026 1772 2027 #define EMPTY_HOWTO(C) \ 1773 HOWTO((C),0,0,0,false,0,complain_overflow_dont,NULL,NULL,false,0,0,false) 1774 1775 #define HOWTO_PREPARE(relocation, symbol) \ 1776 { \ 1777 if (symbol != (asymbol *)NULL) { \ 1778 if (bfd_is_com_section (symbol->section)) { \ 1779 relocation = 0; \ 1780 } \ 1781 else { \ 1782 relocation = symbol->value; \ 1783 } \ 1784 } \ 1785 } 2028 HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ 2029 NULL, FALSE, 0, 0, FALSE) 2030 2031 #define HOWTO_PREPARE(relocation, symbol) \ 2032 { \ 2033 if (symbol != (asymbol *) NULL) \ 2034 { \ 2035 if (bfd_is_com_section (symbol->section)) \ 2036 { \ 2037 relocation = 0; \ 2038 } \ 2039 else \ 2040 { \ 2041 relocation = symbol->value; \ 2042 } \ 2043 } \ 2044 } 2045 1786 2046 unsigned int 1787 2047 bfd_get_reloc_size PARAMS ((reloc_howto_type *)); 1788 2048 1789 typedef struct relent_chain { 2049 typedef struct relent_chain 2050 { 1790 2051 arelent relent; 1791 struct relent_chain *next; 1792 } arelent_chain; 2052 struct relent_chain *next; 2053 } 2054 arelent_chain; 2055 1793 2056 bfd_reloc_status_type 1794 2057 bfd_check_overflow PARAMS ((enum complain_overflow how, … … 1817 2080 1818 2081 1819 /* Basic absolute relocations of N bits. */2082 /* Basic absolute relocations of N bits. */ 1820 2083 BFD_RELOC_64, 1821 2084 BFD_RELOC_32, … … 1830 2093 the section containing the relocation. It depends on the specific target. 1831 2094 1832 The 24-bit relocation is used in some Intel 960 configurations. */2095 The 24-bit relocation is used in some Intel 960 configurations. */ 1833 2096 BFD_RELOC_64_PCREL, 1834 2097 BFD_RELOC_32_PCREL, … … 1838 2101 BFD_RELOC_8_PCREL, 1839 2102 1840 /* For ELF. */2103 /* For ELF. */ 1841 2104 BFD_RELOC_32_GOT_PCREL, 1842 2105 BFD_RELOC_16_GOT_PCREL, … … 1848 2111 BFD_RELOC_HI16_S_GOTOFF, 1849 2112 BFD_RELOC_8_GOTOFF, 2113 BFD_RELOC_64_PLT_PCREL, 1850 2114 BFD_RELOC_32_PLT_PCREL, 1851 2115 BFD_RELOC_24_PLT_PCREL, 1852 2116 BFD_RELOC_16_PLT_PCREL, 1853 2117 BFD_RELOC_8_PLT_PCREL, 2118 BFD_RELOC_64_PLTOFF, 1854 2119 BFD_RELOC_32_PLTOFF, 1855 2120 BFD_RELOC_16_PLTOFF, … … 1859 2124 BFD_RELOC_8_PLTOFF, 1860 2125 1861 /* Relocations used by 68K ELF. */2126 /* Relocations used by 68K ELF. */ 1862 2127 BFD_RELOC_68K_GLOB_DAT, 1863 2128 BFD_RELOC_68K_JMP_SLOT, 1864 2129 BFD_RELOC_68K_RELATIVE, 1865 2130 1866 /* Linkage-table relative. */2131 /* Linkage-table relative. */ 1867 2132 BFD_RELOC_32_BASEREL, 1868 2133 BFD_RELOC_16_BASEREL, … … 1873 2138 BFD_RELOC_RVA, 1874 2139 1875 /* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */2140 /* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */ 1876 2141 BFD_RELOC_8_FFnn, 1877 2142 … … 1881 2146 SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The 1882 2147 signed 16-bit displacement is used on the MIPS, and the 23-bit 1883 displacement is used on the Alpha. */2148 displacement is used on the Alpha. */ 1884 2149 BFD_RELOC_32_PCREL_S2, 1885 2150 BFD_RELOC_16_PCREL_S2, … … 1887 2152 1888 2153 /* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of 1889 the target word. These are used on the SPARC. */2154 the target word. These are used on the SPARC. */ 1890 2155 BFD_RELOC_HI22, 1891 2156 BFD_RELOC_LO10, … … 1894 2159 displacements off that register. These relocation types are 1895 2160 handled specially, because the value the register will have is 1896 decided relatively late. */2161 decided relatively late. */ 1897 2162 BFD_RELOC_GPREL16, 1898 2163 BFD_RELOC_GPREL32, 1899 2164 1900 /* Reloc types used for i960/b.out. */2165 /* Reloc types used for i960/b.out. */ 1901 2166 BFD_RELOC_I960_CALLJ, 1902 2167 1903 2168 /* SPARC ELF relocations. There is probably some overlap with other 1904 relocation types already defined. */2169 relocation types already defined. */ 1905 2170 BFD_RELOC_NONE, 1906 2171 BFD_RELOC_SPARC_WDISP22, … … 1921 2186 BFD_RELOC_SPARC_UA64, 1922 2187 1923 /* I think these are specific to SPARC a.out (e.g., Sun 4). */2188 /* I think these are specific to SPARC a.out (e.g., Sun 4). */ 1924 2189 BFD_RELOC_SPARC_BASE13, 1925 2190 BFD_RELOC_SPARC_BASE22, 1926 2191 1927 /* SPARC64 relocations */2192 /* SPARC64 relocations */ 1928 2193 #define BFD_RELOC_SPARC_64 BFD_RELOC_64 1929 2194 BFD_RELOC_SPARC_10, … … 1942 2207 BFD_RELOC_SPARC_5, 1943 2208 #define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL 2209 BFD_RELOC_SPARC_PLT32, 1944 2210 BFD_RELOC_SPARC_PLT64, 1945 2211 BFD_RELOC_SPARC_HIX22, … … 1950 2216 BFD_RELOC_SPARC_REGISTER, 1951 2217 1952 /* SPARC little endian relocation */2218 /* SPARC little endian relocation */ 1953 2219 BFD_RELOC_SPARC_REV32, 2220 2221 /* SPARC TLS relocations */ 2222 BFD_RELOC_SPARC_TLS_GD_HI22, 2223 BFD_RELOC_SPARC_TLS_GD_LO10, 2224 BFD_RELOC_SPARC_TLS_GD_ADD, 2225 BFD_RELOC_SPARC_TLS_GD_CALL, 2226 BFD_RELOC_SPARC_TLS_LDM_HI22, 2227 BFD_RELOC_SPARC_TLS_LDM_LO10, 2228 BFD_RELOC_SPARC_TLS_LDM_ADD, 2229 BFD_RELOC_SPARC_TLS_LDM_CALL, 2230 BFD_RELOC_SPARC_TLS_LDO_HIX22, 2231 BFD_RELOC_SPARC_TLS_LDO_LOX10, 2232 BFD_RELOC_SPARC_TLS_LDO_ADD, 2233 BFD_RELOC_SPARC_TLS_IE_HI22, 2234 BFD_RELOC_SPARC_TLS_IE_LO10, 2235 BFD_RELOC_SPARC_TLS_IE_LD, 2236 BFD_RELOC_SPARC_TLS_IE_LDX, 2237 BFD_RELOC_SPARC_TLS_IE_ADD, 2238 BFD_RELOC_SPARC_TLS_LE_HIX22, 2239 BFD_RELOC_SPARC_TLS_LE_LOX10, 2240 BFD_RELOC_SPARC_TLS_DTPMOD32, 2241 BFD_RELOC_SPARC_TLS_DTPMOD64, 2242 BFD_RELOC_SPARC_TLS_DTPOFF32, 2243 BFD_RELOC_SPARC_TLS_DTPOFF64, 2244 BFD_RELOC_SPARC_TLS_TPOFF32, 2245 BFD_RELOC_SPARC_TLS_TPOFF64, 1954 2246 1955 2247 /* Alpha ECOFF and ELF relocations. Some of these treat the symbol or … … 1958 2250 writing; when reading, it will be the absolute section symbol. The 1959 2251 addend is the displacement in bytes of the "lda" instruction from 1960 the "ldah" instruction (which is at the address of this reloc). */2252 the "ldah" instruction (which is at the address of this reloc). */ 1961 2253 BFD_RELOC_ALPHA_GPDISP_HI16, 1962 2254 … … 1964 2256 with GPDISP_HI16 relocs. The addend is ignored when writing the 1965 2257 relocations out, and is filled in with the file's GP value on 1966 reading, for convenience. */2258 reading, for convenience. */ 1967 2259 BFD_RELOC_ALPHA_GPDISP_LO16, 1968 2260 1969 2261 /* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16 1970 2262 relocation except that there is no accompanying GPDISP_LO16 1971 relocation. */2263 relocation. */ 1972 2264 BFD_RELOC_ALPHA_GPDISP, 1973 2265 … … 1994 2286 1 - "memory" fmt insn 1995 2287 2 - byte-manipulation (byte offset reg) 1996 3 - jsr (target of branch) 1997 1998 The GNU linker currently doesn't do any of this optimizing. */ 2288 3 - jsr (target of branch) */ 1999 2289 BFD_RELOC_ALPHA_LITERAL, 2000 2290 BFD_RELOC_ALPHA_ELF_LITERAL, 2001 2291 BFD_RELOC_ALPHA_LITUSE, 2002 2292 2003 /* The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to2004 process the explicit !<reloc>!sequence relocations, and are mapped2005 into the normal relocations at the end of processing. */2006 BFD_RELOC_ALPHA_USER_LITERAL,2007 BFD_RELOC_ALPHA_USER_LITUSE_BASE,2008 BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF,2009 BFD_RELOC_ALPHA_USER_LITUSE_JSR,2010 BFD_RELOC_ALPHA_USER_GPDISP,2011 BFD_RELOC_ALPHA_USER_GPRELHIGH,2012 BFD_RELOC_ALPHA_USER_GPRELLOW,2013 2014 2293 /* The HINT relocation indicates a value that should be filled into the 2015 2294 "hint" field of a jmp/jsr/ret instruction, for possible branch- 2016 prediction logic which may be provided on some processors. */2295 prediction logic which may be provided on some processors. */ 2017 2296 BFD_RELOC_ALPHA_HINT, 2018 2297 2019 2298 /* The LINKAGE relocation outputs a linkage pair in the object file, 2020 which is filled by the linker. */2299 which is filled by the linker. */ 2021 2300 BFD_RELOC_ALPHA_LINKAGE, 2022 2301 2023 2302 /* The CODEADDR relocation outputs a STO_CA in the object file, 2024 which is filled by the linker. */2303 which is filled by the linker. */ 2025 2304 BFD_RELOC_ALPHA_CODEADDR, 2026 2305 2306 /* The GPREL_HI/LO relocations together form a 32-bit offset from the 2307 GP register. */ 2308 BFD_RELOC_ALPHA_GPREL_HI16, 2309 BFD_RELOC_ALPHA_GPREL_LO16, 2310 2311 /* Like BFD_RELOC_23_PCREL_S2, except that the source and target must 2312 share a common GP, and the target address is adjusted for 2313 STO_ALPHA_STD_GPLOAD. */ 2314 BFD_RELOC_ALPHA_BRSGP, 2315 2316 /* Alpha thread-local storage relocations. */ 2317 BFD_RELOC_ALPHA_TLSGD, 2318 BFD_RELOC_ALPHA_TLSLDM, 2319 BFD_RELOC_ALPHA_DTPMOD64, 2320 BFD_RELOC_ALPHA_GOTDTPREL16, 2321 BFD_RELOC_ALPHA_DTPREL64, 2322 BFD_RELOC_ALPHA_DTPREL_HI16, 2323 BFD_RELOC_ALPHA_DTPREL_LO16, 2324 BFD_RELOC_ALPHA_DTPREL16, 2325 BFD_RELOC_ALPHA_GOTTPREL16, 2326 BFD_RELOC_ALPHA_TPREL64, 2327 BFD_RELOC_ALPHA_TPREL_HI16, 2328 BFD_RELOC_ALPHA_TPREL_LO16, 2329 BFD_RELOC_ALPHA_TPREL16, 2330 2027 2331 /* Bits 27..2 of the relocation address shifted right 2 bits; 2028 simple reloc otherwise. */2332 simple reloc otherwise. */ 2029 2333 BFD_RELOC_MIPS_JMP, 2030 2334 2031 /* The MIPS16 jump instruction. */2335 /* The MIPS16 jump instruction. */ 2032 2336 BFD_RELOC_MIPS16_JMP, 2033 2337 2034 /* MIPS16 GP relative reloc. */2338 /* MIPS16 GP relative reloc. */ 2035 2339 BFD_RELOC_MIPS16_GPREL, 2036 2340 2037 /* High 16 bits of 32-bit value; simple reloc. */2341 /* High 16 bits of 32-bit value; simple reloc. */ 2038 2342 BFD_RELOC_HI16, 2039 2343 … … 2041 2345 extended and added to form the final result. If the low 16 2042 2346 bits form a negative number, we need to add one to the high value 2043 to compensate for the borrow when the low bits are added. */2347 to compensate for the borrow when the low bits are added. */ 2044 2348 BFD_RELOC_HI16_S, 2045 2349 2046 /* Low 16 bits. */2350 /* Low 16 bits. */ 2047 2351 BFD_RELOC_LO16, 2048 2352 2049 /* Like BFD_RELOC_HI16_S, but PC relative. */2353 /* Like BFD_RELOC_HI16_S, but PC relative. */ 2050 2354 BFD_RELOC_PCREL_HI16_S, 2051 2355 2052 /* Like BFD_RELOC_LO16, but PC relative. */2356 /* Like BFD_RELOC_LO16, but PC relative. */ 2053 2357 BFD_RELOC_PCREL_LO16, 2054 2358 2055 /* Relocation relative to the global pointer. */ 2056 #define BFD_RELOC_MIPS_GPREL BFD_RELOC_GPREL16 2057 2058 /* Relocation against a MIPS literal section. */ 2359 /* Relocation against a MIPS literal section. */ 2059 2360 BFD_RELOC_MIPS_LITERAL, 2060 2361 2061 /* MIPS ELF relocations. */2362 /* MIPS ELF relocations. */ 2062 2363 BFD_RELOC_MIPS_GOT16, 2063 2364 BFD_RELOC_MIPS_CALL16, 2064 #define BFD_RELOC_MIPS_GPREL32 BFD_RELOC_GPREL322065 2365 BFD_RELOC_MIPS_GOT_HI16, 2066 2366 BFD_RELOC_MIPS_GOT_LO16, … … 2083 2383 BFD_RELOC_MIPS_JALR, 2084 2384 2085 2086 /* i386/elf relocations */ 2385 /* Fujitsu Frv Relocations. */ 2386 BFD_RELOC_FRV_LABEL16, 2387 BFD_RELOC_FRV_LABEL24, 2388 BFD_RELOC_FRV_LO16, 2389 BFD_RELOC_FRV_HI16, 2390 BFD_RELOC_FRV_GPREL12, 2391 BFD_RELOC_FRV_GPRELU12, 2392 BFD_RELOC_FRV_GPREL32, 2393 BFD_RELOC_FRV_GPRELHI, 2394 BFD_RELOC_FRV_GPRELLO, 2395 2396 2397 /* i386/elf relocations */ 2087 2398 BFD_RELOC_386_GOT32, 2088 2399 BFD_RELOC_386_PLT32, … … 2093 2404 BFD_RELOC_386_GOTOFF, 2094 2405 BFD_RELOC_386_GOTPC, 2095 2096 /* x86-64/elf relocations */ 2406 BFD_RELOC_386_TLS_TPOFF, 2407 BFD_RELOC_386_TLS_IE, 2408 BFD_RELOC_386_TLS_GOTIE, 2409 BFD_RELOC_386_TLS_LE, 2410 BFD_RELOC_386_TLS_GD, 2411 BFD_RELOC_386_TLS_LDM, 2412 BFD_RELOC_386_TLS_LDO_32, 2413 BFD_RELOC_386_TLS_IE_32, 2414 BFD_RELOC_386_TLS_LE_32, 2415 BFD_RELOC_386_TLS_DTPMOD32, 2416 BFD_RELOC_386_TLS_DTPOFF32, 2417 BFD_RELOC_386_TLS_TPOFF32, 2418 2419 /* x86-64/elf relocations */ 2097 2420 BFD_RELOC_X86_64_GOT32, 2098 2421 BFD_RELOC_X86_64_PLT32, … … 2103 2426 BFD_RELOC_X86_64_GOTPCREL, 2104 2427 BFD_RELOC_X86_64_32S, 2105 2106 /* ns32k relocations */ 2428 BFD_RELOC_X86_64_DTPMOD64, 2429 BFD_RELOC_X86_64_DTPOFF64, 2430 BFD_RELOC_X86_64_TPOFF64, 2431 BFD_RELOC_X86_64_TLSGD, 2432 BFD_RELOC_X86_64_TLSLD, 2433 BFD_RELOC_X86_64_DTPOFF32, 2434 BFD_RELOC_X86_64_GOTTPOFF, 2435 BFD_RELOC_X86_64_TPOFF32, 2436 2437 /* ns32k relocations */ 2107 2438 BFD_RELOC_NS32K_IMM_8, 2108 2439 BFD_RELOC_NS32K_IMM_16, … … 2118 2449 BFD_RELOC_NS32K_DISP_32_PCREL, 2119 2450 2120 /* Picojava relocs. Not all of these appear in object files. */ 2451 /* PDP11 relocations */ 2452 BFD_RELOC_PDP11_DISP_8_PCREL, 2453 BFD_RELOC_PDP11_DISP_6_PCREL, 2454 2455 /* Picojava relocs. Not all of these appear in object files. */ 2121 2456 BFD_RELOC_PJ_CODE_HI16, 2122 2457 BFD_RELOC_PJ_CODE_LO16, … … 2126 2461 BFD_RELOC_PJ_CODE_REL32, 2127 2462 2128 /* Power(rs6000) and PowerPC relocations. */2463 /* Power(rs6000) and PowerPC relocations. */ 2129 2464 BFD_RELOC_PPC_B26, 2130 2465 BFD_RELOC_PPC_BA26, … … 2157 2492 BFD_RELOC_PPC_EMB_BIT_FLD, 2158 2493 BFD_RELOC_PPC_EMB_RELSDA, 2159 2160 /* IBM 370/390 relocations */ 2494 BFD_RELOC_PPC64_HIGHER, 2495 BFD_RELOC_PPC64_HIGHER_S, 2496 BFD_RELOC_PPC64_HIGHEST, 2497 BFD_RELOC_PPC64_HIGHEST_S, 2498 BFD_RELOC_PPC64_TOC16_LO, 2499 BFD_RELOC_PPC64_TOC16_HI, 2500 BFD_RELOC_PPC64_TOC16_HA, 2501 BFD_RELOC_PPC64_TOC, 2502 BFD_RELOC_PPC64_PLTGOT16, 2503 BFD_RELOC_PPC64_PLTGOT16_LO, 2504 BFD_RELOC_PPC64_PLTGOT16_HI, 2505 BFD_RELOC_PPC64_PLTGOT16_HA, 2506 BFD_RELOC_PPC64_ADDR16_DS, 2507 BFD_RELOC_PPC64_ADDR16_LO_DS, 2508 BFD_RELOC_PPC64_GOT16_DS, 2509 BFD_RELOC_PPC64_GOT16_LO_DS, 2510 BFD_RELOC_PPC64_PLT16_LO_DS, 2511 BFD_RELOC_PPC64_SECTOFF_DS, 2512 BFD_RELOC_PPC64_SECTOFF_LO_DS, 2513 BFD_RELOC_PPC64_TOC16_DS, 2514 BFD_RELOC_PPC64_TOC16_LO_DS, 2515 BFD_RELOC_PPC64_PLTGOT16_DS, 2516 BFD_RELOC_PPC64_PLTGOT16_LO_DS, 2517 2518 /* PowerPC and PowerPC64 thread-local storage relocations. */ 2519 BFD_RELOC_PPC_TLS, 2520 BFD_RELOC_PPC_DTPMOD, 2521 BFD_RELOC_PPC_TPREL16, 2522 BFD_RELOC_PPC_TPREL16_LO, 2523 BFD_RELOC_PPC_TPREL16_HI, 2524 BFD_RELOC_PPC_TPREL16_HA, 2525 BFD_RELOC_PPC_TPREL, 2526 BFD_RELOC_PPC_DTPREL16, 2527 BFD_RELOC_PPC_DTPREL16_LO, 2528 BFD_RELOC_PPC_DTPREL16_HI, 2529 BFD_RELOC_PPC_DTPREL16_HA, 2530 BFD_RELOC_PPC_DTPREL, 2531 BFD_RELOC_PPC_GOT_TLSGD16, 2532 BFD_RELOC_PPC_GOT_TLSGD16_LO, 2533 BFD_RELOC_PPC_GOT_TLSGD16_HI, 2534 BFD_RELOC_PPC_GOT_TLSGD16_HA, 2535 BFD_RELOC_PPC_GOT_TLSLD16, 2536 BFD_RELOC_PPC_GOT_TLSLD16_LO, 2537 BFD_RELOC_PPC_GOT_TLSLD16_HI, 2538 BFD_RELOC_PPC_GOT_TLSLD16_HA, 2539 BFD_RELOC_PPC_GOT_TPREL16, 2540 BFD_RELOC_PPC_GOT_TPREL16_LO, 2541 BFD_RELOC_PPC_GOT_TPREL16_HI, 2542 BFD_RELOC_PPC_GOT_TPREL16_HA, 2543 BFD_RELOC_PPC_GOT_DTPREL16, 2544 BFD_RELOC_PPC_GOT_DTPREL16_LO, 2545 BFD_RELOC_PPC_GOT_DTPREL16_HI, 2546 BFD_RELOC_PPC_GOT_DTPREL16_HA, 2547 BFD_RELOC_PPC64_TPREL16_DS, 2548 BFD_RELOC_PPC64_TPREL16_LO_DS, 2549 BFD_RELOC_PPC64_TPREL16_HIGHER, 2550 BFD_RELOC_PPC64_TPREL16_HIGHERA, 2551 BFD_RELOC_PPC64_TPREL16_HIGHEST, 2552 BFD_RELOC_PPC64_TPREL16_HIGHESTA, 2553 BFD_RELOC_PPC64_DTPREL16_DS, 2554 BFD_RELOC_PPC64_DTPREL16_LO_DS, 2555 BFD_RELOC_PPC64_DTPREL16_HIGHER, 2556 BFD_RELOC_PPC64_DTPREL16_HIGHERA, 2557 BFD_RELOC_PPC64_DTPREL16_HIGHEST, 2558 BFD_RELOC_PPC64_DTPREL16_HIGHESTA, 2559 2560 /* IBM 370/390 relocations */ 2161 2561 BFD_RELOC_I370_D12, 2162 2562 2163 2563 /* The type of reloc used to build a contructor table - at the moment 2164 2564 probably a 32 bit wide absolute relocation, but the target can choose. 2165 It generally does map to one of the other relocation types. */2565 It generally does map to one of the other relocation types. */ 2166 2566 BFD_RELOC_CTOR, 2167 2567 2168 2568 /* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are 2169 not stored in the instruction. */2569 not stored in the instruction. */ 2170 2570 BFD_RELOC_ARM_PCREL_BRANCH, 2171 2571 2172 2572 /* ARM 26 bit pc-relative branch. The lowest bit must be zero and is 2173 2573 not stored in the instruction. The 2nd lowest bit comes from a 1 bit 2174 field in the instruction. */2574 field in the instruction. */ 2175 2575 BFD_RELOC_ARM_PCREL_BLX, 2176 2576 2177 2577 /* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is 2178 2578 not stored in the instruction. The 2nd lowest bit comes from a 1 bit 2179 field in the instruction. */2579 field in the instruction. */ 2180 2580 BFD_RELOC_THUMB_PCREL_BLX, 2181 2581 2182 2582 /* These relocs are only used within the ARM assembler. They are not 2183 (at present) written to any object files. */2583 (at present) written to any object files. */ 2184 2584 BFD_RELOC_ARM_IMMEDIATE, 2185 2585 BFD_RELOC_ARM_ADRL_IMMEDIATE, … … 2189 2589 BFD_RELOC_ARM_MULTI, 2190 2590 BFD_RELOC_ARM_CP_OFF_IMM, 2591 BFD_RELOC_ARM_CP_OFF_IMM_S2, 2191 2592 BFD_RELOC_ARM_ADR_IMM, 2192 2593 BFD_RELOC_ARM_LDR_IMM, … … 2209 2610 BFD_RELOC_ARM_GOTPC, 2210 2611 2211 /* Hitachi SH relocs. Not all of these appear in object files.*/2612 /* Renesas / SuperH SH relocs. Not all of these appear in object files. */ 2212 2613 BFD_RELOC_SH_PCDISP8BY2, 2213 2614 BFD_RELOC_SH_PCDISP12BY2, … … 2235 2636 BFD_RELOC_SH_RELATIVE, 2236 2637 BFD_RELOC_SH_GOTPC, 2638 BFD_RELOC_SH_GOT_LOW16, 2639 BFD_RELOC_SH_GOT_MEDLOW16, 2640 BFD_RELOC_SH_GOT_MEDHI16, 2641 BFD_RELOC_SH_GOT_HI16, 2642 BFD_RELOC_SH_GOTPLT_LOW16, 2643 BFD_RELOC_SH_GOTPLT_MEDLOW16, 2644 BFD_RELOC_SH_GOTPLT_MEDHI16, 2645 BFD_RELOC_SH_GOTPLT_HI16, 2646 BFD_RELOC_SH_PLT_LOW16, 2647 BFD_RELOC_SH_PLT_MEDLOW16, 2648 BFD_RELOC_SH_PLT_MEDHI16, 2649 BFD_RELOC_SH_PLT_HI16, 2650 BFD_RELOC_SH_GOTOFF_LOW16, 2651 BFD_RELOC_SH_GOTOFF_MEDLOW16, 2652 BFD_RELOC_SH_GOTOFF_MEDHI16, 2653 BFD_RELOC_SH_GOTOFF_HI16, 2654 BFD_RELOC_SH_GOTPC_LOW16, 2655 BFD_RELOC_SH_GOTPC_MEDLOW16, 2656 BFD_RELOC_SH_GOTPC_MEDHI16, 2657 BFD_RELOC_SH_GOTPC_HI16, 2658 BFD_RELOC_SH_COPY64, 2659 BFD_RELOC_SH_GLOB_DAT64, 2660 BFD_RELOC_SH_JMP_SLOT64, 2661 BFD_RELOC_SH_RELATIVE64, 2662 BFD_RELOC_SH_GOT10BY4, 2663 BFD_RELOC_SH_GOT10BY8, 2664 BFD_RELOC_SH_GOTPLT10BY4, 2665 BFD_RELOC_SH_GOTPLT10BY8, 2666 BFD_RELOC_SH_GOTPLT32, 2667 BFD_RELOC_SH_SHMEDIA_CODE, 2668 BFD_RELOC_SH_IMMU5, 2669 BFD_RELOC_SH_IMMS6, 2670 BFD_RELOC_SH_IMMS6BY32, 2671 BFD_RELOC_SH_IMMU6, 2672 BFD_RELOC_SH_IMMS10, 2673 BFD_RELOC_SH_IMMS10BY2, 2674 BFD_RELOC_SH_IMMS10BY4, 2675 BFD_RELOC_SH_IMMS10BY8, 2676 BFD_RELOC_SH_IMMS16, 2677 BFD_RELOC_SH_IMMU16, 2678 BFD_RELOC_SH_IMM_LOW16, 2679 BFD_RELOC_SH_IMM_LOW16_PCREL, 2680 BFD_RELOC_SH_IMM_MEDLOW16, 2681 BFD_RELOC_SH_IMM_MEDLOW16_PCREL, 2682 BFD_RELOC_SH_IMM_MEDHI16, 2683 BFD_RELOC_SH_IMM_MEDHI16_PCREL, 2684 BFD_RELOC_SH_IMM_HI16, 2685 BFD_RELOC_SH_IMM_HI16_PCREL, 2686 BFD_RELOC_SH_PT_16, 2687 BFD_RELOC_SH_TLS_GD_32, 2688 BFD_RELOC_SH_TLS_LD_32, 2689 BFD_RELOC_SH_TLS_LDO_32, 2690 BFD_RELOC_SH_TLS_IE_32, 2691 BFD_RELOC_SH_TLS_LE_32, 2692 BFD_RELOC_SH_TLS_DTPMOD32, 2693 BFD_RELOC_SH_TLS_DTPOFF32, 2694 BFD_RELOC_SH_TLS_TPOFF32, 2237 2695 2238 2696 /* Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must 2239 be zero and is not stored in the instruction. */2697 be zero and is not stored in the instruction. */ 2240 2698 BFD_RELOC_THUMB_PCREL_BRANCH9, 2241 2699 BFD_RELOC_THUMB_PCREL_BRANCH12, … … 2245 2703 ARC 22 bit pc-relative branch. The lowest two bits must be zero and are 2246 2704 not stored in the instruction. The high 20 bits are installed in bits 26 2247 through 7 of the instruction. */2705 through 7 of the instruction. */ 2248 2706 BFD_RELOC_ARC_B22_PCREL, 2249 2707 2250 2708 /* ARC 26 bit absolute branch. The lowest two bits must be zero and are not 2251 2709 stored in the instruction. The high 24 bits are installed in bits 23 2252 through 0. */2710 through 0. */ 2253 2711 BFD_RELOC_ARC_B26, 2254 2712 2255 2713 /* Mitsubishi D10V relocs. 2256 2714 This is a 10-bit reloc with the right 2 bits 2257 assumed to be 0. */2715 assumed to be 0. */ 2258 2716 BFD_RELOC_D10V_10_PCREL_R, 2259 2717 … … 2262 2720 assumed to be 0. This is the same as the previous reloc 2263 2721 except it is in the left container, i.e., 2264 shifted left 15 bits. */2722 shifted left 15 bits. */ 2265 2723 BFD_RELOC_D10V_10_PCREL_L, 2266 2724 2267 2725 /* This is an 18-bit reloc with the right 2 bits 2268 assumed to be 0. */2726 assumed to be 0. */ 2269 2727 BFD_RELOC_D10V_18, 2270 2728 2271 2729 /* This is an 18-bit reloc with the right 2 bits 2272 assumed to be 0. */2730 assumed to be 0. */ 2273 2731 BFD_RELOC_D10V_18_PCREL, 2274 2732 2275 2733 /* Mitsubishi D30V relocs. 2276 This is a 6-bit absolute reloc. */2734 This is a 6-bit absolute reloc. */ 2277 2735 BFD_RELOC_D30V_6, 2278 2736 2279 2737 /* This is a 6-bit pc-relative reloc with 2280 the right 3 bits assumed to be 0. */2738 the right 3 bits assumed to be 0. */ 2281 2739 BFD_RELOC_D30V_9_PCREL, 2282 2740 … … 2284 2742 the right 3 bits assumed to be 0. Same 2285 2743 as the previous reloc but on the right side 2286 of the container. */2744 of the container. */ 2287 2745 BFD_RELOC_D30V_9_PCREL_R, 2288 2746 2289 2747 /* This is a 12-bit absolute reloc with the 2290 right 3 bitsassumed to be 0. */2748 right 3 bitsassumed to be 0. */ 2291 2749 BFD_RELOC_D30V_15, 2292 2750 2293 2751 /* This is a 12-bit pc-relative reloc with 2294 the right 3 bits assumed to be 0. */2752 the right 3 bits assumed to be 0. */ 2295 2753 BFD_RELOC_D30V_15_PCREL, 2296 2754 … … 2298 2756 the right 3 bits assumed to be 0. Same 2299 2757 as the previous reloc but on the right side 2300 of the container. */2758 of the container. */ 2301 2759 BFD_RELOC_D30V_15_PCREL_R, 2302 2760 2303 2761 /* This is an 18-bit absolute reloc with 2304 the right 3 bits assumed to be 0. */2762 the right 3 bits assumed to be 0. */ 2305 2763 BFD_RELOC_D30V_21, 2306 2764 2307 2765 /* This is an 18-bit pc-relative reloc with 2308 the right 3 bits assumed to be 0. */2766 the right 3 bits assumed to be 0. */ 2309 2767 BFD_RELOC_D30V_21_PCREL, 2310 2768 … … 2312 2770 the right 3 bits assumed to be 0. Same 2313 2771 as the previous reloc but on the right side 2314 of the container. */2772 of the container. */ 2315 2773 BFD_RELOC_D30V_21_PCREL_R, 2316 2774 2317 /* This is a 32-bit absolute reloc. */2775 /* This is a 32-bit absolute reloc. */ 2318 2776 BFD_RELOC_D30V_32, 2319 2777 2320 /* This is a 32-bit pc-relative reloc. */2778 /* This is a 32-bit pc-relative reloc. */ 2321 2779 BFD_RELOC_D30V_32_PCREL, 2322 2780 2323 /* Mitsubishi M32R relocs. 2324 This is a 24 bit absolute address. */ 2781 /* DLX relocs */ 2782 BFD_RELOC_DLX_HI16_S, 2783 2784 /* DLX relocs */ 2785 BFD_RELOC_DLX_LO16, 2786 2787 /* DLX relocs */ 2788 BFD_RELOC_DLX_JMP26, 2789 2790 /* Renesas M32R (formerly Mitsubishi M32R) relocs. 2791 This is a 24 bit absolute address. */ 2325 2792 BFD_RELOC_M32R_24, 2326 2793 2327 /* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */2794 /* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */ 2328 2795 BFD_RELOC_M32R_10_PCREL, 2329 2796 2330 /* This is an 18-bit reloc with the right 2 bits assumed to be 0. */2797 /* This is an 18-bit reloc with the right 2 bits assumed to be 0. */ 2331 2798 BFD_RELOC_M32R_18_PCREL, 2332 2799 2333 /* This is a 26-bit reloc with the right 2 bits assumed to be 0. */2800 /* This is a 26-bit reloc with the right 2 bits assumed to be 0. */ 2334 2801 BFD_RELOC_M32R_26_PCREL, 2335 2802 2336 2803 /* This is a 16-bit reloc containing the high 16 bits of an address 2337 used when the lower 16 bits are treated as unsigned. */2804 used when the lower 16 bits are treated as unsigned. */ 2338 2805 BFD_RELOC_M32R_HI16_ULO, 2339 2806 2340 2807 /* This is a 16-bit reloc containing the high 16 bits of an address 2341 used when the lower 16 bits are treated as signed. */2808 used when the lower 16 bits are treated as signed. */ 2342 2809 BFD_RELOC_M32R_HI16_SLO, 2343 2810 2344 /* This is a 16-bit reloc containing the lower 16 bits of an address. */2811 /* This is a 16-bit reloc containing the lower 16 bits of an address. */ 2345 2812 BFD_RELOC_M32R_LO16, 2346 2813 2347 2814 /* This is a 16-bit reloc containing the small data area offset for use in 2348 add3, load, and store instructions. */2815 add3, load, and store instructions. */ 2349 2816 BFD_RELOC_M32R_SDA16, 2350 2817 2351 /* This is a 9-bit reloc */2818 /* This is a 9-bit reloc */ 2352 2819 BFD_RELOC_V850_9_PCREL, 2353 2820 2354 /* This is a 22-bit reloc */2821 /* This is a 22-bit reloc */ 2355 2822 BFD_RELOC_V850_22_PCREL, 2356 2823 2357 /* This is a 16 bit offset from the short data area pointer. */2824 /* This is a 16 bit offset from the short data area pointer. */ 2358 2825 BFD_RELOC_V850_SDA_16_16_OFFSET, 2359 2826 2360 2827 /* This is a 16 bit offset (of which only 15 bits are used) from the 2361 short data area pointer. */2828 short data area pointer. */ 2362 2829 BFD_RELOC_V850_SDA_15_16_OFFSET, 2363 2830 2364 /* This is a 16 bit offset from the zero data area pointer. */2831 /* This is a 16 bit offset from the zero data area pointer. */ 2365 2832 BFD_RELOC_V850_ZDA_16_16_OFFSET, 2366 2833 2367 2834 /* This is a 16 bit offset (of which only 15 bits are used) from the 2368 zero data area pointer. */2835 zero data area pointer. */ 2369 2836 BFD_RELOC_V850_ZDA_15_16_OFFSET, 2370 2837 2371 2838 /* This is an 8 bit offset (of which only 6 bits are used) from the 2372 tiny data area pointer. */2839 tiny data area pointer. */ 2373 2840 BFD_RELOC_V850_TDA_6_8_OFFSET, 2374 2841 2375 2842 /* This is an 8bit offset (of which only 7 bits are used) from the tiny 2376 data area pointer. */2843 data area pointer. */ 2377 2844 BFD_RELOC_V850_TDA_7_8_OFFSET, 2378 2845 2379 /* This is a 7 bit offset from the tiny data area pointer. */2846 /* This is a 7 bit offset from the tiny data area pointer. */ 2380 2847 BFD_RELOC_V850_TDA_7_7_OFFSET, 2381 2848 2382 /* This is a 16 bit offset from the tiny data area pointer. */2849 /* This is a 16 bit offset from the tiny data area pointer. */ 2383 2850 BFD_RELOC_V850_TDA_16_16_OFFSET, 2384 2851 2385 2852 /* This is a 5 bit offset (of which only 4 bits are used) from the tiny 2386 data area pointer. */2853 data area pointer. */ 2387 2854 BFD_RELOC_V850_TDA_4_5_OFFSET, 2388 2855 2389 /* This is a 4 bit offset from the tiny data area pointer. */2856 /* This is a 4 bit offset from the tiny data area pointer. */ 2390 2857 BFD_RELOC_V850_TDA_4_4_OFFSET, 2391 2858 2392 2859 /* This is a 16 bit offset from the short data area pointer, with the 2393 bits placed non-contigously in the instruction. */2860 bits placed non-contigously in the instruction. */ 2394 2861 BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET, 2395 2862 2396 2863 /* This is a 16 bit offset from the zero data area pointer, with the 2397 bits placed non-contigously in the instruction. */2864 bits placed non-contigously in the instruction. */ 2398 2865 BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET, 2399 2866 2400 /* This is a 6 bit offset from the call table base pointer. */2867 /* This is a 6 bit offset from the call table base pointer. */ 2401 2868 BFD_RELOC_V850_CALLT_6_7_OFFSET, 2402 2869 2403 /* This is a 16 bit offset from the call table base pointer. */2870 /* This is a 16 bit offset from the call table base pointer. */ 2404 2871 BFD_RELOC_V850_CALLT_16_16_OFFSET, 2405 2872 2873 /* Used for relaxing indirect function calls. */ 2874 BFD_RELOC_V850_LONGCALL, 2875 2876 /* Used for relaxing indirect jumps. */ 2877 BFD_RELOC_V850_LONGJUMP, 2878 2879 /* Used to maintain alignment whilst relaxing. */ 2880 BFD_RELOC_V850_ALIGN, 2406 2881 2407 2882 /* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the 2408 instruction. */2883 instruction. */ 2409 2884 BFD_RELOC_MN10300_32_PCREL, 2410 2885 2411 2886 /* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the 2412 instruction. */2887 instruction. */ 2413 2888 BFD_RELOC_MN10300_16_PCREL, 2414 2889 2415 2890 /* This is a 8bit DP reloc for the tms320c30, where the most 2416 2891 significant 8 bits of a 24 bit word are placed into the least 2417 significant 8 bits of the opcode. */2892 significant 8 bits of the opcode. */ 2418 2893 BFD_RELOC_TIC30_LDP, 2419 2894 2420 2895 /* This is a 7bit reloc for the tms320c54x, where the least 2421 2896 significant 7 bits of a 16 bit word are placed into the least 2422 significant 7 bits of the opcode. */2897 significant 7 bits of the opcode. */ 2423 2898 BFD_RELOC_TIC54X_PARTLS7, 2424 2899 2425 2900 /* This is a 9bit DP reloc for the tms320c54x, where the most 2426 2901 significant 9 bits of a 16 bit word are placed into the least 2427 significant 9 bits of the opcode. */2902 significant 9 bits of the opcode. */ 2428 2903 BFD_RELOC_TIC54X_PARTMS9, 2429 2904 2430 /* This is an extended address 23-bit reloc for the tms320c54x. */2905 /* This is an extended address 23-bit reloc for the tms320c54x. */ 2431 2906 BFD_RELOC_TIC54X_23, 2432 2907 2433 2908 /* This is a 16-bit reloc for the tms320c54x, where the least 2434 2909 significant 16 bits of a 23-bit extended address are placed into 2435 the opcode. */2910 the opcode. */ 2436 2911 BFD_RELOC_TIC54X_16_OF_23, 2437 2912 2438 2913 /* This is a reloc for the tms320c54x, where the most 2439 2914 significant 7 bits of a 23-bit extended address are placed into 2440 the opcode. */2915 the opcode. */ 2441 2916 BFD_RELOC_TIC54X_MS7_OF_23, 2442 2917 2443 /* This is a 48 bit reloc for the FR30 that stores 32 bits. */2918 /* This is a 48 bit reloc for the FR30 that stores 32 bits. */ 2444 2919 BFD_RELOC_FR30_48, 2445 2920 2446 2921 /* This is a 32 bit reloc for the FR30 that stores 20 bits split up into 2447 two sections. */2922 two sections. */ 2448 2923 BFD_RELOC_FR30_20, 2449 2924 2450 2925 /* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in 2451 4 bits. */2926 4 bits. */ 2452 2927 BFD_RELOC_FR30_6_IN_4, 2453 2928 2454 2929 /* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset 2455 into 8 bits. */2930 into 8 bits. */ 2456 2931 BFD_RELOC_FR30_8_IN_8, 2457 2932 2458 2933 /* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset 2459 into 8 bits. */2934 into 8 bits. */ 2460 2935 BFD_RELOC_FR30_9_IN_8, 2461 2936 2462 2937 /* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset 2463 into 8 bits. */2938 into 8 bits. */ 2464 2939 BFD_RELOC_FR30_10_IN_8, 2465 2940 2466 2941 /* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative 2467 short offset into 8 bits. */2942 short offset into 8 bits. */ 2468 2943 BFD_RELOC_FR30_9_PCREL, 2469 2944 2470 2945 /* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative 2471 short offset into 11 bits. */2946 short offset into 11 bits. */ 2472 2947 BFD_RELOC_FR30_12_PCREL, 2473 2948 2474 /* Motorola Mcore relocations. */2949 /* Motorola Mcore relocations. */ 2475 2950 BFD_RELOC_MCORE_PCREL_IMM8BY4, 2476 2951 BFD_RELOC_MCORE_PCREL_IMM11BY2, … … 2480 2955 BFD_RELOC_MCORE_RVA, 2481 2956 2957 /* These are relocations for the GETA instruction. */ 2958 BFD_RELOC_MMIX_GETA, 2959 BFD_RELOC_MMIX_GETA_1, 2960 BFD_RELOC_MMIX_GETA_2, 2961 BFD_RELOC_MMIX_GETA_3, 2962 2963 /* These are relocations for a conditional branch instruction. */ 2964 BFD_RELOC_MMIX_CBRANCH, 2965 BFD_RELOC_MMIX_CBRANCH_J, 2966 BFD_RELOC_MMIX_CBRANCH_1, 2967 BFD_RELOC_MMIX_CBRANCH_2, 2968 BFD_RELOC_MMIX_CBRANCH_3, 2969 2970 /* These are relocations for the PUSHJ instruction. */ 2971 BFD_RELOC_MMIX_PUSHJ, 2972 BFD_RELOC_MMIX_PUSHJ_1, 2973 BFD_RELOC_MMIX_PUSHJ_2, 2974 BFD_RELOC_MMIX_PUSHJ_3, 2975 2976 /* These are relocations for the JMP instruction. */ 2977 BFD_RELOC_MMIX_JMP, 2978 BFD_RELOC_MMIX_JMP_1, 2979 BFD_RELOC_MMIX_JMP_2, 2980 BFD_RELOC_MMIX_JMP_3, 2981 2982 /* This is a relocation for a relative address as in a GETA instruction or 2983 a branch. */ 2984 BFD_RELOC_MMIX_ADDR19, 2985 2986 /* This is a relocation for a relative address as in a JMP instruction. */ 2987 BFD_RELOC_MMIX_ADDR27, 2988 2989 /* This is a relocation for an instruction field that may be a general 2990 register or a value 0..255. */ 2991 BFD_RELOC_MMIX_REG_OR_BYTE, 2992 2993 /* This is a relocation for an instruction field that may be a general 2994 register. */ 2995 BFD_RELOC_MMIX_REG, 2996 2997 /* This is a relocation for two instruction fields holding a register and 2998 an offset, the equivalent of the relocation. */ 2999 BFD_RELOC_MMIX_BASE_PLUS_OFFSET, 3000 3001 /* This relocation is an assertion that the expression is not allocated as 3002 a global register. It does not modify contents. */ 3003 BFD_RELOC_MMIX_LOCAL, 3004 2482 3005 /* This is a 16 bit reloc for the AVR that stores 8 bit pc relative 2483 short offset into 7 bits. */3006 short offset into 7 bits. */ 2484 3007 BFD_RELOC_AVR_7_PCREL, 2485 3008 2486 3009 /* This is a 16 bit reloc for the AVR that stores 13 bit pc relative 2487 short offset into 12 bits. */3010 short offset into 12 bits. */ 2488 3011 BFD_RELOC_AVR_13_PCREL, 2489 3012 2490 3013 /* This is a 16 bit reloc for the AVR that stores 17 bit value (usually 2491 program memory address) into 16 bits. */3014 program memory address) into 16 bits. */ 2492 3015 BFD_RELOC_AVR_16_PM, 2493 3016 2494 3017 /* This is a 16 bit reloc for the AVR that stores 8 bit value (usually 2495 data memory address) into 8 bit immediate value of LDI insn. */3018 data memory address) into 8 bit immediate value of LDI insn. */ 2496 3019 BFD_RELOC_AVR_LO8_LDI, 2497 3020 2498 3021 /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit 2499 of data memory address) into 8 bit immediate value of LDI insn. */3022 of data memory address) into 8 bit immediate value of LDI insn. */ 2500 3023 BFD_RELOC_AVR_HI8_LDI, 2501 3024 2502 3025 /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit 2503 of program memory address) into 8 bit immediate value of LDI insn. */3026 of program memory address) into 8 bit immediate value of LDI insn. */ 2504 3027 BFD_RELOC_AVR_HH8_LDI, 2505 3028 2506 3029 /* This is a 16 bit reloc for the AVR that stores negated 8 bit value 2507 (usually data memory address) into 8 bit immediate value of SUBI insn. */3030 (usually data memory address) into 8 bit immediate value of SUBI insn. */ 2508 3031 BFD_RELOC_AVR_LO8_LDI_NEG, 2509 3032 2510 3033 /* This is a 16 bit reloc for the AVR that stores negated 8 bit value 2511 3034 (high 8 bit of data memory address) into 8 bit immediate value of 2512 SUBI insn. */3035 SUBI insn. */ 2513 3036 BFD_RELOC_AVR_HI8_LDI_NEG, 2514 3037 2515 3038 /* This is a 16 bit reloc for the AVR that stores negated 8 bit value 2516 3039 (most high 8 bit of program memory address) into 8 bit immediate value 2517 of LDI or SUBI insn. */3040 of LDI or SUBI insn. */ 2518 3041 BFD_RELOC_AVR_HH8_LDI_NEG, 2519 3042 2520 3043 /* This is a 16 bit reloc for the AVR that stores 8 bit value (usually 2521 command address) into 8 bit immediate value of LDI insn. */3044 command address) into 8 bit immediate value of LDI insn. */ 2522 3045 BFD_RELOC_AVR_LO8_LDI_PM, 2523 3046 2524 3047 /* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit 2525 of command address) into 8 bit immediate value of LDI insn. */3048 of command address) into 8 bit immediate value of LDI insn. */ 2526 3049 BFD_RELOC_AVR_HI8_LDI_PM, 2527 3050 2528 3051 /* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit 2529 of command address) into 8 bit immediate value of LDI insn. */3052 of command address) into 8 bit immediate value of LDI insn. */ 2530 3053 BFD_RELOC_AVR_HH8_LDI_PM, 2531 3054 2532 3055 /* This is a 16 bit reloc for the AVR that stores negated 8 bit value 2533 (usually command address) into 8 bit immediate value of SUBI insn. */3056 (usually command address) into 8 bit immediate value of SUBI insn. */ 2534 3057 BFD_RELOC_AVR_LO8_LDI_PM_NEG, 2535 3058 2536 3059 /* This is a 16 bit reloc for the AVR that stores negated 8 bit value 2537 3060 (high 8 bit of 16 bit command address) into 8 bit immediate value 2538 of SUBI insn. */3061 of SUBI insn. */ 2539 3062 BFD_RELOC_AVR_HI8_LDI_PM_NEG, 2540 3063 2541 3064 /* This is a 16 bit reloc for the AVR that stores negated 8 bit value 2542 3065 (high 6 bit of 22 bit command address) into 8 bit immediate 2543 value of SUBI insn. */3066 value of SUBI insn. */ 2544 3067 BFD_RELOC_AVR_HH8_LDI_PM_NEG, 2545 3068 2546 3069 /* This is a 32 bit reloc for the AVR that stores 23 bit value 2547 into 22 bits. */3070 into 22 bits. */ 2548 3071 BFD_RELOC_AVR_CALL, 3072 3073 /* Direct 12 bit. */ 3074 BFD_RELOC_390_12, 3075 3076 /* 12 bit GOT offset. */ 3077 BFD_RELOC_390_GOT12, 3078 3079 /* 32 bit PC relative PLT address. */ 3080 BFD_RELOC_390_PLT32, 3081 3082 /* Copy symbol at runtime. */ 3083 BFD_RELOC_390_COPY, 3084 3085 /* Create GOT entry. */ 3086 BFD_RELOC_390_GLOB_DAT, 3087 3088 /* Create PLT entry. */ 3089 BFD_RELOC_390_JMP_SLOT, 3090 3091 /* Adjust by program base. */ 3092 BFD_RELOC_390_RELATIVE, 3093 3094 /* 32 bit PC relative offset to GOT. */ 3095 BFD_RELOC_390_GOTPC, 3096 3097 /* 16 bit GOT offset. */ 3098 BFD_RELOC_390_GOT16, 3099 3100 /* PC relative 16 bit shifted by 1. */ 3101 BFD_RELOC_390_PC16DBL, 3102 3103 /* 16 bit PC rel. PLT shifted by 1. */ 3104 BFD_RELOC_390_PLT16DBL, 3105 3106 /* PC relative 32 bit shifted by 1. */ 3107 BFD_RELOC_390_PC32DBL, 3108 3109 /* 32 bit PC rel. PLT shifted by 1. */ 3110 BFD_RELOC_390_PLT32DBL, 3111 3112 /* 32 bit PC rel. GOT shifted by 1. */ 3113 BFD_RELOC_390_GOTPCDBL, 3114 3115 /* 64 bit GOT offset. */ 3116 BFD_RELOC_390_GOT64, 3117 3118 /* 64 bit PC relative PLT address. */ 3119 BFD_RELOC_390_PLT64, 3120 3121 /* 32 bit rel. offset to GOT entry. */ 3122 BFD_RELOC_390_GOTENT, 3123 3124 /* 64 bit offset to GOT. */ 3125 BFD_RELOC_390_GOTOFF64, 3126 3127 /* 12-bit offset to symbol-entry within GOT, with PLT handling. */ 3128 BFD_RELOC_390_GOTPLT12, 3129 3130 /* 16-bit offset to symbol-entry within GOT, with PLT handling. */ 3131 BFD_RELOC_390_GOTPLT16, 3132 3133 /* 32-bit offset to symbol-entry within GOT, with PLT handling. */ 3134 BFD_RELOC_390_GOTPLT32, 3135 3136 /* 64-bit offset to symbol-entry within GOT, with PLT handling. */ 3137 BFD_RELOC_390_GOTPLT64, 3138 3139 /* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */ 3140 BFD_RELOC_390_GOTPLTENT, 3141 3142 /* 16-bit rel. offset from the GOT to a PLT entry. */ 3143 BFD_RELOC_390_PLTOFF16, 3144 3145 /* 32-bit rel. offset from the GOT to a PLT entry. */ 3146 BFD_RELOC_390_PLTOFF32, 3147 3148 /* 64-bit rel. offset from the GOT to a PLT entry. */ 3149 BFD_RELOC_390_PLTOFF64, 3150 3151 /* s390 tls relocations. */ 3152 BFD_RELOC_390_TLS_LOAD, 3153 BFD_RELOC_390_TLS_GDCALL, 3154 BFD_RELOC_390_TLS_LDCALL, 3155 BFD_RELOC_390_TLS_GD32, 3156 BFD_RELOC_390_TLS_GD64, 3157 BFD_RELOC_390_TLS_GOTIE12, 3158 BFD_RELOC_390_TLS_GOTIE32, 3159 BFD_RELOC_390_TLS_GOTIE64, 3160 BFD_RELOC_390_TLS_LDM32, 3161 BFD_RELOC_390_TLS_LDM64, 3162 BFD_RELOC_390_TLS_IE32, 3163 BFD_RELOC_390_TLS_IE64, 3164 BFD_RELOC_390_TLS_IEENT, 3165 BFD_RELOC_390_TLS_LE32, 3166 BFD_RELOC_390_TLS_LE64, 3167 BFD_RELOC_390_TLS_LDO32, 3168 BFD_RELOC_390_TLS_LDO64, 3169 BFD_RELOC_390_TLS_DTPMOD, 3170 BFD_RELOC_390_TLS_DTPOFF, 3171 BFD_RELOC_390_TLS_TPOFF, 3172 3173 /* Scenix IP2K - 9-bit register number / data address */ 3174 BFD_RELOC_IP2K_FR9, 3175 3176 /* Scenix IP2K - 4-bit register/data bank number */ 3177 BFD_RELOC_IP2K_BANK, 3178 3179 /* Scenix IP2K - low 13 bits of instruction word address */ 3180 BFD_RELOC_IP2K_ADDR16CJP, 3181 3182 /* Scenix IP2K - high 3 bits of instruction word address */ 3183 BFD_RELOC_IP2K_PAGE3, 3184 3185 /* Scenix IP2K - ext/low/high 8 bits of data address */ 3186 BFD_RELOC_IP2K_LO8DATA, 3187 BFD_RELOC_IP2K_HI8DATA, 3188 BFD_RELOC_IP2K_EX8DATA, 3189 3190 /* Scenix IP2K - low/high 8 bits of instruction word address */ 3191 BFD_RELOC_IP2K_LO8INSN, 3192 BFD_RELOC_IP2K_HI8INSN, 3193 3194 /* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */ 3195 BFD_RELOC_IP2K_PC_SKIP, 3196 3197 /* Scenix IP2K - 16 bit word address in text section. */ 3198 BFD_RELOC_IP2K_TEXT, 3199 3200 /* Scenix IP2K - 7-bit sp or dp offset */ 3201 BFD_RELOC_IP2K_FR_OFFSET, 3202 3203 /* Scenix VPE4K coprocessor - data/insn-space addressing */ 3204 BFD_RELOC_VPE4KMATH_DATA, 3205 BFD_RELOC_VPE4KMATH_INSN, 2549 3206 2550 3207 /* These two relocations are used by the linker to determine which of … … 2564 3221 describes the entry that is being used. For Rela hosts, this offset 2565 3222 is stored in the reloc's addend. For Rel hosts, we are forced to put 2566 this offset in the reloc's section offset. */3223 this offset in the reloc's section offset. */ 2567 3224 BFD_RELOC_VTABLE_INHERIT, 2568 3225 BFD_RELOC_VTABLE_ENTRY, 2569 3226 2570 /* Intel IA64 Relocations. */3227 /* Intel IA64 Relocations. */ 2571 3228 BFD_RELOC_IA64_IMM14, 2572 3229 BFD_RELOC_IA64_IMM22, … … 2606 3263 BFD_RELOC_IA64_LTOFF_FPTR22, 2607 3264 BFD_RELOC_IA64_LTOFF_FPTR64I, 3265 BFD_RELOC_IA64_LTOFF_FPTR32MSB, 3266 BFD_RELOC_IA64_LTOFF_FPTR32LSB, 2608 3267 BFD_RELOC_IA64_LTOFF_FPTR64MSB, 2609 3268 BFD_RELOC_IA64_LTOFF_FPTR64LSB, … … 2627 3286 BFD_RELOC_IA64_IPLTLSB, 2628 3287 BFD_RELOC_IA64_COPY, 3288 BFD_RELOC_IA64_LTOFF22X, 3289 BFD_RELOC_IA64_LDXMOV, 3290 BFD_RELOC_IA64_TPREL14, 2629 3291 BFD_RELOC_IA64_TPREL22, 3292 BFD_RELOC_IA64_TPREL64I, 2630 3293 BFD_RELOC_IA64_TPREL64MSB, 2631 3294 BFD_RELOC_IA64_TPREL64LSB, 2632 BFD_RELOC_IA64_LTOFF_TP22, 2633 BFD_RELOC_IA64_LTOFF22X, 2634 BFD_RELOC_IA64_LDXMOV, 3295 BFD_RELOC_IA64_LTOFF_TPREL22, 3296 BFD_RELOC_IA64_DTPMOD64MSB, 3297 BFD_RELOC_IA64_DTPMOD64LSB, 3298 BFD_RELOC_IA64_LTOFF_DTPMOD22, 3299 BFD_RELOC_IA64_DTPREL14, 3300 BFD_RELOC_IA64_DTPREL22, 3301 BFD_RELOC_IA64_DTPREL64I, 3302 BFD_RELOC_IA64_DTPREL32MSB, 3303 BFD_RELOC_IA64_DTPREL32LSB, 3304 BFD_RELOC_IA64_DTPREL64MSB, 3305 BFD_RELOC_IA64_DTPREL64LSB, 3306 BFD_RELOC_IA64_LTOFF_DTPREL22, 2635 3307 2636 3308 /* Motorola 68HC11 reloc. 2637 This is the 8 bit s high part of an absolute address.*/3309 This is the 8 bit high part of an absolute address. */ 2638 3310 BFD_RELOC_M68HC11_HI8, 2639 3311 2640 3312 /* Motorola 68HC11 reloc. 2641 This is the 8 bit s low part of an absolute address.*/3313 This is the 8 bit low part of an absolute address. */ 2642 3314 BFD_RELOC_M68HC11_LO8, 2643 3315 2644 3316 /* Motorola 68HC11 reloc. 2645 This is the 3 bit s of a value.*/3317 This is the 3 bit of a value. */ 2646 3318 BFD_RELOC_M68HC11_3B, 2647 3319 3320 /* Motorola 68HC11 reloc. 3321 This reloc marks the beginning of a jump/call instruction. 3322 It is used for linker relaxation to correctly identify beginning 3323 of instruction and change some branchs to use PC-relative 3324 addressing mode. */ 3325 BFD_RELOC_M68HC11_RL_JUMP, 3326 3327 /* Motorola 68HC11 reloc. 3328 This reloc marks a group of several instructions that gcc generates 3329 and for which the linker relaxation pass can modify and/or remove 3330 some of them. */ 3331 BFD_RELOC_M68HC11_RL_GROUP, 3332 3333 /* Motorola 68HC11 reloc. 3334 This is the 16-bit lower part of an address. It is used for 'call' 3335 instruction to specify the symbol address without any special 3336 transformation (due to memory bank window). */ 3337 BFD_RELOC_M68HC11_LO16, 3338 3339 /* Motorola 68HC11 reloc. 3340 This is a 8-bit reloc that specifies the page number of an address. 3341 It is used by 'call' instruction to specify the page number of 3342 the symbol. */ 3343 BFD_RELOC_M68HC11_PAGE, 3344 3345 /* Motorola 68HC11 reloc. 3346 This is a 24-bit reloc that represents the address with a 16-bit 3347 value and a 8-bit page number. The symbol address is transformed 3348 to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */ 3349 BFD_RELOC_M68HC11_24, 3350 2648 3351 /* These relocs are only used within the CRIS assembler. They are not 2649 (at present) written to any object files. */3352 (at present) written to any object files. */ 2650 3353 BFD_RELOC_CRIS_BDISP8, 2651 3354 BFD_RELOC_CRIS_UNSIGNED_5, … … 2654 3357 BFD_RELOC_CRIS_UNSIGNED_4, 2655 3358 2656 /* Intel i860 Relocations. */ 3359 /* Relocs used in ELF shared libraries for CRIS. */ 3360 BFD_RELOC_CRIS_COPY, 3361 BFD_RELOC_CRIS_GLOB_DAT, 3362 BFD_RELOC_CRIS_JUMP_SLOT, 3363 BFD_RELOC_CRIS_RELATIVE, 3364 3365 /* 32-bit offset to symbol-entry within GOT. */ 3366 BFD_RELOC_CRIS_32_GOT, 3367 3368 /* 16-bit offset to symbol-entry within GOT. */ 3369 BFD_RELOC_CRIS_16_GOT, 3370 3371 /* 32-bit offset to symbol-entry within GOT, with PLT handling. */ 3372 BFD_RELOC_CRIS_32_GOTPLT, 3373 3374 /* 16-bit offset to symbol-entry within GOT, with PLT handling. */ 3375 BFD_RELOC_CRIS_16_GOTPLT, 3376 3377 /* 32-bit offset to symbol, relative to GOT. */ 3378 BFD_RELOC_CRIS_32_GOTREL, 3379 3380 /* 32-bit offset to symbol with PLT entry, relative to GOT. */ 3381 BFD_RELOC_CRIS_32_PLT_GOTREL, 3382 3383 /* 32-bit offset to symbol with PLT entry, relative to this relocation. */ 3384 BFD_RELOC_CRIS_32_PLT_PCREL, 3385 3386 /* Intel i860 Relocations. */ 2657 3387 BFD_RELOC_860_COPY, 2658 3388 BFD_RELOC_860_GLOB_DAT, … … 2687 3417 BFD_RELOC_860_HIGOT, 2688 3418 BFD_RELOC_860_HIGOTOFF, 3419 3420 /* OpenRISC Relocations. */ 3421 BFD_RELOC_OPENRISC_ABS_26, 3422 BFD_RELOC_OPENRISC_REL_26, 3423 3424 /* H8 elf Relocations. */ 3425 BFD_RELOC_H8_DIR16A8, 3426 BFD_RELOC_H8_DIR16R8, 3427 BFD_RELOC_H8_DIR24A8, 3428 BFD_RELOC_H8_DIR24R8, 3429 BFD_RELOC_H8_DIR32A16, 3430 3431 /* Sony Xstormy16 Relocations. */ 3432 BFD_RELOC_XSTORMY16_REL_12, 3433 BFD_RELOC_XSTORMY16_12, 3434 BFD_RELOC_XSTORMY16_24, 3435 BFD_RELOC_XSTORMY16_FPTR16, 3436 3437 /* Relocations used by VAX ELF. */ 3438 BFD_RELOC_VAX_GLOB_DAT, 3439 BFD_RELOC_VAX_JMP_SLOT, 3440 BFD_RELOC_VAX_RELATIVE, 3441 3442 /* msp430 specific relocation codes */ 3443 BFD_RELOC_MSP430_10_PCREL, 3444 BFD_RELOC_MSP430_16_PCREL, 3445 BFD_RELOC_MSP430_16, 3446 BFD_RELOC_MSP430_16_PCREL_BYTE, 3447 BFD_RELOC_MSP430_16_BYTE, 3448 3449 /* IQ2000 Relocations. */ 3450 BFD_RELOC_IQ2000_OFFSET_16, 3451 BFD_RELOC_IQ2000_OFFSET_21, 3452 BFD_RELOC_IQ2000_UHI16, 3453 3454 /* Special Xtensa relocation used only by PLT entries in ELF shared 3455 objects to indicate that the runtime linker should set the value 3456 to one of its own internal functions or data structures. */ 3457 BFD_RELOC_XTENSA_RTLD, 3458 3459 /* Xtensa relocations for ELF shared objects. */ 3460 BFD_RELOC_XTENSA_GLOB_DAT, 3461 BFD_RELOC_XTENSA_JMP_SLOT, 3462 BFD_RELOC_XTENSA_RELATIVE, 3463 3464 /* Xtensa relocation used in ELF object files for symbols that may require 3465 PLT entries. Otherwise, this is just a generic 32-bit relocation. */ 3466 BFD_RELOC_XTENSA_PLT, 3467 3468 /* Generic Xtensa relocations. Only the operand number is encoded 3469 in the relocation. The details are determined by extracting the 3470 instruction opcode. */ 3471 BFD_RELOC_XTENSA_OP0, 3472 BFD_RELOC_XTENSA_OP1, 3473 BFD_RELOC_XTENSA_OP2, 3474 3475 /* Xtensa relocation to mark that the assembler expanded the 3476 instructions from an original target. The expansion size is 3477 encoded in the reloc size. */ 3478 BFD_RELOC_XTENSA_ASM_EXPAND, 3479 3480 /* Xtensa relocation to mark that the linker should simplify 3481 assembler-expanded instructions. This is commonly used 3482 internally by the linker after analysis of a 3483 BFD_RELOC_XTENSA_ASM_EXPAND. */ 3484 BFD_RELOC_XTENSA_ASM_SIMPLIFY, 2689 3485 BFD_RELOC_UNUSED }; 2690 3486 typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; … … 2695 3491 bfd_get_reloc_code_name PARAMS ((bfd_reloc_code_real_type code)); 2696 3492 3493 /* Extracted from syms.c. */ 2697 3494 2698 3495 typedef struct symbol_cache_entry 2699 3496 { 2700 /* A pointer to the BFD which owns the symbol. This information 2701 is necessary so that a back end can work out what additional 2702 information (invisible to the application writer) is carried 2703 with the symbol. 2704 2705 This field is *almost* redundant, since you can use section->owner 2706 instead, except that some symbols point to the global sections 2707 bfd_{abs,com,und}_section. This could be fixed by making 2708 these globals be per-bfd (or per-target-flavor). FIXME. */ 2709 2710 struct _bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ 2711 2712 /* The text of the symbol. The name is left alone, and not copied; the 2713 application may not alter it. */ 2714 CONST char *name; 2715 2716 /* The value of the symbol. This really should be a union of a 2717 numeric value with a pointer, since some flags indicate that 2718 a pointer to another symbol is stored here. */ 3497 /* A pointer to the BFD which owns the symbol. This information 3498 is necessary so that a back end can work out what additional 3499 information (invisible to the application writer) is carried 3500 with the symbol. 3501 3502 This field is *almost* redundant, since you can use section->owner 3503 instead, except that some symbols point to the global sections 3504 bfd_{abs,com,und}_section. This could be fixed by making 3505 these globals be per-bfd (or per-target-flavor). FIXME. */ 3506 struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ 3507 3508 /* The text of the symbol. The name is left alone, and not copied; the 3509 application may not alter it. */ 3510 const char *name; 3511 3512 /* The value of the symbol. This really should be a union of a 3513 numeric value with a pointer, since some flags indicate that 3514 a pointer to another symbol is stored here. */ 2719 3515 symvalue value; 2720 3516 2721 /* Attributes of a symbol: */ 2722 3517 /* Attributes of a symbol. */ 2723 3518 #define BSF_NO_FLAGS 0x00 2724 3519 2725 2726 is the offset into the section of the data.*/3520 /* The symbol has local scope; <<static>> in <<C>>. The value 3521 is the offset into the section of the data. */ 2727 3522 #define BSF_LOCAL 0x01 2728 3523 2729 2730 value is the offset into the section of the data.*/3524 /* The symbol has global scope; initialized data in <<C>>. The 3525 value is the offset into the section of the data. */ 2731 3526 #define BSF_GLOBAL 0x02 2732 3527 2733 2734 the offset into the section of the data.*/2735 #define BSF_EXPORT BSF_GLOBAL /* no real difference*/2736 2737 2738 2739 <<BSF_GLOBAL>>*/2740 2741 2742 3528 /* The symbol has global scope and is exported. The value is 3529 the offset into the section of the data. */ 3530 #define BSF_EXPORT BSF_GLOBAL /* No real difference. */ 3531 3532 /* A normal C symbol would be one of: 3533 <<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or 3534 <<BSF_GLOBAL>>. */ 3535 3536 /* The symbol is a debugging record. The value has an arbitary 3537 meaning, unless BSF_DEBUGGING_RELOC is also set. */ 2743 3538 #define BSF_DEBUGGING 0x08 2744 3539 2745 2746 3540 /* The symbol denotes a function entry point. Used in ELF, 3541 perhaps others someday. */ 2747 3542 #define BSF_FUNCTION 0x10 2748 3543 2749 /* Used by the linker.*/3544 /* Used by the linker. */ 2750 3545 #define BSF_KEEP 0x20 2751 3546 #define BSF_KEEP_G 0x40 2752 3547 2753 2754 3548 /* A weak global symbol, overridable without warnings by 3549 a regular global symbol of the same name. */ 2755 3550 #define BSF_WEAK 0x80 2756 3551 2757 2758 3552 /* This symbol was created to point to a section, e.g. ELF's 3553 STT_SECTION symbols. */ 2759 3554 #define BSF_SECTION_SYM 0x100 2760 3555 2761 2762 allocated.*/3556 /* The symbol used to be a common symbol, but now it is 3557 allocated. */ 2763 3558 #define BSF_OLD_COMMON 0x200 2764 3559 2765 /* The default value for common data.*/3560 /* The default value for common data. */ 2766 3561 #define BFD_FORT_COMM_DEFAULT_VALUE 0 2767 3562 2768 /* In some files the type of a symbol sometimes alters its 2769 location in an output file - ie in coff a <<ISFCN>> symbol 2770 which is also <<C_EXT>> symbol appears where it was 2771 declared and not at the end of a section. This bit is set 2772 by the target BFD part to convey this information. */ 2773 3563 /* In some files the type of a symbol sometimes alters its 3564 location in an output file - ie in coff a <<ISFCN>> symbol 3565 which is also <<C_EXT>> symbol appears where it was 3566 declared and not at the end of a section. This bit is set 3567 by the target BFD part to convey this information. */ 2774 3568 #define BSF_NOT_AT_END 0x400 2775 3569 2776 /* Signal that the symbol is the label of constructor section.*/3570 /* Signal that the symbol is the label of constructor section. */ 2777 3571 #define BSF_CONSTRUCTOR 0x800 2778 3572 2779 2780 2781 2782 symbol, a warning is issued by the linker.*/3573 /* Signal that the symbol is a warning symbol. The name is a 3574 warning. The name of the next symbol is the one to warn about; 3575 if a reference is made to a symbol with the same name as the next 3576 symbol, a warning is issued by the linker. */ 2783 3577 #define BSF_WARNING 0x1000 2784 3578 2785 2786 pointer to the symbol with the same name as the next symbol.*/3579 /* Signal that the symbol is indirect. This symbol is an indirect 3580 pointer to the symbol with the same name as the next symbol. */ 2787 3581 #define BSF_INDIRECT 0x2000 2788 3582 2789 2790 3583 /* BSF_FILE marks symbols that contain a file name. This is used 3584 for ELF STT_FILE symbols. */ 2791 3585 #define BSF_FILE 0x4000 2792 3586 2793 3587 /* Symbol is from dynamic linking information. */ 2794 3588 #define BSF_DYNAMIC 0x8000 2795 3589 2796 2797 3590 /* The symbol denotes a data object. Used in ELF, and perhaps 3591 others someday. */ 2798 3592 #define BSF_OBJECT 0x10000 2799 3593 2800 2801 2802 3594 /* This symbol is a debugging symbol. The value is the offset 3595 into the section of the data. BSF_DEBUGGING should be set 3596 as well. */ 2803 3597 #define BSF_DEBUGGING_RELOC 0x20000 2804 3598 3599 /* This symbol is thread local. Used in ELF. */ 3600 #define BSF_THREAD_LOCAL 0x40000 3601 2805 3602 flagword flags; 2806 3603 2807 2808 2809 3604 /* A pointer to the section to which this symbol is 3605 relative. This will always be non NULL, there are special 3606 sections for undefined and absolute symbols. */ 2810 3607 struct sec *section; 2811 3608 2812 3609 /* Back end special data. */ 2813 3610 union 2814 3611 { 2815 3612 PTR p; 2816 3613 bfd_vma i; 2817 } udata; 2818 2819 } asymbol; 3614 } 3615 udata; 3616 } 3617 asymbol; 3618 2820 3619 #define bfd_get_symtab_upper_bound(abfd) \ 2821 3620 BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) 2822 boolean 3621 3622 bfd_boolean 2823 3623 bfd_is_local_label PARAMS ((bfd *abfd, asymbol *sym)); 2824 3624 2825 b oolean3625 bfd_boolean 2826 3626 bfd_is_local_label_name PARAMS ((bfd *abfd, const char *name)); 2827 3627 2828 3628 #define bfd_is_local_label_name(abfd, name) \ 2829 3629 BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) 3630 2830 3631 #define bfd_canonicalize_symtab(abfd, location) \ 2831 3632 BFD_SEND (abfd, _bfd_canonicalize_symtab,\ 2832 3633 (abfd, location)) 2833 boolean 3634 3635 bfd_boolean 2834 3636 bfd_set_symtab PARAMS ((bfd *abfd, asymbol **location, unsigned int count)); 2835 3637 2836 3638 void 2837 bfd_print_symbol_vandf PARAMS (( PTR file, asymbol *symbol));3639 bfd_print_symbol_vandf PARAMS ((bfd *abfd, PTR file, asymbol *symbol)); 2838 3640 2839 3641 #define bfd_make_empty_symbol(abfd) \ 2840 3642 BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) 3643 3644 asymbol * 3645 _bfd_generic_make_empty_symbol PARAMS ((bfd *)); 3646 2841 3647 #define bfd_make_debug_symbol(abfd,ptr,size) \ 2842 3648 BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) 3649 2843 3650 int 2844 3651 bfd_decode_symclass PARAMS ((asymbol *symbol)); 2845 3652 2846 b oolean3653 bfd_boolean 2847 3654 bfd_is_undefined_symclass PARAMS ((int symclass)); 2848 3655 … … 2850 3657 bfd_symbol_info PARAMS ((asymbol *symbol, symbol_info *ret)); 2851 3658 2852 b oolean3659 bfd_boolean 2853 3660 bfd_copy_private_symbol_data PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym)); 2854 3661 … … 2856 3663 BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ 2857 3664 (ibfd, isymbol, obfd, osymbol)) 2858 struct _bfd 3665 3666 /* Extracted from bfd.c. */ 3667 struct bfd 2859 3668 { 2860 /* The filename the application opened the BFD with. */ 2861 CONST char *filename; 2862 2863 /* A pointer to the target jump table. */ 2864 const struct bfd_target *xvec; 2865 2866 /* To avoid dragging too many header files into every file that 2867 includes `<<bfd.h>>', IOSTREAM has been declared as a "char 2868 *", and MTIME as a "long". Their correct types, to which they 2869 are cast when used, are "FILE *" and "time_t". The iostream 2870 is the result of an fopen on the filename. However, if the 2871 BFD_IN_MEMORY flag is set, then iostream is actually a pointer 2872 to a bfd_in_memory struct. */ 2873 PTR iostream; 2874 2875 /* Is the file descriptor being cached? That is, can it be closed as 2876 needed, and re-opened when accessed later? */ 2877 2878 boolean cacheable; 2879 2880 /* Marks whether there was a default target specified when the 2881 BFD was opened. This is used to select which matching algorithm 2882 to use to choose the back end. */ 2883 2884 boolean target_defaulted; 2885 2886 /* The caching routines use these to maintain a 2887 least-recently-used list of BFDs */ 2888 2889 struct _bfd *lru_prev, *lru_next; 2890 2891 /* When a file is closed by the caching routines, BFD retains 2892 state information on the file here: */ 2893 2894 file_ptr where; 2895 2896 /* and here: (``once'' means at least once) */ 2897 2898 boolean opened_once; 2899 2900 /* Set if we have a locally maintained mtime value, rather than 2901 getting it from the file each time: */ 2902 2903 boolean mtime_set; 2904 2905 /* File modified time, if mtime_set is true: */ 2906 2907 long mtime; 2908 2909 /* Reserved for an unimplemented file locking extension.*/ 2910 2911 int ifd; 2912 2913 /* The format which belongs to the BFD. (object, core, etc.) */ 2914 2915 bfd_format format; 2916 2917 /* The direction the BFD was opened with*/ 2918 2919 enum bfd_direction {no_direction = 0, 2920 read_direction = 1, 2921 write_direction = 2, 2922 both_direction = 3} direction; 2923 2924 /* Format_specific flags*/ 2925 2926 flagword flags; 2927 2928 /* Currently my_archive is tested before adding origin to 2929 anything. I believe that this can become always an add of 2930 origin, with origin set to 0 for non archive files. */ 2931 2932 file_ptr origin; 2933 2934 /* Remember when output has begun, to stop strange things 2935 from happening. */ 2936 boolean output_has_begun; 2937 2938 /* Pointer to linked list of sections*/ 2939 struct sec *sections; 2940 2941 /* The number of sections */ 2942 unsigned int section_count; 2943 2944 /* Stuff only useful for object files: 2945 The start address. */ 2946 bfd_vma start_address; 2947 2948 /* Used for input and output*/ 2949 unsigned int symcount; 2950 2951 /* Symbol table for output BFD (with symcount entries) */ 2952 struct symbol_cache_entry **outsymbols; 2953 2954 /* Pointer to structure which contains architecture information*/ 2955 const struct bfd_arch_info *arch_info; 2956 2957 /* Stuff only useful for archives:*/ 2958 PTR arelt_data; 2959 struct _bfd *my_archive; /* The containing archive BFD. */ 2960 struct _bfd *next; /* The next BFD in the archive. */ 2961 struct _bfd *archive_head; /* The first BFD in the archive. */ 2962 boolean has_armap; 2963 2964 /* A chain of BFD structures involved in a link. */ 2965 struct _bfd *link_next; 2966 2967 /* A field used by _bfd_generic_link_add_archive_symbols. This will 2968 be used only for archive elements. */ 2969 int archive_pass; 2970 2971 /* Used by the back end to hold private data. */ 2972 2973 union 2974 { 3669 /* A unique identifier of the BFD */ 3670 unsigned int id; 3671 3672 /* The filename the application opened the BFD with. */ 3673 const char *filename; 3674 3675 /* A pointer to the target jump table. */ 3676 const struct bfd_target *xvec; 3677 3678 /* To avoid dragging too many header files into every file that 3679 includes `<<bfd.h>>', IOSTREAM has been declared as a "char *", 3680 and MTIME as a "long". Their correct types, to which they 3681 are cast when used, are "FILE *" and "time_t". The iostream 3682 is the result of an fopen on the filename. However, if the 3683 BFD_IN_MEMORY flag is set, then iostream is actually a pointer 3684 to a bfd_in_memory struct. */ 3685 PTR iostream; 3686 3687 /* Is the file descriptor being cached? That is, can it be closed as 3688 needed, and re-opened when accessed later? */ 3689 bfd_boolean cacheable; 3690 3691 /* Marks whether there was a default target specified when the 3692 BFD was opened. This is used to select which matching algorithm 3693 to use to choose the back end. */ 3694 bfd_boolean target_defaulted; 3695 3696 /* The caching routines use these to maintain a 3697 least-recently-used list of BFDs. */ 3698 struct bfd *lru_prev, *lru_next; 3699 3700 /* When a file is closed by the caching routines, BFD retains 3701 state information on the file here... */ 3702 ufile_ptr where; 3703 3704 /* ... and here: (``once'' means at least once). */ 3705 bfd_boolean opened_once; 3706 3707 /* Set if we have a locally maintained mtime value, rather than 3708 getting it from the file each time. */ 3709 bfd_boolean mtime_set; 3710 3711 /* File modified time, if mtime_set is TRUE. */ 3712 long mtime; 3713 3714 /* Reserved for an unimplemented file locking extension. */ 3715 int ifd; 3716 3717 /* The format which belongs to the BFD. (object, core, etc.) */ 3718 bfd_format format; 3719 3720 /* The direction with which the BFD was opened. */ 3721 enum bfd_direction 3722 { 3723 no_direction = 0, 3724 read_direction = 1, 3725 write_direction = 2, 3726 both_direction = 3 3727 } 3728 direction; 3729 3730 /* Format_specific flags. */ 3731 flagword flags; 3732 3733 /* Currently my_archive is tested before adding origin to 3734 anything. I believe that this can become always an add of 3735 origin, with origin set to 0 for non archive files. */ 3736 ufile_ptr origin; 3737 3738 /* Remember when output has begun, to stop strange things 3739 from happening. */ 3740 bfd_boolean output_has_begun; 3741 3742 /* A hash table for section names. */ 3743 struct bfd_hash_table section_htab; 3744 3745 /* Pointer to linked list of sections. */ 3746 struct sec *sections; 3747 3748 /* The place where we add to the section list. */ 3749 struct sec **section_tail; 3750 3751 /* The number of sections. */ 3752 unsigned int section_count; 3753 3754 /* Stuff only useful for object files: 3755 The start address. */ 3756 bfd_vma start_address; 3757 3758 /* Used for input and output. */ 3759 unsigned int symcount; 3760 3761 /* Symbol table for output BFD (with symcount entries). */ 3762 struct symbol_cache_entry **outsymbols; 3763 3764 /* Used for slurped dynamic symbol tables. */ 3765 unsigned int dynsymcount; 3766 3767 /* Pointer to structure which contains architecture information. */ 3768 const struct bfd_arch_info *arch_info; 3769 3770 /* Stuff only useful for archives. */ 3771 PTR arelt_data; 3772 struct bfd *my_archive; /* The containing archive BFD. */ 3773 struct bfd *next; /* The next BFD in the archive. */ 3774 struct bfd *archive_head; /* The first BFD in the archive. */ 3775 bfd_boolean has_armap; 3776 3777 /* A chain of BFD structures involved in a link. */ 3778 struct bfd *link_next; 3779 3780 /* A field used by _bfd_generic_link_add_archive_symbols. This will 3781 be used only for archive elements. */ 3782 int archive_pass; 3783 3784 /* Used by the back end to hold private data. */ 3785 union 3786 { 2975 3787 struct aout_data_struct *aout_data; 2976 3788 struct artdata *aout_ar_data; … … 2989 3801 struct nlm_obj_tdata *nlm_obj_data; 2990 3802 struct bout_data_struct *bout_data; 3803 struct mmo_data_struct *mmo_data; 2991 3804 struct sun_core_struct *sun_core_data; 2992 3805 struct sco5_core_struct *sco5_core_data; … … 3001 3814 struct versados_data_struct *versados_data; 3002 3815 struct netbsd_core_struct *netbsd_core_data; 3816 struct mach_o_data_struct *mach_o_data; 3817 struct mach_o_fat_data_struct *mach_o_fat_data; 3818 struct bfd_pef_data_struct *pef_data; 3819 struct bfd_pef_xlib_data_struct *pef_xlib_data; 3820 struct bfd_sym_data_struct *sym_data; 3003 3821 PTR any; 3004 } tdata; 3005 3006 /* Used by the application to hold private data*/ 3007 PTR usrdata; 3822 } 3823 tdata; 3824 3825 /* Used by the application to hold private data. */ 3826 PTR usrdata; 3008 3827 3009 3828 /* Where all the allocated stuff under this BFD goes. This is a 3010 3829 struct objalloc *, but we use PTR to avoid requiring the inclusion of 3011 3830 objalloc.h. */ 3012 3831 PTR memory; 3013 3832 }; 3014 3833 … … 3019 3838 bfd_error_invalid_target, 3020 3839 bfd_error_wrong_format, 3840 bfd_error_wrong_object_format, 3021 3841 bfd_error_invalid_operation, 3022 3842 bfd_error_no_memory, … … 3034 3854 bfd_error_file_too_big, 3035 3855 bfd_error_invalid_error_code 3036 } bfd_error_type; 3856 } 3857 bfd_error_type; 3037 3858 3038 3859 bfd_error_type … … 3042 3863 bfd_set_error PARAMS ((bfd_error_type error_tag)); 3043 3864 3044 CONSTchar *3865 const char * 3045 3866 bfd_errmsg PARAMS ((bfd_error_type error_tag)); 3046 3867 3047 3868 void 3048 bfd_perror PARAMS (( CONSTchar *message));3869 bfd_perror PARAMS ((const char *message)); 3049 3870 3050 3871 typedef void (*bfd_error_handler_type) PARAMS ((const char *, ...)); … … 3058 3879 bfd_error_handler_type 3059 3880 bfd_get_error_handler PARAMS ((void)); 3881 3882 const char * 3883 bfd_archive_filename PARAMS ((bfd *)); 3060 3884 3061 3885 long … … 3069 3893 3070 3894 void 3071 bfd_set_reloc PARAMS ((bfd *abfd, asection *sec, arelent **rel, unsigned int count) 3072 3073 ); 3074 3075 boolean 3895 bfd_set_reloc PARAMS ((bfd *abfd, asection *sec, arelent **rel, unsigned int count)); 3896 3897 bfd_boolean 3076 3898 bfd_set_file_flags PARAMS ((bfd *abfd, flagword flags)); 3077 3899 … … 3082 3904 bfd_get_sign_extend_vma PARAMS ((bfd *abfd)); 3083 3905 3084 b oolean3906 bfd_boolean 3085 3907 bfd_set_start_address PARAMS ((bfd *abfd, bfd_vma vma)); 3086 3908 3087 long 3088 bfd_get_mtime PARAMS ((bfd *abfd)); 3089 3090 long 3091 bfd_get_size PARAMS ((bfd *abfd)); 3092 3093 int 3909 unsigned int 3094 3910 bfd_get_gp_size PARAMS ((bfd *abfd)); 3095 3911 3096 3912 void 3097 bfd_set_gp_size PARAMS ((bfd *abfd, int i));3913 bfd_set_gp_size PARAMS ((bfd *abfd, unsigned int i)); 3098 3914 3099 3915 bfd_vma 3100 bfd_scan_vma PARAMS (( CONST char *string, CONSTchar **end, int base));3101 3102 b oolean3916 bfd_scan_vma PARAMS ((const char *string, const char **end, int base)); 3917 3918 bfd_boolean 3103 3919 bfd_copy_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd)); 3104 3920 … … 3106 3922 BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ 3107 3923 (ibfd, obfd)) 3108 b oolean3924 bfd_boolean 3109 3925 bfd_merge_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd)); 3110 3926 … … 3112 3928 BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ 3113 3929 (ibfd, obfd)) 3114 b oolean3930 bfd_boolean 3115 3931 bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags)); 3116 3932 3117 3933 #define bfd_set_private_flags(abfd, flags) \ 3118 BFD_SEND (abfd, _bfd_set_private_flags, \ 3119 (abfd, flags)) 3934 BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) 3120 3935 #define bfd_sizeof_headers(abfd, reloc) \ 3121 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))3936 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) 3122 3937 3123 3938 #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ 3124 BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line))3125 3126 /* Do these three do anything useful at all, for any back end? */ 3939 BFD_SEND (abfd, _bfd_find_nearest_line, \ 3940 (abfd, sec, syms, off, file, func, line)) 3941 3127 3942 #define bfd_debug_info_start(abfd) \ 3128 3943 BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) 3129 3944 3130 3945 #define bfd_debug_info_end(abfd) \ 3131 3946 BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) 3132 3947 3133 3948 #define bfd_debug_info_accumulate(abfd, section) \ 3134 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) 3135 3949 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) 3136 3950 3137 3951 #define bfd_stat_arch_elt(abfd, stat) \ 3138 3952 BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) 3139 3953 3140 3954 #define bfd_update_armap_timestamp(abfd) \ 3141 3955 BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) 3142 3956 3143 3957 #define bfd_set_arch_mach(abfd, arch, mach)\ 3144 3958 BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) 3145 3959 3146 3960 #define bfd_relax_section(abfd, section, link_info, again) \ … … 3150 3964 BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info)) 3151 3965 3966 #define bfd_merge_sections(abfd, link_info) \ 3967 BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info)) 3968 3969 #define bfd_discard_group(abfd, sec) \ 3970 BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) 3971 3152 3972 #define bfd_link_hash_table_create(abfd) \ 3153 3973 BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) 3154 3974 3975 #define bfd_link_hash_table_free(abfd, hash) \ 3976 BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) 3977 3155 3978 #define bfd_link_add_symbols(abfd, info) \ 3156 3979 BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) 3980 3981 #define bfd_link_just_syms(sec, info) \ 3982 BFD_SEND (abfd, _bfd_link_just_syms, (sec, info)) 3157 3983 3158 3984 #define bfd_final_link(abfd, info) \ … … 3180 4006 PARAMS ((bfd *, struct bfd_link_info *, 3181 4007 struct bfd_link_order *, bfd_byte *, 3182 boolean, asymbol **)); 3183 4008 bfd_boolean, asymbol **)); 4009 4010 bfd_boolean 4011 bfd_alt_mach_code PARAMS ((bfd *abfd, int alternative)); 4012 4013 struct bfd_preserve 4014 { 4015 PTR marker; 4016 PTR tdata; 4017 flagword flags; 4018 const struct bfd_arch_info *arch_info; 4019 struct sec *sections; 4020 struct sec **section_tail; 4021 unsigned int section_count; 4022 struct bfd_hash_table section_htab; 4023 }; 4024 4025 bfd_boolean 4026 bfd_preserve_save PARAMS ((bfd *, struct bfd_preserve *)); 4027 4028 void 4029 bfd_preserve_restore PARAMS ((bfd *, struct bfd_preserve *)); 4030 4031 void 4032 bfd_preserve_finish PARAMS ((bfd *, struct bfd_preserve *)); 4033 4034 /* Extracted from archive.c. */ 3184 4035 symindex 3185 4036 bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym)); 3186 4037 3187 b oolean4038 bfd_boolean 3188 4039 bfd_set_archive_head PARAMS ((bfd *output, bfd *new_head)); 3189 4040 … … 3191 4042 bfd_openr_next_archived_file PARAMS ((bfd *archive, bfd *previous)); 3192 4043 3193 CONST char * 4044 /* Extracted from corefile.c. */ 4045 const char * 3194 4046 bfd_core_file_failing_command PARAMS ((bfd *abfd)); 3195 4047 … … 3197 4049 bfd_core_file_failing_signal PARAMS ((bfd *abfd)); 3198 4050 3199 b oolean4051 bfd_boolean 3200 4052 core_file_matches_executable_p PARAMS ((bfd *core_bfd, bfd *exec_bfd)); 3201 4053 4054 /* Extracted from targets.c. */ 3202 4055 #define BFD_SEND(bfd, message, arglist) \ 3203 4056 ((*((bfd)->xvec->message)) arglist) … … 3220 4073 (bfd_assert (__FILE__,__LINE__), NULL)) 3221 4074 #endif 3222 enum bfd_flavour { 4075 4076 enum bfd_flavour 4077 { 3223 4078 bfd_target_unknown_flavour, 3224 4079 bfd_target_aout_flavour, … … 3238 4093 bfd_target_msdos_flavour, 3239 4094 bfd_target_ovax_flavour, 3240 bfd_target_evax_flavour 4095 bfd_target_evax_flavour, 4096 bfd_target_mmo_flavour, 4097 bfd_target_mach_o_flavour, 4098 bfd_target_pef_flavour, 4099 bfd_target_pef_xlib_flavour, 4100 bfd_target_sym_flavour 3241 4101 }; 3242 4102 … … 3248 4108 typedef struct bfd_target 3249 4109 { 4110 /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ 3250 4111 char *name; 4112 4113 /* The "flavour" of a back end is a general indication about 4114 the contents of a file. */ 3251 4115 enum bfd_flavour flavour; 4116 4117 /* The order of bytes within the data area of a file. */ 3252 4118 enum bfd_endian byteorder; 4119 4120 /* The order of bytes within the header parts of a file. */ 3253 4121 enum bfd_endian header_byteorder; 4122 4123 /* A mask of all the flags which an executable may have set - 4124 from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. */ 3254 4125 flagword object_flags; 4126 4127 /* A mask of all the flags which a section may have set - from 4128 the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. */ 3255 4129 flagword section_flags; 4130 4131 /* The character normally found at the front of a symbol. 4132 (if any), perhaps `_'. */ 3256 4133 char symbol_leading_char; 4134 4135 /* The pad character for file names within an archive header. */ 3257 4136 char ar_pad_char; 4137 4138 /* The maximum number of characters in an archive header. */ 3258 4139 unsigned short ar_max_namelen; 3259 bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *)); 4140 4141 /* Entries for byte swapping for data. These are different from the 4142 other entry points, since they don't take a BFD asthe first argument. 4143 Certain other handlers could do the same. */ 4144 bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *)); 3260 4145 bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *)); 3261 void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));3262 bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *));4146 void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *)); 4147 bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *)); 3263 4148 bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((const bfd_byte *)); 3264 void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));3265 bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *));4149 void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *)); 4150 bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *)); 3266 4151 bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *)); 3267 void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *)); 3268 bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *)); 4152 void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *)); 4153 4154 /* Byte swapping for the headers. */ 4155 bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *)); 3269 4156 bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *)); 3270 void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));3271 bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *));4157 void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *)); 4158 bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *)); 3272 4159 bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((const bfd_byte *)); 3273 void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));3274 bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *));4160 void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *)); 4161 bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *)); 3275 4162 bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *)); 3276 void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *)); 4163 void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *)); 4164 4165 /* Format dependent routines: these are vectors of entry points 4166 within the target vector structure, one for each format to check. */ 4167 4168 /* Check the format of a file being read. Return a <<bfd_target *>> or zero. */ 3277 4169 const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *)); 3278 boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); 3279 boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); 4170 4171 /* Set the format of a file being written. */ 4172 bfd_boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); 4173 4174 /* Write cached information into a file being written, at <<bfd_close>>. */ 4175 bfd_boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); 4176 3280 4177 3281 4178 /* Generic entry points. */ 3282 #define BFD_JUMP_TABLE_GENERIC(NAME) \3283 C AT(NAME,_close_and_cleanup),\3284 C AT(NAME,_bfd_free_cached_info),\3285 C AT(NAME,_new_section_hook),\3286 C AT(NAME,_get_section_contents),\3287 C AT(NAME,_get_section_contents_in_window)4179 #define BFD_JUMP_TABLE_GENERIC(NAME) \ 4180 CONCAT2 (NAME,_close_and_cleanup), \ 4181 CONCAT2 (NAME,_bfd_free_cached_info), \ 4182 CONCAT2 (NAME,_new_section_hook), \ 4183 CONCAT2 (NAME,_get_section_contents), \ 4184 CONCAT2 (NAME,_get_section_contents_in_window) 3288 4185 3289 4186 /* Called when the BFD is being closed to do any necessary cleanup. */ 3290 b oolean(*_close_and_cleanup) PARAMS ((bfd *));4187 bfd_boolean (*_close_and_cleanup) PARAMS ((bfd *)); 3291 4188 /* Ask the BFD to free all cached information. */ 3292 b oolean (*_bfd_free_cached_info) PARAMS ((bfd *));4189 bfd_boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); 3293 4190 /* Called when a new section is created. */ 3294 b oolean(*_new_section_hook) PARAMS ((bfd *, sec_ptr));4191 bfd_boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); 3295 4192 /* Read the contents of a section. */ 3296 boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, 3297 file_ptr, bfd_size_type)); 3298 boolean (*_bfd_get_section_contents_in_window) 3299 PARAMS ((bfd *, sec_ptr, bfd_window *, 3300 file_ptr, bfd_size_type)); 4193 bfd_boolean (*_bfd_get_section_contents) 4194 PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); 4195 bfd_boolean (*_bfd_get_section_contents_in_window) 4196 PARAMS ((bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type)); 3301 4197 3302 4198 /* Entry points to copy private data. */ 3303 #define BFD_JUMP_TABLE_COPY(NAME) \3304 C AT(NAME,_bfd_copy_private_bfd_data),\3305 C AT(NAME,_bfd_merge_private_bfd_data),\3306 C AT(NAME,_bfd_copy_private_section_data),\3307 C AT(NAME,_bfd_copy_private_symbol_data),\3308 C AT(NAME,_bfd_set_private_flags),\3309 C AT(NAME,_bfd_print_private_bfd_data)\4199 #define BFD_JUMP_TABLE_COPY(NAME) \ 4200 CONCAT2 (NAME,_bfd_copy_private_bfd_data), \ 4201 CONCAT2 (NAME,_bfd_merge_private_bfd_data), \ 4202 CONCAT2 (NAME,_bfd_copy_private_section_data), \ 4203 CONCAT2 (NAME,_bfd_copy_private_symbol_data), \ 4204 CONCAT2 (NAME,_bfd_set_private_flags), \ 4205 CONCAT2 (NAME,_bfd_print_private_bfd_data) \ 3310 4206 /* Called to copy BFD general private data from one object file 3311 4207 to another. */ 3312 b oolean(*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));4208 bfd_boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *)); 3313 4209 /* Called to merge BFD general private data from one object file 3314 4210 to a common output file when linking. */ 3315 b oolean(*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *));4211 bfd_boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *)); 3316 4212 /* Called to copy BFD private section data from one object file 3317 4213 to another. */ 3318 b oolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr,3319 4214 bfd_boolean (*_bfd_copy_private_section_data) 4215 PARAMS ((bfd *, sec_ptr, bfd *, sec_ptr)); 3320 4216 /* Called to copy BFD private symbol data from one symbol 3321 4217 to another. */ 3322 b oolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *,3323 3324 /* Called to set private backend flags */3325 b oolean(*_bfd_set_private_flags) PARAMS ((bfd *, flagword));3326 3327 /* Called to print private BFD data */3328 b oolean(*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR));4218 bfd_boolean (*_bfd_copy_private_symbol_data) 4219 PARAMS ((bfd *, asymbol *, bfd *, asymbol *)); 4220 /* Called to set private backend flags. */ 4221 bfd_boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword)); 4222 4223 /* Called to print private BFD data. */ 4224 bfd_boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR)); 3329 4225 3330 4226 /* Core file entry points. */ 3331 #define BFD_JUMP_TABLE_CORE(NAME) \3332 C AT(NAME,_core_file_failing_command),\3333 C AT(NAME,_core_file_failing_signal),\3334 C AT(NAME,_core_file_matches_executable_p)3335 char * (*_core_file_failing_command) PARAMS ((bfd *));3336 int (*_core_file_failing_signal) PARAMS ((bfd *));3337 b oolean(*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *));4227 #define BFD_JUMP_TABLE_CORE(NAME) \ 4228 CONCAT2 (NAME,_core_file_failing_command), \ 4229 CONCAT2 (NAME,_core_file_failing_signal), \ 4230 CONCAT2 (NAME,_core_file_matches_executable_p) 4231 char * (*_core_file_failing_command) PARAMS ((bfd *)); 4232 int (*_core_file_failing_signal) PARAMS ((bfd *)); 4233 bfd_boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *)); 3338 4234 3339 4235 /* Archive entry points. */ 3340 #define BFD_JUMP_TABLE_ARCHIVE(NAME)\ 3341 CAT(NAME,_slurp_armap),\ 3342 CAT(NAME,_slurp_extended_name_table),\ 3343 CAT(NAME,_construct_extended_name_table),\ 3344 CAT(NAME,_truncate_arname),\ 3345 CAT(NAME,_write_armap),\ 3346 CAT(NAME,_read_ar_hdr),\ 3347 CAT(NAME,_openr_next_archived_file),\ 3348 CAT(NAME,_get_elt_at_index),\ 3349 CAT(NAME,_generic_stat_arch_elt),\ 3350 CAT(NAME,_update_armap_timestamp) 3351 boolean (*_bfd_slurp_armap) PARAMS ((bfd *)); 3352 boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *)); 3353 boolean (*_bfd_construct_extended_name_table) 3354 PARAMS ((bfd *, char **, bfd_size_type *, const char **)); 3355 void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *)); 3356 boolean (*write_armap) PARAMS ((bfd *arch, 3357 unsigned int elength, 3358 struct orl *map, 3359 unsigned int orl_count, 3360 int stridx)); 3361 PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); 3362 bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev)); 4236 #define BFD_JUMP_TABLE_ARCHIVE(NAME) \ 4237 CONCAT2 (NAME,_slurp_armap), \ 4238 CONCAT2 (NAME,_slurp_extended_name_table), \ 4239 CONCAT2 (NAME,_construct_extended_name_table), \ 4240 CONCAT2 (NAME,_truncate_arname), \ 4241 CONCAT2 (NAME,_write_armap), \ 4242 CONCAT2 (NAME,_read_ar_hdr), \ 4243 CONCAT2 (NAME,_openr_next_archived_file), \ 4244 CONCAT2 (NAME,_get_elt_at_index), \ 4245 CONCAT2 (NAME,_generic_stat_arch_elt), \ 4246 CONCAT2 (NAME,_update_armap_timestamp) 4247 bfd_boolean (*_bfd_slurp_armap) PARAMS ((bfd *)); 4248 bfd_boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *)); 4249 bfd_boolean (*_bfd_construct_extended_name_table) 4250 PARAMS ((bfd *, char **, bfd_size_type *, const char **)); 4251 void (*_bfd_truncate_arname) PARAMS ((bfd *, const char *, char *)); 4252 bfd_boolean (*write_armap) 4253 PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); 4254 PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); 4255 bfd * (*openr_next_archived_file) PARAMS ((bfd *, bfd *)); 3363 4256 #define bfd_get_elt_at_index(b,i) BFD_SEND(b, _bfd_get_elt_at_index, (b,i)) 3364 bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex));3365 int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));3366 b oolean(*_bfd_update_armap_timestamp) PARAMS ((bfd *));4257 bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex)); 4258 int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); 4259 bfd_boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *)); 3367 4260 3368 4261 /* Entry points used for symbols. */ 3369 #define BFD_JUMP_TABLE_SYMBOLS(NAME)\ 3370 CAT(NAME,_get_symtab_upper_bound),\ 3371 CAT(NAME,_get_symtab),\ 3372 CAT(NAME,_make_empty_symbol),\ 3373 CAT(NAME,_print_symbol),\ 3374 CAT(NAME,_get_symbol_info),\ 3375 CAT(NAME,_bfd_is_local_label_name),\ 3376 CAT(NAME,_get_lineno),\ 3377 CAT(NAME,_find_nearest_line),\ 3378 CAT(NAME,_bfd_make_debug_symbol),\ 3379 CAT(NAME,_read_minisymbols),\ 3380 CAT(NAME,_minisymbol_to_symbol) 3381 long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); 3382 long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, 3383 struct symbol_cache_entry **)); 3384 struct symbol_cache_entry * 3385 (*_bfd_make_empty_symbol) PARAMS ((bfd *)); 3386 void (*_bfd_print_symbol) PARAMS ((bfd *, PTR, 3387 struct symbol_cache_entry *, 3388 bfd_print_symbol_type)); 4262 #define BFD_JUMP_TABLE_SYMBOLS(NAME) \ 4263 CONCAT2 (NAME,_get_symtab_upper_bound), \ 4264 CONCAT2 (NAME,_get_symtab), \ 4265 CONCAT2 (NAME,_make_empty_symbol), \ 4266 CONCAT2 (NAME,_print_symbol), \ 4267 CONCAT2 (NAME,_get_symbol_info), \ 4268 CONCAT2 (NAME,_bfd_is_local_label_name), \ 4269 CONCAT2 (NAME,_get_lineno), \ 4270 CONCAT2 (NAME,_find_nearest_line), \ 4271 CONCAT2 (NAME,_bfd_make_debug_symbol), \ 4272 CONCAT2 (NAME,_read_minisymbols), \ 4273 CONCAT2 (NAME,_minisymbol_to_symbol) 4274 long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); 4275 long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, 4276 struct symbol_cache_entry **)); 4277 struct symbol_cache_entry * 4278 (*_bfd_make_empty_symbol) PARAMS ((bfd *)); 4279 void (*_bfd_print_symbol) 4280 PARAMS ((bfd *, PTR, struct symbol_cache_entry *, bfd_print_symbol_type)); 3389 4281 #define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e)) 3390 void (*_bfd_get_symbol_info) PARAMS ((bfd *, 3391 struct symbol_cache_entry *, 3392 symbol_info *)); 4282 void (*_bfd_get_symbol_info) 4283 PARAMS ((bfd *, struct symbol_cache_entry *, symbol_info *)); 3393 4284 #define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e)) 3394 boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *)); 3395 3396 alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); 3397 boolean (*_bfd_find_nearest_line) PARAMS ((bfd *abfd, 3398 struct sec *section, struct symbol_cache_entry **symbols, 3399 bfd_vma offset, CONST char **file, CONST char **func, 3400 unsigned int *line)); 4285 bfd_boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *)); 4286 4287 alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); 4288 bfd_boolean (*_bfd_find_nearest_line) 4289 PARAMS ((bfd *, struct sec *, struct symbol_cache_entry **, bfd_vma, 4290 const char **, const char **, unsigned int *)); 3401 4291 /* Back-door to allow format-aware applications to create debug symbols 3402 4292 while using BFD for everything else. Currently used by the assembler 3403 4293 when creating COFF files. */ 3404 asymbol * (*_bfd_make_debug_symbol) PARAMS (( 3405 bfd *abfd, 3406 void *ptr, 3407 unsigned long size)); 4294 asymbol * (*_bfd_make_debug_symbol) 4295 PARAMS ((bfd *, void *, unsigned long size)); 3408 4296 #define bfd_read_minisymbols(b, d, m, s) \ 3409 4297 BFD_SEND (b, _read_minisymbols, (b, d, m, s)) 3410 long (*_read_minisymbols) PARAMS ((bfd *, boolean, PTR *,3411 4298 long (*_read_minisymbols) 4299 PARAMS ((bfd *, bfd_boolean, PTR *, unsigned int *)); 3412 4300 #define bfd_minisymbol_to_symbol(b, d, m, f) \ 3413 4301 BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) 3414 asymbol * (*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR,3415 4302 asymbol * (*_minisymbol_to_symbol) 4303 PARAMS ((bfd *, bfd_boolean, const PTR, asymbol *)); 3416 4304 3417 4305 /* Routines for relocs. */ 3418 #define BFD_JUMP_TABLE_RELOCS(NAME) \3419 C AT(NAME,_get_reloc_upper_bound),\3420 C AT(NAME,_canonicalize_reloc),\3421 C AT(NAME,_bfd_reloc_type_lookup)3422 long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));3423 long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **,3424 4306 #define BFD_JUMP_TABLE_RELOCS(NAME) \ 4307 CONCAT2 (NAME,_get_reloc_upper_bound), \ 4308 CONCAT2 (NAME,_canonicalize_reloc), \ 4309 CONCAT2 (NAME,_bfd_reloc_type_lookup) 4310 long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr)); 4311 long (*_bfd_canonicalize_reloc) 4312 PARAMS ((bfd *, sec_ptr, arelent **, struct symbol_cache_entry **)); 3425 4313 /* See documentation on reloc types. */ 3426 4314 reloc_howto_type * 3427 (*reloc_type_lookup) PARAMS ((bfd *abfd, 3428 bfd_reloc_code_real_type code)); 4315 (*reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type)); 3429 4316 3430 4317 /* Routines used when writing an object file. */ 3431 #define BFD_JUMP_TABLE_WRITE(NAME) \3432 C AT(NAME,_set_arch_mach),\3433 C AT(NAME,_set_section_contents)3434 b oolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture,3435 3436 b oolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR,3437 4318 #define BFD_JUMP_TABLE_WRITE(NAME) \ 4319 CONCAT2 (NAME,_set_arch_mach), \ 4320 CONCAT2 (NAME,_set_section_contents) 4321 bfd_boolean (*_bfd_set_arch_mach) 4322 PARAMS ((bfd *, enum bfd_architecture, unsigned long)); 4323 bfd_boolean (*_bfd_set_section_contents) 4324 PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); 3438 4325 3439 4326 /* Routines used by the linker. */ 3440 #define BFD_JUMP_TABLE_LINK(NAME)\ 3441 CAT(NAME,_sizeof_headers),\ 3442 CAT(NAME,_bfd_get_relocated_section_contents),\ 3443 CAT(NAME,_bfd_relax_section),\ 3444 CAT(NAME,_bfd_link_hash_table_create),\ 3445 CAT(NAME,_bfd_link_add_symbols),\ 3446 CAT(NAME,_bfd_final_link),\ 3447 CAT(NAME,_bfd_link_split_section),\ 3448 CAT(NAME,_bfd_gc_sections) 3449 int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); 3450 bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *, 3451 struct bfd_link_info *, struct bfd_link_order *, 3452 bfd_byte *data, boolean relocateable, 3453 struct symbol_cache_entry **)); 3454 3455 boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *, 3456 struct bfd_link_info *, boolean *again)); 4327 #define BFD_JUMP_TABLE_LINK(NAME) \ 4328 CONCAT2 (NAME,_sizeof_headers), \ 4329 CONCAT2 (NAME,_bfd_get_relocated_section_contents), \ 4330 CONCAT2 (NAME,_bfd_relax_section), \ 4331 CONCAT2 (NAME,_bfd_link_hash_table_create), \ 4332 CONCAT2 (NAME,_bfd_link_hash_table_free), \ 4333 CONCAT2 (NAME,_bfd_link_add_symbols), \ 4334 CONCAT2 (NAME,_bfd_link_just_syms), \ 4335 CONCAT2 (NAME,_bfd_final_link), \ 4336 CONCAT2 (NAME,_bfd_link_split_section), \ 4337 CONCAT2 (NAME,_bfd_gc_sections), \ 4338 CONCAT2 (NAME,_bfd_merge_sections), \ 4339 CONCAT2 (NAME,_bfd_discard_group) 4340 int (*_bfd_sizeof_headers) PARAMS ((bfd *, bfd_boolean)); 4341 bfd_byte * (*_bfd_get_relocated_section_contents) 4342 PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, 4343 bfd_byte *, bfd_boolean, struct symbol_cache_entry **)); 4344 4345 bfd_boolean (*_bfd_relax_section) 4346 PARAMS ((bfd *, struct sec *, struct bfd_link_info *, bfd_boolean *)); 3457 4347 3458 4348 /* Create a hash table for the linker. Different backends store 3459 4349 different information in this table. */ 3460 struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *)); 4350 struct bfd_link_hash_table * 4351 (*_bfd_link_hash_table_create) PARAMS ((bfd *)); 4352 4353 /* Release the memory associated with the linker hash table. */ 4354 void (*_bfd_link_hash_table_free) 4355 PARAMS ((struct bfd_link_hash_table *)); 3461 4356 3462 4357 /* Add symbols from this object file into the hash table. */ 3463 boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *)); 4358 bfd_boolean (*_bfd_link_add_symbols) 4359 PARAMS ((bfd *, struct bfd_link_info *)); 4360 4361 /* Indicate that we are only retrieving symbol values from this section. */ 4362 void (*_bfd_link_just_syms) 4363 PARAMS ((asection *, struct bfd_link_info *)); 3464 4364 3465 4365 /* Do a link based on the link_order structures attached to each 3466 4366 section of the BFD. */ 3467 b oolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));4367 bfd_boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *)); 3468 4368 3469 4369 /* Should this section be split up into smaller pieces during linking. */ 3470 b oolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *));4370 bfd_boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *)); 3471 4371 3472 4372 /* Remove sections that are not referenced from the output. */ 3473 boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); 4373 bfd_boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); 4374 4375 /* Attempt to merge SEC_MERGE sections. */ 4376 bfd_boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *)); 4377 4378 /* Discard members of a group. */ 4379 bfd_boolean (*_bfd_discard_group) PARAMS ((bfd *, struct sec *)); 3474 4380 3475 4381 /* Routines to handle dynamic symbols and relocs. */ 3476 #define BFD_JUMP_TABLE_DYNAMIC(NAME) \3477 C AT(NAME,_get_dynamic_symtab_upper_bound),\3478 C AT(NAME,_canonicalize_dynamic_symtab),\3479 C AT(NAME,_get_dynamic_reloc_upper_bound),\3480 C AT(NAME,_canonicalize_dynamic_reloc)3481 /* Get the amount of memory required to hold the dynamic symbols. */3482 long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *));4382 #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ 4383 CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \ 4384 CONCAT2 (NAME,_canonicalize_dynamic_symtab), \ 4385 CONCAT2 (NAME,_get_dynamic_reloc_upper_bound), \ 4386 CONCAT2 (NAME,_canonicalize_dynamic_reloc) 4387 /* Get the amount of memory required to hold the dynamic symbols. */ 4388 long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *)); 3483 4389 /* Read in the dynamic symbols. */ 3484 long (*_bfd_canonicalize_dynamic_symtab)4390 long (*_bfd_canonicalize_dynamic_symtab) 3485 4391 PARAMS ((bfd *, struct symbol_cache_entry **)); 3486 4392 /* Get the amount of memory required to hold the dynamic relocs. */ 3487 long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *));4393 long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *)); 3488 4394 /* Read in the dynamic relocs. */ 3489 long (*_bfd_canonicalize_dynamic_reloc)4395 long (*_bfd_canonicalize_dynamic_reloc) 3490 4396 PARAMS ((bfd *, arelent **, struct symbol_cache_entry **)); 3491 4397 3492 /* Opposite endian version of this target. */ 3493 const struct bfd_target * alternative_target; 3494 3495 PTR backend_data; 4398 /* Opposite endian version of this target. */ 4399 const struct bfd_target * alternative_target; 4400 4401 /* Data for use by back-end routines, which isn't 4402 generic enough to belong in this structure. */ 4403 PTR backend_data; 3496 4404 3497 4405 } bfd_target; 3498 boolean 4406 4407 bfd_boolean 3499 4408 bfd_set_default_target PARAMS ((const char *name)); 3500 4409 3501 4410 const bfd_target * 3502 bfd_find_target PARAMS (( CONSTchar *target_name, bfd *abfd));4411 bfd_find_target PARAMS ((const char *target_name, bfd *abfd)); 3503 4412 3504 4413 const char ** … … 3506 4415 3507 4416 const bfd_target * 3508 bfd_search_for_target PARAMS ((int (* search_func) (const bfd_target *, void *), void *)); 3509 3510 boolean 4417 bfd_search_for_target PARAMS ((int (* search_func) 4418 (const bfd_target *, void *), 4419 void *)); 4420 4421 /* Extracted from format.c. */ 4422 bfd_boolean 3511 4423 bfd_check_format PARAMS ((bfd *abfd, bfd_format format)); 3512 4424 3513 boolean 3514 bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format, char ***matching)); 3515 3516 boolean 4425 bfd_boolean 4426 bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format, 4427 char ***matching)); 4428 4429 bfd_boolean 3517 4430 bfd_set_format PARAMS ((bfd *abfd, bfd_format format)); 3518 4431 3519 CONSTchar *4432 const char * 3520 4433 bfd_format_string PARAMS ((bfd_format format)); 4434 4435 /* Extracted from linker.c. */ 4436 bfd_boolean 4437 bfd_link_split_section PARAMS ((bfd *abfd, asection *sec)); 4438 4439 #define bfd_link_split_section(abfd, sec) \ 4440 BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec)) 4441 4442 /* Extracted from simple.c. */ 4443 bfd_byte * 4444 bfd_simple_get_relocated_section_contents PARAMS ((bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table)); 3521 4445 3522 4446 #ifdef __cplusplus -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.