Deleted Added
full compact
bfd-in2.h (107492) bfd-in2.h (130561)
1/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
2 generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
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 "section.c", "archures.c", "reloc.c", "syms.c", "bfd.c", "archive.c",
4 "corefile.c", "targets.c" and "format.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".
5 Run "make headers" in your build bfd/ to regenerate. */
6
7/* Main header file for the bfd library -- portable access to object files.
6 Run "make headers" in your build bfd/ to regenerate. */
7
8/* Main header file for the bfd library -- portable access to object files.
8 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
9 2000, 2001, 2002
10 Free Software Foundation, Inc.
9
10 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
11 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
12
11 Contributed by Cygnus Support.
12
13 This file is part of BFD, the Binary File Descriptor library.
14
15 This program is free software; you can redistribute it and/or modify
16 it under the terms of the GNU General Public License as published by
17 the Free Software Foundation; either version 2 of the License, or
18 (at your option) any later version.

--- 23 unchanged lines hidden (view full) ---

42 want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will
43 cause the inner CONCAT2 macros to be evaluated first, producing
44 still-valid pp-tokens. Then the final concatenation can be done. */
45#undef CONCAT4
46#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
47#endif
48#endif
49
13 Contributed by Cygnus Support.
14
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.

--- 23 unchanged lines hidden (view full) ---

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
50#define BFD_VERSION @bfd_version@
51#define BFD_VERSION_DATE @bfd_version_date@
52#define BFD_VERSION_STRING @bfd_version_string@
53
54/* The word size used by BFD on the host. This may be 64 with a 32
55 bit target if the host is 64 bit, or if other 64 bit targets have
56 been selected with --enable-targets, or if --enable-64-bit-bfd. */
57#define BFD_ARCH_SIZE @wordsize@
58
59/* The word size of the default bfd target. */
60#define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@
61
62#define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@
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. */
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
60#define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@
61#define BFD_HOST_LONG_LONG @BFD_HOST_LONG_LONG@
63#if @BFD_HOST_64_BIT_DEFINED@
64#define BFD_HOST_64_BIT @BFD_HOST_64_BIT@
65#define BFD_HOST_U_64_BIT @BFD_HOST_U_64_BIT@
62#if @BFD_HOST_64_BIT_DEFINED@
63#define BFD_HOST_64_BIT @BFD_HOST_64_BIT@
64#define BFD_HOST_U_64_BIT @BFD_HOST_U_64_BIT@
65typedef BFD_HOST_64_BIT bfd_int64_t;
66typedef BFD_HOST_U_64_BIT bfd_uint64_t;
66#endif
67
68#if BFD_ARCH_SIZE >= 64
69#define BFD64
70#endif
71
72#ifndef INLINE
73#if __GNUC__ >= 2
74#define INLINE __inline__
75#else
76#define INLINE
77#endif
78#endif
79
80/* Forward declaration. */
67#endif
68
69#if BFD_ARCH_SIZE >= 64
70#define BFD64
71#endif
72
73#ifndef INLINE
74#if __GNUC__ >= 2
75#define INLINE __inline__
76#else
77#define INLINE
78#endif
79#endif
80
81/* Forward declaration. */
81typedef struct _bfd bfd;
82typedef struct bfd bfd;
82
83
83/* To squelch erroneous compiler warnings ("illegal pointer
84 combination") from the SVR3 compiler, we would like to typedef
85 boolean to int (it doesn't like functions which return boolean.
86 Making sure they are never implicitly declared to return int
87 doesn't seem to help). But this file is not configured based on
88 the host. */
89/* General rules: functions which are boolean return true on success
90 and false on failure (unless they're a predicate). -- bfd.doc */
91/* I'm sure this is going to break something and someone is going to
92 force me to change it. */
93/* typedef enum boolean {false, true} boolean; */
94/* Yup, SVR4 has a "typedef enum boolean" in <sys/types.h> -fnf */
95/* It gets worse if the host also defines a true/false enum... -sts */
96/* And even worse if your compiler has built-in boolean types... -law */
97/* And even worse if your compiler provides a stdbool.h that conflicts
98 with these definitions... gcc 2.95 and later do. If so, it must
99 be included first. -drow */
100#if defined (__GNUG__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6))
101#define TRUE_FALSE_ALREADY_DEFINED
102#else
103#if defined (__bool_true_false_are_defined)
104/* We have <stdbool.h>. */
105#define TRUE_FALSE_ALREADY_DEFINED
106#endif
107#endif
108#ifdef MPW
109/* Pre-emptive strike - get the file with the enum. */
110#include <Types.h>
111#define TRUE_FALSE_ALREADY_DEFINED
112#endif /* MPW */
113#ifndef TRUE_FALSE_ALREADY_DEFINED
114typedef enum bfd_boolean {false, true} boolean;
115#define BFD_TRUE_FALSE
116#else
117/* Use enum names that will appear nowhere else. */
118typedef enum bfd_boolean {bfd_fffalse, bfd_tttrue} boolean;
119#endif
84/* Boolean type used in bfd. Too many systems define their own
85 versions of "boolean" for us to safely typedef a "boolean" of
86 our own. Using an enum for "bfd_boolean" has its own set of
87 problems, with strange looking casts required to avoid warnings
88 on some older compilers. Thus we just use an int.
120
89
121/* Support for different sizes of target format ints and addresses.
122 If the type `long' is at least 64 bits, BFD_HOST_64BIT_LONG will be
123 set to 1 above. Otherwise, if gcc is being used, this code will
124 use gcc's "long long" type. Otherwise, BFD_HOST_64_BIT must be
125 defined above. */
90 General rule: Functions which are bfd_boolean return TRUE on
91 success and FALSE on failure (unless they're a predicate). */
126
92
127#ifndef BFD_HOST_64_BIT
128# if BFD_HOST_64BIT_LONG
129# define BFD_HOST_64_BIT long
130# define BFD_HOST_U_64_BIT unsigned long
131# else
132# ifdef __GNUC__
133# if __GNUC__ >= 2
134# define BFD_HOST_64_BIT long long
135# define BFD_HOST_U_64_BIT unsigned long long
136# endif /* __GNUC__ >= 2 */
137# endif /* ! defined (__GNUC__) */
138# endif /* ! BFD_HOST_64BIT_LONG */
139#endif /* ! defined (BFD_HOST_64_BIT) */
93typedef int bfd_boolean;
94#undef FALSE
95#undef TRUE
96#define FALSE 0
97#define TRUE 1
140
98
99#if 0
100/* Poison. */
101#undef false
102#undef true
103#define false dont_use_false_in_bfd
104#define true dont_use_true_in_bfd
105#endif
106
141#ifdef BFD64
142
143#ifndef BFD_HOST_64_BIT
144 #error No 64 bit integer type available
145#endif /* ! defined (BFD_HOST_64_BIT) */
146
147typedef BFD_HOST_U_64_BIT bfd_vma;
148typedef BFD_HOST_64_BIT bfd_signed_vma;

--- 31 unchanged lines hidden (view full) ---

180typedef unsigned long bfd_size_type;
181
182/* Print a bfd_vma x on stream s. */
183#define fprintf_vma(s,x) fprintf (s, "%08lx", x)
184#define sprintf_vma(s,x) sprintf (s, "%08lx", x)
185
186#endif /* not BFD64 */
187
107#ifdef BFD64
108
109#ifndef BFD_HOST_64_BIT
110 #error No 64 bit integer type available
111#endif /* ! defined (BFD_HOST_64_BIT) */
112
113typedef BFD_HOST_U_64_BIT bfd_vma;
114typedef BFD_HOST_64_BIT bfd_signed_vma;

--- 31 unchanged lines hidden (view full) ---

146typedef unsigned long bfd_size_type;
147
148/* Print a bfd_vma x on stream s. */
149#define fprintf_vma(s,x) fprintf (s, "%08lx", x)
150#define sprintf_vma(s,x) sprintf (s, "%08lx", x)
151
152#endif /* not BFD64 */
153
188/* A pointer to a position in a file. */
189/* FIXME: This should be using off_t from <sys/types.h>.
190 For now, try to avoid breaking stuff by not including <sys/types.h> here.
191 This will break on systems with 64-bit file offsets (e.g. 4.4BSD).
192 Probably the best long-term answer is to avoid using file_ptr AND off_t
193 in this header file, and to handle this in the BFD implementation
194 rather than in its interface. */
195/* typedef off_t file_ptr; */
196typedef bfd_signed_vma file_ptr;
197typedef bfd_vma ufile_ptr;
154#ifndef BFD_HOST_64_BIT
155/* Fall back on a 32 bit type. The idea is to make these types always
156 available for function return types, but in the case that
157 BFD_HOST_64_BIT is undefined such a function should abort or
158 otherwise signal an error. */
159typedef bfd_signed_vma bfd_int64_t;
160typedef bfd_vma bfd_uint64_t;
161#endif
198
162
199extern void bfd_sprintf_vma PARAMS ((bfd *, char *, bfd_vma));
200extern void bfd_fprintf_vma PARAMS ((bfd *, PTR, bfd_vma));
163/* An offset into a file. BFD always uses the largest possible offset
164 based on the build time availability of fseek, fseeko, or fseeko64. */
165typedef @bfd_file_ptr@ file_ptr;
166typedef unsigned @bfd_file_ptr@ ufile_ptr;
201
167
168extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
169extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
170
202#define printf_vma(x) fprintf_vma(stdout,x)
203#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
204
205typedef unsigned int flagword; /* 32 bits of flags */
206typedef unsigned char bfd_byte;
207
208/* File formats. */
209
210typedef enum bfd_format
211{
212 bfd_unknown = 0, /* File format is unknown. */
171#define printf_vma(x) fprintf_vma(stdout,x)
172#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
173
174typedef unsigned int flagword; /* 32 bits of flags */
175typedef unsigned char bfd_byte;
176
177/* File formats. */
178
179typedef enum bfd_format
180{
181 bfd_unknown = 0, /* File format is unknown. */
213 bfd_object, /* Linker/assember/compiler output. */
182 bfd_object, /* Linker/assembler/compiler output. */
214 bfd_archive, /* Object archive file. */
215 bfd_core, /* Core dump. */
216 bfd_type_end /* Marks the end; don't use it! */
217}
218bfd_format;
219
220/* Values that may appear in the flags field of a BFD. These also
221 appear in the object_flags field of the bfd_target structure, where

--- 46 unchanged lines hidden (view full) ---

268 traditional format. For example, this is used to request that when
269 writing out an a.out object the symbols not be hashed to eliminate
270 duplicates. */
271#define BFD_TRADITIONAL_FORMAT 0x400
272
273/* This flag indicates that the BFD contents are actually cached in
274 memory. If this is set, iostream points to a bfd_in_memory struct. */
275#define BFD_IN_MEMORY 0x800
183 bfd_archive, /* Object archive file. */
184 bfd_core, /* Core dump. */
185 bfd_type_end /* Marks the end; don't use it! */
186}
187bfd_format;
188
189/* Values that may appear in the flags field of a BFD. These also
190 appear in the object_flags field of the bfd_target structure, where

--- 46 unchanged lines hidden (view full) ---

237 traditional format. For example, this is used to request that when
238 writing out an a.out object the symbols not be hashed to eliminate
239 duplicates. */
240#define BFD_TRADITIONAL_FORMAT 0x400
241
242/* This flag indicates that the BFD contents are actually cached in
243 memory. If this is set, iostream points to a bfd_in_memory struct. */
244#define BFD_IN_MEMORY 0x800
245
246/* The sections in this BFD specify a memory page. */
247#define HAS_LOAD_PAGE 0x1000
276
277/* Symbols and relocation. */
278
279/* A count of carsyms (canonical archive symbols). */
280typedef unsigned long symindex;
281
282/* How to perform a relocation. */
283typedef const struct reloc_howto_struct reloc_howto_type;

--- 36 unchanged lines hidden (view full) ---

320};
321
322/* Linenumber stuff. */
323typedef struct lineno_cache_entry
324{
325 unsigned int line_number; /* Linenumber from start of function. */
326 union
327 {
248
249/* Symbols and relocation. */
250
251/* A count of carsyms (canonical archive symbols). */
252typedef unsigned long symindex;
253
254/* How to perform a relocation. */
255typedef const struct reloc_howto_struct reloc_howto_type;

--- 36 unchanged lines hidden (view full) ---

292};
293
294/* Linenumber stuff. */
295typedef struct lineno_cache_entry
296{
297 unsigned int line_number; /* Linenumber from start of function. */
298 union
299 {
328 struct symbol_cache_entry *sym; /* Function name. */
300 struct bfd_symbol *sym; /* Function name. */
329 bfd_vma offset; /* Offset into section. */
330 } u;
331}
332alent;
333
334/* Object and core file sections. */
335
336#define align_power(addr, align) \
337 (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align)))
338
301 bfd_vma offset; /* Offset into section. */
302 } u;
303}
304alent;
305
306/* Object and core file sections. */
307
308#define align_power(addr, align) \
309 (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align)))
310
339typedef struct sec *sec_ptr;
311typedef struct bfd_section *sec_ptr;
340
341#define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0)
342#define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0)
343#define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0)
344#define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
345#define bfd_section_name(bfd, ptr) ((ptr)->name)
346#define bfd_section_size(bfd, ptr) (bfd_get_section_size_before_reloc(ptr))
347#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
348#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
349#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
350#define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
351#define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
352
353#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
354
312
313#define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0)
314#define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0)
315#define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0)
316#define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
317#define bfd_section_name(bfd, ptr) ((ptr)->name)
318#define bfd_section_size(bfd, ptr) (bfd_get_section_size_before_reloc(ptr))
319#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
320#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
321#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
322#define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
323#define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
324
325#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
326
355#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = (unsigned int)true), true)
356#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),true)
357#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),true)
327#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
328#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
329#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
358
359typedef struct stat stat_type;
360
361typedef enum bfd_print_symbol
362{
363 bfd_print_symbol_name,
364 bfd_print_symbol_more,
365 bfd_print_symbol_all

--- 9 unchanged lines hidden (view full) ---

375 unsigned char stab_type; /* Stab type. */
376 char stab_other; /* Stab other. */
377 short stab_desc; /* Stab desc. */
378 const char *stab_name; /* String for stab type. */
379} symbol_info;
380
381/* Get the name of a stabs type code. */
382
330
331typedef struct stat stat_type;
332
333typedef enum bfd_print_symbol
334{
335 bfd_print_symbol_name,
336 bfd_print_symbol_more,
337 bfd_print_symbol_all

--- 9 unchanged lines hidden (view full) ---

347 unsigned char stab_type; /* Stab type. */
348 char stab_other; /* Stab other. */
349 short stab_desc; /* Stab desc. */
350 const char *stab_name; /* String for stab type. */
351} symbol_info;
352
353/* Get the name of a stabs type code. */
354
383extern const char *bfd_get_stab_name PARAMS ((int));
355extern const char *bfd_get_stab_name (int);
384
385/* Hash table routines. There is no way to free up a hash table. */
386
387/* An element in the hash table. Most uses will actually use a larger
388 structure, and an instance of this will be the first field. */
389
390struct bfd_hash_entry
391{

--- 16 unchanged lines hidden (view full) ---

408 unsigned int size;
409 /* A function used to create new elements in the hash table. The
410 first entry is itself a pointer to an element. When this
411 function is first invoked, this pointer will be NULL. However,
412 having the pointer permits a hierarchy of method functions to be
413 built each of which calls the function in the superclass. Thus
414 each function should be written to allocate a new block of memory
415 only if the argument is NULL. */
356
357/* Hash table routines. There is no way to free up a hash table. */
358
359/* An element in the hash table. Most uses will actually use a larger
360 structure, and an instance of this will be the first field. */
361
362struct bfd_hash_entry
363{

--- 16 unchanged lines hidden (view full) ---

380 unsigned int size;
381 /* A function used to create new elements in the hash table. The
382 first entry is itself a pointer to an element. When this
383 function is first invoked, this pointer will be NULL. However,
384 having the pointer permits a hierarchy of method functions to be
385 built each of which calls the function in the superclass. Thus
386 each function should be written to allocate a new block of memory
387 only if the argument is NULL. */
416 struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *,
417 struct bfd_hash_table *,
418 const char *));
388 struct bfd_hash_entry *(*newfunc)
389 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
419 /* An objalloc for this hash table. This is a struct objalloc *,
390 /* An objalloc for this hash table. This is a struct objalloc *,
420 but we use PTR to avoid requiring the inclusion of objalloc.h. */
421 PTR memory;
391 but we use void * to avoid requiring the inclusion of objalloc.h. */
392 void *memory;
422};
423
424/* Initialize a hash table. */
393};
394
395/* Initialize a hash table. */
425extern boolean bfd_hash_table_init
426 PARAMS ((struct bfd_hash_table *,
427 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
428 struct bfd_hash_table *,
429 const char *)));
396extern bfd_boolean bfd_hash_table_init
397 (struct bfd_hash_table *,
398 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
399 struct bfd_hash_table *,
400 const char *));
430
431/* Initialize a hash table specifying a size. */
401
402/* Initialize a hash table specifying a size. */
432extern boolean bfd_hash_table_init_n
433 PARAMS ((struct bfd_hash_table *,
434 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
435 struct bfd_hash_table *,
436 const char *),
437 unsigned int size));
403extern bfd_boolean bfd_hash_table_init_n
404 (struct bfd_hash_table *,
405 struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
406 struct bfd_hash_table *,
407 const char *),
408 unsigned int size);
438
439/* Free up a hash table. */
409
410/* Free up a hash table. */
440extern void bfd_hash_table_free PARAMS ((struct bfd_hash_table *));
411extern void bfd_hash_table_free
412 (struct bfd_hash_table *);
441
413
442/* Look up a string in a hash table. If CREATE is true, a new entry
414/* Look up a string in a hash table. If CREATE is TRUE, a new entry
443 will be created for this string if one does not already exist. The
415 will be created for this string if one does not already exist. The
444 COPY argument must be true if this routine should copy the string
416 COPY argument must be TRUE if this routine should copy the string
445 into newly allocated memory when adding an entry. */
446extern struct bfd_hash_entry *bfd_hash_lookup
417 into newly allocated memory when adding an entry. */
418extern struct bfd_hash_entry *bfd_hash_lookup
447 PARAMS ((struct bfd_hash_table *, const char *, boolean create,
448 boolean copy));
419 (struct bfd_hash_table *, const char *, bfd_boolean create,
420 bfd_boolean copy);
449
450/* Replace an entry in a hash table. */
451extern void bfd_hash_replace
421
422/* Replace an entry in a hash table. */
423extern void bfd_hash_replace
452 PARAMS ((struct bfd_hash_table *, struct bfd_hash_entry *old,
453 struct bfd_hash_entry *nw));
424 (struct bfd_hash_table *, struct bfd_hash_entry *old,
425 struct bfd_hash_entry *nw);
454
455/* Base method for creating a hash table entry. */
456extern struct bfd_hash_entry *bfd_hash_newfunc
426
427/* Base method for creating a hash table entry. */
428extern struct bfd_hash_entry *bfd_hash_newfunc
457 PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *,
458 const char *));
429 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
459
460/* Grab some space for a hash table entry. */
430
431/* Grab some space for a hash table entry. */
461extern PTR bfd_hash_allocate PARAMS ((struct bfd_hash_table *,
462 unsigned int));
432extern void *bfd_hash_allocate
433 (struct bfd_hash_table *, unsigned int);
463
464/* Traverse a hash table in a random order, calling a function on each
434
435/* Traverse a hash table in a random order, calling a function on each
465 element. If the function returns false, the traversal stops. The
436 element. If the function returns FALSE, the traversal stops. The
466 INFO argument is passed to the function. */
437 INFO argument is passed to the function. */
467extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *,
468 boolean (*) (struct bfd_hash_entry *,
469 PTR),
470 PTR info));
438extern void bfd_hash_traverse
439 (struct bfd_hash_table *,
440 bfd_boolean (*) (struct bfd_hash_entry *, void *),
441 void *info);
471
442
472#define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table
443#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
473
474/* User program access to BFD facilities. */
475
476/* Direct I/O routines, for programs which know more about the object
477 file than BFD does. Use higher level routines if possible. */
478
444
445/* User program access to BFD facilities. */
446
447/* Direct I/O routines, for programs which know more about the object
448 file than BFD does. Use higher level routines if possible. */
449
479extern bfd_size_type bfd_bread PARAMS ((PTR, bfd_size_type, bfd *));
480extern bfd_size_type bfd_bwrite PARAMS ((const PTR, bfd_size_type, bfd *));
481extern int bfd_seek PARAMS ((bfd *, file_ptr, int));
482extern ufile_ptr bfd_tell PARAMS ((bfd *));
483extern int bfd_flush PARAMS ((bfd *));
484extern int bfd_stat PARAMS ((bfd *, struct stat *));
450extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
451extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
452extern int bfd_seek (bfd *, file_ptr, int);
453extern file_ptr bfd_tell (bfd *);
454extern int bfd_flush (bfd *);
455extern int bfd_stat (bfd *, struct stat *);
485
486/* Deprecated old routines. */
487#if __GNUC__
488#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
489 (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \
490 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
491#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
492 (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
493 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
494#else
495#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
496 (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
497 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
498#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
499 (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
500 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
501#endif
456
457/* Deprecated old routines. */
458#if __GNUC__
459#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
460 (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \
461 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
462#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
463 (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
464 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
465#else
466#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
467 (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
468 bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
469#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
470 (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
471 bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
472#endif
502extern void warn_deprecated
503 PARAMS ((const char *, const char *, int, const char *));
473extern void warn_deprecated (const char *, const char *, int, const char *);
504
505/* Cast from const char * to char * so that caller can assign to
506 a char * without a warning. */
507#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
508#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
509#define bfd_get_format(abfd) ((abfd)->format)
510#define bfd_get_target(abfd) ((abfd)->xvec->name)
511#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)

--- 19 unchanged lines hidden (view full) ---

531#define bfd_get_symcount(abfd) ((abfd)->symcount)
532#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
533#define bfd_count_sections(abfd) ((abfd)->section_count)
534
535#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
536
537#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
538
474
475/* Cast from const char * to char * so that caller can assign to
476 a char * without a warning. */
477#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
478#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
479#define bfd_get_format(abfd) ((abfd)->format)
480#define bfd_get_target(abfd) ((abfd)->xvec->name)
481#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)

--- 19 unchanged lines hidden (view full) ---

501#define bfd_get_symcount(abfd) ((abfd)->symcount)
502#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
503#define bfd_count_sections(abfd) ((abfd)->section_count)
504
505#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
506
507#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
508
539#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean) (bool)), true)
509#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
540
510
541extern boolean bfd_cache_close PARAMS ((bfd *abfd));
511extern bfd_boolean bfd_cache_close
512 (bfd *abfd);
542/* NB: This declaration should match the autogenerated one in libbfd.h. */
543
513/* NB: This declaration should match the autogenerated one in libbfd.h. */
514
544extern boolean bfd_record_phdr
545 PARAMS ((bfd *, unsigned long, boolean, flagword, boolean, bfd_vma,
546 boolean, boolean, unsigned int, struct sec **));
515extern bfd_boolean bfd_record_phdr
516 (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
517 bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
547
548/* Byte swapping routines. */
549
518
519/* Byte swapping routines. */
520
550bfd_vma bfd_getb64 PARAMS ((const unsigned char *));
551bfd_vma bfd_getl64 PARAMS ((const unsigned char *));
552bfd_signed_vma bfd_getb_signed_64 PARAMS ((const unsigned char *));
553bfd_signed_vma bfd_getl_signed_64 PARAMS ((const unsigned char *));
554bfd_vma bfd_getb32 PARAMS ((const unsigned char *));
555bfd_vma bfd_getl32 PARAMS ((const unsigned char *));
556bfd_signed_vma bfd_getb_signed_32 PARAMS ((const unsigned char *));
557bfd_signed_vma bfd_getl_signed_32 PARAMS ((const unsigned char *));
558bfd_vma bfd_getb16 PARAMS ((const unsigned char *));
559bfd_vma bfd_getl16 PARAMS ((const unsigned char *));
560bfd_signed_vma bfd_getb_signed_16 PARAMS ((const unsigned char *));
561bfd_signed_vma bfd_getl_signed_16 PARAMS ((const unsigned char *));
562void bfd_putb64 PARAMS ((bfd_vma, unsigned char *));
563void bfd_putl64 PARAMS ((bfd_vma, unsigned char *));
564void bfd_putb32 PARAMS ((bfd_vma, unsigned char *));
565void bfd_putl32 PARAMS ((bfd_vma, unsigned char *));
566void bfd_putb16 PARAMS ((bfd_vma, unsigned char *));
567void bfd_putl16 PARAMS ((bfd_vma, unsigned char *));
521bfd_uint64_t bfd_getb64 (const void *);
522bfd_uint64_t bfd_getl64 (const void *);
523bfd_int64_t bfd_getb_signed_64 (const void *);
524bfd_int64_t bfd_getl_signed_64 (const void *);
525bfd_vma bfd_getb32 (const void *);
526bfd_vma bfd_getl32 (const void *);
527bfd_signed_vma bfd_getb_signed_32 (const void *);
528bfd_signed_vma bfd_getl_signed_32 (const void *);
529bfd_vma bfd_getb16 (const void *);
530bfd_vma bfd_getl16 (const void *);
531bfd_signed_vma bfd_getb_signed_16 (const void *);
532bfd_signed_vma bfd_getl_signed_16 (const void *);
533void bfd_putb64 (bfd_uint64_t, void *);
534void bfd_putl64 (bfd_uint64_t, void *);
535void bfd_putb32 (bfd_vma, void *);
536void bfd_putl32 (bfd_vma, void *);
537void bfd_putb16 (bfd_vma, void *);
538void bfd_putl16 (bfd_vma, void *);
568
569/* Byte swapping routines which take size and endiannes as arguments. */
570
539
540/* Byte swapping routines which take size and endiannes as arguments. */
541
571bfd_vma bfd_get_bits PARAMS ((bfd_byte *, int, boolean));
572void bfd_put_bits PARAMS ((bfd_vma, bfd_byte *, int, boolean));
542bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
543void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
573
574/* Externally visible ECOFF routines. */
575
576#if defined(__STDC__) || defined(ALMOST_STDC)
577struct ecoff_debug_info;
578struct ecoff_debug_swap;
579struct ecoff_extr;
544
545/* Externally visible ECOFF routines. */
546
547#if defined(__STDC__) || defined(ALMOST_STDC)
548struct ecoff_debug_info;
549struct ecoff_debug_swap;
550struct ecoff_extr;
580struct symbol_cache_entry;
551struct bfd_symbol;
581struct bfd_link_info;
582struct bfd_link_hash_entry;
583struct bfd_elf_version_tree;
584#endif
552struct bfd_link_info;
553struct bfd_link_hash_entry;
554struct bfd_elf_version_tree;
555#endif
585extern bfd_vma bfd_ecoff_get_gp_value PARAMS ((bfd * abfd));
586extern boolean bfd_ecoff_set_gp_value PARAMS ((bfd *abfd, bfd_vma gp_value));
587extern boolean bfd_ecoff_set_regmasks
588 PARAMS ((bfd *abfd, unsigned long gprmask, unsigned long fprmask,
589 unsigned long *cprmask));
590extern PTR bfd_ecoff_debug_init
591 PARAMS ((bfd *output_bfd, struct ecoff_debug_info *output_debug,
592 const struct ecoff_debug_swap *output_swap,
593 struct bfd_link_info *));
556extern bfd_vma bfd_ecoff_get_gp_value
557 (bfd * abfd);
558extern bfd_boolean bfd_ecoff_set_gp_value
559 (bfd *abfd, bfd_vma gp_value);
560extern bfd_boolean bfd_ecoff_set_regmasks
561 (bfd *abfd, unsigned long gprmask, unsigned long fprmask,
562 unsigned long *cprmask);
563extern void *bfd_ecoff_debug_init
564 (bfd *output_bfd, struct ecoff_debug_info *output_debug,
565 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
594extern void bfd_ecoff_debug_free
566extern void bfd_ecoff_debug_free
595 PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
596 const struct ecoff_debug_swap *output_swap,
597 struct bfd_link_info *));
598extern boolean bfd_ecoff_debug_accumulate
599 PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
600 const struct ecoff_debug_swap *output_swap,
601 bfd *input_bfd, struct ecoff_debug_info *input_debug,
602 const struct ecoff_debug_swap *input_swap,
603 struct bfd_link_info *));
604extern boolean bfd_ecoff_debug_accumulate_other
605 PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
606 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
607 struct bfd_link_info *));
608extern boolean bfd_ecoff_debug_externals
609 PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
610 const struct ecoff_debug_swap *swap,
611 boolean relocateable,
612 boolean (*get_extr) (struct symbol_cache_entry *,
613 struct ecoff_extr *),
614 void (*set_index) (struct symbol_cache_entry *,
615 bfd_size_type)));
616extern boolean bfd_ecoff_debug_one_external
617 PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
618 const struct ecoff_debug_swap *swap,
619 const char *name, struct ecoff_extr *esym));
567 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
568 const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
569extern bfd_boolean bfd_ecoff_debug_accumulate
570 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
571 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
572 struct ecoff_debug_info *input_debug,
573 const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);
574extern bfd_boolean bfd_ecoff_debug_accumulate_other
575 (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
576 const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
577 struct bfd_link_info *);
578extern bfd_boolean bfd_ecoff_debug_externals
579 (bfd *abfd, struct ecoff_debug_info *debug,
580 const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
581 bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),
582 void (*set_index) (struct bfd_symbol *, bfd_size_type));
583extern bfd_boolean bfd_ecoff_debug_one_external
584 (bfd *abfd, struct ecoff_debug_info *debug,
585 const struct ecoff_debug_swap *swap, const char *name,
586 struct ecoff_extr *esym);
620extern bfd_size_type bfd_ecoff_debug_size
587extern bfd_size_type bfd_ecoff_debug_size
621 PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
622 const struct ecoff_debug_swap *swap));
623extern boolean bfd_ecoff_write_debug
624 PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
625 const struct ecoff_debug_swap *swap, file_ptr where));
626extern boolean bfd_ecoff_write_accumulated_debug
627 PARAMS ((PTR handle, bfd *abfd, struct ecoff_debug_info *debug,
628 const struct ecoff_debug_swap *swap,
629 struct bfd_link_info *info, file_ptr where));
630extern boolean bfd_mips_ecoff_create_embedded_relocs
631 PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
632 char **));
588 (bfd *abfd, struct ecoff_debug_info *debug,
589 const struct ecoff_debug_swap *swap);
590extern bfd_boolean bfd_ecoff_write_debug
591 (bfd *abfd, struct ecoff_debug_info *debug,
592 const struct ecoff_debug_swap *swap, file_ptr where);
593extern bfd_boolean bfd_ecoff_write_accumulated_debug
594 (void *handle, bfd *abfd, struct ecoff_debug_info *debug,
595 const struct ecoff_debug_swap *swap,
596 struct bfd_link_info *info, file_ptr where);
597extern bfd_boolean bfd_mips_ecoff_create_embedded_relocs
598 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
633
634/* Externally visible ELF routines. */
635
636struct bfd_link_needed_list
637{
638 struct bfd_link_needed_list *next;
639 bfd *by;
640 const char *name;
641};
642
599
600/* Externally visible ELF routines. */
601
602struct bfd_link_needed_list
603{
604 struct bfd_link_needed_list *next;
605 bfd *by;
606 const char *name;
607};
608
643extern boolean bfd_elf32_record_link_assignment
644 PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean));
645extern boolean bfd_elf64_record_link_assignment
646 PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean));
609enum dynamic_lib_link_class {
610 DYN_NORMAL = 0,
611 DYN_AS_NEEDED = 1,
612 DYN_DT_NEEDED = 2
613};
614
615extern bfd_boolean bfd_elf_record_link_assignment
616 (bfd *, struct bfd_link_info *, const char *, bfd_boolean);
647extern struct bfd_link_needed_list *bfd_elf_get_needed_list
617extern struct bfd_link_needed_list *bfd_elf_get_needed_list
648 PARAMS ((bfd *, struct bfd_link_info *));
649extern boolean bfd_elf_get_bfd_needed_list
650 PARAMS ((bfd *, struct bfd_link_needed_list **));
651extern boolean bfd_elf32_size_dynamic_sections
652 PARAMS ((bfd *, const char *, const char *, const char *,
653 const char * const *, struct bfd_link_info *, struct sec **,
654 struct bfd_elf_version_tree *));
655extern boolean bfd_elf64_size_dynamic_sections
656 PARAMS ((bfd *, const char *, const char *, const char *,
657 const char * const *, struct bfd_link_info *, struct sec **,
658 struct bfd_elf_version_tree *));
659extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
660extern void bfd_elf_set_dt_needed_soname PARAMS ((bfd *, const char *));
661extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *));
618 (bfd *, struct bfd_link_info *);
619extern bfd_boolean bfd_elf_get_bfd_needed_list
620 (bfd *, struct bfd_link_needed_list **);
621extern bfd_boolean bfd_elf_size_dynamic_sections
622 (bfd *, const char *, const char *, const char *, const char * const *,
623 struct bfd_link_info *, struct bfd_section **, struct bfd_elf_version_tree *);
624extern void bfd_elf_set_dt_needed_name
625 (bfd *, const char *);
626extern const char *bfd_elf_get_dt_soname
627 (bfd *);
628extern void bfd_elf_set_dyn_lib_class
629 (bfd *, int);
662extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
630extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
663 PARAMS ((bfd *, struct bfd_link_info *));
664extern boolean bfd_elf32_discard_info
665 PARAMS ((bfd *, struct bfd_link_info *));
666extern boolean bfd_elf64_discard_info
667 PARAMS ((bfd *, struct bfd_link_info *));
631 (bfd *, struct bfd_link_info *);
632extern bfd_boolean bfd_elf_discard_info
633 (bfd *, struct bfd_link_info *);
668
669/* Return an upper bound on the number of bytes required to store a
670 copy of ABFD's program header table entries. Return -1 if an error
671 occurs; bfd_get_error will return an appropriate code. */
634
635/* Return an upper bound on the number of bytes required to store a
636 copy of ABFD's program header table entries. Return -1 if an error
637 occurs; bfd_get_error will return an appropriate code. */
672extern long bfd_get_elf_phdr_upper_bound PARAMS ((bfd *abfd));
638extern long bfd_get_elf_phdr_upper_bound
639 (bfd *abfd);
673
674/* Copy ABFD's program header table entries to *PHDRS. The entries
675 will be stored as an array of Elf_Internal_Phdr structures, as
676 defined in include/elf/internal.h. To find out how large the
677 buffer needs to be, call bfd_get_elf_phdr_upper_bound.
678
679 Return the number of program header table entries read, or -1 if an
680 error occurs; bfd_get_error will return an appropriate code. */
640
641/* Copy ABFD's program header table entries to *PHDRS. The entries
642 will be stored as an array of Elf_Internal_Phdr structures, as
643 defined in include/elf/internal.h. To find out how large the
644 buffer needs to be, call bfd_get_elf_phdr_upper_bound.
645
646 Return the number of program header table entries read, or -1 if an
647 error occurs; bfd_get_error will return an appropriate code. */
681extern int bfd_get_elf_phdrs PARAMS ((bfd *abfd, void *phdrs));
648extern int bfd_get_elf_phdrs
649 (bfd *abfd, void *phdrs);
682
650
651/* Create a new BFD as if by bfd_openr. Rather than opening a file,
652 reconstruct an ELF file by reading the segments out of remote memory
653 based on the ELF file header at EHDR_VMA and the ELF program headers it
654 points to. If not null, *LOADBASEP is filled in with the difference
655 between the VMAs from which the segments were read, and the VMAs the
656 file headers (and hence BFD's idea of each section's VMA) put them at.
657
658 The function TARGET_READ_MEMORY is called to copy LEN bytes from the
659 remote memory at target address VMA into the local buffer at MYADDR; it
660 should return zero on success or an `errno' code on failure. TEMPL must
661 be a BFD for an ELF target with the word size and byte order found in
662 the remote memory. */
663extern bfd *bfd_elf_bfd_from_remote_memory
664 (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
665 int (*target_read_memory) (bfd_vma vma, char *myaddr, int len));
666
683/* Return the arch_size field of an elf bfd, or -1 if not elf. */
667/* Return the arch_size field of an elf bfd, or -1 if not elf. */
684extern int bfd_get_arch_size PARAMS ((bfd *));
668extern int bfd_get_arch_size
669 (bfd *);
685
670
686/* Return true if address "naturally" sign extends, or -1 if not elf. */
687extern int bfd_get_sign_extend_vma PARAMS ((bfd *));
671/* Return TRUE if address "naturally" sign extends, or -1 if not elf. */
672extern int bfd_get_sign_extend_vma
673 (bfd *);
688
674
689extern boolean bfd_m68k_elf32_create_embedded_relocs
690 PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
691 char **));
692extern boolean bfd_mips_elf32_create_embedded_relocs
693 PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
694 char **));
675extern struct bfd_section *_bfd_elf_tls_setup
676 (bfd *, struct bfd_link_info *);
695
677
678extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
679 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
680extern bfd_boolean bfd_mips_elf32_create_embedded_relocs
681 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
682
696/* SunOS shared library support routines for the linker. */
697
698extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
683/* SunOS shared library support routines for the linker. */
684
685extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
699 PARAMS ((bfd *, struct bfd_link_info *));
700extern boolean bfd_sunos_record_link_assignment
701 PARAMS ((bfd *, struct bfd_link_info *, const char *));
702extern boolean bfd_sunos_size_dynamic_sections
703 PARAMS ((bfd *, struct bfd_link_info *, struct sec **, struct sec **,
704 struct sec **));
686 (bfd *, struct bfd_link_info *);
687extern bfd_boolean bfd_sunos_record_link_assignment
688 (bfd *, struct bfd_link_info *, const char *);
689extern bfd_boolean bfd_sunos_size_dynamic_sections
690 (bfd *, struct bfd_link_info *, struct bfd_section **, struct bfd_section **, struct bfd_section **);
705
706/* Linux shared library support routines for the linker. */
707
691
692/* Linux shared library support routines for the linker. */
693
708extern boolean bfd_i386linux_size_dynamic_sections
709 PARAMS ((bfd *, struct bfd_link_info *));
710extern boolean bfd_m68klinux_size_dynamic_sections
711 PARAMS ((bfd *, struct bfd_link_info *));
712extern boolean bfd_sparclinux_size_dynamic_sections
713 PARAMS ((bfd *, struct bfd_link_info *));
694extern bfd_boolean bfd_i386linux_size_dynamic_sections
695 (bfd *, struct bfd_link_info *);
696extern bfd_boolean bfd_m68klinux_size_dynamic_sections
697 (bfd *, struct bfd_link_info *);
698extern bfd_boolean bfd_sparclinux_size_dynamic_sections
699 (bfd *, struct bfd_link_info *);
714
715/* mmap hacks */
716
717struct _bfd_window_internal;
718typedef struct _bfd_window_internal bfd_window_internal;
719
720typedef struct _bfd_window
721{
722 /* What the user asked for. */
700
701/* mmap hacks */
702
703struct _bfd_window_internal;
704typedef struct _bfd_window_internal bfd_window_internal;
705
706typedef struct _bfd_window
707{
708 /* What the user asked for. */
723 PTR data;
709 void *data;
724 bfd_size_type size;
725 /* The actual window used by BFD. Small user-requested read-only
726 regions sharing a page may share a single window into the object
727 file. Read-write versions shouldn't until I've fixed things to
728 keep track of which portions have been claimed by the
729 application; don't want to give the same region back when the
730 application wants two writable copies! */
731 struct _bfd_window_internal *i;
732}
733bfd_window;
734
710 bfd_size_type size;
711 /* The actual window used by BFD. Small user-requested read-only
712 regions sharing a page may share a single window into the object
713 file. Read-write versions shouldn't until I've fixed things to
714 keep track of which portions have been claimed by the
715 application; don't want to give the same region back when the
716 application wants two writable copies! */
717 struct _bfd_window_internal *i;
718}
719bfd_window;
720
735extern void bfd_init_window PARAMS ((bfd_window *));
736extern void bfd_free_window PARAMS ((bfd_window *));
737extern boolean bfd_get_file_window
738 PARAMS ((bfd *, file_ptr, bfd_size_type, bfd_window *, boolean));
721extern void bfd_init_window
722 (bfd_window *);
723extern void bfd_free_window
724 (bfd_window *);
725extern bfd_boolean bfd_get_file_window
726 (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
739
740/* XCOFF support routines for the linker. */
741
727
728/* XCOFF support routines for the linker. */
729
742extern boolean bfd_xcoff_link_record_set
743 PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
744 bfd_size_type));
745extern boolean bfd_xcoff_import_symbol
746 PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
747 bfd_vma, const char *, const char *, const char *, unsigned int));
748extern boolean bfd_xcoff_export_symbol
749 PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *));
750extern boolean bfd_xcoff_link_count_reloc
751 PARAMS ((bfd *, struct bfd_link_info *, const char *));
752extern boolean bfd_xcoff_record_link_assignment
753 PARAMS ((bfd *, struct bfd_link_info *, const char *));
754extern boolean bfd_xcoff_size_dynamic_sections
755 PARAMS ((bfd *, struct bfd_link_info *, const char *, const char *,
756 unsigned long, unsigned long, unsigned long, boolean,
757 int, boolean, boolean, struct sec **, boolean));
758extern boolean bfd_xcoff_link_generate_rtinit
759 PARAMS ((bfd *, const char *, const char *, boolean));
730extern bfd_boolean bfd_xcoff_link_record_set
731 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
732extern bfd_boolean bfd_xcoff_import_symbol
733 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
734 const char *, const char *, const char *, unsigned int);
735extern bfd_boolean bfd_xcoff_export_symbol
736 (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
737extern bfd_boolean bfd_xcoff_link_count_reloc
738 (bfd *, struct bfd_link_info *, const char *);
739extern bfd_boolean bfd_xcoff_record_link_assignment
740 (bfd *, struct bfd_link_info *, const char *);
741extern bfd_boolean bfd_xcoff_size_dynamic_sections
742 (bfd *, struct bfd_link_info *, const char *, const char *,
743 unsigned long, unsigned long, unsigned long, bfd_boolean,
744 int, bfd_boolean, bfd_boolean, struct bfd_section **, bfd_boolean);
745extern bfd_boolean bfd_xcoff_link_generate_rtinit
746 (bfd *, const char *, const char *, bfd_boolean);
760
761/* XCOFF support routines for ar. */
747
748/* XCOFF support routines for ar. */
762extern boolean bfd_xcoff_ar_archive_set_magic PARAMS ((bfd *, char *));
749extern bfd_boolean bfd_xcoff_ar_archive_set_magic
750 (bfd *, char *);
763
764/* Externally visible COFF routines. */
765
766#if defined(__STDC__) || defined(ALMOST_STDC)
767struct internal_syment;
768union internal_auxent;
769#endif
770
751
752/* Externally visible COFF routines. */
753
754#if defined(__STDC__) || defined(ALMOST_STDC)
755struct internal_syment;
756union internal_auxent;
757#endif
758
771extern boolean bfd_coff_get_syment
772 PARAMS ((bfd *, struct symbol_cache_entry *, struct internal_syment *));
759extern bfd_boolean bfd_coff_get_syment
760 (bfd *, struct bfd_symbol *, struct internal_syment *);
773
761
774extern boolean bfd_coff_get_auxent
775 PARAMS ((bfd *, struct symbol_cache_entry *, int, union internal_auxent *));
762extern bfd_boolean bfd_coff_get_auxent
763 (bfd *, struct bfd_symbol *, int, union internal_auxent *);
776
764
777extern boolean bfd_coff_set_symbol_class
778 PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int));
765extern bfd_boolean bfd_coff_set_symbol_class
766 (bfd *, struct bfd_symbol *, unsigned int);
779
767
780extern boolean bfd_m68k_coff_create_embedded_relocs
781 PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
782 char **));
768extern bfd_boolean bfd_m68k_coff_create_embedded_relocs
769 (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
783
784/* ARM Interworking support. Called from linker. */
770
771/* ARM Interworking support. Called from linker. */
785extern boolean bfd_arm_allocate_interworking_sections
786 PARAMS ((struct bfd_link_info *));
772extern bfd_boolean bfd_arm_allocate_interworking_sections
773 (struct bfd_link_info *);
787
774
788extern boolean bfd_arm_process_before_allocation
789 PARAMS ((bfd *, struct bfd_link_info *, int));
775extern bfd_boolean bfd_arm_process_before_allocation
776 (bfd *, struct bfd_link_info *, int);
790
777
791extern boolean bfd_arm_get_bfd_for_interworking
792 PARAMS ((bfd *, struct bfd_link_info *));
778extern bfd_boolean bfd_arm_get_bfd_for_interworking
779 (bfd *, struct bfd_link_info *);
793
794/* PE ARM Interworking support. Called from linker. */
780
781/* PE ARM Interworking support. Called from linker. */
795extern boolean bfd_arm_pe_allocate_interworking_sections
796 PARAMS ((struct bfd_link_info *));
782extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
783 (struct bfd_link_info *);
797
784
798extern boolean bfd_arm_pe_process_before_allocation
799 PARAMS ((bfd *, struct bfd_link_info *, int));
785extern bfd_boolean bfd_arm_pe_process_before_allocation
786 (bfd *, struct bfd_link_info *, int);
800
787
801extern boolean bfd_arm_pe_get_bfd_for_interworking
802 PARAMS ((bfd *, struct bfd_link_info *));
788extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
789 (bfd *, struct bfd_link_info *);
803
804/* ELF ARM Interworking support. Called from linker. */
790
791/* ELF ARM Interworking support. Called from linker. */
805extern boolean bfd_elf32_arm_allocate_interworking_sections
806 PARAMS ((struct bfd_link_info *));
792extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
793 (struct bfd_link_info *);
807
794
808extern boolean bfd_elf32_arm_process_before_allocation
809 PARAMS ((bfd *, struct bfd_link_info *, int));
795extern bfd_boolean bfd_elf32_arm_process_before_allocation
796 (bfd *, struct bfd_link_info *, int);
810
797
811extern boolean bfd_elf32_arm_get_bfd_for_interworking
812 PARAMS ((bfd *, struct bfd_link_info *));
798extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
799 (bfd *, struct bfd_link_info *);
813
800
814extern boolean bfd_elf32_arm_add_glue_sections_to_bfd
815 PARAMS ((bfd *, struct bfd_link_info *));
801extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
802 (bfd *, struct bfd_link_info *);
816
803
804/* ARM Note section processing. */
805extern bfd_boolean bfd_arm_merge_machines
806 (bfd *, bfd *);
807
808extern bfd_boolean bfd_arm_update_notes
809 (bfd *, const char *);
810
811extern unsigned int bfd_arm_get_mach_from_notes
812 (bfd *, const char *);
813
817/* TI COFF load page support. */
818extern void bfd_ticoff_set_section_load_page
814/* TI COFF load page support. */
815extern void bfd_ticoff_set_section_load_page
819 PARAMS ((struct sec *, int));
816 (struct bfd_section *, int);
820
821extern int bfd_ticoff_get_section_load_page
817
818extern int bfd_ticoff_get_section_load_page
822 PARAMS ((struct sec *));
819 (struct bfd_section *);
823
820
821/* H8/300 functions. */
822extern bfd_vma bfd_h8300_pad_address
823 (bfd *, bfd_vma);
824
825/* IA64 Itanium code generation. Called from linker. */
826extern void bfd_elf32_ia64_after_parse
827 (int);
828
829extern void bfd_elf64_ia64_after_parse
830 (int);
831
824/* Extracted from init.c. */
832/* Extracted from init.c. */
825void
826bfd_init PARAMS ((void));
833void bfd_init (void);
827
828/* Extracted from opncls.c. */
834
835/* Extracted from opncls.c. */
829bfd *
830bfd_openr PARAMS ((const char *filename, const char *target));
836bfd *bfd_openr (const char *filename, const char *target);
831
837
832bfd *
833bfd_fdopenr PARAMS ((const char *filename, const char *target, int fd));
838bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
834
839
835bfd *
836bfd_openstreamr PARAMS ((const char *, const char *, PTR));
840bfd *bfd_openstreamr (const char *, const char *, void *);
837
841
838bfd *
839bfd_openw PARAMS ((const char *filename, const char *target));
842bfd *bfd_openw (const char *filename, const char *target);
840
843
841boolean
842bfd_close PARAMS ((bfd *abfd));
844bfd_boolean bfd_close (bfd *abfd);
843
845
844boolean
845bfd_close_all_done PARAMS ((bfd *));
846bfd_boolean bfd_close_all_done (bfd *);
846
847
847bfd *
848bfd_create PARAMS ((const char *filename, bfd *templ));
848bfd *bfd_create (const char *filename, bfd *templ);
849
849
850boolean
851bfd_make_writable PARAMS ((bfd *abfd));
850bfd_boolean bfd_make_writable (bfd *abfd);
852
851
853boolean
854bfd_make_readable PARAMS ((bfd *abfd));
852bfd_boolean bfd_make_readable (bfd *abfd);
855
853
854unsigned long bfd_calc_gnu_debuglink_crc32
855 (unsigned long crc, const unsigned char *buf, bfd_size_type len);
856
857char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
858
859struct bfd_section *bfd_create_gnu_debuglink_section
860 (bfd *abfd, const char *filename);
861
862bfd_boolean bfd_fill_in_gnu_debuglink_section
863 (bfd *abfd, struct bfd_section *sect, const char *filename);
864
856/* Extracted from libbfd.c. */
857
858/* Byte swapping macros for user section data. */
859
860#define bfd_put_8(abfd, val, ptr) \
865/* Extracted from libbfd.c. */
866
867/* Byte swapping macros for user section data. */
868
869#define bfd_put_8(abfd, val, ptr) \
861 ((void) (*((unsigned char *) (ptr)) = (unsigned char) (val)))
870 ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
862#define bfd_put_signed_8 \
871#define bfd_put_signed_8 \
863 bfd_put_8
872 bfd_put_8
864#define bfd_get_8(abfd, ptr) \
873#define bfd_get_8(abfd, ptr) \
865 (*(unsigned char *) (ptr) & 0xff)
874 (*(unsigned char *) (ptr) & 0xff)
866#define bfd_get_signed_8(abfd, ptr) \
875#define bfd_get_signed_8(abfd, ptr) \
867 (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
876 (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
868
869#define bfd_put_16(abfd, val, ptr) \
877
878#define bfd_put_16(abfd, val, ptr) \
870 BFD_SEND(abfd, bfd_putx16, ((val),(ptr)))
879 BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
871#define bfd_put_signed_16 \
880#define bfd_put_signed_16 \
872 bfd_put_16
881 bfd_put_16
873#define bfd_get_16(abfd, ptr) \
882#define bfd_get_16(abfd, ptr) \
874 BFD_SEND(abfd, bfd_getx16, (ptr))
883 BFD_SEND (abfd, bfd_getx16, (ptr))
875#define bfd_get_signed_16(abfd, ptr) \
884#define bfd_get_signed_16(abfd, ptr) \
876 BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
885 BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
877
878#define bfd_put_32(abfd, val, ptr) \
886
887#define bfd_put_32(abfd, val, ptr) \
879 BFD_SEND(abfd, bfd_putx32, ((val),(ptr)))
888 BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
880#define bfd_put_signed_32 \
889#define bfd_put_signed_32 \
881 bfd_put_32
890 bfd_put_32
882#define bfd_get_32(abfd, ptr) \
891#define bfd_get_32(abfd, ptr) \
883 BFD_SEND(abfd, bfd_getx32, (ptr))
892 BFD_SEND (abfd, bfd_getx32, (ptr))
884#define bfd_get_signed_32(abfd, ptr) \
893#define bfd_get_signed_32(abfd, ptr) \
885 BFD_SEND(abfd, bfd_getx_signed_32, (ptr))
894 BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
886
887#define bfd_put_64(abfd, val, ptr) \
895
896#define bfd_put_64(abfd, val, ptr) \
888 BFD_SEND(abfd, bfd_putx64, ((val), (ptr)))
897 BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
889#define bfd_put_signed_64 \
898#define bfd_put_signed_64 \
890 bfd_put_64
899 bfd_put_64
891#define bfd_get_64(abfd, ptr) \
900#define bfd_get_64(abfd, ptr) \
892 BFD_SEND(abfd, bfd_getx64, (ptr))
901 BFD_SEND (abfd, bfd_getx64, (ptr))
893#define bfd_get_signed_64(abfd, ptr) \
902#define bfd_get_signed_64(abfd, ptr) \
894 BFD_SEND(abfd, bfd_getx_signed_64, (ptr))
903 BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
895
904
896#define bfd_get(bits, abfd, ptr) \
897 ( (bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
898 : (bits) == 16 ? bfd_get_16 (abfd, ptr) \
899 : (bits) == 32 ? bfd_get_32 (abfd, ptr) \
900 : (bits) == 64 ? bfd_get_64 (abfd, ptr) \
901 : (abort (), (bfd_vma) - 1))
905#define bfd_get(bits, abfd, ptr) \
906 ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
907 : (bits) == 16 ? bfd_get_16 (abfd, ptr) \
908 : (bits) == 32 ? bfd_get_32 (abfd, ptr) \
909 : (bits) == 64 ? bfd_get_64 (abfd, ptr) \
910 : (abort (), (bfd_vma) - 1))
902
911
903#define bfd_put(bits, abfd, val, ptr) \
904 ( (bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
905 : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
906 : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
907 : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
908 : (abort (), (void) 0))
912#define bfd_put(bits, abfd, val, ptr) \
913 ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
914 : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
915 : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
916 : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
917 : (abort (), (void) 0))
909
910
911/* Byte swapping macros for file header data. */
912
913#define bfd_h_put_8(abfd, val, ptr) \
914 bfd_put_8 (abfd, val, ptr)
915#define bfd_h_put_signed_8(abfd, val, ptr) \
916 bfd_put_8 (abfd, val, ptr)

--- 24 unchanged lines hidden (view full) ---

941 BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
942#define bfd_h_put_signed_64 \
943 bfd_h_put_64
944#define bfd_h_get_64(abfd, ptr) \
945 BFD_SEND (abfd, bfd_h_getx64, (ptr))
946#define bfd_h_get_signed_64(abfd, ptr) \
947 BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
948
918
919
920/* Byte swapping macros for file header data. */
921
922#define bfd_h_put_8(abfd, val, ptr) \
923 bfd_put_8 (abfd, val, ptr)
924#define bfd_h_put_signed_8(abfd, val, ptr) \
925 bfd_put_8 (abfd, val, ptr)

--- 24 unchanged lines hidden (view full) ---

950 BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
951#define bfd_h_put_signed_64 \
952 bfd_h_put_64
953#define bfd_h_get_64(abfd, ptr) \
954 BFD_SEND (abfd, bfd_h_getx64, (ptr))
955#define bfd_h_get_signed_64(abfd, ptr) \
956 BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
957
949/* Refinements on the above, which should eventually go away. Save
950 cluttering the source with (bfd_vma) and (bfd_byte *) casts. */
958/* Aliases for the above, which should eventually go away. */
951
959
952#define H_PUT_64(abfd, val, where) \
953 bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
960#define H_PUT_64 bfd_h_put_64
961#define H_PUT_32 bfd_h_put_32
962#define H_PUT_16 bfd_h_put_16
963#define H_PUT_8 bfd_h_put_8
964#define H_PUT_S64 bfd_h_put_signed_64
965#define H_PUT_S32 bfd_h_put_signed_32
966#define H_PUT_S16 bfd_h_put_signed_16
967#define H_PUT_S8 bfd_h_put_signed_8
968#define H_GET_64 bfd_h_get_64
969#define H_GET_32 bfd_h_get_32
970#define H_GET_16 bfd_h_get_16
971#define H_GET_8 bfd_h_get_8
972#define H_GET_S64 bfd_h_get_signed_64
973#define H_GET_S32 bfd_h_get_signed_32
974#define H_GET_S16 bfd_h_get_signed_16
975#define H_GET_S8 bfd_h_get_signed_8
954
976
955#define H_PUT_32(abfd, val, where) \
956 bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
957
977
958#define H_PUT_16(abfd, val, where) \
959 bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
978/* Extracted from bfdio.c. */
979long bfd_get_mtime (bfd *abfd);
960
980
961#define H_PUT_8 bfd_h_put_8
981long bfd_get_size (bfd *abfd);
962
982
963#define H_PUT_S64(abfd, val, where) \
964 bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
965
966#define H_PUT_S32(abfd, val, where) \
967 bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
968
969#define H_PUT_S16(abfd, val, where) \
970 bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
971
972#define H_PUT_S8 bfd_h_put_signed_8
973
974#define H_GET_64(abfd, where) \
975 bfd_h_get_64 ((abfd), (bfd_byte *) (where))
976
977#define H_GET_32(abfd, where) \
978 bfd_h_get_32 ((abfd), (bfd_byte *) (where))
979
980#define H_GET_16(abfd, where) \
981 bfd_h_get_16 ((abfd), (bfd_byte *) (where))
982
983#define H_GET_8 bfd_h_get_8
984
985#define H_GET_S64(abfd, where) \
986 bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where))
987
988#define H_GET_S32(abfd, where) \
989 bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where))
990
991#define H_GET_S16(abfd, where) \
992 bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where))
993
994#define H_GET_S8 bfd_h_get_signed_8
995
996
983/* Extracted from bfdwin.c. */
997/* Extracted from section.c. */
998/* This structure is used for a comdat section, as in PE. A comdat
999 section is associated with a particular symbol. When the linker
1000 sees a comdat section, it keeps only one of the sections with a
1001 given name and associated with a given symbol. */
1002
1003struct bfd_comdat_info
1004{
1005 /* The name of the symbol associated with a comdat section. */
1006 const char *name;
1007
1008 /* The local symbol table index of the symbol associated with a
1009 comdat section. This is only meaningful to the object file format
1010 specific code; it is not an index into the list returned by
1011 bfd_canonicalize_symtab. */
1012 long symbol;
1013};
1014
984/* Extracted from section.c. */
985/* This structure is used for a comdat section, as in PE. A comdat
986 section is associated with a particular symbol. When the linker
987 sees a comdat section, it keeps only one of the sections with a
988 given name and associated with a given symbol. */
989
990struct bfd_comdat_info
991{
992 /* The name of the symbol associated with a comdat section. */
993 const char *name;
994
995 /* The local symbol table index of the symbol associated with a
996 comdat section. This is only meaningful to the object file format
997 specific code; it is not an index into the list returned by
998 bfd_canonicalize_symtab. */
999 long symbol;
1000};
1001
1015typedef struct sec
1002typedef struct bfd_section
1016{
1017 /* The name of the section; the name isn't a copy, the pointer is
1018 the same as that passed to bfd_make_section. */
1019 const char *name;
1020
1021 /* A unique sequence number. */
1022 int id;
1023
1024 /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
1025 int index;
1026
1027 /* The next section in the list belonging to the BFD, or NULL. */
1003{
1004 /* The name of the section; the name isn't a copy, the pointer is
1005 the same as that passed to bfd_make_section. */
1006 const char *name;
1007
1008 /* A unique sequence number. */
1009 int id;
1010
1011 /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */
1012 int index;
1013
1014 /* The next section in the list belonging to the BFD, or NULL. */
1028 struct sec *next;
1015 struct bfd_section *next;
1029
1030 /* The field flags contains attributes of the section. Some
1031 flags are read in from the object file, and some are
1032 synthesized from other information. */
1033 flagword flags;
1034
1035#define SEC_NO_FLAGS 0x000
1036

--- 181 unchanged lines hidden (view full) ---

1218
1219 /* Another mark flag used by some of the linker backends. Set for
1220 output sections that have an input section. */
1221 unsigned int linker_has_input : 1;
1222
1223 /* A mark flag used by some linker backends for garbage collection. */
1224 unsigned int gc_mark : 1;
1225
1016
1017 /* The field flags contains attributes of the section. Some
1018 flags are read in from the object file, and some are
1019 synthesized from other information. */
1020 flagword flags;
1021
1022#define SEC_NO_FLAGS 0x000
1023

--- 181 unchanged lines hidden (view full) ---

1205
1206 /* Another mark flag used by some of the linker backends. Set for
1207 output sections that have an input section. */
1208 unsigned int linker_has_input : 1;
1209
1210 /* A mark flag used by some linker backends for garbage collection. */
1211 unsigned int gc_mark : 1;
1212
1226 /* Used by the ELF code to mark sections which have been allocated
1227 to segments. */
1213 /* The following flags are used by the ELF linker. */
1214
1215 /* Mark sections which have been allocated to segments. */
1228 unsigned int segment_mark : 1;
1229
1216 unsigned int segment_mark : 1;
1217
1218 /* Type of sec_info information. */
1219 unsigned int sec_info_type:3;
1220#define ELF_INFO_TYPE_NONE 0
1221#define ELF_INFO_TYPE_STABS 1
1222#define ELF_INFO_TYPE_MERGE 2
1223#define ELF_INFO_TYPE_EH_FRAME 3
1224#define ELF_INFO_TYPE_JUST_SYMS 4
1225
1226 /* Nonzero if this section uses RELA relocations, rather than REL. */
1227 unsigned int use_rela_p:1;
1228
1229 /* Bits used by various backends. */
1230 unsigned int has_tls_reloc:1;
1231
1232 /* Nonzero if this section needs the relax finalize pass. */
1233 unsigned int need_finalize_relax:1;
1234
1235 /* Nonzero if this section has a gp reloc. */
1236 unsigned int has_gp_reloc:1;
1237
1238 /* Unused bits. */
1239 unsigned int flag13:1;
1240 unsigned int flag14:1;
1241 unsigned int flag15:1;
1242 unsigned int flag16:4;
1243 unsigned int flag20:4;
1244 unsigned int flag24:8;
1245
1230 /* End of internal packed boolean fields. */
1231
1232 /* The virtual memory address of the section - where it will be
1233 at run time. The symbols are relocated against this. The
1234 user_set_vma flag is maintained by bfd; if it's not set, the
1235 backend can assign addresses (for example, in <<a.out>>, where
1236 the default address for <<.data>> is dependent on the specific
1237 target and various flags). */

--- 19 unchanged lines hidden (view full) ---

1257 input section (byte ==> smallest addressable unit on the
1258 target). In most cases, if this was going to start at the
1259 100th octet (8-bit quantity) in the output section, this value
1260 would be 100. However, if the target byte size is 16 bits
1261 (bfd_octets_per_byte is "2"), this value would be 50. */
1262 bfd_vma output_offset;
1263
1264 /* The output section through which to map on output. */
1246 /* End of internal packed boolean fields. */
1247
1248 /* The virtual memory address of the section - where it will be
1249 at run time. The symbols are relocated against this. The
1250 user_set_vma flag is maintained by bfd; if it's not set, the
1251 backend can assign addresses (for example, in <<a.out>>, where
1252 the default address for <<.data>> is dependent on the specific
1253 target and various flags). */

--- 19 unchanged lines hidden (view full) ---

1273 input section (byte ==> smallest addressable unit on the
1274 target). In most cases, if this was going to start at the
1275 100th octet (8-bit quantity) in the output section, this value
1276 would be 100. However, if the target byte size is 16 bits
1277 (bfd_octets_per_byte is "2"), this value would be 50. */
1278 bfd_vma output_offset;
1279
1280 /* The output section through which to map on output. */
1265 struct sec *output_section;
1281 struct bfd_section *output_section;
1266
1267 /* The alignment requirement of the section, as an exponent of 2 -
1268 e.g., 3 aligns to 2^3 (or 8). */
1269 unsigned int alignment_power;
1270
1271 /* If an input section, a pointer to a vector of relocation
1272 records for the data in this section. */
1273 struct reloc_cache_entry *relocation;

--- 13 unchanged lines hidden (view full) ---

1287
1288 /* File position of relocation info. */
1289 file_ptr rel_filepos;
1290
1291 /* File position of line data. */
1292 file_ptr line_filepos;
1293
1294 /* Pointer to data for applications. */
1282
1283 /* The alignment requirement of the section, as an exponent of 2 -
1284 e.g., 3 aligns to 2^3 (or 8). */
1285 unsigned int alignment_power;
1286
1287 /* If an input section, a pointer to a vector of relocation
1288 records for the data in this section. */
1289 struct reloc_cache_entry *relocation;

--- 13 unchanged lines hidden (view full) ---

1303
1304 /* File position of relocation info. */
1305 file_ptr rel_filepos;
1306
1307 /* File position of line data. */
1308 file_ptr line_filepos;
1309
1310 /* Pointer to data for applications. */
1295 PTR userdata;
1311 void *userdata;
1296
1297 /* If the SEC_IN_MEMORY flag is set, this points to the actual
1298 contents. */
1299 unsigned char *contents;
1300
1301 /* Attached line number information. */
1302 alent *lineno;
1303
1304 /* Number of line number records. */
1305 unsigned int lineno_count;
1306
1307 /* Entity size for merging purposes. */
1308 unsigned int entsize;
1309
1310 /* Optional information about a COMDAT entry; NULL if not COMDAT. */
1311 struct bfd_comdat_info *comdat;
1312
1312
1313 /* If the SEC_IN_MEMORY flag is set, this points to the actual
1314 contents. */
1315 unsigned char *contents;
1316
1317 /* Attached line number information. */
1318 alent *lineno;
1319
1320 /* Number of line number records. */
1321 unsigned int lineno_count;
1322
1323 /* Entity size for merging purposes. */
1324 unsigned int entsize;
1325
1326 /* Optional information about a COMDAT entry; NULL if not COMDAT. */
1327 struct bfd_comdat_info *comdat;
1328
1329 /* Points to the kept section if this section is a link-once section,
1330 and is discarded. */
1331 struct bfd_section *kept_section;
1332
1313 /* When a section is being output, this value changes as more
1314 linenumbers are written out. */
1315 file_ptr moving_line_filepos;
1316
1317 /* What the section number is in the target world. */
1318 int target_index;
1319
1333 /* When a section is being output, this value changes as more
1334 linenumbers are written out. */
1335 file_ptr moving_line_filepos;
1336
1337 /* What the section number is in the target world. */
1338 int target_index;
1339
1320 PTR used_by_bfd;
1340 void *used_by_bfd;
1321
1322 /* If this is a constructor section then here is a list of the
1323 relocations created to relocate items within it. */
1324 struct relent_chain *constructor_chain;
1325
1326 /* The BFD which owns the section. */
1327 bfd *owner;
1328
1329 /* A symbol which points at this section only. */
1341
1342 /* If this is a constructor section then here is a list of the
1343 relocations created to relocate items within it. */
1344 struct relent_chain *constructor_chain;
1345
1346 /* The BFD which owns the section. */
1347 bfd *owner;
1348
1349 /* A symbol which points at this section only. */
1330 struct symbol_cache_entry *symbol;
1331 struct symbol_cache_entry **symbol_ptr_ptr;
1350 struct bfd_symbol *symbol;
1351 struct bfd_symbol **symbol_ptr_ptr;
1332
1333 struct bfd_link_order *link_order_head;
1334 struct bfd_link_order *link_order_tail;
1335} asection;
1336
1337/* These sections are global, and are managed by BFD. The application
1338 and target back end are not permitted to change the values in
1339 these sections. New code should use the section_ptr macros rather
1340 than referring directly to the const sections. The const sections
1341 may eventually vanish. */
1342#define BFD_ABS_SECTION_NAME "*ABS*"
1343#define BFD_UND_SECTION_NAME "*UND*"
1344#define BFD_COM_SECTION_NAME "*COM*"
1345#define BFD_IND_SECTION_NAME "*IND*"
1346
1347/* The absolute section. */
1352
1353 struct bfd_link_order *link_order_head;
1354 struct bfd_link_order *link_order_tail;
1355} asection;
1356
1357/* These sections are global, and are managed by BFD. The application
1358 and target back end are not permitted to change the values in
1359 these sections. New code should use the section_ptr macros rather
1360 than referring directly to the const sections. The const sections
1361 may eventually vanish. */
1362#define BFD_ABS_SECTION_NAME "*ABS*"
1363#define BFD_UND_SECTION_NAME "*UND*"
1364#define BFD_COM_SECTION_NAME "*COM*"
1365#define BFD_IND_SECTION_NAME "*IND*"
1366
1367/* The absolute section. */
1348extern const asection bfd_abs_section;
1368extern asection bfd_abs_section;
1349#define bfd_abs_section_ptr ((asection *) &bfd_abs_section)
1350#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
1351/* Pointer to the undefined section. */
1369#define bfd_abs_section_ptr ((asection *) &bfd_abs_section)
1370#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
1371/* Pointer to the undefined section. */
1352extern const asection bfd_und_section;
1372extern asection bfd_und_section;
1353#define bfd_und_section_ptr ((asection *) &bfd_und_section)
1354#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
1355/* Pointer to the common section. */
1373#define bfd_und_section_ptr ((asection *) &bfd_und_section)
1374#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
1375/* Pointer to the common section. */
1356extern const asection bfd_com_section;
1376extern asection bfd_com_section;
1357#define bfd_com_section_ptr ((asection *) &bfd_com_section)
1358/* Pointer to the indirect section. */
1377#define bfd_com_section_ptr ((asection *) &bfd_com_section)
1378/* Pointer to the indirect section. */
1359extern const asection bfd_ind_section;
1379extern asection bfd_ind_section;
1360#define bfd_ind_section_ptr ((asection *) &bfd_ind_section)
1361#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
1362
1363#define bfd_is_const_section(SEC) \
1364 ( ((SEC) == bfd_abs_section_ptr) \
1365 || ((SEC) == bfd_und_section_ptr) \
1366 || ((SEC) == bfd_com_section_ptr) \
1367 || ((SEC) == bfd_ind_section_ptr))
1368
1380#define bfd_ind_section_ptr ((asection *) &bfd_ind_section)
1381#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
1382
1383#define bfd_is_const_section(SEC) \
1384 ( ((SEC) == bfd_abs_section_ptr) \
1385 || ((SEC) == bfd_und_section_ptr) \
1386 || ((SEC) == bfd_com_section_ptr) \
1387 || ((SEC) == bfd_ind_section_ptr))
1388
1369extern const struct symbol_cache_entry * const bfd_abs_symbol;
1370extern const struct symbol_cache_entry * const bfd_com_symbol;
1371extern const struct symbol_cache_entry * const bfd_und_symbol;
1372extern const struct symbol_cache_entry * const bfd_ind_symbol;
1389extern const struct bfd_symbol * const bfd_abs_symbol;
1390extern const struct bfd_symbol * const bfd_com_symbol;
1391extern const struct bfd_symbol * const bfd_und_symbol;
1392extern const struct bfd_symbol * const bfd_ind_symbol;
1373#define bfd_get_section_size_before_reloc(section) \
1393#define bfd_get_section_size_before_reloc(section) \
1374 ((section)->reloc_done ? (abort (), (bfd_size_type) 1) \
1375 : (section)->_raw_size)
1394 ((section)->_raw_size)
1376#define bfd_get_section_size_after_reloc(section) \
1377 ((section)->reloc_done ? (section)->_cooked_size \
1378 : (abort (), (bfd_size_type) 1))
1379
1380/* Macros to handle insertion and deletion of a bfd's sections. These
1381 only handle the list pointers, ie. do not adjust section_count,
1382 target_index etc. */
1383#define bfd_section_list_remove(ABFD, PS) \

--- 13 unchanged lines hidden (view full) ---

1397 asection *_s = S; \
1398 _s->next = *_ps; \
1399 *_ps = _s; \
1400 if (_s->next == NULL) \
1401 (ABFD)->section_tail = &_s->next; \
1402 } \
1403 while (0)
1404
1395#define bfd_get_section_size_after_reloc(section) \
1396 ((section)->reloc_done ? (section)->_cooked_size \
1397 : (abort (), (bfd_size_type) 1))
1398
1399/* Macros to handle insertion and deletion of a bfd's sections. These
1400 only handle the list pointers, ie. do not adjust section_count,
1401 target_index etc. */
1402#define bfd_section_list_remove(ABFD, PS) \

--- 13 unchanged lines hidden (view full) ---

1416 asection *_s = S; \
1417 _s->next = *_ps; \
1418 *_ps = _s; \
1419 if (_s->next == NULL) \
1420 (ABFD)->section_tail = &_s->next; \
1421 } \
1422 while (0)
1423
1405void
1406bfd_section_list_clear PARAMS ((bfd *));
1424void bfd_section_list_clear (bfd *);
1407
1425
1408asection *
1409bfd_get_section_by_name PARAMS ((bfd *abfd, const char *name));
1426asection *bfd_get_section_by_name (bfd *abfd, const char *name);
1410
1427
1411char *
1412bfd_get_unique_section_name PARAMS ((bfd *abfd,
1413 const char *templat,
1414 int *count));
1428char *bfd_get_unique_section_name
1429 (bfd *abfd, const char *templat, int *count);
1415
1430
1416asection *
1417bfd_make_section_old_way PARAMS ((bfd *abfd, const char *name));
1431asection *bfd_make_section_old_way (bfd *abfd, const char *name);
1418
1432
1419asection *
1420bfd_make_section_anyway PARAMS ((bfd *abfd, const char *name));
1433asection *bfd_make_section_anyway (bfd *abfd, const char *name);
1421
1434
1422asection *
1423bfd_make_section PARAMS ((bfd *, const char *name));
1435asection *bfd_make_section (bfd *, const char *name);
1424
1436
1425boolean
1426bfd_set_section_flags PARAMS ((bfd *abfd, asection *sec, flagword flags));
1437bfd_boolean bfd_set_section_flags
1438 (bfd *abfd, asection *sec, flagword flags);
1427
1439
1428void
1429bfd_map_over_sections PARAMS ((bfd *abfd,
1430 void (*func) (bfd *abfd,
1431 asection *sect,
1432 PTR obj),
1433 PTR obj));
1440void bfd_map_over_sections
1441 (bfd *abfd,
1442 void (*func) (bfd *abfd, asection *sect, void *obj),
1443 void *obj);
1434
1444
1435boolean
1436bfd_set_section_size PARAMS ((bfd *abfd, asection *sec, bfd_size_type val));
1445bfd_boolean bfd_set_section_size
1446 (bfd *abfd, asection *sec, bfd_size_type val);
1437
1447
1438boolean
1439bfd_set_section_contents PARAMS ((bfd *abfd, asection *section,
1440 PTR data, file_ptr offset,
1441 bfd_size_type count));
1448bfd_boolean bfd_set_section_contents
1449 (bfd *abfd, asection *section, const void *data,
1450 file_ptr offset, bfd_size_type count);
1442
1451
1443boolean
1444bfd_get_section_contents PARAMS ((bfd *abfd, asection *section,
1445 PTR location, file_ptr offset,
1446 bfd_size_type count));
1452bfd_boolean bfd_get_section_contents
1453 (bfd *abfd, asection *section, void *location, file_ptr offset,
1454 bfd_size_type count);
1447
1455
1448boolean
1449bfd_copy_private_section_data PARAMS ((bfd *ibfd, asection *isec,
1450 bfd *obfd, asection *osec));
1456bfd_boolean bfd_copy_private_section_data
1457 (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
1451
1452#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
1453 BFD_SEND (obfd, _bfd_copy_private_section_data, \
1454 (ibfd, isection, obfd, osection))
1458
1459#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
1460 BFD_SEND (obfd, _bfd_copy_private_section_data, \
1461 (ibfd, isection, obfd, osection))
1455void
1456_bfd_strip_section_from_output PARAMS ((struct bfd_link_info *info, asection *section));
1462void _bfd_strip_section_from_output
1463 (struct bfd_link_info *info, asection *section);
1457
1464
1458boolean
1459bfd_generic_discard_group PARAMS ((bfd *abfd, asection *group));
1465bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
1460
1461/* Extracted from archures.c. */
1462enum bfd_architecture
1463{
1464 bfd_arch_unknown, /* File arch not known. */
1465 bfd_arch_obscure, /* Arch known, not one of these. */
1466 bfd_arch_m68k, /* Motorola 68xxx */
1467#define bfd_mach_m68000 1
1468#define bfd_mach_m68008 2
1469#define bfd_mach_m68010 3
1470#define bfd_mach_m68020 4
1471#define bfd_mach_m68030 5
1472#define bfd_mach_m68040 6
1473#define bfd_mach_m68060 7
1474#define bfd_mach_cpu32 8
1475#define bfd_mach_mcf5200 9
1476#define bfd_mach_mcf5206e 10
1477#define bfd_mach_mcf5307 11
1478#define bfd_mach_mcf5407 12
1466
1467/* Extracted from archures.c. */
1468enum bfd_architecture
1469{
1470 bfd_arch_unknown, /* File arch not known. */
1471 bfd_arch_obscure, /* Arch known, not one of these. */
1472 bfd_arch_m68k, /* Motorola 68xxx */
1473#define bfd_mach_m68000 1
1474#define bfd_mach_m68008 2
1475#define bfd_mach_m68010 3
1476#define bfd_mach_m68020 4
1477#define bfd_mach_m68030 5
1478#define bfd_mach_m68040 6
1479#define bfd_mach_m68060 7
1480#define bfd_mach_cpu32 8
1481#define bfd_mach_mcf5200 9
1482#define bfd_mach_mcf5206e 10
1483#define bfd_mach_mcf5307 11
1484#define bfd_mach_mcf5407 12
1485#define bfd_mach_mcf528x 13
1479 bfd_arch_vax, /* DEC Vax */
1480 bfd_arch_i960, /* Intel 960 */
1481 /* The order of the following is important.
1482 lower number indicates a machine type that
1483 only accepts a subset of the instructions
1484 available to machines with higher numbers.
1485 The exception is the "ca", which is
1486 incompatible with all other machines except

--- 29 unchanged lines hidden (view full) ---

1516 && (mach) != bfd_mach_sparc_sparclite_le)
1517 bfd_arch_mips, /* MIPS Rxxxx */
1518#define bfd_mach_mips3000 3000
1519#define bfd_mach_mips3900 3900
1520#define bfd_mach_mips4000 4000
1521#define bfd_mach_mips4010 4010
1522#define bfd_mach_mips4100 4100
1523#define bfd_mach_mips4111 4111
1486 bfd_arch_vax, /* DEC Vax */
1487 bfd_arch_i960, /* Intel 960 */
1488 /* The order of the following is important.
1489 lower number indicates a machine type that
1490 only accepts a subset of the instructions
1491 available to machines with higher numbers.
1492 The exception is the "ca", which is
1493 incompatible with all other machines except

--- 29 unchanged lines hidden (view full) ---

1523 && (mach) != bfd_mach_sparc_sparclite_le)
1524 bfd_arch_mips, /* MIPS Rxxxx */
1525#define bfd_mach_mips3000 3000
1526#define bfd_mach_mips3900 3900
1527#define bfd_mach_mips4000 4000
1528#define bfd_mach_mips4010 4010
1529#define bfd_mach_mips4100 4100
1530#define bfd_mach_mips4111 4111
1531#define bfd_mach_mips4120 4120
1524#define bfd_mach_mips4300 4300
1525#define bfd_mach_mips4400 4400
1526#define bfd_mach_mips4600 4600
1527#define bfd_mach_mips4650 4650
1528#define bfd_mach_mips5000 5000
1532#define bfd_mach_mips4300 4300
1533#define bfd_mach_mips4400 4400
1534#define bfd_mach_mips4600 4600
1535#define bfd_mach_mips4650 4650
1536#define bfd_mach_mips5000 5000
1537#define bfd_mach_mips5400 5400
1538#define bfd_mach_mips5500 5500
1529#define bfd_mach_mips6000 6000
1539#define bfd_mach_mips6000 6000
1540#define bfd_mach_mips7000 7000
1530#define bfd_mach_mips8000 8000
1531#define bfd_mach_mips10000 10000
1532#define bfd_mach_mips12000 12000
1533#define bfd_mach_mips16 16
1534#define bfd_mach_mips5 5
1535#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */
1536#define bfd_mach_mipsisa32 32
1541#define bfd_mach_mips8000 8000
1542#define bfd_mach_mips10000 10000
1543#define bfd_mach_mips12000 12000
1544#define bfd_mach_mips16 16
1545#define bfd_mach_mips5 5
1546#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */
1547#define bfd_mach_mipsisa32 32
1548#define bfd_mach_mipsisa32r2 33
1537#define bfd_mach_mipsisa64 64
1549#define bfd_mach_mipsisa64 64
1550#define bfd_mach_mipsisa64r2 65
1538 bfd_arch_i386, /* Intel 386 */
1551 bfd_arch_i386, /* Intel 386 */
1539#define bfd_mach_i386_i386 0
1540#define bfd_mach_i386_i8086 1
1541#define bfd_mach_i386_i386_intel_syntax 2
1542#define bfd_mach_x86_64 3
1543#define bfd_mach_x86_64_intel_syntax 4
1552#define bfd_mach_i386_i386 1
1553#define bfd_mach_i386_i8086 2
1554#define bfd_mach_i386_i386_intel_syntax 3
1555#define bfd_mach_x86_64 64
1556#define bfd_mach_x86_64_intel_syntax 65
1544 bfd_arch_we32k, /* AT&T WE32xxx */
1545 bfd_arch_tahoe, /* CCI/Harris Tahoe */
1546 bfd_arch_i860, /* Intel 860 */
1547 bfd_arch_i370, /* IBM 360/370 Mainframes */
1548 bfd_arch_romp, /* IBM ROMP PC/RT */
1549 bfd_arch_alliant, /* Alliant */
1550 bfd_arch_convex, /* Convex */
1551 bfd_arch_m88k, /* Motorola 88xxx */
1557 bfd_arch_we32k, /* AT&T WE32xxx */
1558 bfd_arch_tahoe, /* CCI/Harris Tahoe */
1559 bfd_arch_i860, /* Intel 860 */
1560 bfd_arch_i370, /* IBM 360/370 Mainframes */
1561 bfd_arch_romp, /* IBM ROMP PC/RT */
1562 bfd_arch_alliant, /* Alliant */
1563 bfd_arch_convex, /* Convex */
1564 bfd_arch_m88k, /* Motorola 88xxx */
1565 bfd_arch_m98k, /* Motorola 98xxx */
1552 bfd_arch_pyramid, /* Pyramid Technology */
1566 bfd_arch_pyramid, /* Pyramid Technology */
1553 bfd_arch_h8300, /* Hitachi H8/300 */
1554#define bfd_mach_h8300 1
1555#define bfd_mach_h8300h 2
1556#define bfd_mach_h8300s 3
1567 bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */
1568#define bfd_mach_h8300 1
1569#define bfd_mach_h8300h 2
1570#define bfd_mach_h8300s 3
1571#define bfd_mach_h8300hn 4
1572#define bfd_mach_h8300sn 5
1573#define bfd_mach_h8300sx 6
1574#define bfd_mach_h8300sxn 7
1557 bfd_arch_pdp11, /* DEC PDP-11 */
1558 bfd_arch_powerpc, /* PowerPC */
1575 bfd_arch_pdp11, /* DEC PDP-11 */
1576 bfd_arch_powerpc, /* PowerPC */
1559#define bfd_mach_ppc 0
1560#define bfd_mach_ppc64 1
1577#define bfd_mach_ppc 32
1578#define bfd_mach_ppc64 64
1561#define bfd_mach_ppc_403 403
1562#define bfd_mach_ppc_403gc 4030
1563#define bfd_mach_ppc_505 505
1564#define bfd_mach_ppc_601 601
1565#define bfd_mach_ppc_602 602
1566#define bfd_mach_ppc_603 603
1567#define bfd_mach_ppc_ec603e 6031
1568#define bfd_mach_ppc_604 604
1569#define bfd_mach_ppc_620 620
1570#define bfd_mach_ppc_630 630
1571#define bfd_mach_ppc_750 750
1572#define bfd_mach_ppc_860 860
1573#define bfd_mach_ppc_a35 35
1574#define bfd_mach_ppc_rs64ii 642
1575#define bfd_mach_ppc_rs64iii 643
1576#define bfd_mach_ppc_7400 7400
1579#define bfd_mach_ppc_403 403
1580#define bfd_mach_ppc_403gc 4030
1581#define bfd_mach_ppc_505 505
1582#define bfd_mach_ppc_601 601
1583#define bfd_mach_ppc_602 602
1584#define bfd_mach_ppc_603 603
1585#define bfd_mach_ppc_ec603e 6031
1586#define bfd_mach_ppc_604 604
1587#define bfd_mach_ppc_620 620
1588#define bfd_mach_ppc_630 630
1589#define bfd_mach_ppc_750 750
1590#define bfd_mach_ppc_860 860
1591#define bfd_mach_ppc_a35 35
1592#define bfd_mach_ppc_rs64ii 642
1593#define bfd_mach_ppc_rs64iii 643
1594#define bfd_mach_ppc_7400 7400
1595#define bfd_mach_ppc_e500 500
1577 bfd_arch_rs6000, /* IBM RS/6000 */
1596 bfd_arch_rs6000, /* IBM RS/6000 */
1578#define bfd_mach_rs6k 0
1597#define bfd_mach_rs6k 6000
1579#define bfd_mach_rs6k_rs1 6001
1580#define bfd_mach_rs6k_rsc 6003
1581#define bfd_mach_rs6k_rs2 6002
1582 bfd_arch_hppa, /* HP PA RISC */
1598#define bfd_mach_rs6k_rs1 6001
1599#define bfd_mach_rs6k_rsc 6003
1600#define bfd_mach_rs6k_rs2 6002
1601 bfd_arch_hppa, /* HP PA RISC */
1602#define bfd_mach_hppa10 10
1603#define bfd_mach_hppa11 11
1604#define bfd_mach_hppa20 20
1605#define bfd_mach_hppa20w 25
1583 bfd_arch_d10v, /* Mitsubishi D10V */
1606 bfd_arch_d10v, /* Mitsubishi D10V */
1584#define bfd_mach_d10v 0
1607#define bfd_mach_d10v 1
1585#define bfd_mach_d10v_ts2 2
1586#define bfd_mach_d10v_ts3 3
1587 bfd_arch_d30v, /* Mitsubishi D30V */
1588 bfd_arch_dlx, /* DLX */
1589 bfd_arch_m68hc11, /* Motorola 68HC11 */
1590 bfd_arch_m68hc12, /* Motorola 68HC12 */
1608#define bfd_mach_d10v_ts2 2
1609#define bfd_mach_d10v_ts3 3
1610 bfd_arch_d30v, /* Mitsubishi D30V */
1611 bfd_arch_dlx, /* DLX */
1612 bfd_arch_m68hc11, /* Motorola 68HC11 */
1613 bfd_arch_m68hc12, /* Motorola 68HC12 */
1614#define bfd_mach_m6812_default 0
1615#define bfd_mach_m6812 1
1616#define bfd_mach_m6812s 2
1591 bfd_arch_z8k, /* Zilog Z8000 */
1592#define bfd_mach_z8001 1
1593#define bfd_mach_z8002 2
1617 bfd_arch_z8k, /* Zilog Z8000 */
1618#define bfd_mach_z8001 1
1619#define bfd_mach_z8002 2
1594 bfd_arch_h8500, /* Hitachi H8/500 */
1595 bfd_arch_sh, /* Hitachi SH */
1596#define bfd_mach_sh 0
1620 bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */
1621 bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */
1622#define bfd_mach_sh 1
1597#define bfd_mach_sh2 0x20
1598#define bfd_mach_sh_dsp 0x2d
1623#define bfd_mach_sh2 0x20
1624#define bfd_mach_sh_dsp 0x2d
1625#define bfd_mach_sh2e 0x2e
1599#define bfd_mach_sh3 0x30
1600#define bfd_mach_sh3_dsp 0x3d
1601#define bfd_mach_sh3e 0x3e
1602#define bfd_mach_sh4 0x40
1626#define bfd_mach_sh3 0x30
1627#define bfd_mach_sh3_dsp 0x3d
1628#define bfd_mach_sh3e 0x3e
1629#define bfd_mach_sh4 0x40
1630#define bfd_mach_sh4_nofpu 0x41
1631#define bfd_mach_sh4a 0x4a
1632#define bfd_mach_sh4a_nofpu 0x4b
1633#define bfd_mach_sh4al_dsp 0x4d
1603#define bfd_mach_sh5 0x50
1604 bfd_arch_alpha, /* Dec Alpha */
1605#define bfd_mach_alpha_ev4 0x10
1606#define bfd_mach_alpha_ev5 0x20
1607#define bfd_mach_alpha_ev6 0x30
1608 bfd_arch_arm, /* Advanced Risc Machines ARM. */
1634#define bfd_mach_sh5 0x50
1635 bfd_arch_alpha, /* Dec Alpha */
1636#define bfd_mach_alpha_ev4 0x10
1637#define bfd_mach_alpha_ev5 0x20
1638#define bfd_mach_alpha_ev6 0x30
1639 bfd_arch_arm, /* Advanced Risc Machines ARM. */
1640#define bfd_mach_arm_unknown 0
1609#define bfd_mach_arm_2 1
1610#define bfd_mach_arm_2a 2
1611#define bfd_mach_arm_3 3
1612#define bfd_mach_arm_3M 4
1613#define bfd_mach_arm_4 5
1614#define bfd_mach_arm_4T 6
1615#define bfd_mach_arm_5 7
1616#define bfd_mach_arm_5T 8
1617#define bfd_mach_arm_5TE 9
1618#define bfd_mach_arm_XScale 10
1641#define bfd_mach_arm_2 1
1642#define bfd_mach_arm_2a 2
1643#define bfd_mach_arm_3 3
1644#define bfd_mach_arm_3M 4
1645#define bfd_mach_arm_4 5
1646#define bfd_mach_arm_4T 6
1647#define bfd_mach_arm_5 7
1648#define bfd_mach_arm_5T 8
1649#define bfd_mach_arm_5TE 9
1650#define bfd_mach_arm_XScale 10
1651#define bfd_mach_arm_ep9312 11
1652#define bfd_mach_arm_iWMMXt 12
1619 bfd_arch_ns32k, /* National Semiconductors ns32000 */
1620 bfd_arch_w65, /* WDC 65816 */
1621 bfd_arch_tic30, /* Texas Instruments TMS320C30 */
1653 bfd_arch_ns32k, /* National Semiconductors ns32000 */
1654 bfd_arch_w65, /* WDC 65816 */
1655 bfd_arch_tic30, /* Texas Instruments TMS320C30 */
1656 bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */
1657#define bfd_mach_tic3x 30
1658#define bfd_mach_tic4x 40
1622 bfd_arch_tic54x, /* Texas Instruments TMS320C54X */
1623 bfd_arch_tic80, /* TI TMS320c80 (MVP) */
1624 bfd_arch_v850, /* NEC V850 */
1659 bfd_arch_tic54x, /* Texas Instruments TMS320C54X */
1660 bfd_arch_tic80, /* TI TMS320c80 (MVP) */
1661 bfd_arch_v850, /* NEC V850 */
1625#define bfd_mach_v850 0
1662#define bfd_mach_v850 1
1626#define bfd_mach_v850e 'E'
1663#define bfd_mach_v850e 'E'
1627#define bfd_mach_v850ea 'A'
1664#define bfd_mach_v850e1 '1'
1628 bfd_arch_arc, /* ARC Cores */
1665 bfd_arch_arc, /* ARC Cores */
1629#define bfd_mach_arc_5 0
1630#define bfd_mach_arc_6 1
1631#define bfd_mach_arc_7 2
1632#define bfd_mach_arc_8 3
1633 bfd_arch_m32r, /* Mitsubishi M32R/D */
1634#define bfd_mach_m32r 0 /* For backwards compatibility. */
1666#define bfd_mach_arc_5 5
1667#define bfd_mach_arc_6 6
1668#define bfd_mach_arc_7 7
1669#define bfd_mach_arc_8 8
1670 bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */
1671#define bfd_mach_m32r 1 /* For backwards compatibility. */
1635#define bfd_mach_m32rx 'x'
1672#define bfd_mach_m32rx 'x'
1673#define bfd_mach_m32r2 '2'
1636 bfd_arch_mn10200, /* Matsushita MN10200 */
1637 bfd_arch_mn10300, /* Matsushita MN10300 */
1638#define bfd_mach_mn10300 300
1639#define bfd_mach_am33 330
1674 bfd_arch_mn10200, /* Matsushita MN10200 */
1675 bfd_arch_mn10300, /* Matsushita MN10300 */
1676#define bfd_mach_mn10300 300
1677#define bfd_mach_am33 330
1678#define bfd_mach_am33_2 332
1640 bfd_arch_fr30,
1641#define bfd_mach_fr30 0x46523330
1642 bfd_arch_frv,
1679 bfd_arch_fr30,
1680#define bfd_mach_fr30 0x46523330
1681 bfd_arch_frv,
1643#define bfd_mach_frv 0
1644#define bfd_mach_frvsimple 1
1682#define bfd_mach_frv 1
1683#define bfd_mach_frvsimple 2
1645#define bfd_mach_fr300 300
1646#define bfd_mach_fr400 400
1647#define bfd_mach_frvtomcat 499 /* fr500 prototype */
1648#define bfd_mach_fr500 500
1684#define bfd_mach_fr300 300
1685#define bfd_mach_fr400 400
1686#define bfd_mach_frvtomcat 499 /* fr500 prototype */
1687#define bfd_mach_fr500 500
1688#define bfd_mach_fr550 550
1649 bfd_arch_mcore,
1650 bfd_arch_ia64, /* HP/Intel ia64 */
1689 bfd_arch_mcore,
1690 bfd_arch_ia64, /* HP/Intel ia64 */
1651#define bfd_mach_ia64_elf64 0
1652#define bfd_mach_ia64_elf32 1
1691#define bfd_mach_ia64_elf64 64
1692#define bfd_mach_ia64_elf32 32
1693 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */
1694#define bfd_mach_ip2022 1
1695#define bfd_mach_ip2022ext 2
1696 bfd_arch_iq2000, /* Vitesse IQ2000. */
1697#define bfd_mach_iq2000 1
1698#define bfd_mach_iq10 2
1653 bfd_arch_pj,
1654 bfd_arch_avr, /* Atmel AVR microcontrollers. */
1655#define bfd_mach_avr1 1
1656#define bfd_mach_avr2 2
1657#define bfd_mach_avr3 3
1658#define bfd_mach_avr4 4
1659#define bfd_mach_avr5 5
1660 bfd_arch_cris, /* Axis CRIS */
1661 bfd_arch_s390, /* IBM s390 */
1699 bfd_arch_pj,
1700 bfd_arch_avr, /* Atmel AVR microcontrollers. */
1701#define bfd_mach_avr1 1
1702#define bfd_mach_avr2 2
1703#define bfd_mach_avr3 3
1704#define bfd_mach_avr4 4
1705#define bfd_mach_avr5 5
1706 bfd_arch_cris, /* Axis CRIS */
1707 bfd_arch_s390, /* IBM s390 */
1662#define bfd_mach_s390_31 0
1663#define bfd_mach_s390_64 1
1708#define bfd_mach_s390_31 31
1709#define bfd_mach_s390_64 64
1664 bfd_arch_openrisc, /* OpenRISC */
1665 bfd_arch_mmix, /* Donald Knuth's educational processor. */
1666 bfd_arch_xstormy16,
1710 bfd_arch_openrisc, /* OpenRISC */
1711 bfd_arch_mmix, /* Donald Knuth's educational processor. */
1712 bfd_arch_xstormy16,
1667#define bfd_mach_xstormy16 0
1713#define bfd_mach_xstormy16 1
1714 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */
1715#define bfd_mach_msp11 11
1716#define bfd_mach_msp110 110
1717#define bfd_mach_msp12 12
1718#define bfd_mach_msp13 13
1719#define bfd_mach_msp14 14
1720#define bfd_mach_msp15 15
1721#define bfd_mach_msp16 16
1722#define bfd_mach_msp31 31
1723#define bfd_mach_msp32 32
1724#define bfd_mach_msp33 33
1725#define bfd_mach_msp41 41
1726#define bfd_mach_msp42 42
1727#define bfd_mach_msp43 43
1728#define bfd_mach_msp44 44
1729 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
1730#define bfd_mach_xtensa 1
1668 bfd_arch_last
1669 };
1670
1671typedef struct bfd_arch_info
1672{
1673 int bits_per_word;
1674 int bits_per_address;
1675 int bits_per_byte;
1676 enum bfd_architecture arch;
1677 unsigned long mach;
1678 const char *arch_name;
1679 const char *printable_name;
1680 unsigned int section_align_power;
1731 bfd_arch_last
1732 };
1733
1734typedef struct bfd_arch_info
1735{
1736 int bits_per_word;
1737 int bits_per_address;
1738 int bits_per_byte;
1739 enum bfd_architecture arch;
1740 unsigned long mach;
1741 const char *arch_name;
1742 const char *printable_name;
1743 unsigned int section_align_power;
1681 /* True if this is the default machine for the architecture.
1744 /* TRUE if this is the default machine for the architecture.
1682 The default arch should be the first entry for an arch so that
1683 all the entries for that arch can be accessed via <<next>>. */
1745 The default arch should be the first entry for an arch so that
1746 all the entries for that arch can be accessed via <<next>>. */
1684 boolean the_default;
1747 bfd_boolean the_default;
1685 const struct bfd_arch_info * (*compatible)
1748 const struct bfd_arch_info * (*compatible)
1686 PARAMS ((const struct bfd_arch_info *a,
1687 const struct bfd_arch_info *b));
1749 (const struct bfd_arch_info *a, const struct bfd_arch_info *b);
1688
1750
1689 boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *));
1751 bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
1690
1691 const struct bfd_arch_info *next;
1692}
1693bfd_arch_info_type;
1694
1752
1753 const struct bfd_arch_info *next;
1754}
1755bfd_arch_info_type;
1756
1695const char *
1696bfd_printable_name PARAMS ((bfd *abfd));
1757const char *bfd_printable_name (bfd *abfd);
1697
1758
1698const bfd_arch_info_type *
1699bfd_scan_arch PARAMS ((const char *string));
1759const bfd_arch_info_type *bfd_scan_arch (const char *string);
1700
1760
1701const char **
1702bfd_arch_list PARAMS ((void));
1761const char **bfd_arch_list (void);
1703
1762
1704const bfd_arch_info_type *
1705bfd_arch_get_compatible PARAMS ((
1706 const bfd *abfd,
1707 const bfd *bbfd));
1763const bfd_arch_info_type *bfd_arch_get_compatible
1764 (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
1708
1765
1709void
1710bfd_set_arch_info PARAMS ((bfd *abfd, const bfd_arch_info_type *arg));
1766void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
1711
1767
1712enum bfd_architecture
1713bfd_get_arch PARAMS ((bfd *abfd));
1768enum bfd_architecture bfd_get_arch (bfd *abfd);
1714
1769
1715unsigned long
1716bfd_get_mach PARAMS ((bfd *abfd));
1770unsigned long bfd_get_mach (bfd *abfd);
1717
1771
1718unsigned int
1719bfd_arch_bits_per_byte PARAMS ((bfd *abfd));
1772unsigned int bfd_arch_bits_per_byte (bfd *abfd);
1720
1773
1721unsigned int
1722bfd_arch_bits_per_address PARAMS ((bfd *abfd));
1774unsigned int bfd_arch_bits_per_address (bfd *abfd);
1723
1775
1724const bfd_arch_info_type *
1725bfd_get_arch_info PARAMS ((bfd *abfd));
1776const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
1726
1777
1727const bfd_arch_info_type *
1728bfd_lookup_arch PARAMS ((enum bfd_architecture
1729 arch,
1730 unsigned long machine));
1778const bfd_arch_info_type *bfd_lookup_arch
1779 (enum bfd_architecture arch, unsigned long machine);
1731
1780
1732const char *
1733bfd_printable_arch_mach PARAMS ((enum bfd_architecture arch, unsigned long machine));
1781const char *bfd_printable_arch_mach
1782 (enum bfd_architecture arch, unsigned long machine);
1734
1783
1735unsigned int
1736bfd_octets_per_byte PARAMS ((bfd *abfd));
1784unsigned int bfd_octets_per_byte (bfd *abfd);
1737
1785
1738unsigned int
1739bfd_arch_mach_octets_per_byte PARAMS ((enum bfd_architecture arch,
1740 unsigned long machine));
1786unsigned int bfd_arch_mach_octets_per_byte
1787 (enum bfd_architecture arch, unsigned long machine);
1741
1742/* Extracted from reloc.c. */
1743typedef enum bfd_reloc_status
1744{
1745 /* No errors detected. */
1746 bfd_reloc_ok,
1747
1748 /* The relocation was performed, but there was an overflow. */

--- 21 unchanged lines hidden (view full) ---

1770 bfd_reloc_dangerous
1771 }
1772 bfd_reloc_status_type;
1773
1774
1775typedef struct reloc_cache_entry
1776{
1777 /* A pointer into the canonical table of pointers. */
1788
1789/* Extracted from reloc.c. */
1790typedef enum bfd_reloc_status
1791{
1792 /* No errors detected. */
1793 bfd_reloc_ok,
1794
1795 /* The relocation was performed, but there was an overflow. */

--- 21 unchanged lines hidden (view full) ---

1817 bfd_reloc_dangerous
1818 }
1819 bfd_reloc_status_type;
1820
1821
1822typedef struct reloc_cache_entry
1823{
1824 /* A pointer into the canonical table of pointers. */
1778 struct symbol_cache_entry **sym_ptr_ptr;
1825 struct bfd_symbol **sym_ptr_ptr;
1779
1780 /* offset in section. */
1781 bfd_size_type address;
1782
1783 /* addend for relocation value. */
1784 bfd_vma addend;
1785
1786 /* Pointer to how to perform the required relocation. */

--- 42 unchanged lines hidden (view full) ---

1829 /* The number of bits in the item to be relocated. This is used
1830 when doing overflow checking. */
1831 unsigned int bitsize;
1832
1833 /* Notes that the relocation is relative to the location in the
1834 data section of the addend. The relocation function will
1835 subtract from the relocation value the address of the location
1836 being relocated. */
1826
1827 /* offset in section. */
1828 bfd_size_type address;
1829
1830 /* addend for relocation value. */
1831 bfd_vma addend;
1832
1833 /* Pointer to how to perform the required relocation. */

--- 42 unchanged lines hidden (view full) ---

1876 /* The number of bits in the item to be relocated. This is used
1877 when doing overflow checking. */
1878 unsigned int bitsize;
1879
1880 /* Notes that the relocation is relative to the location in the
1881 data section of the addend. The relocation function will
1882 subtract from the relocation value the address of the location
1883 being relocated. */
1837 boolean pc_relative;
1884 bfd_boolean pc_relative;
1838
1839 /* The bit position of the reloc value in the destination.
1840 The relocated value is left shifted by this amount. */
1841 unsigned int bitpos;
1842
1843 /* What type of overflow error should be checked for when
1844 relocating. */
1845 enum complain_overflow complain_on_overflow;
1846
1847 /* If this field is non null, then the supplied function is
1848 called rather than the normal function. This allows really
1885
1886 /* The bit position of the reloc value in the destination.
1887 The relocated value is left shifted by this amount. */
1888 unsigned int bitpos;
1889
1890 /* What type of overflow error should be checked for when
1891 relocating. */
1892 enum complain_overflow complain_on_overflow;
1893
1894 /* If this field is non null, then the supplied function is
1895 called rather than the normal function. This allows really
1849 strange relocation methods to be accomodated (e.g., i960 callj
1896 strange relocation methods to be accommodated (e.g., i960 callj
1850 instructions). */
1851 bfd_reloc_status_type (*special_function)
1897 instructions). */
1898 bfd_reloc_status_type (*special_function)
1852 PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *,
1853 bfd *, char **));
1899 (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
1900 bfd *, char **);
1854
1855 /* The textual name of the relocation type. */
1856 char *name;
1857
1858 /* Some formats record a relocation addend in the section contents
1859 rather than with the relocation. For ELF formats this is the
1860 distinction between USE_REL and USE_RELA (though the code checks
1861 for USE_REL == 1/0). The value of this field is TRUE if the
1862 addend is recorded with the section contents; when performing a
1863 partial link (ld -r) the section contents (the data) will be
1864 modified. The value of this field is FALSE if addends are
1865 recorded with the relocation (in arelent.addend); when performing
1866 a partial link the relocation will be modified.
1867 All relocations for all ELF USE_RELA targets should set this field
1868 to FALSE (values of TRUE should be looked on with suspicion).
1869 However, the converse is not true: not all relocations of all ELF
1870 USE_REL targets set this field to TRUE. Why this is so is peculiar
1871 to each particular target. For relocs that aren't used in partial
1872 links (e.g. GOT stuff) it doesn't matter what this is set to. */
1901
1902 /* The textual name of the relocation type. */
1903 char *name;
1904
1905 /* Some formats record a relocation addend in the section contents
1906 rather than with the relocation. For ELF formats this is the
1907 distinction between USE_REL and USE_RELA (though the code checks
1908 for USE_REL == 1/0). The value of this field is TRUE if the
1909 addend is recorded with the section contents; when performing a
1910 partial link (ld -r) the section contents (the data) will be
1911 modified. The value of this field is FALSE if addends are
1912 recorded with the relocation (in arelent.addend); when performing
1913 a partial link the relocation will be modified.
1914 All relocations for all ELF USE_RELA targets should set this field
1915 to FALSE (values of TRUE should be looked on with suspicion).
1916 However, the converse is not true: not all relocations of all ELF
1917 USE_REL targets set this field to TRUE. Why this is so is peculiar
1918 to each particular target. For relocs that aren't used in partial
1919 links (e.g. GOT stuff) it doesn't matter what this is set to. */
1873 boolean partial_inplace;
1920 bfd_boolean partial_inplace;
1874
1921
1875 /* The src_mask selects which parts of the read in data
1876 are to be used in the relocation sum. E.g., if this was an 8 bit
1877 byte of data which we read and relocated, this would be
1878 0x000000ff. When we have relocs which have an addend, such as
1879 sun4 extended relocs, the value in the offset part of a
1880 relocating field is garbage so we never use it. In this case
1881 the mask would be 0x00000000. */
1922 /* src_mask selects the part of the instruction (or data) to be used
1923 in the relocation sum. If the target relocations don't have an
1924 addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
1925 dst_mask to extract the addend from the section contents. If
1926 relocations do have an addend in the reloc, eg. ELF USE_RELA, this
1927 field should be zero. Non-zero values for ELF USE_RELA targets are
1928 bogus as in those cases the value in the dst_mask part of the
1929 section contents should be treated as garbage. */
1882 bfd_vma src_mask;
1883
1930 bfd_vma src_mask;
1931
1884 /* The dst_mask selects which parts of the instruction are replaced
1885 into the instruction. In most cases src_mask == dst_mask,
1886 except in the above special case, where dst_mask would be
1887 0x000000ff, and src_mask would be 0x00000000. */
1932 /* dst_mask selects which parts of the instruction (or data) are
1933 replaced with a relocated value. */
1888 bfd_vma dst_mask;
1889
1890 /* When some formats create PC relative instructions, they leave
1891 the value of the pc of the place being relocated in the offset
1892 slot of the instruction, so that a PC relative relocation can
1893 be made just by adding in an ordinary offset (e.g., sun3 a.out).
1894 Some formats leave the displacement part of an instruction
1895 empty (e.g., m88k bcs); this flag signals the fact. */
1934 bfd_vma dst_mask;
1935
1936 /* When some formats create PC relative instructions, they leave
1937 the value of the pc of the place being relocated in the offset
1938 slot of the instruction, so that a PC relative relocation can
1939 be made just by adding in an ordinary offset (e.g., sun3 a.out).
1940 Some formats leave the displacement part of an instruction
1941 empty (e.g., m88k bcs); this flag signals the fact. */
1896 boolean pcrel_offset;
1942 bfd_boolean pcrel_offset;
1897};
1898
1899#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
1900 { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC }
1901#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \
1902 HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \
1943};
1944
1945#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
1946 { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC }
1947#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \
1948 HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \
1903 NAME, false, 0, 0, IN)
1949 NAME, FALSE, 0, 0, IN)
1904
1905#define EMPTY_HOWTO(C) \
1950
1951#define EMPTY_HOWTO(C) \
1906 HOWTO ((C), 0, 0, 0, false, 0, complain_overflow_dont, NULL, \
1907 NULL, false, 0, 0, false)
1952 HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
1953 NULL, FALSE, 0, 0, FALSE)
1908
1909#define HOWTO_PREPARE(relocation, symbol) \
1910 { \
1954
1955#define HOWTO_PREPARE(relocation, symbol) \
1956 { \
1911 if (symbol != (asymbol *) NULL) \
1957 if (symbol != NULL) \
1912 { \
1913 if (bfd_is_com_section (symbol->section)) \
1914 { \
1915 relocation = 0; \
1916 } \
1917 else \
1918 { \
1919 relocation = symbol->value; \
1920 } \
1921 } \
1922 }
1923
1958 { \
1959 if (bfd_is_com_section (symbol->section)) \
1960 { \
1961 relocation = 0; \
1962 } \
1963 else \
1964 { \
1965 relocation = symbol->value; \
1966 } \
1967 } \
1968 }
1969
1924unsigned int
1925bfd_get_reloc_size PARAMS ((reloc_howto_type *));
1970unsigned int bfd_get_reloc_size (reloc_howto_type *);
1926
1927typedef struct relent_chain
1928{
1929 arelent relent;
1930 struct relent_chain *next;
1931}
1932arelent_chain;
1933
1971
1972typedef struct relent_chain
1973{
1974 arelent relent;
1975 struct relent_chain *next;
1976}
1977arelent_chain;
1978
1934bfd_reloc_status_type
1935bfd_check_overflow PARAMS ((enum complain_overflow how,
1979bfd_reloc_status_type bfd_check_overflow
1980 (enum complain_overflow how,
1936 unsigned int bitsize,
1937 unsigned int rightshift,
1938 unsigned int addrsize,
1981 unsigned int bitsize,
1982 unsigned int rightshift,
1983 unsigned int addrsize,
1939 bfd_vma relocation));
1984 bfd_vma relocation);
1940
1985
1941bfd_reloc_status_type
1942bfd_perform_relocation PARAMS ((bfd *abfd,
1986bfd_reloc_status_type bfd_perform_relocation
1987 (bfd *abfd,
1943 arelent *reloc_entry,
1988 arelent *reloc_entry,
1944 PTR data,
1989 void *data,
1945 asection *input_section,
1946 bfd *output_bfd,
1990 asection *input_section,
1991 bfd *output_bfd,
1947 char **error_message));
1992 char **error_message);
1948
1993
1949bfd_reloc_status_type
1950bfd_install_relocation PARAMS ((bfd *abfd,
1994bfd_reloc_status_type bfd_install_relocation
1995 (bfd *abfd,
1951 arelent *reloc_entry,
1996 arelent *reloc_entry,
1952 PTR data, bfd_vma data_start,
1997 void *data, bfd_vma data_start,
1953 asection *input_section,
1998 asection *input_section,
1954 char **error_message));
1999 char **error_message);
1955
1956enum bfd_reloc_code_real {
1957 _dummy_first_bfd_reloc_code_real,
1958
1959
1960/* Basic absolute relocations of N bits. */
1961 BFD_RELOC_64,
1962 BFD_RELOC_32,

--- 128 unchanged lines hidden (view full) ---

2091 BFD_RELOC_SPARC_H44,
2092 BFD_RELOC_SPARC_M44,
2093 BFD_RELOC_SPARC_L44,
2094 BFD_RELOC_SPARC_REGISTER,
2095
2096/* SPARC little endian relocation */
2097 BFD_RELOC_SPARC_REV32,
2098
2000
2001enum bfd_reloc_code_real {
2002 _dummy_first_bfd_reloc_code_real,
2003
2004
2005/* Basic absolute relocations of N bits. */
2006 BFD_RELOC_64,
2007 BFD_RELOC_32,

--- 128 unchanged lines hidden (view full) ---

2136 BFD_RELOC_SPARC_H44,
2137 BFD_RELOC_SPARC_M44,
2138 BFD_RELOC_SPARC_L44,
2139 BFD_RELOC_SPARC_REGISTER,
2140
2141/* SPARC little endian relocation */
2142 BFD_RELOC_SPARC_REV32,
2143
2144/* SPARC TLS relocations */
2145 BFD_RELOC_SPARC_TLS_GD_HI22,
2146 BFD_RELOC_SPARC_TLS_GD_LO10,
2147 BFD_RELOC_SPARC_TLS_GD_ADD,
2148 BFD_RELOC_SPARC_TLS_GD_CALL,
2149 BFD_RELOC_SPARC_TLS_LDM_HI22,
2150 BFD_RELOC_SPARC_TLS_LDM_LO10,
2151 BFD_RELOC_SPARC_TLS_LDM_ADD,
2152 BFD_RELOC_SPARC_TLS_LDM_CALL,
2153 BFD_RELOC_SPARC_TLS_LDO_HIX22,
2154 BFD_RELOC_SPARC_TLS_LDO_LOX10,
2155 BFD_RELOC_SPARC_TLS_LDO_ADD,
2156 BFD_RELOC_SPARC_TLS_IE_HI22,
2157 BFD_RELOC_SPARC_TLS_IE_LO10,
2158 BFD_RELOC_SPARC_TLS_IE_LD,
2159 BFD_RELOC_SPARC_TLS_IE_LDX,
2160 BFD_RELOC_SPARC_TLS_IE_ADD,
2161 BFD_RELOC_SPARC_TLS_LE_HIX22,
2162 BFD_RELOC_SPARC_TLS_LE_LOX10,
2163 BFD_RELOC_SPARC_TLS_DTPMOD32,
2164 BFD_RELOC_SPARC_TLS_DTPMOD64,
2165 BFD_RELOC_SPARC_TLS_DTPOFF32,
2166 BFD_RELOC_SPARC_TLS_DTPOFF64,
2167 BFD_RELOC_SPARC_TLS_TPOFF32,
2168 BFD_RELOC_SPARC_TLS_TPOFF64,
2169
2099/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
2100"addend" in some special way.
2101For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
2102writing; when reading, it will be the absolute section symbol. The
2103addend is the displacement in bytes of the "lda" instruction from
2104the "ldah" instruction (which is at the address of this reloc). */
2105 BFD_RELOC_ALPHA_GPDISP_HI16,
2106

--- 49 unchanged lines hidden (view full) ---

2156 BFD_RELOC_ALPHA_CODEADDR,
2157
2158/* The GPREL_HI/LO relocations together form a 32-bit offset from the
2159GP register. */
2160 BFD_RELOC_ALPHA_GPREL_HI16,
2161 BFD_RELOC_ALPHA_GPREL_LO16,
2162
2163/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
2170/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
2171"addend" in some special way.
2172For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
2173writing; when reading, it will be the absolute section symbol. The
2174addend is the displacement in bytes of the "lda" instruction from
2175the "ldah" instruction (which is at the address of this reloc). */
2176 BFD_RELOC_ALPHA_GPDISP_HI16,
2177

--- 49 unchanged lines hidden (view full) ---

2227 BFD_RELOC_ALPHA_CODEADDR,
2228
2229/* The GPREL_HI/LO relocations together form a 32-bit offset from the
2230GP register. */
2231 BFD_RELOC_ALPHA_GPREL_HI16,
2232 BFD_RELOC_ALPHA_GPREL_LO16,
2233
2234/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
2164share a common GP, and the target address is adjusted for
2235share a common GP, and the target address is adjusted for
2165STO_ALPHA_STD_GPLOAD. */
2166 BFD_RELOC_ALPHA_BRSGP,
2167
2168/* Alpha thread-local storage relocations. */
2169 BFD_RELOC_ALPHA_TLSGD,
2170 BFD_RELOC_ALPHA_TLSLDM,
2171 BFD_RELOC_ALPHA_DTPMOD64,
2172 BFD_RELOC_ALPHA_GOTDTPREL16,

--- 56 unchanged lines hidden (view full) ---

2229 BFD_RELOC_MIPS_DELETE,
2230 BFD_RELOC_MIPS_HIGHEST,
2231 BFD_RELOC_MIPS_HIGHER,
2232 BFD_RELOC_MIPS_SCN_DISP,
2233 BFD_RELOC_MIPS_REL16,
2234 BFD_RELOC_MIPS_RELGOT,
2235 BFD_RELOC_MIPS_JALR,
2236
2236STO_ALPHA_STD_GPLOAD. */
2237 BFD_RELOC_ALPHA_BRSGP,
2238
2239/* Alpha thread-local storage relocations. */
2240 BFD_RELOC_ALPHA_TLSGD,
2241 BFD_RELOC_ALPHA_TLSLDM,
2242 BFD_RELOC_ALPHA_DTPMOD64,
2243 BFD_RELOC_ALPHA_GOTDTPREL16,

--- 56 unchanged lines hidden (view full) ---

2300 BFD_RELOC_MIPS_DELETE,
2301 BFD_RELOC_MIPS_HIGHEST,
2302 BFD_RELOC_MIPS_HIGHER,
2303 BFD_RELOC_MIPS_SCN_DISP,
2304 BFD_RELOC_MIPS_REL16,
2305 BFD_RELOC_MIPS_RELGOT,
2306 BFD_RELOC_MIPS_JALR,
2307
2308
2237/* Fujitsu Frv Relocations. */
2238 BFD_RELOC_FRV_LABEL16,
2239 BFD_RELOC_FRV_LABEL24,
2240 BFD_RELOC_FRV_LO16,
2241 BFD_RELOC_FRV_HI16,
2242 BFD_RELOC_FRV_GPREL12,
2243 BFD_RELOC_FRV_GPRELU12,
2244 BFD_RELOC_FRV_GPREL32,
2245 BFD_RELOC_FRV_GPRELHI,
2246 BFD_RELOC_FRV_GPRELLO,
2309/* Fujitsu Frv Relocations. */
2310 BFD_RELOC_FRV_LABEL16,
2311 BFD_RELOC_FRV_LABEL24,
2312 BFD_RELOC_FRV_LO16,
2313 BFD_RELOC_FRV_HI16,
2314 BFD_RELOC_FRV_GPREL12,
2315 BFD_RELOC_FRV_GPRELU12,
2316 BFD_RELOC_FRV_GPREL32,
2317 BFD_RELOC_FRV_GPRELHI,
2318 BFD_RELOC_FRV_GPRELLO,
2319 BFD_RELOC_FRV_GOT12,
2320 BFD_RELOC_FRV_GOTHI,
2321 BFD_RELOC_FRV_GOTLO,
2322 BFD_RELOC_FRV_FUNCDESC,
2323 BFD_RELOC_FRV_FUNCDESC_GOT12,
2324 BFD_RELOC_FRV_FUNCDESC_GOTHI,
2325 BFD_RELOC_FRV_FUNCDESC_GOTLO,
2326 BFD_RELOC_FRV_FUNCDESC_VALUE,
2327 BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
2328 BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
2329 BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
2330 BFD_RELOC_FRV_GOTOFF12,
2331 BFD_RELOC_FRV_GOTOFFHI,
2332 BFD_RELOC_FRV_GOTOFFLO,
2247
2248
2333
2334
2335/* This is a 24bit GOT-relative reloc for the mn10300. */
2336 BFD_RELOC_MN10300_GOTOFF24,
2337
2338/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
2339in the instruction. */
2340 BFD_RELOC_MN10300_GOT32,
2341
2342/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
2343in the instruction. */
2344 BFD_RELOC_MN10300_GOT24,
2345
2346/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
2347in the instruction. */
2348 BFD_RELOC_MN10300_GOT16,
2349
2350/* Copy symbol at runtime. */
2351 BFD_RELOC_MN10300_COPY,
2352
2353/* Create GOT entry. */
2354 BFD_RELOC_MN10300_GLOB_DAT,
2355
2356/* Create PLT entry. */
2357 BFD_RELOC_MN10300_JMP_SLOT,
2358
2359/* Adjust by program base. */
2360 BFD_RELOC_MN10300_RELATIVE,
2361
2362
2249/* i386/elf relocations */
2250 BFD_RELOC_386_GOT32,
2251 BFD_RELOC_386_PLT32,
2252 BFD_RELOC_386_COPY,
2253 BFD_RELOC_386_GLOB_DAT,
2254 BFD_RELOC_386_JUMP_SLOT,
2255 BFD_RELOC_386_RELATIVE,
2256 BFD_RELOC_386_GOTOFF,

--- 15 unchanged lines hidden (view full) ---

2272 BFD_RELOC_X86_64_GOT32,
2273 BFD_RELOC_X86_64_PLT32,
2274 BFD_RELOC_X86_64_COPY,
2275 BFD_RELOC_X86_64_GLOB_DAT,
2276 BFD_RELOC_X86_64_JUMP_SLOT,
2277 BFD_RELOC_X86_64_RELATIVE,
2278 BFD_RELOC_X86_64_GOTPCREL,
2279 BFD_RELOC_X86_64_32S,
2363/* i386/elf relocations */
2364 BFD_RELOC_386_GOT32,
2365 BFD_RELOC_386_PLT32,
2366 BFD_RELOC_386_COPY,
2367 BFD_RELOC_386_GLOB_DAT,
2368 BFD_RELOC_386_JUMP_SLOT,
2369 BFD_RELOC_386_RELATIVE,
2370 BFD_RELOC_386_GOTOFF,

--- 15 unchanged lines hidden (view full) ---

2386 BFD_RELOC_X86_64_GOT32,
2387 BFD_RELOC_X86_64_PLT32,
2388 BFD_RELOC_X86_64_COPY,
2389 BFD_RELOC_X86_64_GLOB_DAT,
2390 BFD_RELOC_X86_64_JUMP_SLOT,
2391 BFD_RELOC_X86_64_RELATIVE,
2392 BFD_RELOC_X86_64_GOTPCREL,
2393 BFD_RELOC_X86_64_32S,
2394 BFD_RELOC_X86_64_DTPMOD64,
2395 BFD_RELOC_X86_64_DTPOFF64,
2396 BFD_RELOC_X86_64_TPOFF64,
2397 BFD_RELOC_X86_64_TLSGD,
2398 BFD_RELOC_X86_64_TLSLD,
2399 BFD_RELOC_X86_64_DTPOFF32,
2400 BFD_RELOC_X86_64_GOTTPOFF,
2401 BFD_RELOC_X86_64_TPOFF32,
2280
2281/* ns32k relocations */
2282 BFD_RELOC_NS32K_IMM_8,
2283 BFD_RELOC_NS32K_IMM_16,
2284 BFD_RELOC_NS32K_IMM_32,
2285 BFD_RELOC_NS32K_IMM_8_PCREL,
2286 BFD_RELOC_NS32K_IMM_16_PCREL,
2287 BFD_RELOC_NS32K_IMM_32_PCREL,

--- 66 unchanged lines hidden (view full) ---

2354 BFD_RELOC_PPC64_PLT16_LO_DS,
2355 BFD_RELOC_PPC64_SECTOFF_DS,
2356 BFD_RELOC_PPC64_SECTOFF_LO_DS,
2357 BFD_RELOC_PPC64_TOC16_DS,
2358 BFD_RELOC_PPC64_TOC16_LO_DS,
2359 BFD_RELOC_PPC64_PLTGOT16_DS,
2360 BFD_RELOC_PPC64_PLTGOT16_LO_DS,
2361
2402
2403/* ns32k relocations */
2404 BFD_RELOC_NS32K_IMM_8,
2405 BFD_RELOC_NS32K_IMM_16,
2406 BFD_RELOC_NS32K_IMM_32,
2407 BFD_RELOC_NS32K_IMM_8_PCREL,
2408 BFD_RELOC_NS32K_IMM_16_PCREL,
2409 BFD_RELOC_NS32K_IMM_32_PCREL,

--- 66 unchanged lines hidden (view full) ---

2476 BFD_RELOC_PPC64_PLT16_LO_DS,
2477 BFD_RELOC_PPC64_SECTOFF_DS,
2478 BFD_RELOC_PPC64_SECTOFF_LO_DS,
2479 BFD_RELOC_PPC64_TOC16_DS,
2480 BFD_RELOC_PPC64_TOC16_LO_DS,
2481 BFD_RELOC_PPC64_PLTGOT16_DS,
2482 BFD_RELOC_PPC64_PLTGOT16_LO_DS,
2483
2484/* PowerPC and PowerPC64 thread-local storage relocations. */
2485 BFD_RELOC_PPC_TLS,
2486 BFD_RELOC_PPC_DTPMOD,
2487 BFD_RELOC_PPC_TPREL16,
2488 BFD_RELOC_PPC_TPREL16_LO,
2489 BFD_RELOC_PPC_TPREL16_HI,
2490 BFD_RELOC_PPC_TPREL16_HA,
2491 BFD_RELOC_PPC_TPREL,
2492 BFD_RELOC_PPC_DTPREL16,
2493 BFD_RELOC_PPC_DTPREL16_LO,
2494 BFD_RELOC_PPC_DTPREL16_HI,
2495 BFD_RELOC_PPC_DTPREL16_HA,
2496 BFD_RELOC_PPC_DTPREL,
2497 BFD_RELOC_PPC_GOT_TLSGD16,
2498 BFD_RELOC_PPC_GOT_TLSGD16_LO,
2499 BFD_RELOC_PPC_GOT_TLSGD16_HI,
2500 BFD_RELOC_PPC_GOT_TLSGD16_HA,
2501 BFD_RELOC_PPC_GOT_TLSLD16,
2502 BFD_RELOC_PPC_GOT_TLSLD16_LO,
2503 BFD_RELOC_PPC_GOT_TLSLD16_HI,
2504 BFD_RELOC_PPC_GOT_TLSLD16_HA,
2505 BFD_RELOC_PPC_GOT_TPREL16,
2506 BFD_RELOC_PPC_GOT_TPREL16_LO,
2507 BFD_RELOC_PPC_GOT_TPREL16_HI,
2508 BFD_RELOC_PPC_GOT_TPREL16_HA,
2509 BFD_RELOC_PPC_GOT_DTPREL16,
2510 BFD_RELOC_PPC_GOT_DTPREL16_LO,
2511 BFD_RELOC_PPC_GOT_DTPREL16_HI,
2512 BFD_RELOC_PPC_GOT_DTPREL16_HA,
2513 BFD_RELOC_PPC64_TPREL16_DS,
2514 BFD_RELOC_PPC64_TPREL16_LO_DS,
2515 BFD_RELOC_PPC64_TPREL16_HIGHER,
2516 BFD_RELOC_PPC64_TPREL16_HIGHERA,
2517 BFD_RELOC_PPC64_TPREL16_HIGHEST,
2518 BFD_RELOC_PPC64_TPREL16_HIGHESTA,
2519 BFD_RELOC_PPC64_DTPREL16_DS,
2520 BFD_RELOC_PPC64_DTPREL16_LO_DS,
2521 BFD_RELOC_PPC64_DTPREL16_HIGHER,
2522 BFD_RELOC_PPC64_DTPREL16_HIGHERA,
2523 BFD_RELOC_PPC64_DTPREL16_HIGHEST,
2524 BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
2525
2362/* IBM 370/390 relocations */
2363 BFD_RELOC_I370_D12,
2364
2526/* IBM 370/390 relocations */
2527 BFD_RELOC_I370_D12,
2528
2365/* The type of reloc used to build a contructor table - at the moment
2529/* The type of reloc used to build a constructor table - at the moment
2366probably a 32 bit wide absolute relocation, but the target can choose.
2367It generally does map to one of the other relocation types. */
2368 BFD_RELOC_CTOR,
2369
2370/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
2371not stored in the instruction. */
2372 BFD_RELOC_ARM_PCREL_BRANCH,
2373

--- 11 unchanged lines hidden (view full) ---

2385(at present) written to any object files. */
2386 BFD_RELOC_ARM_IMMEDIATE,
2387 BFD_RELOC_ARM_ADRL_IMMEDIATE,
2388 BFD_RELOC_ARM_OFFSET_IMM,
2389 BFD_RELOC_ARM_SHIFT_IMM,
2390 BFD_RELOC_ARM_SWI,
2391 BFD_RELOC_ARM_MULTI,
2392 BFD_RELOC_ARM_CP_OFF_IMM,
2530probably a 32 bit wide absolute relocation, but the target can choose.
2531It generally does map to one of the other relocation types. */
2532 BFD_RELOC_CTOR,
2533
2534/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are
2535not stored in the instruction. */
2536 BFD_RELOC_ARM_PCREL_BRANCH,
2537

--- 11 unchanged lines hidden (view full) ---

2549(at present) written to any object files. */
2550 BFD_RELOC_ARM_IMMEDIATE,
2551 BFD_RELOC_ARM_ADRL_IMMEDIATE,
2552 BFD_RELOC_ARM_OFFSET_IMM,
2553 BFD_RELOC_ARM_SHIFT_IMM,
2554 BFD_RELOC_ARM_SWI,
2555 BFD_RELOC_ARM_MULTI,
2556 BFD_RELOC_ARM_CP_OFF_IMM,
2557 BFD_RELOC_ARM_CP_OFF_IMM_S2,
2393 BFD_RELOC_ARM_ADR_IMM,
2394 BFD_RELOC_ARM_LDR_IMM,
2395 BFD_RELOC_ARM_LITERAL,
2396 BFD_RELOC_ARM_IN_POOL,
2397 BFD_RELOC_ARM_OFFSET_IMM8,
2398 BFD_RELOC_ARM_HWLITERAL,
2399 BFD_RELOC_ARM_THUMB_ADD,
2400 BFD_RELOC_ARM_THUMB_IMM,

--- 4 unchanged lines hidden (view full) ---

2405 BFD_RELOC_ARM_JUMP_SLOT,
2406 BFD_RELOC_ARM_COPY,
2407 BFD_RELOC_ARM_GLOB_DAT,
2408 BFD_RELOC_ARM_PLT32,
2409 BFD_RELOC_ARM_RELATIVE,
2410 BFD_RELOC_ARM_GOTOFF,
2411 BFD_RELOC_ARM_GOTPC,
2412
2558 BFD_RELOC_ARM_ADR_IMM,
2559 BFD_RELOC_ARM_LDR_IMM,
2560 BFD_RELOC_ARM_LITERAL,
2561 BFD_RELOC_ARM_IN_POOL,
2562 BFD_RELOC_ARM_OFFSET_IMM8,
2563 BFD_RELOC_ARM_HWLITERAL,
2564 BFD_RELOC_ARM_THUMB_ADD,
2565 BFD_RELOC_ARM_THUMB_IMM,

--- 4 unchanged lines hidden (view full) ---

2570 BFD_RELOC_ARM_JUMP_SLOT,
2571 BFD_RELOC_ARM_COPY,
2572 BFD_RELOC_ARM_GLOB_DAT,
2573 BFD_RELOC_ARM_PLT32,
2574 BFD_RELOC_ARM_RELATIVE,
2575 BFD_RELOC_ARM_GOTOFF,
2576 BFD_RELOC_ARM_GOTPC,
2577
2413/* Hitachi SH relocs. Not all of these appear in object files. */
2578/* Renesas / SuperH SH relocs. Not all of these appear in object files. */
2414 BFD_RELOC_SH_PCDISP8BY2,
2415 BFD_RELOC_SH_PCDISP12BY2,
2416 BFD_RELOC_SH_IMM4,
2417 BFD_RELOC_SH_IMM4BY2,
2418 BFD_RELOC_SH_IMM4BY4,
2419 BFD_RELOC_SH_IMM8,
2420 BFD_RELOC_SH_IMM8BY2,
2421 BFD_RELOC_SH_IMM8BY4,

--- 58 unchanged lines hidden (view full) ---

2480 BFD_RELOC_SH_IMM_LOW16_PCREL,
2481 BFD_RELOC_SH_IMM_MEDLOW16,
2482 BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
2483 BFD_RELOC_SH_IMM_MEDHI16,
2484 BFD_RELOC_SH_IMM_MEDHI16_PCREL,
2485 BFD_RELOC_SH_IMM_HI16,
2486 BFD_RELOC_SH_IMM_HI16_PCREL,
2487 BFD_RELOC_SH_PT_16,
2579 BFD_RELOC_SH_PCDISP8BY2,
2580 BFD_RELOC_SH_PCDISP12BY2,
2581 BFD_RELOC_SH_IMM4,
2582 BFD_RELOC_SH_IMM4BY2,
2583 BFD_RELOC_SH_IMM4BY4,
2584 BFD_RELOC_SH_IMM8,
2585 BFD_RELOC_SH_IMM8BY2,
2586 BFD_RELOC_SH_IMM8BY4,

--- 58 unchanged lines hidden (view full) ---

2645 BFD_RELOC_SH_IMM_LOW16_PCREL,
2646 BFD_RELOC_SH_IMM_MEDLOW16,
2647 BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
2648 BFD_RELOC_SH_IMM_MEDHI16,
2649 BFD_RELOC_SH_IMM_MEDHI16_PCREL,
2650 BFD_RELOC_SH_IMM_HI16,
2651 BFD_RELOC_SH_IMM_HI16_PCREL,
2652 BFD_RELOC_SH_PT_16,
2653 BFD_RELOC_SH_TLS_GD_32,
2654 BFD_RELOC_SH_TLS_LD_32,
2655 BFD_RELOC_SH_TLS_LDO_32,
2656 BFD_RELOC_SH_TLS_IE_32,
2657 BFD_RELOC_SH_TLS_LE_32,
2658 BFD_RELOC_SH_TLS_DTPMOD32,
2659 BFD_RELOC_SH_TLS_DTPOFF32,
2660 BFD_RELOC_SH_TLS_TPOFF32,
2488
2489/* Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must
2490be zero and is not stored in the instruction. */
2491 BFD_RELOC_THUMB_PCREL_BRANCH9,
2492 BFD_RELOC_THUMB_PCREL_BRANCH12,
2493 BFD_RELOC_THUMB_PCREL_BRANCH23,
2494
2495/* ARC Cores relocs.

--- 79 unchanged lines hidden (view full) ---

2575 BFD_RELOC_DLX_HI16_S,
2576
2577/* DLX relocs */
2578 BFD_RELOC_DLX_LO16,
2579
2580/* DLX relocs */
2581 BFD_RELOC_DLX_JMP26,
2582
2661
2662/* Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must
2663be zero and is not stored in the instruction. */
2664 BFD_RELOC_THUMB_PCREL_BRANCH9,
2665 BFD_RELOC_THUMB_PCREL_BRANCH12,
2666 BFD_RELOC_THUMB_PCREL_BRANCH23,
2667
2668/* ARC Cores relocs.

--- 79 unchanged lines hidden (view full) ---

2748 BFD_RELOC_DLX_HI16_S,
2749
2750/* DLX relocs */
2751 BFD_RELOC_DLX_LO16,
2752
2753/* DLX relocs */
2754 BFD_RELOC_DLX_JMP26,
2755
2583/* Mitsubishi M32R relocs.
2756/* Renesas M32R (formerly Mitsubishi M32R) relocs.
2584This is a 24 bit absolute address. */
2585 BFD_RELOC_M32R_24,
2586
2587/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
2588 BFD_RELOC_M32R_10_PCREL,
2589
2590/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
2591 BFD_RELOC_M32R_18_PCREL,

--- 11 unchanged lines hidden (view full) ---

2603
2604/* This is a 16-bit reloc containing the lower 16 bits of an address. */
2605 BFD_RELOC_M32R_LO16,
2606
2607/* This is a 16-bit reloc containing the small data area offset for use in
2608add3, load, and store instructions. */
2609 BFD_RELOC_M32R_SDA16,
2610
2757This is a 24 bit absolute address. */
2758 BFD_RELOC_M32R_24,
2759
2760/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */
2761 BFD_RELOC_M32R_10_PCREL,
2762
2763/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */
2764 BFD_RELOC_M32R_18_PCREL,

--- 11 unchanged lines hidden (view full) ---

2776
2777/* This is a 16-bit reloc containing the lower 16 bits of an address. */
2778 BFD_RELOC_M32R_LO16,
2779
2780/* This is a 16-bit reloc containing the small data area offset for use in
2781add3, load, and store instructions. */
2782 BFD_RELOC_M32R_SDA16,
2783
2784/* For PIC. */
2785 BFD_RELOC_M32R_GOT24,
2786 BFD_RELOC_M32R_26_PLTREL,
2787 BFD_RELOC_M32R_COPY,
2788 BFD_RELOC_M32R_GLOB_DAT,
2789 BFD_RELOC_M32R_JMP_SLOT,
2790 BFD_RELOC_M32R_RELATIVE,
2791 BFD_RELOC_M32R_GOTOFF,
2792 BFD_RELOC_M32R_GOTPC24,
2793 BFD_RELOC_M32R_GOT16_HI_ULO,
2794 BFD_RELOC_M32R_GOT16_HI_SLO,
2795 BFD_RELOC_M32R_GOT16_LO,
2796 BFD_RELOC_M32R_GOTPC_HI_ULO,
2797 BFD_RELOC_M32R_GOTPC_HI_SLO,
2798 BFD_RELOC_M32R_GOTPC_LO,
2799
2611/* This is a 9-bit reloc */
2612 BFD_RELOC_V850_9_PCREL,
2613
2614/* This is a 22-bit reloc */
2615 BFD_RELOC_V850_22_PCREL,
2616
2617/* This is a 16 bit offset from the short data area pointer. */
2618 BFD_RELOC_V850_SDA_16_16_OFFSET,

--- 26 unchanged lines hidden (view full) ---

2645/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
2646data area pointer. */
2647 BFD_RELOC_V850_TDA_4_5_OFFSET,
2648
2649/* This is a 4 bit offset from the tiny data area pointer. */
2650 BFD_RELOC_V850_TDA_4_4_OFFSET,
2651
2652/* This is a 16 bit offset from the short data area pointer, with the
2800/* This is a 9-bit reloc */
2801 BFD_RELOC_V850_9_PCREL,
2802
2803/* This is a 22-bit reloc */
2804 BFD_RELOC_V850_22_PCREL,
2805
2806/* This is a 16 bit offset from the short data area pointer. */
2807 BFD_RELOC_V850_SDA_16_16_OFFSET,

--- 26 unchanged lines hidden (view full) ---

2834/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
2835data area pointer. */
2836 BFD_RELOC_V850_TDA_4_5_OFFSET,
2837
2838/* This is a 4 bit offset from the tiny data area pointer. */
2839 BFD_RELOC_V850_TDA_4_4_OFFSET,
2840
2841/* This is a 16 bit offset from the short data area pointer, with the
2653bits placed non-contigously in the instruction. */
2842bits placed non-contiguously in the instruction. */
2654 BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
2655
2656/* This is a 16 bit offset from the zero data area pointer, with the
2843 BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
2844
2845/* This is a 16 bit offset from the zero data area pointer, with the
2657bits placed non-contigously in the instruction. */
2846bits placed non-contiguously in the instruction. */
2658 BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
2659
2660/* This is a 6 bit offset from the call table base pointer. */
2661 BFD_RELOC_V850_CALLT_6_7_OFFSET,
2662
2663/* This is a 16 bit offset from the call table base pointer. */
2664 BFD_RELOC_V850_CALLT_16_16_OFFSET,
2665
2847 BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
2848
2849/* This is a 6 bit offset from the call table base pointer. */
2850 BFD_RELOC_V850_CALLT_6_7_OFFSET,
2851
2852/* This is a 16 bit offset from the call table base pointer. */
2853 BFD_RELOC_V850_CALLT_16_16_OFFSET,
2854
2855/* Used for relaxing indirect function calls. */
2856 BFD_RELOC_V850_LONGCALL,
2666
2857
2858/* Used for relaxing indirect jumps. */
2859 BFD_RELOC_V850_LONGJUMP,
2860
2861/* Used to maintain alignment whilst relaxing. */
2862 BFD_RELOC_V850_ALIGN,
2863
2667/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
2668instruction. */
2669 BFD_RELOC_MN10300_32_PCREL,
2670
2671/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
2672instruction. */
2673 BFD_RELOC_MN10300_16_PCREL,
2674

--- 77 unchanged lines hidden (view full) ---

2752 BFD_RELOC_MMIX_CBRANCH_2,
2753 BFD_RELOC_MMIX_CBRANCH_3,
2754
2755/* These are relocations for the PUSHJ instruction. */
2756 BFD_RELOC_MMIX_PUSHJ,
2757 BFD_RELOC_MMIX_PUSHJ_1,
2758 BFD_RELOC_MMIX_PUSHJ_2,
2759 BFD_RELOC_MMIX_PUSHJ_3,
2864/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
2865instruction. */
2866 BFD_RELOC_MN10300_32_PCREL,
2867
2868/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
2869instruction. */
2870 BFD_RELOC_MN10300_16_PCREL,
2871

--- 77 unchanged lines hidden (view full) ---

2949 BFD_RELOC_MMIX_CBRANCH_2,
2950 BFD_RELOC_MMIX_CBRANCH_3,
2951
2952/* These are relocations for the PUSHJ instruction. */
2953 BFD_RELOC_MMIX_PUSHJ,
2954 BFD_RELOC_MMIX_PUSHJ_1,
2955 BFD_RELOC_MMIX_PUSHJ_2,
2956 BFD_RELOC_MMIX_PUSHJ_3,
2957 BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
2760
2761/* These are relocations for the JMP instruction. */
2762 BFD_RELOC_MMIX_JMP,
2763 BFD_RELOC_MMIX_JMP_1,
2764 BFD_RELOC_MMIX_JMP_2,
2765 BFD_RELOC_MMIX_JMP_3,
2766
2767/* This is a relocation for a relative address as in a GETA instruction or

--- 133 unchanged lines hidden (view full) ---

2901 BFD_RELOC_390_GOT64,
2902
2903/* 64 bit PC relative PLT address. */
2904 BFD_RELOC_390_PLT64,
2905
2906/* 32 bit rel. offset to GOT entry. */
2907 BFD_RELOC_390_GOTENT,
2908
2958
2959/* These are relocations for the JMP instruction. */
2960 BFD_RELOC_MMIX_JMP,
2961 BFD_RELOC_MMIX_JMP_1,
2962 BFD_RELOC_MMIX_JMP_2,
2963 BFD_RELOC_MMIX_JMP_3,
2964
2965/* This is a relocation for a relative address as in a GETA instruction or

--- 133 unchanged lines hidden (view full) ---

3099 BFD_RELOC_390_GOT64,
3100
3101/* 64 bit PC relative PLT address. */
3102 BFD_RELOC_390_PLT64,
3103
3104/* 32 bit rel. offset to GOT entry. */
3105 BFD_RELOC_390_GOTENT,
3106
3107/* 64 bit offset to GOT. */
3108 BFD_RELOC_390_GOTOFF64,
3109
3110/* 12-bit offset to symbol-entry within GOT, with PLT handling. */
3111 BFD_RELOC_390_GOTPLT12,
3112
3113/* 16-bit offset to symbol-entry within GOT, with PLT handling. */
3114 BFD_RELOC_390_GOTPLT16,
3115
3116/* 32-bit offset to symbol-entry within GOT, with PLT handling. */
3117 BFD_RELOC_390_GOTPLT32,
3118
3119/* 64-bit offset to symbol-entry within GOT, with PLT handling. */
3120 BFD_RELOC_390_GOTPLT64,
3121
3122/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */
3123 BFD_RELOC_390_GOTPLTENT,
3124
3125/* 16-bit rel. offset from the GOT to a PLT entry. */
3126 BFD_RELOC_390_PLTOFF16,
3127
3128/* 32-bit rel. offset from the GOT to a PLT entry. */
3129 BFD_RELOC_390_PLTOFF32,
3130
3131/* 64-bit rel. offset from the GOT to a PLT entry. */
3132 BFD_RELOC_390_PLTOFF64,
3133
3134/* s390 tls relocations. */
3135 BFD_RELOC_390_TLS_LOAD,
3136 BFD_RELOC_390_TLS_GDCALL,
3137 BFD_RELOC_390_TLS_LDCALL,
3138 BFD_RELOC_390_TLS_GD32,
3139 BFD_RELOC_390_TLS_GD64,
3140 BFD_RELOC_390_TLS_GOTIE12,
3141 BFD_RELOC_390_TLS_GOTIE32,
3142 BFD_RELOC_390_TLS_GOTIE64,
3143 BFD_RELOC_390_TLS_LDM32,
3144 BFD_RELOC_390_TLS_LDM64,
3145 BFD_RELOC_390_TLS_IE32,
3146 BFD_RELOC_390_TLS_IE64,
3147 BFD_RELOC_390_TLS_IEENT,
3148 BFD_RELOC_390_TLS_LE32,
3149 BFD_RELOC_390_TLS_LE64,
3150 BFD_RELOC_390_TLS_LDO32,
3151 BFD_RELOC_390_TLS_LDO64,
3152 BFD_RELOC_390_TLS_DTPMOD,
3153 BFD_RELOC_390_TLS_DTPOFF,
3154 BFD_RELOC_390_TLS_TPOFF,
3155
3156/* Long displacement extension. */
3157 BFD_RELOC_390_20,
3158 BFD_RELOC_390_GOT20,
3159 BFD_RELOC_390_GOTPLT20,
3160 BFD_RELOC_390_TLS_GOTIE20,
3161
3162/* Scenix IP2K - 9-bit register number / data address */
3163 BFD_RELOC_IP2K_FR9,
3164
3165/* Scenix IP2K - 4-bit register/data bank number */
3166 BFD_RELOC_IP2K_BANK,
3167
3168/* Scenix IP2K - low 13 bits of instruction word address */
3169 BFD_RELOC_IP2K_ADDR16CJP,
3170
3171/* Scenix IP2K - high 3 bits of instruction word address */
3172 BFD_RELOC_IP2K_PAGE3,
3173
3174/* Scenix IP2K - ext/low/high 8 bits of data address */
3175 BFD_RELOC_IP2K_LO8DATA,
3176 BFD_RELOC_IP2K_HI8DATA,
3177 BFD_RELOC_IP2K_EX8DATA,
3178
3179/* Scenix IP2K - low/high 8 bits of instruction word address */
3180 BFD_RELOC_IP2K_LO8INSN,
3181 BFD_RELOC_IP2K_HI8INSN,
3182
3183/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */
3184 BFD_RELOC_IP2K_PC_SKIP,
3185
3186/* Scenix IP2K - 16 bit word address in text section. */
3187 BFD_RELOC_IP2K_TEXT,
3188
3189/* Scenix IP2K - 7-bit sp or dp offset */
3190 BFD_RELOC_IP2K_FR_OFFSET,
3191
3192/* Scenix VPE4K coprocessor - data/insn-space addressing */
3193 BFD_RELOC_VPE4KMATH_DATA,
3194 BFD_RELOC_VPE4KMATH_INSN,
3195
2909/* These two relocations are used by the linker to determine which of
2910the entries in a C++ virtual function table are actually used. When
2911the --gc-sections option is given, the linker will zero out the entries
2912that are not used, so that the code for those functions need not be
2913included in the output.
2914
2915VTABLE_INHERIT is a zero-space relocation used to describe to the
3196/* These two relocations are used by the linker to determine which of
3197the entries in a C++ virtual function table are actually used. When
3198the --gc-sections option is given, the linker will zero out the entries
3199that are not used, so that the code for those functions need not be
3200included in the output.
3201
3202VTABLE_INHERIT is a zero-space relocation used to describe to the
2916linker the inheritence tree of a C++ virtual function table. The
3203linker the inheritance tree of a C++ virtual function table. The
2917relocation's symbol should be the parent class' vtable, and the
2918relocation should be located at the child vtable.
2919
2920VTABLE_ENTRY is a zero-space relocation that describes the use of a
2921virtual function table entry. The reloc's symbol should refer to the
2922table of the class mentioned in the code. Off of that base, an offset
2923describes the entry that is being used. For Rela hosts, this offset
2924is stored in the reloc's addend. For Rel hosts, we are forced to put

--- 78 unchanged lines hidden (view full) ---

3003 BFD_RELOC_IA64_DTPREL64I,
3004 BFD_RELOC_IA64_DTPREL32MSB,
3005 BFD_RELOC_IA64_DTPREL32LSB,
3006 BFD_RELOC_IA64_DTPREL64MSB,
3007 BFD_RELOC_IA64_DTPREL64LSB,
3008 BFD_RELOC_IA64_LTOFF_DTPREL22,
3009
3010/* Motorola 68HC11 reloc.
3204relocation's symbol should be the parent class' vtable, and the
3205relocation should be located at the child vtable.
3206
3207VTABLE_ENTRY is a zero-space relocation that describes the use of a
3208virtual function table entry. The reloc's symbol should refer to the
3209table of the class mentioned in the code. Off of that base, an offset
3210describes the entry that is being used. For Rela hosts, this offset
3211is stored in the reloc's addend. For Rel hosts, we are forced to put

--- 78 unchanged lines hidden (view full) ---

3290 BFD_RELOC_IA64_DTPREL64I,
3291 BFD_RELOC_IA64_DTPREL32MSB,
3292 BFD_RELOC_IA64_DTPREL32LSB,
3293 BFD_RELOC_IA64_DTPREL64MSB,
3294 BFD_RELOC_IA64_DTPREL64LSB,
3295 BFD_RELOC_IA64_LTOFF_DTPREL22,
3296
3297/* Motorola 68HC11 reloc.
3011This is the 8 bits high part of an absolute address. */
3298This is the 8 bit high part of an absolute address. */
3012 BFD_RELOC_M68HC11_HI8,
3013
3014/* Motorola 68HC11 reloc.
3299 BFD_RELOC_M68HC11_HI8,
3300
3301/* Motorola 68HC11 reloc.
3015This is the 8 bits low part of an absolute address. */
3302This is the 8 bit low part of an absolute address. */
3016 BFD_RELOC_M68HC11_LO8,
3017
3018/* Motorola 68HC11 reloc.
3303 BFD_RELOC_M68HC11_LO8,
3304
3305/* Motorola 68HC11 reloc.
3019This is the 3 bits of a value. */
3306This is the 3 bit of a value. */
3020 BFD_RELOC_M68HC11_3B,
3021
3307 BFD_RELOC_M68HC11_3B,
3308
3309/* Motorola 68HC11 reloc.
3310This reloc marks the beginning of a jump/call instruction.
3311It is used for linker relaxation to correctly identify beginning
3312of instruction and change some branches to use PC-relative
3313addressing mode. */
3314 BFD_RELOC_M68HC11_RL_JUMP,
3315
3316/* Motorola 68HC11 reloc.
3317This reloc marks a group of several instructions that gcc generates
3318and for which the linker relaxation pass can modify and/or remove
3319some of them. */
3320 BFD_RELOC_M68HC11_RL_GROUP,
3321
3322/* Motorola 68HC11 reloc.
3323This is the 16-bit lower part of an address. It is used for 'call'
3324instruction to specify the symbol address without any special
3325transformation (due to memory bank window). */
3326 BFD_RELOC_M68HC11_LO16,
3327
3328/* Motorola 68HC11 reloc.
3329This is a 8-bit reloc that specifies the page number of an address.
3330It is used by 'call' instruction to specify the page number of
3331the symbol. */
3332 BFD_RELOC_M68HC11_PAGE,
3333
3334/* Motorola 68HC11 reloc.
3335This is a 24-bit reloc that represents the address with a 16-bit
3336value and a 8-bit page number. The symbol address is transformed
3337to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */
3338 BFD_RELOC_M68HC11_24,
3339
3340/* Motorola 68HC12 reloc.
3341This is the 5 bits of a value. */
3342 BFD_RELOC_M68HC12_5B,
3343
3022/* These relocs are only used within the CRIS assembler. They are not
3023(at present) written to any object files. */
3024 BFD_RELOC_CRIS_BDISP8,
3025 BFD_RELOC_CRIS_UNSIGNED_5,
3026 BFD_RELOC_CRIS_SIGNED_6,
3027 BFD_RELOC_CRIS_UNSIGNED_6,
3028 BFD_RELOC_CRIS_UNSIGNED_4,
3029

--- 66 unchanged lines hidden (view full) ---

3096 BFD_RELOC_H8_DIR16A8,
3097 BFD_RELOC_H8_DIR16R8,
3098 BFD_RELOC_H8_DIR24A8,
3099 BFD_RELOC_H8_DIR24R8,
3100 BFD_RELOC_H8_DIR32A16,
3101
3102/* Sony Xstormy16 Relocations. */
3103 BFD_RELOC_XSTORMY16_REL_12,
3344/* These relocs are only used within the CRIS assembler. They are not
3345(at present) written to any object files. */
3346 BFD_RELOC_CRIS_BDISP8,
3347 BFD_RELOC_CRIS_UNSIGNED_5,
3348 BFD_RELOC_CRIS_SIGNED_6,
3349 BFD_RELOC_CRIS_UNSIGNED_6,
3350 BFD_RELOC_CRIS_UNSIGNED_4,
3351

--- 66 unchanged lines hidden (view full) ---

3418 BFD_RELOC_H8_DIR16A8,
3419 BFD_RELOC_H8_DIR16R8,
3420 BFD_RELOC_H8_DIR24A8,
3421 BFD_RELOC_H8_DIR24R8,
3422 BFD_RELOC_H8_DIR32A16,
3423
3424/* Sony Xstormy16 Relocations. */
3425 BFD_RELOC_XSTORMY16_REL_12,
3426 BFD_RELOC_XSTORMY16_12,
3104 BFD_RELOC_XSTORMY16_24,
3105 BFD_RELOC_XSTORMY16_FPTR16,
3106
3107/* Relocations used by VAX ELF. */
3108 BFD_RELOC_VAX_GLOB_DAT,
3109 BFD_RELOC_VAX_JMP_SLOT,
3110 BFD_RELOC_VAX_RELATIVE,
3427 BFD_RELOC_XSTORMY16_24,
3428 BFD_RELOC_XSTORMY16_FPTR16,
3429
3430/* Relocations used by VAX ELF. */
3431 BFD_RELOC_VAX_GLOB_DAT,
3432 BFD_RELOC_VAX_JMP_SLOT,
3433 BFD_RELOC_VAX_RELATIVE,
3434
3435/* msp430 specific relocation codes */
3436 BFD_RELOC_MSP430_10_PCREL,
3437 BFD_RELOC_MSP430_16_PCREL,
3438 BFD_RELOC_MSP430_16,
3439 BFD_RELOC_MSP430_16_PCREL_BYTE,
3440 BFD_RELOC_MSP430_16_BYTE,
3441
3442/* IQ2000 Relocations. */
3443 BFD_RELOC_IQ2000_OFFSET_16,
3444 BFD_RELOC_IQ2000_OFFSET_21,
3445 BFD_RELOC_IQ2000_UHI16,
3446
3447/* Special Xtensa relocation used only by PLT entries in ELF shared
3448objects to indicate that the runtime linker should set the value
3449to one of its own internal functions or data structures. */
3450 BFD_RELOC_XTENSA_RTLD,
3451
3452/* Xtensa relocations for ELF shared objects. */
3453 BFD_RELOC_XTENSA_GLOB_DAT,
3454 BFD_RELOC_XTENSA_JMP_SLOT,
3455 BFD_RELOC_XTENSA_RELATIVE,
3456
3457/* Xtensa relocation used in ELF object files for symbols that may require
3458PLT entries. Otherwise, this is just a generic 32-bit relocation. */
3459 BFD_RELOC_XTENSA_PLT,
3460
3461/* Generic Xtensa relocations. Only the operand number is encoded
3462in the relocation. The details are determined by extracting the
3463instruction opcode. */
3464 BFD_RELOC_XTENSA_OP0,
3465 BFD_RELOC_XTENSA_OP1,
3466 BFD_RELOC_XTENSA_OP2,
3467
3468/* Xtensa relocation to mark that the assembler expanded the
3469instructions from an original target. The expansion size is
3470encoded in the reloc size. */
3471 BFD_RELOC_XTENSA_ASM_EXPAND,
3472
3473/* Xtensa relocation to mark that the linker should simplify
3474assembler-expanded instructions. This is commonly used
3475internally by the linker after analysis of a
3476BFD_RELOC_XTENSA_ASM_EXPAND. */
3477 BFD_RELOC_XTENSA_ASM_SIMPLIFY,
3111 BFD_RELOC_UNUSED };
3112typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
3478 BFD_RELOC_UNUSED };
3479typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
3113reloc_howto_type *
3114bfd_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
3480reloc_howto_type *bfd_reloc_type_lookup
3481 (bfd *abfd, bfd_reloc_code_real_type code);
3115
3482
3116const char *
3117bfd_get_reloc_code_name PARAMS ((bfd_reloc_code_real_type code));
3483const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
3118
3119/* Extracted from syms.c. */
3120
3484
3485/* Extracted from syms.c. */
3486
3121typedef struct symbol_cache_entry
3487typedef struct bfd_symbol
3122{
3123 /* A pointer to the BFD which owns the symbol. This information
3124 is necessary so that a back end can work out what additional
3125 information (invisible to the application writer) is carried
3126 with the symbol.
3127
3128 This field is *almost* redundant, since you can use section->owner
3129 instead, except that some symbols point to the global sections
3130 bfd_{abs,com,und}_section. This could be fixed by making
3131 these globals be per-bfd (or per-target-flavor). FIXME. */
3488{
3489 /* A pointer to the BFD which owns the symbol. This information
3490 is necessary so that a back end can work out what additional
3491 information (invisible to the application writer) is carried
3492 with the symbol.
3493
3494 This field is *almost* redundant, since you can use section->owner
3495 instead, except that some symbols point to the global sections
3496 bfd_{abs,com,und}_section. This could be fixed by making
3497 these globals be per-bfd (or per-target-flavor). FIXME. */
3132 struct _bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
3498 struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
3133
3134 /* The text of the symbol. The name is left alone, and not copied; the
3135 application may not alter it. */
3136 const char *name;
3137
3138 /* The value of the symbol. This really should be a union of a
3139 numeric value with a pointer, since some flags indicate that
3140 a pointer to another symbol is stored here. */

--- 13 unchanged lines hidden (view full) ---

3154 /* The symbol has global scope and is exported. The value is
3155 the offset into the section of the data. */
3156#define BSF_EXPORT BSF_GLOBAL /* No real difference. */
3157
3158 /* A normal C symbol would be one of:
3159 <<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or
3160 <<BSF_GLOBAL>>. */
3161
3499
3500 /* The text of the symbol. The name is left alone, and not copied; the
3501 application may not alter it. */
3502 const char *name;
3503
3504 /* The value of the symbol. This really should be a union of a
3505 numeric value with a pointer, since some flags indicate that
3506 a pointer to another symbol is stored here. */

--- 13 unchanged lines hidden (view full) ---

3520 /* The symbol has global scope and is exported. The value is
3521 the offset into the section of the data. */
3522#define BSF_EXPORT BSF_GLOBAL /* No real difference. */
3523
3524 /* A normal C symbol would be one of:
3525 <<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or
3526 <<BSF_GLOBAL>>. */
3527
3162 /* The symbol is a debugging record. The value has an arbitary
3528 /* The symbol is a debugging record. The value has an arbitrary
3163 meaning, unless BSF_DEBUGGING_RELOC is also set. */
3164#define BSF_DEBUGGING 0x08
3165
3166 /* The symbol denotes a function entry point. Used in ELF,
3167 perhaps others someday. */
3168#define BSF_FUNCTION 0x10
3169
3170 /* Used by the linker. */

--- 54 unchanged lines hidden (view full) ---

3225 /* This symbol is thread local. Used in ELF. */
3226#define BSF_THREAD_LOCAL 0x40000
3227
3228 flagword flags;
3229
3230 /* A pointer to the section to which this symbol is
3231 relative. This will always be non NULL, there are special
3232 sections for undefined and absolute symbols. */
3529 meaning, unless BSF_DEBUGGING_RELOC is also set. */
3530#define BSF_DEBUGGING 0x08
3531
3532 /* The symbol denotes a function entry point. Used in ELF,
3533 perhaps others someday. */
3534#define BSF_FUNCTION 0x10
3535
3536 /* Used by the linker. */

--- 54 unchanged lines hidden (view full) ---

3591 /* This symbol is thread local. Used in ELF. */
3592#define BSF_THREAD_LOCAL 0x40000
3593
3594 flagword flags;
3595
3596 /* A pointer to the section to which this symbol is
3597 relative. This will always be non NULL, there are special
3598 sections for undefined and absolute symbols. */
3233 struct sec *section;
3599 struct bfd_section *section;
3234
3235 /* Back end special data. */
3236 union
3237 {
3600
3601 /* Back end special data. */
3602 union
3603 {
3238 PTR p;
3604 void *p;
3239 bfd_vma i;
3240 }
3241 udata;
3242}
3243asymbol;
3244
3245#define bfd_get_symtab_upper_bound(abfd) \
3246 BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
3247
3605 bfd_vma i;
3606 }
3607 udata;
3608}
3609asymbol;
3610
3611#define bfd_get_symtab_upper_bound(abfd) \
3612 BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
3613
3248boolean
3249bfd_is_local_label PARAMS ((bfd *abfd, asymbol *sym));
3614bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
3250
3615
3251boolean
3252bfd_is_local_label_name PARAMS ((bfd *abfd, const char *name));
3616bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
3253
3254#define bfd_is_local_label_name(abfd, name) \
3617
3618#define bfd_is_local_label_name(abfd, name) \
3255 BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
3619 BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
3256
3257#define bfd_canonicalize_symtab(abfd, location) \
3620
3621#define bfd_canonicalize_symtab(abfd, location) \
3258 BFD_SEND (abfd, _bfd_canonicalize_symtab,\
3259 (abfd, location))
3622 BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
3260
3623
3261boolean
3262bfd_set_symtab PARAMS ((bfd *abfd, asymbol **location, unsigned int count));
3624bfd_boolean bfd_set_symtab
3625 (bfd *abfd, asymbol **location, unsigned int count);
3263
3626
3264void
3265bfd_print_symbol_vandf PARAMS ((bfd *abfd, PTR file, asymbol *symbol));
3627void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
3266
3267#define bfd_make_empty_symbol(abfd) \
3628
3629#define bfd_make_empty_symbol(abfd) \
3268 BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
3630 BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
3269
3631
3270asymbol *
3271_bfd_generic_make_empty_symbol PARAMS ((bfd *));
3632asymbol *_bfd_generic_make_empty_symbol (bfd *);
3272
3273#define bfd_make_debug_symbol(abfd,ptr,size) \
3633
3634#define bfd_make_debug_symbol(abfd,ptr,size) \
3274 BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
3635 BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
3275
3636
3276int
3277bfd_decode_symclass PARAMS ((asymbol *symbol));
3637int bfd_decode_symclass (asymbol *symbol);
3278
3638
3279boolean
3280bfd_is_undefined_symclass PARAMS ((int symclass));
3639bfd_boolean bfd_is_undefined_symclass (int symclass);
3281
3640
3282void
3283bfd_symbol_info PARAMS ((asymbol *symbol, symbol_info *ret));
3641void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
3284
3642
3285boolean
3286bfd_copy_private_symbol_data PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym));
3643bfd_boolean bfd_copy_private_symbol_data
3644 (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
3287
3288#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
3645
3646#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
3289 BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
3290 (ibfd, isymbol, obfd, osymbol))
3647 BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
3648 (ibfd, isymbol, obfd, osymbol))
3291
3292/* Extracted from bfd.c. */
3649
3650/* Extracted from bfd.c. */
3293struct _bfd
3651struct bfd
3294{
3652{
3653 /* A unique identifier of the BFD */
3654 unsigned int id;
3655
3295 /* The filename the application opened the BFD with. */
3296 const char *filename;
3297
3298 /* A pointer to the target jump table. */
3299 const struct bfd_target *xvec;
3300
3301 /* To avoid dragging too many header files into every file that
3302 includes `<<bfd.h>>', IOSTREAM has been declared as a "char *",
3303 and MTIME as a "long". Their correct types, to which they
3304 are cast when used, are "FILE *" and "time_t". The iostream
3305 is the result of an fopen on the filename. However, if the
3306 BFD_IN_MEMORY flag is set, then iostream is actually a pointer
3307 to a bfd_in_memory struct. */
3656 /* The filename the application opened the BFD with. */
3657 const char *filename;
3658
3659 /* A pointer to the target jump table. */
3660 const struct bfd_target *xvec;
3661
3662 /* To avoid dragging too many header files into every file that
3663 includes `<<bfd.h>>', IOSTREAM has been declared as a "char *",
3664 and MTIME as a "long". Their correct types, to which they
3665 are cast when used, are "FILE *" and "time_t". The iostream
3666 is the result of an fopen on the filename. However, if the
3667 BFD_IN_MEMORY flag is set, then iostream is actually a pointer
3668 to a bfd_in_memory struct. */
3308 PTR iostream;
3669 void *iostream;
3309
3310 /* Is the file descriptor being cached? That is, can it be closed as
3311 needed, and re-opened when accessed later? */
3670
3671 /* Is the file descriptor being cached? That is, can it be closed as
3672 needed, and re-opened when accessed later? */
3312 boolean cacheable;
3673 bfd_boolean cacheable;
3313
3314 /* Marks whether there was a default target specified when the
3315 BFD was opened. This is used to select which matching algorithm
3316 to use to choose the back end. */
3674
3675 /* Marks whether there was a default target specified when the
3676 BFD was opened. This is used to select which matching algorithm
3677 to use to choose the back end. */
3317 boolean target_defaulted;
3678 bfd_boolean target_defaulted;
3318
3319 /* The caching routines use these to maintain a
3320 least-recently-used list of BFDs. */
3679
3680 /* The caching routines use these to maintain a
3681 least-recently-used list of BFDs. */
3321 struct _bfd *lru_prev, *lru_next;
3682 struct bfd *lru_prev, *lru_next;
3322
3323 /* When a file is closed by the caching routines, BFD retains
3324 state information on the file here... */
3325 ufile_ptr where;
3326
3327 /* ... and here: (``once'' means at least once). */
3683
3684 /* When a file is closed by the caching routines, BFD retains
3685 state information on the file here... */
3686 ufile_ptr where;
3687
3688 /* ... and here: (``once'' means at least once). */
3328 boolean opened_once;
3689 bfd_boolean opened_once;
3329
3330 /* Set if we have a locally maintained mtime value, rather than
3331 getting it from the file each time. */
3690
3691 /* Set if we have a locally maintained mtime value, rather than
3692 getting it from the file each time. */
3332 boolean mtime_set;
3693 bfd_boolean mtime_set;
3333
3694
3334 /* File modified time, if mtime_set is true. */
3695 /* File modified time, if mtime_set is TRUE. */
3335 long mtime;
3336
3337 /* Reserved for an unimplemented file locking extension. */
3338 int ifd;
3339
3340 /* The format which belongs to the BFD. (object, core, etc.) */
3341 bfd_format format;
3342

--- 12 unchanged lines hidden (view full) ---

3355
3356 /* Currently my_archive is tested before adding origin to
3357 anything. I believe that this can become always an add of
3358 origin, with origin set to 0 for non archive files. */
3359 ufile_ptr origin;
3360
3361 /* Remember when output has begun, to stop strange things
3362 from happening. */
3696 long mtime;
3697
3698 /* Reserved for an unimplemented file locking extension. */
3699 int ifd;
3700
3701 /* The format which belongs to the BFD. (object, core, etc.) */
3702 bfd_format format;
3703

--- 12 unchanged lines hidden (view full) ---

3716
3717 /* Currently my_archive is tested before adding origin to
3718 anything. I believe that this can become always an add of
3719 origin, with origin set to 0 for non archive files. */
3720 ufile_ptr origin;
3721
3722 /* Remember when output has begun, to stop strange things
3723 from happening. */
3363 boolean output_has_begun;
3724 bfd_boolean output_has_begun;
3364
3365 /* A hash table for section names. */
3366 struct bfd_hash_table section_htab;
3367
3368 /* Pointer to linked list of sections. */
3725
3726 /* A hash table for section names. */
3727 struct bfd_hash_table section_htab;
3728
3729 /* Pointer to linked list of sections. */
3369 struct sec *sections;
3730 struct bfd_section *sections;
3370
3371 /* The place where we add to the section list. */
3731
3732 /* The place where we add to the section list. */
3372 struct sec **section_tail;
3733 struct bfd_section **section_tail;
3373
3374 /* The number of sections. */
3375 unsigned int section_count;
3376
3377 /* Stuff only useful for object files:
3378 The start address. */
3379 bfd_vma start_address;
3380
3381 /* Used for input and output. */
3382 unsigned int symcount;
3383
3384 /* Symbol table for output BFD (with symcount entries). */
3734
3735 /* The number of sections. */
3736 unsigned int section_count;
3737
3738 /* Stuff only useful for object files:
3739 The start address. */
3740 bfd_vma start_address;
3741
3742 /* Used for input and output. */
3743 unsigned int symcount;
3744
3745 /* Symbol table for output BFD (with symcount entries). */
3385 struct symbol_cache_entry **outsymbols;
3746 struct bfd_symbol **outsymbols;
3386
3387 /* Used for slurped dynamic symbol tables. */
3388 unsigned int dynsymcount;
3389
3390 /* Pointer to structure which contains architecture information. */
3391 const struct bfd_arch_info *arch_info;
3392
3393 /* Stuff only useful for archives. */
3747
3748 /* Used for slurped dynamic symbol tables. */
3749 unsigned int dynsymcount;
3750
3751 /* Pointer to structure which contains architecture information. */
3752 const struct bfd_arch_info *arch_info;
3753
3754 /* Stuff only useful for archives. */
3394 PTR arelt_data;
3395 struct _bfd *my_archive; /* The containing archive BFD. */
3396 struct _bfd *next; /* The next BFD in the archive. */
3397 struct _bfd *archive_head; /* The first BFD in the archive. */
3398 boolean has_armap;
3755 void *arelt_data;
3756 struct bfd *my_archive; /* The containing archive BFD. */
3757 struct bfd *next; /* The next BFD in the archive. */
3758 struct bfd *archive_head; /* The first BFD in the archive. */
3759 bfd_boolean has_armap;
3399
3400 /* A chain of BFD structures involved in a link. */
3760
3761 /* A chain of BFD structures involved in a link. */
3401 struct _bfd *link_next;
3762 struct bfd *link_next;
3402
3403 /* A field used by _bfd_generic_link_add_archive_symbols. This will
3404 be used only for archive elements. */
3405 int archive_pass;
3406
3407 /* Used by the back end to hold private data. */
3408 union
3409 {

--- 21 unchanged lines hidden (view full) ---

3431 struct hpux_core_struct *hpux_core_data;
3432 struct hppabsd_core_struct *hppabsd_core_data;
3433 struct sgi_core_struct *sgi_core_data;
3434 struct lynx_core_struct *lynx_core_data;
3435 struct osf_core_struct *osf_core_data;
3436 struct cisco_core_struct *cisco_core_data;
3437 struct versados_data_struct *versados_data;
3438 struct netbsd_core_struct *netbsd_core_data;
3763
3764 /* A field used by _bfd_generic_link_add_archive_symbols. This will
3765 be used only for archive elements. */
3766 int archive_pass;
3767
3768 /* Used by the back end to hold private data. */
3769 union
3770 {

--- 21 unchanged lines hidden (view full) ---

3792 struct hpux_core_struct *hpux_core_data;
3793 struct hppabsd_core_struct *hppabsd_core_data;
3794 struct sgi_core_struct *sgi_core_data;
3795 struct lynx_core_struct *lynx_core_data;
3796 struct osf_core_struct *osf_core_data;
3797 struct cisco_core_struct *cisco_core_data;
3798 struct versados_data_struct *versados_data;
3799 struct netbsd_core_struct *netbsd_core_data;
3439 PTR any;
3800 struct mach_o_data_struct *mach_o_data;
3801 struct mach_o_fat_data_struct *mach_o_fat_data;
3802 struct bfd_pef_data_struct *pef_data;
3803 struct bfd_pef_xlib_data_struct *pef_xlib_data;
3804 struct bfd_sym_data_struct *sym_data;
3805 void *any;
3440 }
3441 tdata;
3442
3443 /* Used by the application to hold private data. */
3806 }
3807 tdata;
3808
3809 /* Used by the application to hold private data. */
3444 PTR usrdata;
3810 void *usrdata;
3445
3446 /* Where all the allocated stuff under this BFD goes. This is a
3811
3812 /* Where all the allocated stuff under this BFD goes. This is a
3447 struct objalloc *, but we use PTR to avoid requiring the inclusion of
3448 objalloc.h. */
3449 PTR memory;
3813 struct objalloc *, but we use void * to avoid requiring the inclusion
3814 of objalloc.h. */
3815 void *memory;
3450};
3451
3452typedef enum bfd_error
3453{
3454 bfd_error_no_error = 0,
3455 bfd_error_system_call,
3456 bfd_error_invalid_target,
3457 bfd_error_wrong_format,

--- 11 unchanged lines hidden (view full) ---

3469 bfd_error_no_debug_section,
3470 bfd_error_bad_value,
3471 bfd_error_file_truncated,
3472 bfd_error_file_too_big,
3473 bfd_error_invalid_error_code
3474}
3475bfd_error_type;
3476
3816};
3817
3818typedef enum bfd_error
3819{
3820 bfd_error_no_error = 0,
3821 bfd_error_system_call,
3822 bfd_error_invalid_target,
3823 bfd_error_wrong_format,

--- 11 unchanged lines hidden (view full) ---

3835 bfd_error_no_debug_section,
3836 bfd_error_bad_value,
3837 bfd_error_file_truncated,
3838 bfd_error_file_too_big,
3839 bfd_error_invalid_error_code
3840}
3841bfd_error_type;
3842
3477bfd_error_type
3478bfd_get_error PARAMS ((void));
3843bfd_error_type bfd_get_error (void);
3479
3844
3480void
3481bfd_set_error PARAMS ((bfd_error_type error_tag));
3845void bfd_set_error (bfd_error_type error_tag);
3482
3846
3483const char *
3484bfd_errmsg PARAMS ((bfd_error_type error_tag));
3847const char *bfd_errmsg (bfd_error_type error_tag);
3485
3848
3486void
3487bfd_perror PARAMS ((const char *message));
3849void bfd_perror (const char *message);
3488
3850
3489typedef void (*bfd_error_handler_type) PARAMS ((const char *, ...));
3851typedef void (*bfd_error_handler_type) (const char *, ...);
3490
3852
3491bfd_error_handler_type
3492bfd_set_error_handler PARAMS ((bfd_error_handler_type));
3853bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
3493
3854
3494void
3495bfd_set_error_program_name PARAMS ((const char *));
3855void bfd_set_error_program_name (const char *);
3496
3856
3497bfd_error_handler_type
3498bfd_get_error_handler PARAMS ((void));
3857bfd_error_handler_type bfd_get_error_handler (void);
3499
3858
3500const char *
3501bfd_archive_filename PARAMS ((bfd *));
3859const char *bfd_archive_filename (bfd *);
3502
3860
3503long
3504bfd_get_reloc_upper_bound PARAMS ((bfd *abfd, asection *sect));
3861long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
3505
3862
3506long
3507bfd_canonicalize_reloc PARAMS ((bfd *abfd,
3508 asection *sec,
3509 arelent **loc,
3510 asymbol **syms));
3863long bfd_canonicalize_reloc
3864 (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
3511
3865
3512void
3513bfd_set_reloc PARAMS ((bfd *abfd, asection *sec, arelent **rel, unsigned int count));
3866void bfd_set_reloc
3867 (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
3514
3868
3515boolean
3516bfd_set_file_flags PARAMS ((bfd *abfd, flagword flags));
3869bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
3517
3870
3518int
3519bfd_get_arch_size PARAMS ((bfd *abfd));
3871int bfd_get_arch_size (bfd *abfd);
3520
3872
3521int
3522bfd_get_sign_extend_vma PARAMS ((bfd *abfd));
3873int bfd_get_sign_extend_vma (bfd *abfd);
3523
3874
3524boolean
3525bfd_set_start_address PARAMS ((bfd *abfd, bfd_vma vma));
3875bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
3526
3876
3527long
3528bfd_get_mtime PARAMS ((bfd *abfd));
3877unsigned int bfd_get_gp_size (bfd *abfd);
3529
3878
3530long
3531bfd_get_size PARAMS ((bfd *abfd));
3879void bfd_set_gp_size (bfd *abfd, unsigned int i);
3532
3880
3533unsigned int
3534bfd_get_gp_size PARAMS ((bfd *abfd));
3881bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
3535
3882
3536void
3537bfd_set_gp_size PARAMS ((bfd *abfd, unsigned int i));
3883bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
3538
3884
3539bfd_vma
3540bfd_scan_vma PARAMS ((const char *string, const char **end, int base));
3541
3542boolean
3543bfd_copy_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd));
3544
3545#define bfd_copy_private_bfd_data(ibfd, obfd) \
3546 BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
3547 (ibfd, obfd))
3885#define bfd_copy_private_bfd_data(ibfd, obfd) \
3886 BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
3887 (ibfd, obfd))
3548boolean
3549bfd_merge_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd));
3888bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd);
3550
3551#define bfd_merge_private_bfd_data(ibfd, obfd) \
3552 BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
3553 (ibfd, obfd))
3889
3890#define bfd_merge_private_bfd_data(ibfd, obfd) \
3891 BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
3892 (ibfd, obfd))
3554boolean
3555bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags));
3893bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
3556
3557#define bfd_set_private_flags(abfd, flags) \
3894
3895#define bfd_set_private_flags(abfd, flags) \
3558 BFD_SEND (abfd, _bfd_set_private_flags, \
3559 (abfd, flags))
3896 BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
3560#define bfd_sizeof_headers(abfd, reloc) \
3897#define bfd_sizeof_headers(abfd, reloc) \
3561 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
3898 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
3562
3563#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
3899
3900#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
3564 BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line))
3901 BFD_SEND (abfd, _bfd_find_nearest_line, \
3902 (abfd, sec, syms, off, file, func, line))
3565
3903
3566 /* Do these three do anything useful at all, for any back end? */
3567#define bfd_debug_info_start(abfd) \
3904#define bfd_debug_info_start(abfd) \
3568 BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
3905 BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
3569
3570#define bfd_debug_info_end(abfd) \
3906
3907#define bfd_debug_info_end(abfd) \
3571 BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
3908 BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
3572
3573#define bfd_debug_info_accumulate(abfd, section) \
3909
3910#define bfd_debug_info_accumulate(abfd, section) \
3574 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
3911 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
3575
3912
3576
3577#define bfd_stat_arch_elt(abfd, stat) \
3913#define bfd_stat_arch_elt(abfd, stat) \
3578 BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
3914 BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
3579
3580#define bfd_update_armap_timestamp(abfd) \
3915
3916#define bfd_update_armap_timestamp(abfd) \
3581 BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
3917 BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
3582
3583#define bfd_set_arch_mach(abfd, arch, mach)\
3918
3919#define bfd_set_arch_mach(abfd, arch, mach)\
3584 BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
3920 BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
3585
3586#define bfd_relax_section(abfd, section, link_info, again) \
3587 BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
3588
3589#define bfd_gc_sections(abfd, link_info) \
3590 BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
3591
3592#define bfd_merge_sections(abfd, link_info) \

--- 31 unchanged lines hidden (view full) ---

3624
3625#define bfd_get_dynamic_reloc_upper_bound(abfd) \
3626 BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
3627
3628#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
3629 BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
3630
3631extern bfd_byte *bfd_get_relocated_section_contents
3921
3922#define bfd_relax_section(abfd, section, link_info, again) \
3923 BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
3924
3925#define bfd_gc_sections(abfd, link_info) \
3926 BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
3927
3928#define bfd_merge_sections(abfd, link_info) \

--- 31 unchanged lines hidden (view full) ---

3960
3961#define bfd_get_dynamic_reloc_upper_bound(abfd) \
3962 BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
3963
3964#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
3965 BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
3966
3967extern bfd_byte *bfd_get_relocated_section_contents
3632 PARAMS ((bfd *, struct bfd_link_info *,
3633 struct bfd_link_order *, bfd_byte *,
3634 boolean, asymbol **));
3968 (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
3969 bfd_boolean, asymbol **);
3635
3970
3636boolean
3637bfd_alt_mach_code PARAMS ((bfd *abfd, int alternative));
3971bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
3638
3972
3973struct bfd_preserve
3974{
3975 void *marker;
3976 void *tdata;
3977 flagword flags;
3978 const struct bfd_arch_info *arch_info;
3979 struct bfd_section *sections;
3980 struct bfd_section **section_tail;
3981 unsigned int section_count;
3982 struct bfd_hash_table section_htab;
3983};
3984
3985bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *);
3986
3987void bfd_preserve_restore (bfd *, struct bfd_preserve *);
3988
3989void bfd_preserve_finish (bfd *, struct bfd_preserve *);
3990
3639/* Extracted from archive.c. */
3991/* Extracted from archive.c. */
3640symindex
3641bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym));
3992symindex bfd_get_next_mapent
3993 (bfd *abfd, symindex previous, carsym **sym);
3642
3994
3643boolean
3644bfd_set_archive_head PARAMS ((bfd *output, bfd *new_head));
3995bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
3645
3996
3646bfd *
3647bfd_openr_next_archived_file PARAMS ((bfd *archive, bfd *previous));
3997bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
3648
3649/* Extracted from corefile.c. */
3998
3999/* Extracted from corefile.c. */
3650const char *
3651bfd_core_file_failing_command PARAMS ((bfd *abfd));
4000const char *bfd_core_file_failing_command (bfd *abfd);
3652
4001
3653int
3654bfd_core_file_failing_signal PARAMS ((bfd *abfd));
4002int bfd_core_file_failing_signal (bfd *abfd);
3655
4003
3656boolean
3657core_file_matches_executable_p PARAMS ((bfd *core_bfd, bfd *exec_bfd));
4004bfd_boolean core_file_matches_executable_p
4005 (bfd *core_bfd, bfd *exec_bfd);
3658
3659/* Extracted from targets.c. */
3660#define BFD_SEND(bfd, message, arglist) \
4006
4007/* Extracted from targets.c. */
4008#define BFD_SEND(bfd, message, arglist) \
3661 ((*((bfd)->xvec->message)) arglist)
4009 ((*((bfd)->xvec->message)) arglist)
3662
3663#ifdef DEBUG_BFD_SEND
3664#undef BFD_SEND
3665#define BFD_SEND(bfd, message, arglist) \
3666 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
3667 ((*((bfd)->xvec->message)) arglist) : \
3668 (bfd_assert (__FILE__,__LINE__), NULL))
3669#endif
3670#define BFD_SEND_FMT(bfd, message, arglist) \
4010
4011#ifdef DEBUG_BFD_SEND
4012#undef BFD_SEND
4013#define BFD_SEND(bfd, message, arglist) \
4014 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
4015 ((*((bfd)->xvec->message)) arglist) : \
4016 (bfd_assert (__FILE__,__LINE__), NULL))
4017#endif
4018#define BFD_SEND_FMT(bfd, message, arglist) \
3671 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
4019 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
3672
3673#ifdef DEBUG_BFD_SEND
3674#undef BFD_SEND_FMT
3675#define BFD_SEND_FMT(bfd, message, arglist) \
3676 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
3677 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
3678 (bfd_assert (__FILE__,__LINE__), NULL))
3679#endif

--- 13 unchanged lines hidden (view full) ---

3693 bfd_target_srec_flavour,
3694 bfd_target_ihex_flavour,
3695 bfd_target_som_flavour,
3696 bfd_target_os9k_flavour,
3697 bfd_target_versados_flavour,
3698 bfd_target_msdos_flavour,
3699 bfd_target_ovax_flavour,
3700 bfd_target_evax_flavour,
4020
4021#ifdef DEBUG_BFD_SEND
4022#undef BFD_SEND_FMT
4023#define BFD_SEND_FMT(bfd, message, arglist) \
4024 (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
4025 (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
4026 (bfd_assert (__FILE__,__LINE__), NULL))
4027#endif

--- 13 unchanged lines hidden (view full) ---

4041 bfd_target_srec_flavour,
4042 bfd_target_ihex_flavour,
4043 bfd_target_som_flavour,
4044 bfd_target_os9k_flavour,
4045 bfd_target_versados_flavour,
4046 bfd_target_msdos_flavour,
4047 bfd_target_ovax_flavour,
4048 bfd_target_evax_flavour,
3701 bfd_target_mmo_flavour
4049 bfd_target_mmo_flavour,
4050 bfd_target_mach_o_flavour,
4051 bfd_target_pef_flavour,
4052 bfd_target_pef_xlib_flavour,
4053 bfd_target_sym_flavour
3702};
3703
3704enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
3705
3706/* Forward declaration. */
3707typedef struct bfd_link_info _bfd_link_info;
3708
3709typedef struct bfd_target

--- 27 unchanged lines hidden (view full) ---

3737 char ar_pad_char;
3738
3739 /* The maximum number of characters in an archive header. */
3740 unsigned short ar_max_namelen;
3741
3742 /* Entries for byte swapping for data. These are different from the
3743 other entry points, since they don't take a BFD asthe first argument.
3744 Certain other handlers could do the same. */
4054};
4055
4056enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
4057
4058/* Forward declaration. */
4059typedef struct bfd_link_info _bfd_link_info;
4060
4061typedef struct bfd_target

--- 27 unchanged lines hidden (view full) ---

4089 char ar_pad_char;
4090
4091 /* The maximum number of characters in an archive header. */
4092 unsigned short ar_max_namelen;
4093
4094 /* Entries for byte swapping for data. These are different from the
4095 other entry points, since they don't take a BFD asthe first argument.
4096 Certain other handlers could do the same. */
3745 bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *));
3746 bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *));
3747 void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));
3748 bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *));
3749 bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((const bfd_byte *));
3750 void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));
3751 bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *));
3752 bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *));
3753 void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *));
4097 bfd_uint64_t (*bfd_getx64) (const void *);
4098 bfd_int64_t (*bfd_getx_signed_64) (const void *);
4099 void (*bfd_putx64) (bfd_uint64_t, void *);
4100 bfd_vma (*bfd_getx32) (const void *);
4101 bfd_signed_vma (*bfd_getx_signed_32) (const void *);
4102 void (*bfd_putx32) (bfd_vma, void *);
4103 bfd_vma (*bfd_getx16) (const void *);
4104 bfd_signed_vma (*bfd_getx_signed_16) (const void *);
4105 void (*bfd_putx16) (bfd_vma, void *);
3754
3755 /* Byte swapping for the headers. */
4106
4107 /* Byte swapping for the headers. */
3756 bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *));
3757 bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *));
3758 void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));
3759 bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *));
3760 bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((const bfd_byte *));
3761 void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));
3762 bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *));
3763 bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *));
3764 void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *));
4108 bfd_uint64_t (*bfd_h_getx64) (const void *);
4109 bfd_int64_t (*bfd_h_getx_signed_64) (const void *);
4110 void (*bfd_h_putx64) (bfd_uint64_t, void *);
4111 bfd_vma (*bfd_h_getx32) (const void *);
4112 bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
4113 void (*bfd_h_putx32) (bfd_vma, void *);
4114 bfd_vma (*bfd_h_getx16) (const void *);
4115 bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
4116 void (*bfd_h_putx16) (bfd_vma, void *);
3765
3766 /* Format dependent routines: these are vectors of entry points
3767 within the target vector structure, one for each format to check. */
3768
3769 /* Check the format of a file being read. Return a <<bfd_target *>> or zero. */
4117
4118 /* Format dependent routines: these are vectors of entry points
4119 within the target vector structure, one for each format to check. */
4120
4121 /* Check the format of a file being read. Return a <<bfd_target *>> or zero. */
3770 const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *));
4122 const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *);
3771
3772 /* Set the format of a file being written. */
4123
4124 /* Set the format of a file being written. */
3773 boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *));
4125 bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
3774
3775 /* Write cached information into a file being written, at <<bfd_close>>. */
4126
4127 /* Write cached information into a file being written, at <<bfd_close>>. */
3776 boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *));
4128 bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
3777
3778
3779 /* Generic entry points. */
3780#define BFD_JUMP_TABLE_GENERIC(NAME) \
4129
4130
4131 /* Generic entry points. */
4132#define BFD_JUMP_TABLE_GENERIC(NAME) \
3781CONCAT2 (NAME,_close_and_cleanup), \
3782CONCAT2 (NAME,_bfd_free_cached_info), \
3783CONCAT2 (NAME,_new_section_hook), \
3784CONCAT2 (NAME,_get_section_contents), \
3785CONCAT2 (NAME,_get_section_contents_in_window)
4133 NAME##_close_and_cleanup, \
4134 NAME##_bfd_free_cached_info, \
4135 NAME##_new_section_hook, \
4136 NAME##_get_section_contents, \
4137 NAME##_get_section_contents_in_window
3786
3787 /* Called when the BFD is being closed to do any necessary cleanup. */
4138
4139 /* Called when the BFD is being closed to do any necessary cleanup. */
3788 boolean (*_close_and_cleanup) PARAMS ((bfd *));
4140 bfd_boolean (*_close_and_cleanup) (bfd *);
3789 /* Ask the BFD to free all cached information. */
4141 /* Ask the BFD to free all cached information. */
3790 boolean (*_bfd_free_cached_info) PARAMS ((bfd *));
4142 bfd_boolean (*_bfd_free_cached_info) (bfd *);
3791 /* Called when a new section is created. */
4143 /* Called when a new section is created. */
3792 boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr));
4144 bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
3793 /* Read the contents of a section. */
4145 /* Read the contents of a section. */
3794 boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
3795 file_ptr, bfd_size_type));
3796 boolean (*_bfd_get_section_contents_in_window)
3797 PARAMS ((bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type));
4146 bfd_boolean (*_bfd_get_section_contents)
4147 (bfd *, sec_ptr, void *, file_ptr, bfd_size_type);
4148 bfd_boolean (*_bfd_get_section_contents_in_window)
4149 (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type);
3798
3799 /* Entry points to copy private data. */
3800#define BFD_JUMP_TABLE_COPY(NAME) \
4150
4151 /* Entry points to copy private data. */
4152#define BFD_JUMP_TABLE_COPY(NAME) \
3801CONCAT2 (NAME,_bfd_copy_private_bfd_data), \
3802CONCAT2 (NAME,_bfd_merge_private_bfd_data), \
3803CONCAT2 (NAME,_bfd_copy_private_section_data), \
3804CONCAT2 (NAME,_bfd_copy_private_symbol_data), \
3805CONCAT2 (NAME,_bfd_set_private_flags), \
3806CONCAT2 (NAME,_bfd_print_private_bfd_data) \
4153 NAME##_bfd_copy_private_bfd_data, \
4154 NAME##_bfd_merge_private_bfd_data, \
4155 NAME##_bfd_copy_private_section_data, \
4156 NAME##_bfd_copy_private_symbol_data, \
4157 NAME##_bfd_set_private_flags, \
4158 NAME##_bfd_print_private_bfd_data
4159
3807 /* Called to copy BFD general private data from one object file
3808 to another. */
4160 /* Called to copy BFD general private data from one object file
4161 to another. */
3809 boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));
4162 bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
3810 /* Called to merge BFD general private data from one object file
3811 to a common output file when linking. */
4163 /* Called to merge BFD general private data from one object file
4164 to a common output file when linking. */
3812 boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *));
4165 bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *);
3813 /* Called to copy BFD private section data from one object file
3814 to another. */
4166 /* Called to copy BFD private section data from one object file
4167 to another. */
3815 boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr,
3816 bfd *, sec_ptr));
4168 bfd_boolean (*_bfd_copy_private_section_data)
4169 (bfd *, sec_ptr, bfd *, sec_ptr);
3817 /* Called to copy BFD private symbol data from one symbol
3818 to another. */
4170 /* Called to copy BFD private symbol data from one symbol
4171 to another. */
3819 boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *,
3820 bfd *, asymbol *));
4172 bfd_boolean (*_bfd_copy_private_symbol_data)
4173 (bfd *, asymbol *, bfd *, asymbol *);
3821 /* Called to set private backend flags. */
4174 /* Called to set private backend flags. */
3822 boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword));
4175 bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
3823
3824 /* Called to print private BFD data. */
4176
4177 /* Called to print private BFD data. */
3825 boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR));
4178 bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
3826
3827 /* Core file entry points. */
3828#define BFD_JUMP_TABLE_CORE(NAME) \
4179
4180 /* Core file entry points. */
4181#define BFD_JUMP_TABLE_CORE(NAME) \
3829CONCAT2 (NAME,_core_file_failing_command), \
3830CONCAT2 (NAME,_core_file_failing_signal), \
3831CONCAT2 (NAME,_core_file_matches_executable_p)
3832 char * (*_core_file_failing_command) PARAMS ((bfd *));
3833 int (*_core_file_failing_signal) PARAMS ((bfd *));
3834 boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *));
4182 NAME##_core_file_failing_command, \
4183 NAME##_core_file_failing_signal, \
4184 NAME##_core_file_matches_executable_p
3835
4185
4186 char * (*_core_file_failing_command) (bfd *);
4187 int (*_core_file_failing_signal) (bfd *);
4188 bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
4189
3836 /* Archive entry points. */
3837#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
4190 /* Archive entry points. */
4191#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
3838CONCAT2 (NAME,_slurp_armap), \
3839CONCAT2 (NAME,_slurp_extended_name_table), \
3840CONCAT2 (NAME,_construct_extended_name_table), \
3841CONCAT2 (NAME,_truncate_arname), \
3842CONCAT2 (NAME,_write_armap), \
3843CONCAT2 (NAME,_read_ar_hdr), \
3844CONCAT2 (NAME,_openr_next_archived_file), \
3845CONCAT2 (NAME,_get_elt_at_index), \
3846CONCAT2 (NAME,_generic_stat_arch_elt), \
3847CONCAT2 (NAME,_update_armap_timestamp)
3848 boolean (*_bfd_slurp_armap) PARAMS ((bfd *));
3849 boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *));
3850 boolean (*_bfd_construct_extended_name_table)
3851 PARAMS ((bfd *, char **, bfd_size_type *, const char **));
3852 void (*_bfd_truncate_arname) PARAMS ((bfd *, const char *, char *));
3853 boolean (*write_armap)
3854 PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
3855 PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *));
3856 bfd * (*openr_next_archived_file) PARAMS ((bfd *, bfd *));
3857#define bfd_get_elt_at_index(b,i) BFD_SEND(b, _bfd_get_elt_at_index, (b,i))
3858 bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex));
3859 int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));
3860 boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *));
4192 NAME##_slurp_armap, \
4193 NAME##_slurp_extended_name_table, \
4194 NAME##_construct_extended_name_table, \
4195 NAME##_truncate_arname, \
4196 NAME##_write_armap, \
4197 NAME##_read_ar_hdr, \
4198 NAME##_openr_next_archived_file, \
4199 NAME##_get_elt_at_index, \
4200 NAME##_generic_stat_arch_elt, \
4201 NAME##_update_armap_timestamp
3861
4202
4203 bfd_boolean (*_bfd_slurp_armap) (bfd *);
4204 bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
4205 bfd_boolean (*_bfd_construct_extended_name_table)
4206 (bfd *, char **, bfd_size_type *, const char **);
4207 void (*_bfd_truncate_arname) (bfd *, const char *, char *);
4208 bfd_boolean (*write_armap)
4209 (bfd *, unsigned int, struct orl *, unsigned int, int);
4210 void * (*_bfd_read_ar_hdr_fn) (bfd *);
4211 bfd * (*openr_next_archived_file) (bfd *, bfd *);
4212#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
4213 bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);
4214 int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
4215 bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
4216
3862 /* Entry points used for symbols. */
3863#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
4217 /* Entry points used for symbols. */
4218#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
3864CONCAT2 (NAME,_get_symtab_upper_bound), \
3865CONCAT2 (NAME,_get_symtab), \
3866CONCAT2 (NAME,_make_empty_symbol), \
3867CONCAT2 (NAME,_print_symbol), \
3868CONCAT2 (NAME,_get_symbol_info), \
3869CONCAT2 (NAME,_bfd_is_local_label_name), \
3870CONCAT2 (NAME,_get_lineno), \
3871CONCAT2 (NAME,_find_nearest_line), \
3872CONCAT2 (NAME,_bfd_make_debug_symbol), \
3873CONCAT2 (NAME,_read_minisymbols), \
3874CONCAT2 (NAME,_minisymbol_to_symbol)
3875 long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *));
3876 long (*_bfd_canonicalize_symtab) PARAMS ((bfd *,
3877 struct symbol_cache_entry **));
3878 struct symbol_cache_entry *
3879 (*_bfd_make_empty_symbol) PARAMS ((bfd *));
3880 void (*_bfd_print_symbol) PARAMS ((bfd *, PTR,
3881 struct symbol_cache_entry *,
3882 bfd_print_symbol_type));
3883#define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e))
3884 void (*_bfd_get_symbol_info) PARAMS ((bfd *,
3885 struct symbol_cache_entry *,
3886 symbol_info *));
3887#define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e))
3888 boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *));
4219 NAME##_get_symtab_upper_bound, \
4220 NAME##_canonicalize_symtab, \
4221 NAME##_make_empty_symbol, \
4222 NAME##_print_symbol, \
4223 NAME##_get_symbol_info, \
4224 NAME##_bfd_is_local_label_name, \
4225 NAME##_get_lineno, \
4226 NAME##_find_nearest_line, \
4227 NAME##_bfd_make_debug_symbol, \
4228 NAME##_read_minisymbols, \
4229 NAME##_minisymbol_to_symbol
3889
4230
3890 alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *));
3891 boolean (*_bfd_find_nearest_line)
3892 PARAMS ((bfd *, struct sec *, struct symbol_cache_entry **, bfd_vma,
3893 const char **, const char **, unsigned int *));
4231 long (*_bfd_get_symtab_upper_bound) (bfd *);
4232 long (*_bfd_canonicalize_symtab)
4233 (bfd *, struct bfd_symbol **);
4234 struct bfd_symbol *
4235 (*_bfd_make_empty_symbol) (bfd *);
4236 void (*_bfd_print_symbol)
4237 (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type);
4238#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
4239 void (*_bfd_get_symbol_info)
4240 (bfd *, struct bfd_symbol *, symbol_info *);
4241#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
4242 bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
4243
4244 alent * (*_get_lineno) (bfd *, struct bfd_symbol *);
4245 bfd_boolean (*_bfd_find_nearest_line)
4246 (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,
4247 const char **, const char **, unsigned int *);
3894 /* Back-door to allow format-aware applications to create debug symbols
3895 while using BFD for everything else. Currently used by the assembler
3896 when creating COFF files. */
4248 /* Back-door to allow format-aware applications to create debug symbols
4249 while using BFD for everything else. Currently used by the assembler
4250 when creating COFF files. */
3897 asymbol *(*_bfd_make_debug_symbol) PARAMS ((bfd *, void *,
3898 unsigned long size));
4251 asymbol * (*_bfd_make_debug_symbol)
4252 (bfd *, void *, unsigned long size);
3899#define bfd_read_minisymbols(b, d, m, s) \
3900 BFD_SEND (b, _read_minisymbols, (b, d, m, s))
4253#define bfd_read_minisymbols(b, d, m, s) \
4254 BFD_SEND (b, _read_minisymbols, (b, d, m, s))
3901 long (*_read_minisymbols) PARAMS ((bfd *, boolean, PTR *,
3902 unsigned int *));
4255 long (*_read_minisymbols)
4256 (bfd *, bfd_boolean, void **, unsigned int *);
3903#define bfd_minisymbol_to_symbol(b, d, m, f) \
3904 BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
4257#define bfd_minisymbol_to_symbol(b, d, m, f) \
4258 BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
3905 asymbol *(*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR,
3906 asymbol *));
4259 asymbol * (*_minisymbol_to_symbol)
4260 (bfd *, bfd_boolean, const void *, asymbol *);
3907
3908 /* Routines for relocs. */
3909#define BFD_JUMP_TABLE_RELOCS(NAME) \
4261
4262 /* Routines for relocs. */
4263#define BFD_JUMP_TABLE_RELOCS(NAME) \
3910CONCAT2 (NAME,_get_reloc_upper_bound), \
3911CONCAT2 (NAME,_canonicalize_reloc), \
3912CONCAT2 (NAME,_bfd_reloc_type_lookup)
3913 long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));
3914 long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **,
3915 struct symbol_cache_entry **));
4264 NAME##_get_reloc_upper_bound, \
4265 NAME##_canonicalize_reloc, \
4266 NAME##_bfd_reloc_type_lookup
4267
4268 long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
4269 long (*_bfd_canonicalize_reloc)
4270 (bfd *, sec_ptr, arelent **, struct bfd_symbol **);
3916 /* See documentation on reloc types. */
3917 reloc_howto_type *
4271 /* See documentation on reloc types. */
4272 reloc_howto_type *
3918 (*reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type));
4273 (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
3919
3920 /* Routines used when writing an object file. */
3921#define BFD_JUMP_TABLE_WRITE(NAME) \
4274
4275 /* Routines used when writing an object file. */
4276#define BFD_JUMP_TABLE_WRITE(NAME) \
3922CONCAT2 (NAME,_set_arch_mach), \
3923CONCAT2 (NAME,_set_section_contents)
3924 boolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture,
3925 unsigned long));
3926 boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
3927 file_ptr, bfd_size_type));
4277 NAME##_set_arch_mach, \
4278 NAME##_set_section_contents
3928
4279
4280 bfd_boolean (*_bfd_set_arch_mach)
4281 (bfd *, enum bfd_architecture, unsigned long);
4282 bfd_boolean (*_bfd_set_section_contents)
4283 (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type);
4284
3929 /* Routines used by the linker. */
3930#define BFD_JUMP_TABLE_LINK(NAME) \
4285 /* Routines used by the linker. */
4286#define BFD_JUMP_TABLE_LINK(NAME) \
3931CONCAT2 (NAME,_sizeof_headers), \
3932CONCAT2 (NAME,_bfd_get_relocated_section_contents), \
3933CONCAT2 (NAME,_bfd_relax_section), \
3934CONCAT2 (NAME,_bfd_link_hash_table_create), \
3935CONCAT2 (NAME,_bfd_link_hash_table_free), \
3936CONCAT2 (NAME,_bfd_link_add_symbols), \
3937CONCAT2 (NAME,_bfd_link_just_syms), \
3938CONCAT2 (NAME,_bfd_final_link), \
3939CONCAT2 (NAME,_bfd_link_split_section), \
3940CONCAT2 (NAME,_bfd_gc_sections), \
3941CONCAT2 (NAME,_bfd_merge_sections), \
3942CONCAT2 (NAME,_bfd_discard_group)
3943 int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean));
3944 bfd_byte *(*_bfd_get_relocated_section_contents)
3945 PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *,
3946 bfd_byte *, boolean, struct symbol_cache_entry **));
4287 NAME##_sizeof_headers, \
4288 NAME##_bfd_get_relocated_section_contents, \
4289 NAME##_bfd_relax_section, \
4290 NAME##_bfd_link_hash_table_create, \
4291 NAME##_bfd_link_hash_table_free, \
4292 NAME##_bfd_link_add_symbols, \
4293 NAME##_bfd_link_just_syms, \
4294 NAME##_bfd_final_link, \
4295 NAME##_bfd_link_split_section, \
4296 NAME##_bfd_gc_sections, \
4297 NAME##_bfd_merge_sections, \
4298 NAME##_bfd_discard_group
3947
4299
3948 boolean (*_bfd_relax_section)
3949 PARAMS ((bfd *, struct sec *, struct bfd_link_info *, boolean *));
4300 int (*_bfd_sizeof_headers) (bfd *, bfd_boolean);
4301 bfd_byte * (*_bfd_get_relocated_section_contents)
4302 (bfd *, struct bfd_link_info *, struct bfd_link_order *,
4303 bfd_byte *, bfd_boolean, struct bfd_symbol **);
3950
4304
4305 bfd_boolean (*_bfd_relax_section)
4306 (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *);
4307
3951 /* Create a hash table for the linker. Different backends store
3952 different information in this table. */
4308 /* Create a hash table for the linker. Different backends store
4309 different information in this table. */
3953 struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *));
4310 struct bfd_link_hash_table *
4311 (*_bfd_link_hash_table_create) (bfd *);
3954
3955 /* Release the memory associated with the linker hash table. */
4312
4313 /* Release the memory associated with the linker hash table. */
3956 void (*_bfd_link_hash_table_free) PARAMS ((struct bfd_link_hash_table *));
4314 void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *);
3957
3958 /* Add symbols from this object file into the hash table. */
4315
4316 /* Add symbols from this object file into the hash table. */
3959 boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *));
4317 bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
3960
3961 /* Indicate that we are only retrieving symbol values from this section. */
4318
4319 /* Indicate that we are only retrieving symbol values from this section. */
3962 void (*_bfd_link_just_syms) PARAMS ((asection *, struct bfd_link_info *));
4320 void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
3963
3964 /* Do a link based on the link_order structures attached to each
3965 section of the BFD. */
4321
4322 /* Do a link based on the link_order structures attached to each
4323 section of the BFD. */
3966 boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));
4324 bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
3967
3968 /* Should this section be split up into smaller pieces during linking. */
4325
4326 /* Should this section be split up into smaller pieces during linking. */
3969 boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *));
4327 bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
3970
3971 /* Remove sections that are not referenced from the output. */
4328
4329 /* Remove sections that are not referenced from the output. */
3972 boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *));
4330 bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
3973
3974 /* Attempt to merge SEC_MERGE sections. */
4331
4332 /* Attempt to merge SEC_MERGE sections. */
3975 boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *));
4333 bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
3976
3977 /* Discard members of a group. */
4334
4335 /* Discard members of a group. */
3978 boolean (*_bfd_discard_group) PARAMS ((bfd *, struct sec *));
4336 bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
3979
3980 /* Routines to handle dynamic symbols and relocs. */
3981#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
4337
4338 /* Routines to handle dynamic symbols and relocs. */
4339#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
3982CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \
3983CONCAT2 (NAME,_canonicalize_dynamic_symtab), \
3984CONCAT2 (NAME,_get_dynamic_reloc_upper_bound), \
3985CONCAT2 (NAME,_canonicalize_dynamic_reloc)
4340 NAME##_get_dynamic_symtab_upper_bound, \
4341 NAME##_canonicalize_dynamic_symtab, \
4342 NAME##_get_dynamic_reloc_upper_bound, \
4343 NAME##_canonicalize_dynamic_reloc
4344
3986 /* Get the amount of memory required to hold the dynamic symbols. */
4345 /* Get the amount of memory required to hold the dynamic symbols. */
3987 long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *));
4346 long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
3988 /* Read in the dynamic symbols. */
4347 /* Read in the dynamic symbols. */
3989 long (*_bfd_canonicalize_dynamic_symtab)
3990 PARAMS ((bfd *, struct symbol_cache_entry **));
4348 long (*_bfd_canonicalize_dynamic_symtab)
4349 (bfd *, struct bfd_symbol **);
3991 /* Get the amount of memory required to hold the dynamic relocs. */
4350 /* Get the amount of memory required to hold the dynamic relocs. */
3992 long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *));
4351 long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
3993 /* Read in the dynamic relocs. */
4352 /* Read in the dynamic relocs. */
3994 long (*_bfd_canonicalize_dynamic_reloc)
3995 PARAMS ((bfd *, arelent **, struct symbol_cache_entry **));
4353 long (*_bfd_canonicalize_dynamic_reloc)
4354 (bfd *, arelent **, struct bfd_symbol **);
3996
3997 /* Opposite endian version of this target. */
3998 const struct bfd_target * alternative_target;
3999
4000 /* Data for use by back-end routines, which isn't
4001 generic enough to belong in this structure. */
4355
4356 /* Opposite endian version of this target. */
4357 const struct bfd_target * alternative_target;
4358
4359 /* Data for use by back-end routines, which isn't
4360 generic enough to belong in this structure. */
4002 PTR backend_data;
4361 const void *backend_data;
4003
4004} bfd_target;
4005
4362
4363} bfd_target;
4364
4006boolean
4007bfd_set_default_target PARAMS ((const char *name));
4365bfd_boolean bfd_set_default_target (const char *name);
4008
4366
4009const bfd_target *
4010bfd_find_target PARAMS ((const char *target_name, bfd *abfd));
4367const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
4011
4368
4012const char **
4013bfd_target_list PARAMS ((void));
4369const char ** bfd_target_list (void);
4014
4370
4015const bfd_target *
4016bfd_search_for_target PARAMS ((int (* search_func) (const bfd_target *, void *), void *));
4371const bfd_target *bfd_search_for_target
4372 (int (*search_func) (const bfd_target *, void *),
4373 void *);
4017
4018/* Extracted from format.c. */
4374
4375/* Extracted from format.c. */
4019boolean
4020bfd_check_format PARAMS ((bfd *abfd, bfd_format format));
4376bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
4021
4377
4022boolean
4023bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format, char ***matching));
4378bfd_boolean bfd_check_format_matches
4379 (bfd *abfd, bfd_format format, char ***matching);
4024
4380
4025boolean
4026bfd_set_format PARAMS ((bfd *abfd, bfd_format format));
4381bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
4027
4382
4028const char *
4029bfd_format_string PARAMS ((bfd_format format));
4383const char *bfd_format_string (bfd_format format);
4030
4384
4385/* Extracted from linker.c. */
4386bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
4387
4388#define bfd_link_split_section(abfd, sec) \
4389 BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
4390
4391/* Extracted from simple.c. */
4392bfd_byte *bfd_simple_get_relocated_section_contents
4393 (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
4394
4031#ifdef __cplusplus
4032}
4033#endif
4034#endif
4395#ifdef __cplusplus
4396}
4397#endif
4398#endif