OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [branches/] [oc/] [gdb-5.0/] [bfd/] [doc/] [bfd.info-3] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 104 markom
This is bfd.info, produced by Makeinfo version 3.12f from bfd.texinfo.
2
 
3
START-INFO-DIR-ENTRY
4
* Bfd: (bfd).                   The Binary File Descriptor library.
5
END-INFO-DIR-ENTRY
6
 
7
   This file documents the BFD library.
8
 
9
   Copyright (C) 1991 Free Software Foundation, Inc.
10
 
11
   Permission is granted to make and distribute verbatim copies of this
12
manual provided the copyright notice and this permission notice are
13
preserved on all copies.
14
 
15
   Permission is granted to copy and distribute modified versions of
16
this manual under the conditions for verbatim copying, subject to the
17
terms of the GNU General Public License, which includes the provision
18
that the entire resulting derived work is distributed under the terms
19
of a permission notice identical to this one.
20
 
21
   Permission is granted to copy and distribute translations of this
22
manual into another language, under the above conditions for modified
23
versions.
24
 
25

26
File: bfd.info,  Node: typedef arelent,  Next: howto manager,  Prev: Relocations,  Up: Relocations
27
 
28
typedef arelent
29
---------------
30
 
31
   This is the structure of a relocation entry:
32
 
33
 
34
     typedef enum bfd_reloc_status
35
     {
36
            /* No errors detected */
37
       bfd_reloc_ok,
38
 
39
            /* The relocation was performed, but there was an overflow. */
40
       bfd_reloc_overflow,
41
 
42
            /* The address to relocate was not within the section supplied. */
43
       bfd_reloc_outofrange,
44
 
45
            /* Used by special functions */
46
       bfd_reloc_continue,
47
 
48
            /* Unsupported relocation size requested. */
49
       bfd_reloc_notsupported,
50
 
51
            /* Unused */
52
       bfd_reloc_other,
53
 
54
            /* The symbol to relocate against was undefined. */
55
       bfd_reloc_undefined,
56
 
57
            /* The relocation was performed, but may not be ok - presently
58
               generated only when linking i960 coff files with i960 b.out
59
               symbols.  If this type is returned, the error_message argument
60
               to bfd_perform_relocation will be set.  */
61
       bfd_reloc_dangerous
62
      }
63
      bfd_reloc_status_type;
64
 
65
 
66
     typedef struct reloc_cache_entry
67
     {
68
            /* A pointer into the canonical table of pointers  */
69
       struct symbol_cache_entry **sym_ptr_ptr;
70
 
71
            /* offset in section */
72
       bfd_size_type address;
73
 
74
            /* addend for relocation value */
75
       bfd_vma addend;
76
 
77
            /* Pointer to how to perform the required relocation */
78
       reloc_howto_type *howto;
79
 
80
     } arelent;
81
   *Description*
82
Here is a description of each of the fields within an `arelent':
83
 
84
   * `sym_ptr_ptr'
85
   The symbol table pointer points to a pointer to the symbol
86
associated with the relocation request.  It is the pointer into the
87
table returned by the back end's `get_symtab' action. *Note Symbols::.
88
The symbol is referenced through a pointer to a pointer so that tools
89
like the linker can fix up all the symbols of the same name by
90
modifying only one pointer. The relocation routine looks in the symbol
91
and uses the base of the section the symbol is attached to and the
92
value of the symbol as the initial relocation offset. If the symbol
93
pointer is zero, then the section provided is looked up.
94
 
95
   * `address'
96
   The `address' field gives the offset in bytes from the base of the
97
section data which owns the relocation record to the first byte of
98
relocatable information. The actual data relocated will be relative to
99
this point; for example, a relocation type which modifies the bottom
100
two bytes of a four byte word would not touch the first byte pointed to
101
in a big endian world.
102
 
103
   * `addend'
104
   The `addend' is a value provided by the back end to be added (!)  to
105
the relocation offset. Its interpretation is dependent upon the howto.
106
For example, on the 68k the code:
107
 
108
             char foo[];
109
             main()
110
                     {
111
                     return foo[0x12345678];
112
                     }
113
 
114
   Could be compiled into:
115
 
116
             linkw fp,#-4
117
             moveb @#12345678,d0
118
             extbl d0
119
             unlk fp
120
             rts
121
 
122
   This could create a reloc pointing to `foo', but leave the offset in
123
the data, something like:
124
 
125
     RELOCATION RECORDS FOR [.text]:
126
     offset   type      value
127
     00000006 32        _foo
128
 
129
     00000000 4e56 fffc          ; linkw fp,#-4
130
     00000004 1039 1234 5678     ; moveb @#12345678,d0
131
     0000000a 49c0               ; extbl d0
132
     0000000c 4e5e               ; unlk fp
133
     0000000e 4e75               ; rts
134
 
135
   Using coff and an 88k, some instructions don't have enough space in
136
them to represent the full address range, and pointers have to be
137
loaded in two parts. So you'd get something like:
138
 
139
             or.u     r13,r0,hi16(_foo+0x12345678)
140
             ld.b     r2,r13,lo16(_foo+0x12345678)
141
             jmp      r1
142
 
143
   This should create two relocs, both pointing to `_foo', and with
144
0x12340000 in their addend field. The data would consist of:
145
 
146
     RELOCATION RECORDS FOR [.text]:
147
     offset   type      value
148
     00000002 HVRT16    _foo+0x12340000
149
     00000006 LVRT16    _foo+0x12340000
150
 
151
     00000000 5da05678           ; or.u r13,r0,0x5678
152
     00000004 1c4d5678           ; ld.b r2,r13,0x5678
153
     00000008 f400c001           ; jmp r1
154
 
155
   The relocation routine digs out the value from the data, adds it to
156
the addend to get the original offset, and then adds the value of
157
`_foo'. Note that all 32 bits have to be kept around somewhere, to cope
158
with carry from bit 15 to bit 16.
159
 
160
   One further example is the sparc and the a.out format. The sparc has
161
a similar problem to the 88k, in that some instructions don't have room
162
for an entire offset, but on the sparc the parts are created in odd
163
sized lumps. The designers of the a.out format chose to not use the
164
data within the section for storing part of the offset; all the offset
165
is kept within the reloc. Anything in the data should be ignored.
166
 
167
             save %sp,-112,%sp
168
             sethi %hi(_foo+0x12345678),%g2
169
             ldsb [%g2+%lo(_foo+0x12345678)],%i0
170
             ret
171
             restore
172
 
173
   Both relocs contain a pointer to `foo', and the offsets contain junk.
174
 
175
     RELOCATION RECORDS FOR [.text]:
176
     offset   type      value
177
     00000004 HI22      _foo+0x12345678
178
     00000008 LO10      _foo+0x12345678
179
 
180
     00000000 9de3bf90     ; save %sp,-112,%sp
181
     00000004 05000000     ; sethi %hi(_foo+0),%g2
182
     00000008 f048a000     ; ldsb [%g2+%lo(_foo+0)],%i0
183
     0000000c 81c7e008     ; ret
184
     00000010 81e80000     ; restore
185
 
186
   * `howto'
187
   The `howto' field can be imagined as a relocation instruction. It is
188
a pointer to a structure which contains information on what to do with
189
all of the other information in the reloc record and data section. A
190
back end would normally have a relocation instruction set and turn
191
relocations into pointers to the correct structure on input - but it
192
would be possible to create each howto field on demand.
193
 
194
`enum complain_overflow'
195
........................
196
 
197
   Indicates what sort of overflow checking should be done when
198
performing a relocation.
199
 
200
 
201
     enum complain_overflow
202
     {
203
            /* Do not complain on overflow. */
204
       complain_overflow_dont,
205
 
206
            /* Complain if the bitfield overflows, whether it is considered
207
               as signed or unsigned. */
208
       complain_overflow_bitfield,
209
 
210
            /* Complain if the value overflows when considered as signed
211
               number. */
212
       complain_overflow_signed,
213
 
214
            /* Complain if the value overflows when considered as an
215
               unsigned number. */
216
       complain_overflow_unsigned
217
     };
218
 
219
`reloc_howto_type'
220
..................
221
 
222
   The `reloc_howto_type' is a structure which contains all the
223
information that libbfd needs to know to tie up a back end's data.
224
 
225
     struct symbol_cache_entry;             /* Forward declaration */
226
 
227
     struct reloc_howto_struct
228
     {
229
            /*  The type field has mainly a documentary use - the back end can
230
                do what it wants with it, though normally the back end's
231
                external idea of what a reloc number is stored
232
                in this field. For example, a PC relative word relocation
233
                in a coff environment has the type 023 - because that's
234
                what the outside world calls a R_PCRWORD reloc. */
235
       unsigned int type;
236
 
237
            /*  The value the final relocation is shifted right by. This drops
238
                unwanted data from the relocation.  */
239
       unsigned int rightshift;
240
 
241
            /*  The size of the item to be relocated.  This is *not* a
242
                power-of-two measure.  To get the number of bytes operated
243
                on by a type of relocation, use bfd_get_reloc_size.  */
244
       int size;
245
 
246
            /*  The number of bits in the item to be relocated.  This is used
247
                when doing overflow checking.  */
248
       unsigned int bitsize;
249
 
250
            /*  Notes that the relocation is relative to the location in the
251
                data section of the addend. The relocation function will
252
                subtract from the relocation value the address of the location
253
                being relocated. */
254
       boolean pc_relative;
255
 
256
            /*  The bit position of the reloc value in the destination.
257
                The relocated value is left shifted by this amount. */
258
       unsigned int bitpos;
259
 
260
            /* What type of overflow error should be checked for when
261
               relocating. */
262
       enum complain_overflow complain_on_overflow;
263
 
264
            /* If this field is non null, then the supplied function is
265
               called rather than the normal function. This allows really
266
               strange relocation methods to be accomodated (e.g., i960 callj
267
               instructions). */
268
       bfd_reloc_status_type (*special_function)
269
                                        PARAMS ((bfd *abfd,
270
                                                 arelent *reloc_entry,
271
                                                 struct symbol_cache_entry *symbol,
272
                                                 PTR data,
273
                                                 asection *input_section,
274
                                                 bfd *output_bfd,
275
                                                 char **error_message));
276
 
277
            /* The textual name of the relocation type. */
278
       char *name;
279
 
280
            /* Some formats record a relocation addend in the section contents
281
               rather than with the relocation.  For ELF formats this is the
282
               distinction between USE_REL and USE_RELA (though the code checks
283
               for USE_REL == 1/0).  The value of this field is TRUE if the
284
               addend is recorded with the section contents; when performing a
285
               partial link (ld -r) the section contents (the data) will be
286
               modified.  The value of this field is FALSE if addends are
287
               recorded with the relocation (in arelent.addend); when performing
288
               a partial link the relocation will be modified.
289
               All relocations for all ELF USE_RELA targets should set this field
290
               to FALSE (values of TRUE should be looked on with suspicion).
291
               However, the converse is not true: not all relocations of all ELF
292
               USE_REL targets set this field to TRUE.  Why this is so is peculiar
293
               to each particular target.  For relocs that aren't used in partial
294
               links (e.g. GOT stuff) it doesn't matter what this is set to.  */
295
       boolean partial_inplace;
296
 
297
            /* The src_mask selects which parts of the read in data
298
               are to be used in the relocation sum.  E.g., if this was an 8 bit
299
               byte of data which we read and relocated, this would be
300
               0x000000ff. When we have relocs which have an addend, such as
301
               sun4 extended relocs, the value in the offset part of a
302
               relocating field is garbage so we never use it. In this case
303
               the mask would be 0x00000000. */
304
       bfd_vma src_mask;
305
 
306
            /* The dst_mask selects which parts of the instruction are replaced
307
               into the instruction. In most cases src_mask == dst_mask,
308
               except in the above special case, where dst_mask would be
309
               0x000000ff, and src_mask would be 0x00000000.   */
310
       bfd_vma dst_mask;
311
 
312
            /* When some formats create PC relative instructions, they leave
313
               the value of the pc of the place being relocated in the offset
314
               slot of the instruction, so that a PC relative relocation can
315
               be made just by adding in an ordinary offset (e.g., sun3 a.out).
316
               Some formats leave the displacement part of an instruction
317
               empty (e.g., m88k bcs); this flag signals the fact.*/
318
       boolean pcrel_offset;
319
 
320
     };
321
 
322
`The HOWTO Macro'
323
.................
324
 
325
   *Description*
326
The HOWTO define is horrible and will go away.
327
     #define HOWTO(C, R,S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
328
       {(unsigned)C,R,S,B, P, BI, O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC}
329
 
330
   *Description*
331
And will be replaced with the totally magic way. But for the moment, we
332
are compatible, so do it this way.
333
     #define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN)
334
 
335
   *Description*
336
This is used to fill in an empty howto entry in an array.
337
     #define EMPTY_HOWTO(C) \
338
       HOWTO((C),0,0,0,false,0,complain_overflow_dont,NULL,NULL,false,0,0,false)
339
 
340
   *Description*
341
Helper routine to turn a symbol into a relocation value.
342
     #define HOWTO_PREPARE(relocation, symbol)      \
343
       {                                            \
344
       if (symbol != (asymbol *)NULL) {             \
345
         if (bfd_is_com_section (symbol->section)) { \
346
           relocation = 0;                          \
347
         }                                          \
348
         else {                                     \
349
           relocation = symbol->value;              \
350
         }                                          \
351
       }                                            \
352
     }
353
 
354
`bfd_get_reloc_size'
355
....................
356
 
357
   *Synopsis*
358
     unsigned int bfd_get_reloc_size (reloc_howto_type *);
359
   *Description*
360
For a reloc_howto_type that operates on a fixed number of bytes, this
361
returns the number of bytes operated on.
362
 
363
`arelent_chain'
364
...............
365
 
366
   *Description*
367
How relocs are tied together in an `asection':
368
     typedef struct relent_chain {
369
       arelent relent;
370
       struct   relent_chain *next;
371
     } arelent_chain;
372
 
373
`bfd_check_overflow'
374
....................
375
 
376
   *Synopsis*
377
     bfd_reloc_status_type
378
     bfd_check_overflow
379
        (enum complain_overflow how,
380
         unsigned int bitsize,
381
         unsigned int rightshift,
382
         unsigned int addrsize,
383
         bfd_vma relocation);
384
   *Description*
385
Perform overflow checking on RELOCATION which has BITSIZE significant
386
bits and will be shifted right by RIGHTSHIFT bits, on a machine with
387
addresses containing ADDRSIZE significant bits.  The result is either of
388
`bfd_reloc_ok' or `bfd_reloc_overflow'.
389
 
390
`bfd_perform_relocation'
391
........................
392
 
393
   *Synopsis*
394
     bfd_reloc_status_type
395
     bfd_perform_relocation
396
        (bfd *abfd,
397
         arelent *reloc_entry,
398
         PTR data,
399
         asection *input_section,
400
         bfd *output_bfd,
401
         char **error_message);
402
   *Description*
403
If OUTPUT_BFD is supplied to this function, the generated image will be
404
relocatable; the relocations are copied to the output file after they
405
have been changed to reflect the new state of the world. There are two
406
ways of reflecting the results of partial linkage in an output file: by
407
modifying the output data in place, and by modifying the relocation
408
record.  Some native formats (e.g., basic a.out and basic coff) have no
409
way of specifying an addend in the relocation type, so the addend has
410
to go in the output data.  This is no big deal since in these formats
411
the output data slot will always be big enough for the addend. Complex
412
reloc types with addends were invented to solve just this problem.  The
413
ERROR_MESSAGE argument is set to an error message if this return
414
`bfd_reloc_dangerous'.
415
 
416
`bfd_install_relocation'
417
........................
418
 
419
   *Synopsis*
420
     bfd_reloc_status_type
421
     bfd_install_relocation
422
        (bfd *abfd,
423
         arelent *reloc_entry,
424
         PTR data, bfd_vma data_start,
425
         asection *input_section,
426
         char **error_message);
427
   *Description*
428
This looks remarkably like `bfd_perform_relocation', except it does not
429
expect that the section contents have been filled in.  I.e., it's
430
suitable for use when creating, rather than applying a relocation.
431
 
432
   For now, this function should be considered reserved for the
433
assembler.
434
 
435

436
File: bfd.info,  Node: howto manager,  Prev: typedef arelent,  Up: Relocations
437
 
438
The howto manager
439
=================
440
 
441
   When an application wants to create a relocation, but doesn't know
442
what the target machine might call it, it can find out by using this
443
bit of code.
444
 
445
`bfd_reloc_code_type'
446
.....................
447
 
448
   *Description*
449
The insides of a reloc code.  The idea is that, eventually, there will
450
be one enumerator for every type of relocation we ever do.  Pass one of
451
these values to `bfd_reloc_type_lookup', and it'll return a howto
452
pointer.
453
 
454
   This does mean that the application must determine the correct
455
enumerator value; you can't get a howto pointer from a random set of
456
attributes.
457
 
458
   Here are the possible values for `enum bfd_reloc_code_real':
459
 
460
 - : BFD_RELOC_64
461
 - : BFD_RELOC_32
462
 - : BFD_RELOC_26
463
 - : BFD_RELOC_24
464
 - : BFD_RELOC_16
465
 - : BFD_RELOC_14
466
 - : BFD_RELOC_8
467
     Basic absolute relocations of N bits.
468
 
469
 - : BFD_RELOC_64_PCREL
470
 - : BFD_RELOC_32_PCREL
471
 - : BFD_RELOC_24_PCREL
472
 - : BFD_RELOC_16_PCREL
473
 - : BFD_RELOC_12_PCREL
474
 - : BFD_RELOC_8_PCREL
475
     PC-relative relocations.  Sometimes these are relative to the
476
     address of the relocation itself; sometimes they are relative to
477
     the start of the section containing the relocation.  It depends on
478
     the specific target.
479
 
480
     The 24-bit relocation is used in some Intel 960 configurations.
481
 
482
 - : BFD_RELOC_32_GOT_PCREL
483
 - : BFD_RELOC_16_GOT_PCREL
484
 - : BFD_RELOC_8_GOT_PCREL
485
 - : BFD_RELOC_32_GOTOFF
486
 - : BFD_RELOC_16_GOTOFF
487
 - : BFD_RELOC_LO16_GOTOFF
488
 - : BFD_RELOC_HI16_GOTOFF
489
 - : BFD_RELOC_HI16_S_GOTOFF
490
 - : BFD_RELOC_8_GOTOFF
491
 - : BFD_RELOC_32_PLT_PCREL
492
 - : BFD_RELOC_24_PLT_PCREL
493
 - : BFD_RELOC_16_PLT_PCREL
494
 - : BFD_RELOC_8_PLT_PCREL
495
 - : BFD_RELOC_32_PLTOFF
496
 - : BFD_RELOC_16_PLTOFF
497
 - : BFD_RELOC_LO16_PLTOFF
498
 - : BFD_RELOC_HI16_PLTOFF
499
 - : BFD_RELOC_HI16_S_PLTOFF
500
 - : BFD_RELOC_8_PLTOFF
501
     For ELF.
502
 
503
 - : BFD_RELOC_68K_GLOB_DAT
504
 - : BFD_RELOC_68K_JMP_SLOT
505
 - : BFD_RELOC_68K_RELATIVE
506
     Relocations used by 68K ELF.
507
 
508
 - : BFD_RELOC_32_BASEREL
509
 - : BFD_RELOC_16_BASEREL
510
 - : BFD_RELOC_LO16_BASEREL
511
 - : BFD_RELOC_HI16_BASEREL
512
 - : BFD_RELOC_HI16_S_BASEREL
513
 - : BFD_RELOC_8_BASEREL
514
 - : BFD_RELOC_RVA
515
     Linkage-table relative.
516
 
517
 - : BFD_RELOC_8_FFnn
518
     Absolute 8-bit relocation, but used to form an address like 0xFFnn.
519
 
520
 - : BFD_RELOC_32_PCREL_S2
521
 - : BFD_RELOC_16_PCREL_S2
522
 - : BFD_RELOC_23_PCREL_S2
523
     These PC-relative relocations are stored as word displacements -
524
     i.e., byte displacements shifted right two bits.  The 30-bit word
525
     displacement (<<32_PCREL_S2>> - 32 bits, shifted 2) is used on the
526
     SPARC.  (SPARC tools generally refer to this as <>.)  The
527
     signed 16-bit displacement is used on the MIPS, and the 23-bit
528
     displacement is used on the Alpha.
529
 
530
 - : BFD_RELOC_HI22
531
 - : BFD_RELOC_LO10
532
     High 22 bits and low 10 bits of 32-bit value, placed into lower
533
     bits of the target word.  These are used on the SPARC.
534
 
535
 - : BFD_RELOC_GPREL16
536
 - : BFD_RELOC_GPREL32
537
     For systems that allocate a Global Pointer register, these are
538
     displacements off that register.  These relocation types are
539
     handled specially, because the value the register will have is
540
     decided relatively late.
541
 
542
 - : BFD_RELOC_I960_CALLJ
543
     Reloc types used for i960/b.out.
544
 
545
 - : BFD_RELOC_NONE
546
 - : BFD_RELOC_SPARC_WDISP22
547
 - : BFD_RELOC_SPARC22
548
 - : BFD_RELOC_SPARC13
549
 - : BFD_RELOC_SPARC_GOT10
550
 - : BFD_RELOC_SPARC_GOT13
551
 - : BFD_RELOC_SPARC_GOT22
552
 - : BFD_RELOC_SPARC_PC10
553
 - : BFD_RELOC_SPARC_PC22
554
 - : BFD_RELOC_SPARC_WPLT30
555
 - : BFD_RELOC_SPARC_COPY
556
 - : BFD_RELOC_SPARC_GLOB_DAT
557
 - : BFD_RELOC_SPARC_JMP_SLOT
558
 - : BFD_RELOC_SPARC_RELATIVE
559
 - : BFD_RELOC_SPARC_UA32
560
     SPARC ELF relocations.  There is probably some overlap with other
561
     relocation types already defined.
562
 
563
 - : BFD_RELOC_SPARC_BASE13
564
 - : BFD_RELOC_SPARC_BASE22
565
     I think these are specific to SPARC a.out (e.g., Sun 4).
566
 
567
 - : BFD_RELOC_SPARC_64
568
 - : BFD_RELOC_SPARC_10
569
 - : BFD_RELOC_SPARC_11
570
 - : BFD_RELOC_SPARC_OLO10
571
 - : BFD_RELOC_SPARC_HH22
572
 - : BFD_RELOC_SPARC_HM10
573
 - : BFD_RELOC_SPARC_LM22
574
 - : BFD_RELOC_SPARC_PC_HH22
575
 - : BFD_RELOC_SPARC_PC_HM10
576
 - : BFD_RELOC_SPARC_PC_LM22
577
 - : BFD_RELOC_SPARC_WDISP16
578
 - : BFD_RELOC_SPARC_WDISP19
579
 - : BFD_RELOC_SPARC_7
580
 - : BFD_RELOC_SPARC_6
581
 - : BFD_RELOC_SPARC_5
582
 - : BFD_RELOC_SPARC_DISP64
583
 - : BFD_RELOC_SPARC_PLT64
584
 - : BFD_RELOC_SPARC_HIX22
585
 - : BFD_RELOC_SPARC_LOX10
586
 - : BFD_RELOC_SPARC_H44
587
 - : BFD_RELOC_SPARC_M44
588
 - : BFD_RELOC_SPARC_L44
589
 - : BFD_RELOC_SPARC_REGISTER
590
     SPARC64 relocations
591
 
592
 - : BFD_RELOC_SPARC_REV32
593
     SPARC little endian relocation
594
 
595
 - : BFD_RELOC_ALPHA_GPDISP_HI16
596
     Alpha ECOFF and ELF relocations.  Some of these treat the symbol or
597
     "addend" in some special way.  For GPDISP_HI16 ("gpdisp")
598
     relocations, the symbol is ignored when writing; when reading, it
599
     will be the absolute section symbol.  The addend is the
600
     displacement in bytes of the "lda" instruction from the "ldah"
601
     instruction (which is at the address of this reloc).
602
 
603
 - : BFD_RELOC_ALPHA_GPDISP_LO16
604
     For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
605
     with GPDISP_HI16 relocs.  The addend is ignored when writing the
606
     relocations out, and is filled in with the file's GP value on
607
     reading, for convenience.
608
 
609
 - : BFD_RELOC_ALPHA_GPDISP
610
     The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
611
     relocation except that there is no accompanying GPDISP_LO16
612
     relocation.
613
 
614
 - : BFD_RELOC_ALPHA_LITERAL
615
 - : BFD_RELOC_ALPHA_ELF_LITERAL
616
 - : BFD_RELOC_ALPHA_LITUSE
617
     The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
618
     the assembler turns it into a LDQ instruction to load the address
619
     of the symbol, and then fills in a register in the real
620
     instruction.
621
 
622
     The LITERAL reloc, at the LDQ instruction, refers to the .lita
623
     section symbol.  The addend is ignored when writing, but is filled
624
     in with the file's GP value on reading, for convenience, as with
625
     the GPDISP_LO16 reloc.
626
 
627
     The ELF_LITERAL reloc is somewhere between 16_GOTOFF and
628
     GPDISP_LO16.  It should refer to the symbol to be referenced, as
629
     with 16_GOTOFF, but it generates output not based on the position
630
     within the .got section, but relative to the GP value chosen for
631
     the file during the final link stage.
632
 
633
     The LITUSE reloc, on the instruction using the loaded address,
634
     gives information to the linker that it might be able to use to
635
     optimize away some literal section references.  The symbol is
636
     ignored (read as the absolute section symbol), and the "addend"
637
     indicates the type of instruction using the register: 1 - "memory"
638
     fmt insn 2 - byte-manipulation (byte offset reg) 3 - jsr (target
639
     of branch)
640
 
641
     The GNU linker currently doesn't do any of this optimizing.
642
 
643
 - : BFD_RELOC_ALPHA_USER_LITERAL
644
 - : BFD_RELOC_ALPHA_USER_LITUSE_BASE
645
 - : BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF
646
 - : BFD_RELOC_ALPHA_USER_LITUSE_JSR
647
 - : BFD_RELOC_ALPHA_USER_GPDISP
648
 - : BFD_RELOC_ALPHA_USER_GPRELHIGH
649
 - : BFD_RELOC_ALPHA_USER_GPRELLOW
650
     The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to
651
     process the explicit !!sequence relocations, and are mapped
652
     into the normal relocations at the end of processing.
653
 
654
 - : BFD_RELOC_ALPHA_HINT
655
     The HINT relocation indicates a value that should be filled into
656
     the "hint" field of a jmp/jsr/ret instruction, for possible branch-
657
     prediction logic which may be provided on some processors.
658
 
659
 - : BFD_RELOC_ALPHA_LINKAGE
660
     The LINKAGE relocation outputs a linkage pair in the object file,
661
     which is filled by the linker.
662
 
663
 - : BFD_RELOC_ALPHA_CODEADDR
664
     The CODEADDR relocation outputs a STO_CA in the object file, which
665
     is filled by the linker.
666
 
667
 - : BFD_RELOC_MIPS_JMP
668
     Bits 27..2 of the relocation address shifted right 2 bits; simple
669
     reloc otherwise.
670
 
671
 - : BFD_RELOC_MIPS16_JMP
672
     The MIPS16 jump instruction.
673
 
674
 - : BFD_RELOC_MIPS16_GPREL
675
     MIPS16 GP relative reloc.
676
 
677
 - : BFD_RELOC_HI16
678
     High 16 bits of 32-bit value; simple reloc.
679
 
680
 - : BFD_RELOC_HI16_S
681
     High 16 bits of 32-bit value but the low 16 bits will be sign
682
     extended and added to form the final result.  If the low 16 bits
683
     form a negative number, we need to add one to the high value to
684
     compensate for the borrow when the low bits are added.
685
 
686
 - : BFD_RELOC_LO16
687
     Low 16 bits.
688
 
689
 - : BFD_RELOC_PCREL_HI16_S
690
     Like BFD_RELOC_HI16_S, but PC relative.
691
 
692
 - : BFD_RELOC_PCREL_LO16
693
     Like BFD_RELOC_LO16, but PC relative.
694
 
695
 - : BFD_RELOC_MIPS_GPREL
696
     Relocation relative to the global pointer.
697
 
698
 - : BFD_RELOC_MIPS_LITERAL
699
     Relocation against a MIPS literal section.
700
 
701
 - : BFD_RELOC_MIPS_GOT16
702
 - : BFD_RELOC_MIPS_CALL16
703
 - : BFD_RELOC_MIPS_GPREL32
704
 - : BFD_RELOC_MIPS_GOT_HI16
705
 - : BFD_RELOC_MIPS_GOT_LO16
706
 - : BFD_RELOC_MIPS_CALL_HI16
707
 - : BFD_RELOC_MIPS_CALL_LO16
708
 - : BFD_RELOC_MIPS_SUB
709
 - : BFD_RELOC_MIPS_GOT_PAGE
710
 - : BFD_RELOC_MIPS_GOT_OFST
711
 - : BFD_RELOC_MIPS_GOT_DISP
712
     MIPS ELF relocations.
713
 
714
 - : BFD_RELOC_386_GOT32
715
 - : BFD_RELOC_386_PLT32
716
 - : BFD_RELOC_386_COPY
717
 - : BFD_RELOC_386_GLOB_DAT
718
 - : BFD_RELOC_386_JUMP_SLOT
719
 - : BFD_RELOC_386_RELATIVE
720
 - : BFD_RELOC_386_GOTOFF
721
 - : BFD_RELOC_386_GOTPC
722
     i386/elf relocations
723
 
724
 - : BFD_RELOC_NS32K_IMM_8
725
 - : BFD_RELOC_NS32K_IMM_16
726
 - : BFD_RELOC_NS32K_IMM_32
727
 - : BFD_RELOC_NS32K_IMM_8_PCREL
728
 - : BFD_RELOC_NS32K_IMM_16_PCREL
729
 - : BFD_RELOC_NS32K_IMM_32_PCREL
730
 - : BFD_RELOC_NS32K_DISP_8
731
 - : BFD_RELOC_NS32K_DISP_16
732
 - : BFD_RELOC_NS32K_DISP_32
733
 - : BFD_RELOC_NS32K_DISP_8_PCREL
734
 - : BFD_RELOC_NS32K_DISP_16_PCREL
735
 - : BFD_RELOC_NS32K_DISP_32_PCREL
736
     ns32k relocations
737
 
738
 - : BFD_RELOC_PJ_CODE_HI16
739
 - : BFD_RELOC_PJ_CODE_LO16
740
 - : BFD_RELOC_PJ_CODE_DIR16
741
 - : BFD_RELOC_PJ_CODE_DIR32
742
 - : BFD_RELOC_PJ_CODE_REL16
743
 - : BFD_RELOC_PJ_CODE_REL32
744
     Picojava relocs.  Not all of these appear in object files.
745
 
746
 - : BFD_RELOC_PPC_B26
747
 - : BFD_RELOC_PPC_BA26
748
 - : BFD_RELOC_PPC_TOC16
749
 - : BFD_RELOC_PPC_B16
750
 - : BFD_RELOC_PPC_B16_BRTAKEN
751
 - : BFD_RELOC_PPC_B16_BRNTAKEN
752
 - : BFD_RELOC_PPC_BA16
753
 - : BFD_RELOC_PPC_BA16_BRTAKEN
754
 - : BFD_RELOC_PPC_BA16_BRNTAKEN
755
 - : BFD_RELOC_PPC_COPY
756
 - : BFD_RELOC_PPC_GLOB_DAT
757
 - : BFD_RELOC_PPC_JMP_SLOT
758
 - : BFD_RELOC_PPC_RELATIVE
759
 - : BFD_RELOC_PPC_LOCAL24PC
760
 - : BFD_RELOC_PPC_EMB_NADDR32
761
 - : BFD_RELOC_PPC_EMB_NADDR16
762
 - : BFD_RELOC_PPC_EMB_NADDR16_LO
763
 - : BFD_RELOC_PPC_EMB_NADDR16_HI
764
 - : BFD_RELOC_PPC_EMB_NADDR16_HA
765
 - : BFD_RELOC_PPC_EMB_SDAI16
766
 - : BFD_RELOC_PPC_EMB_SDA2I16
767
 - : BFD_RELOC_PPC_EMB_SDA2REL
768
 - : BFD_RELOC_PPC_EMB_SDA21
769
 - : BFD_RELOC_PPC_EMB_MRKREF
770
 - : BFD_RELOC_PPC_EMB_RELSEC16
771
 - : BFD_RELOC_PPC_EMB_RELST_LO
772
 - : BFD_RELOC_PPC_EMB_RELST_HI
773
 - : BFD_RELOC_PPC_EMB_RELST_HA
774
 - : BFD_RELOC_PPC_EMB_BIT_FLD
775
 - : BFD_RELOC_PPC_EMB_RELSDA
776
     Power(rs6000) and PowerPC relocations.
777
 
778
 - : BFD_RELOC_I370_D12
779
     IBM 370/390 relocations
780
 
781
 - : BFD_RELOC_CTOR
782
     The type of reloc used to build a contructor table - at the moment
783
     probably a 32 bit wide absolute relocation, but the target can
784
     choose.  It generally does map to one of the other relocation
785
     types.
786
 
787
 - : BFD_RELOC_ARM_PCREL_BRANCH
788
     ARM 26 bit pc-relative branch.  The lowest two bits must be zero
789
     and are not stored in the instruction.
790
 
791
 - : BFD_RELOC_ARM_PCREL_BLX
792
     ARM 26 bit pc-relative branch.  The lowest bit must be zero and is
793
     not stored in the instruction.  The 2nd lowest bit comes from a 1
794
     bit field in the instruction.
795
 
796
 - : BFD_RELOC_THUMB_PCREL_BLX
797
     Thumb 22 bit pc-relative branch.  The lowest bit must be zero and
798
     is not stored in the instruction.  The 2nd lowest bit comes from a
799
     1 bit field in the instruction.
800
 
801
 - : BFD_RELOC_ARM_IMMEDIATE
802
 - : BFD_RELOC_ARM_ADRL_IMMEDIATE
803
 - : BFD_RELOC_ARM_OFFSET_IMM
804
 - : BFD_RELOC_ARM_SHIFT_IMM
805
 - : BFD_RELOC_ARM_SWI
806
 - : BFD_RELOC_ARM_MULTI
807
 - : BFD_RELOC_ARM_CP_OFF_IMM
808
 - : BFD_RELOC_ARM_ADR_IMM
809
 - : BFD_RELOC_ARM_LDR_IMM
810
 - : BFD_RELOC_ARM_LITERAL
811
 - : BFD_RELOC_ARM_IN_POOL
812
 - : BFD_RELOC_ARM_OFFSET_IMM8
813
 - : BFD_RELOC_ARM_HWLITERAL
814
 - : BFD_RELOC_ARM_THUMB_ADD
815
 - : BFD_RELOC_ARM_THUMB_IMM
816
 - : BFD_RELOC_ARM_THUMB_SHIFT
817
 - : BFD_RELOC_ARM_THUMB_OFFSET
818
 - : BFD_RELOC_ARM_GOT12
819
 - : BFD_RELOC_ARM_GOT32
820
 - : BFD_RELOC_ARM_JUMP_SLOT
821
 - : BFD_RELOC_ARM_COPY
822
 - : BFD_RELOC_ARM_GLOB_DAT
823
 - : BFD_RELOC_ARM_PLT32
824
 - : BFD_RELOC_ARM_RELATIVE
825
 - : BFD_RELOC_ARM_GOTOFF
826
 - : BFD_RELOC_ARM_GOTPC
827
     These relocs are only used within the ARM assembler.  They are not
828
     (at present) written to any object files.
829
 
830
 - : BFD_RELOC_SH_PCDISP8BY2
831
 - : BFD_RELOC_SH_PCDISP12BY2
832
 - : BFD_RELOC_SH_IMM4
833
 - : BFD_RELOC_SH_IMM4BY2
834
 - : BFD_RELOC_SH_IMM4BY4
835
 - : BFD_RELOC_SH_IMM8
836
 - : BFD_RELOC_SH_IMM8BY2
837
 - : BFD_RELOC_SH_IMM8BY4
838
 - : BFD_RELOC_SH_PCRELIMM8BY2
839
 - : BFD_RELOC_SH_PCRELIMM8BY4
840
 - : BFD_RELOC_SH_SWITCH16
841
 - : BFD_RELOC_SH_SWITCH32
842
 - : BFD_RELOC_SH_USES
843
 - : BFD_RELOC_SH_COUNT
844
 - : BFD_RELOC_SH_ALIGN
845
 - : BFD_RELOC_SH_CODE
846
 - : BFD_RELOC_SH_DATA
847
 - : BFD_RELOC_SH_LABEL
848
 - : BFD_RELOC_SH_LOOP_START
849
 - : BFD_RELOC_SH_LOOP_END
850
     Hitachi SH relocs.  Not all of these appear in object files.
851
 
852
 - : BFD_RELOC_THUMB_PCREL_BRANCH9
853
 - : BFD_RELOC_THUMB_PCREL_BRANCH12
854
 - : BFD_RELOC_THUMB_PCREL_BRANCH23
855
     Thumb 23-, 12- and 9-bit pc-relative branches.  The lowest bit must
856
     be zero and is not stored in the instruction.
857
 
858
 - : BFD_RELOC_ARC_B22_PCREL
859
     Argonaut RISC Core (ARC) relocs.  ARC 22 bit pc-relative branch.
860
     The lowest two bits must be zero and are not stored in the
861
     instruction.  The high 20 bits are installed in bits 26 through 7
862
     of the instruction.
863
 
864
 - : BFD_RELOC_ARC_B26
865
     ARC 26 bit absolute branch.  The lowest two bits must be zero and
866
     are not stored in the instruction.  The high 24 bits are installed
867
     in bits 23 through 0.
868
 
869
 - : BFD_RELOC_D10V_10_PCREL_R
870
     Mitsubishi D10V relocs.  This is a 10-bit reloc with the right 2
871
     bits assumed to be 0.
872
 
873
 - : BFD_RELOC_D10V_10_PCREL_L
874
     Mitsubishi D10V relocs.  This is a 10-bit reloc with the right 2
875
     bits assumed to be 0.  This is the same as the previous reloc
876
     except it is in the left container, i.e., shifted left 15 bits.
877
 
878
 - : BFD_RELOC_D10V_18
879
     This is an 18-bit reloc with the right 2 bits assumed to be 0.
880
 
881
 - : BFD_RELOC_D10V_18_PCREL
882
     This is an 18-bit reloc with the right 2 bits assumed to be 0.
883
 
884
 - : BFD_RELOC_D30V_6
885
     Mitsubishi D30V relocs.  This is a 6-bit absolute reloc.
886
 
887
 - : BFD_RELOC_D30V_9_PCREL
888
     This is a 6-bit pc-relative reloc with the right 3 bits assumed to
889
     be 0.
890
 
891
 - : BFD_RELOC_D30V_9_PCREL_R
892
     This is a 6-bit pc-relative reloc with the right 3 bits assumed to
893
     be 0. Same as the previous reloc but on the right side of the
894
     container.
895
 
896
 - : BFD_RELOC_D30V_15
897
     This is a 12-bit absolute reloc with the right 3 bitsassumed to be
898
     0.
899
 
900
 - : BFD_RELOC_D30V_15_PCREL
901
     This is a 12-bit pc-relative reloc with the right 3 bits assumed
902
     to be 0.
903
 
904
 - : BFD_RELOC_D30V_15_PCREL_R
905
     This is a 12-bit pc-relative reloc with the right 3 bits assumed
906
     to be 0. Same as the previous reloc but on the right side of the
907
     container.
908
 
909
 - : BFD_RELOC_D30V_21
910
     This is an 18-bit absolute reloc with the right 3 bits assumed to
911
     be 0.
912
 
913
 - : BFD_RELOC_D30V_21_PCREL
914
     This is an 18-bit pc-relative reloc with the right 3 bits assumed
915
     to be 0.
916
 
917
 - : BFD_RELOC_D30V_21_PCREL_R
918
     This is an 18-bit pc-relative reloc with the right 3 bits assumed
919
     to be 0. Same as the previous reloc but on the right side of the
920
     container.
921
 
922
 - : BFD_RELOC_D30V_32
923
     This is a 32-bit absolute reloc.
924
 
925
 - : BFD_RELOC_D30V_32_PCREL
926
     This is a 32-bit pc-relative reloc.
927
 
928
 - : BFD_RELOC_M32R_24
929
     Mitsubishi M32R relocs.  This is a 24 bit absolute address.
930
 
931
 - : BFD_RELOC_M32R_10_PCREL
932
     This is a 10-bit pc-relative reloc with the right 2 bits assumed
933
     to be 0.
934
 
935
 - : BFD_RELOC_M32R_18_PCREL
936
     This is an 18-bit reloc with the right 2 bits assumed to be 0.
937
 
938
 - : BFD_RELOC_M32R_26_PCREL
939
     This is a 26-bit reloc with the right 2 bits assumed to be 0.
940
 
941
 - : BFD_RELOC_M32R_HI16_ULO
942
     This is a 16-bit reloc containing the high 16 bits of an address
943
     used when the lower 16 bits are treated as unsigned.
944
 
945
 - : BFD_RELOC_M32R_HI16_SLO
946
     This is a 16-bit reloc containing the high 16 bits of an address
947
     used when the lower 16 bits are treated as signed.
948
 
949
 - : BFD_RELOC_M32R_LO16
950
     This is a 16-bit reloc containing the lower 16 bits of an address.
951
 
952
 - : BFD_RELOC_M32R_SDA16
953
     This is a 16-bit reloc containing the small data area offset for
954
     use in add3, load, and store instructions.
955
 
956
 - : BFD_RELOC_V850_9_PCREL
957
     This is a 9-bit reloc
958
 
959
 - : BFD_RELOC_V850_22_PCREL
960
     This is a 22-bit reloc
961
 
962
 - : BFD_RELOC_V850_SDA_16_16_OFFSET
963
     This is a 16 bit offset from the short data area pointer.
964
 
965
 - : BFD_RELOC_V850_SDA_15_16_OFFSET
966
     This is a 16 bit offset (of which only 15 bits are used) from the
967
     short data area pointer.
968
 
969
 - : BFD_RELOC_V850_ZDA_16_16_OFFSET
970
     This is a 16 bit offset from the zero data area pointer.
971
 
972
 - : BFD_RELOC_V850_ZDA_15_16_OFFSET
973
     This is a 16 bit offset (of which only 15 bits are used) from the
974
     zero data area pointer.
975
 
976
 - : BFD_RELOC_V850_TDA_6_8_OFFSET
977
     This is an 8 bit offset (of which only 6 bits are used) from the
978
     tiny data area pointer.
979
 
980
 - : BFD_RELOC_V850_TDA_7_8_OFFSET
981
     This is an 8bit offset (of which only 7 bits are used) from the
982
     tiny data area pointer.
983
 
984
 - : BFD_RELOC_V850_TDA_7_7_OFFSET
985
     This is a 7 bit offset from the tiny data area pointer.
986
 
987
 - : BFD_RELOC_V850_TDA_16_16_OFFSET
988
     This is a 16 bit offset from the tiny data area pointer.
989
 
990
 - : BFD_RELOC_V850_TDA_4_5_OFFSET
991
     This is a 5 bit offset (of which only 4 bits are used) from the
992
     tiny data area pointer.
993
 
994
 - : BFD_RELOC_V850_TDA_4_4_OFFSET
995
     This is a 4 bit offset from the tiny data area pointer.
996
 
997
 - : BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET
998
     This is a 16 bit offset from the short data area pointer, with the
999
     bits placed non-contigously in the instruction.
1000
 
1001
 - : BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET
1002
     This is a 16 bit offset from the zero data area pointer, with the
1003
     bits placed non-contigously in the instruction.
1004
 
1005
 - : BFD_RELOC_V850_CALLT_6_7_OFFSET
1006
     This is a 6 bit offset from the call table base pointer.
1007
 
1008
 - : BFD_RELOC_V850_CALLT_16_16_OFFSET
1009
     This is a 16 bit offset from the call table base pointer.
1010
 
1011
 - : BFD_RELOC_MN10300_32_PCREL
1012
     This is a 32bit pcrel reloc for the mn10300, offset by two bytes
1013
     in the instruction.
1014
 
1015
 - : BFD_RELOC_MN10300_16_PCREL
1016
     This is a 16bit pcrel reloc for the mn10300, offset by two bytes
1017
     in the instruction.
1018
 
1019
 - : BFD_RELOC_TIC30_LDP
1020
     This is a 8bit DP reloc for the tms320c30, where the most
1021
     significant 8 bits of a 24 bit word are placed into the least
1022
     significant 8 bits of the opcode.
1023
 
1024
 - : BFD_RELOC_TIC54X_PARTLS7
1025
     This is a 7bit reloc for the tms320c54x, where the least
1026
     significant 7 bits of a 16 bit word are placed into the least
1027
     significant 7 bits of the opcode.
1028
 
1029
 - : BFD_RELOC_TIC54X_PARTMS9
1030
     This is a 9bit DP reloc for the tms320c54x, where the most
1031
     significant 9 bits of a 16 bit word are placed into the least
1032
     significant 9 bits of the opcode.
1033
 
1034
 - : BFD_RELOC_TIC54X_23
1035
     This is an extended address 23-bit reloc for the tms320c54x.
1036
 
1037
 - : BFD_RELOC_TIC54X_16_OF_23
1038
     This is a 16-bit reloc for the tms320c54x, where the least
1039
     significant 16 bits of a 23-bit extended address are placed into
1040
     the opcode.
1041
 
1042
 - : BFD_RELOC_TIC54X_MS7_OF_23
1043
     This is a reloc for the tms320c54x, where the most significant 7
1044
     bits of a 23-bit extended address are placed into the opcode.
1045
 
1046
 - : BFD_RELOC_FR30_48
1047
     This is a 48 bit reloc for the FR30 that stores 32 bits.
1048
 
1049
 - : BFD_RELOC_FR30_20
1050
     This is a 32 bit reloc for the FR30 that stores 20 bits split up
1051
     into two sections.
1052
 
1053
 - : BFD_RELOC_FR30_6_IN_4
1054
     This is a 16 bit reloc for the FR30 that stores a 6 bit word
1055
     offset in 4 bits.
1056
 
1057
 - : BFD_RELOC_FR30_8_IN_8
1058
     This is a 16 bit reloc for the FR30 that stores an 8 bit byte
1059
     offset into 8 bits.
1060
 
1061
 - : BFD_RELOC_FR30_9_IN_8
1062
     This is a 16 bit reloc for the FR30 that stores a 9 bit short
1063
     offset into 8 bits.
1064
 
1065
 - : BFD_RELOC_FR30_10_IN_8
1066
     This is a 16 bit reloc for the FR30 that stores a 10 bit word
1067
     offset into 8 bits.
1068
 
1069
 - : BFD_RELOC_FR30_9_PCREL
1070
     This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
1071
     short offset into 8 bits.
1072
 
1073
 - : BFD_RELOC_FR30_12_PCREL
1074
     This is a 16 bit reloc for the FR30 that stores a 12 bit pc
1075
     relative short offset into 11 bits.
1076
 
1077
 - : BFD_RELOC_MCORE_PCREL_IMM8BY4
1078
 - : BFD_RELOC_MCORE_PCREL_IMM11BY2
1079
 - : BFD_RELOC_MCORE_PCREL_IMM4BY2
1080
 - : BFD_RELOC_MCORE_PCREL_32
1081
 - : BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2
1082
 - : BFD_RELOC_MCORE_RVA
1083
     Motorola Mcore relocations.
1084
 
1085
 - : BFD_RELOC_AVR_7_PCREL
1086
     This is a 16 bit reloc for the AVR that stores 8 bit pc relative
1087
     short offset into 7 bits.
1088
 
1089
 - : BFD_RELOC_AVR_13_PCREL
1090
     This is a 16 bit reloc for the AVR that stores 13 bit pc relative
1091
     short offset into 12 bits.
1092
 
1093
 - : BFD_RELOC_AVR_16_PM
1094
     This is a 16 bit reloc for the AVR that stores 17 bit value
1095
     (usually program memory address) into 16 bits.
1096
 
1097
 - : BFD_RELOC_AVR_LO8_LDI
1098
     This is a 16 bit reloc for the AVR that stores 8 bit value (usually
1099
     data memory address) into 8 bit immediate value of LDI insn.
1100
 
1101
 - : BFD_RELOC_AVR_HI8_LDI
1102
     This is a 16 bit reloc for the AVR that stores 8 bit value (high 8
1103
     bit of data memory address) into 8 bit immediate value of LDI insn.
1104
 
1105
 - : BFD_RELOC_AVR_HH8_LDI
1106
     This is a 16 bit reloc for the AVR that stores 8 bit value (most
1107
     high 8 bit of program memory address) into 8 bit immediate value
1108
     of LDI insn.
1109
 
1110
 - : BFD_RELOC_AVR_LO8_LDI_NEG
1111
     This is a 16 bit reloc for the AVR that stores negated 8 bit value
1112
     (usually data memory address) into 8 bit immediate value of SUBI
1113
     insn.
1114
 
1115
 - : BFD_RELOC_AVR_HI8_LDI_NEG
1116
     This is a 16 bit reloc for the AVR that stores negated 8 bit value
1117
     (high 8 bit of data memory address) into 8 bit immediate value of
1118
     SUBI insn.
1119
 
1120
 - : BFD_RELOC_AVR_HH8_LDI_NEG
1121
     This is a 16 bit reloc for the AVR that stores negated 8 bit value
1122
     (most high 8 bit of program memory address) into 8 bit immediate
1123
     value of LDI or SUBI insn.
1124
 
1125
 - : BFD_RELOC_AVR_LO8_LDI_PM
1126
     This is a 16 bit reloc for the AVR that stores 8 bit value (usually
1127
     command address) into 8 bit immediate value of LDI insn.
1128
 
1129
 - : BFD_RELOC_AVR_HI8_LDI_PM
1130
     This is a 16 bit reloc for the AVR that stores 8 bit value (high 8
1131
     bit of command address) into 8 bit immediate value of LDI insn.
1132
 
1133
 - : BFD_RELOC_AVR_HH8_LDI_PM
1134
     This is a 16 bit reloc for the AVR that stores 8 bit value (most
1135
     high 8 bit of command address) into 8 bit immediate value of LDI
1136
     insn.
1137
 
1138
 - : BFD_RELOC_AVR_LO8_LDI_PM_NEG
1139
     This is a 16 bit reloc for the AVR that stores negated 8 bit value
1140
     (usually command address) into 8 bit immediate value of SUBI insn.
1141
 
1142
 - : BFD_RELOC_AVR_HI8_LDI_PM_NEG
1143
     This is a 16 bit reloc for the AVR that stores negated 8 bit value
1144
     (high 8 bit of 16 bit command address) into 8 bit immediate value
1145
     of SUBI insn.
1146
 
1147
 - : BFD_RELOC_AVR_HH8_LDI_PM_NEG
1148
     This is a 16 bit reloc for the AVR that stores negated 8 bit value
1149
     (high 6 bit of 22 bit command address) into 8 bit immediate value
1150
     of SUBI insn.
1151
 
1152
 - : BFD_RELOC_AVR_CALL
1153
     This is a 32 bit reloc for the AVR that stores 23 bit value into
1154
     22 bits.
1155
 
1156
 - : BFD_RELOC_VTABLE_INHERIT
1157
 - : BFD_RELOC_VTABLE_ENTRY
1158
     These two relocations are used by the linker to determine which of
1159
     the entries in a C++ virtual function table are actually used.
1160
     When the -gc-sections option is given, the linker will zero out
1161
     the entries that are not used, so that the code for those
1162
     functions need not be included in the output.
1163
 
1164
     VTABLE_INHERIT is a zero-space relocation used to describe to the
1165
     linker the inheritence tree of a C++ virtual function table.  The
1166
     relocation's symbol should be the parent class' vtable, and the
1167
     relocation should be located at the child vtable.
1168
 
1169
     VTABLE_ENTRY is a zero-space relocation that describes the use of a
1170
     virtual function table entry.  The reloc's symbol should refer to
1171
     the table of the class mentioned in the code.  Off of that base,
1172
     an offset describes the entry that is being used.  For Rela hosts,
1173
     this offset is stored in the reloc's addend.  For Rel hosts, we
1174
     are forced to put this offset in the reloc's section offset.
1175
 
1176
 
1177
     typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
1178
 
1179
`bfd_reloc_type_lookup'
1180
.......................
1181
 
1182
   *Synopsis*
1183
     reloc_howto_type *
1184
     bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code);
1185
   *Description*
1186
Return a pointer to a howto structure which, when invoked, will perform
1187
the relocation CODE on data from the architecture noted.
1188
 
1189
`bfd_default_reloc_type_lookup'
1190
...............................
1191
 
1192
   *Synopsis*
1193
     reloc_howto_type *bfd_default_reloc_type_lookup
1194
        (bfd *abfd, bfd_reloc_code_real_type  code);
1195
   *Description*
1196
Provides a default relocation lookup routine for any architecture.
1197
 
1198
`bfd_get_reloc_code_name'
1199
.........................
1200
 
1201
   *Synopsis*
1202
     const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
1203
   *Description*
1204
Provides a printable name for the supplied relocation code.  Useful
1205
mainly for printing error messages.
1206
 
1207
`bfd_generic_relax_section'
1208
...........................
1209
 
1210
   *Synopsis*
1211
     boolean bfd_generic_relax_section
1212
        (bfd *abfd,
1213
         asection *section,
1214
         struct bfd_link_info *,
1215
         boolean *);
1216
   *Description*
1217
Provides default handling for relaxing for back ends which don't do
1218
relaxing - i.e., does nothing.
1219
 
1220
`bfd_generic_gc_sections'
1221
.........................
1222
 
1223
   *Synopsis*
1224
     boolean bfd_generic_gc_sections
1225
        (bfd *, struct bfd_link_info *);
1226
   *Description*
1227
Provides default handling for relaxing for back ends which don't do
1228
section gc - i.e., does nothing.
1229
 
1230
`bfd_generic_get_relocated_section_contents'
1231
............................................
1232
 
1233
   *Synopsis*
1234
     bfd_byte *
1235
     bfd_generic_get_relocated_section_contents (bfd *abfd,
1236
         struct bfd_link_info *link_info,
1237
         struct bfd_link_order *link_order,
1238
         bfd_byte *data,
1239
         boolean relocateable,
1240
         asymbol **symbols);
1241
   *Description*
1242
Provides default handling of relocation effort for back ends which
1243
can't be bothered to do it efficiently.
1244
 
1245

1246
File: bfd.info,  Node: Core Files,  Next: Targets,  Prev: Relocations,  Up: BFD front end
1247
 
1248
Core files
1249
==========
1250
 
1251
   *Description*
1252
These are functions pertaining to core files.
1253
 
1254
`bfd_core_file_failing_command'
1255
...............................
1256
 
1257
   *Synopsis*
1258
     CONST char *bfd_core_file_failing_command(bfd *abfd);
1259
   *Description*
1260
Return a read-only string explaining which program was running when it
1261
failed and produced the core file ABFD.
1262
 
1263
`bfd_core_file_failing_signal'
1264
..............................
1265
 
1266
   *Synopsis*
1267
     int bfd_core_file_failing_signal(bfd *abfd);
1268
   *Description*
1269
Returns the signal number which caused the core dump which generated
1270
the file the BFD ABFD is attached to.
1271
 
1272
`core_file_matches_executable_p'
1273
................................
1274
 
1275
   *Synopsis*
1276
     boolean core_file_matches_executable_p
1277
        (bfd *core_bfd, bfd *exec_bfd);
1278
   *Description*
1279
Return `true' if the core file attached to CORE_BFD was generated by a
1280
run of the executable file attached to EXEC_BFD, `false' otherwise.
1281
 
1282

1283
File: bfd.info,  Node: Targets,  Next: Architectures,  Prev: Core Files,  Up: BFD front end
1284
 
1285
Targets
1286
=======
1287
 
1288
   *Description*
1289
Each port of BFD to a different machine requries the creation of a
1290
target back end. All the back end provides to the root part of BFD is a
1291
structure containing pointers to functions which perform certain low
1292
level operations on files. BFD translates the applications's requests
1293
through a pointer into calls to the back end routines.
1294
 
1295
   When a file is opened with `bfd_openr', its format and target are
1296
unknown. BFD uses various mechanisms to determine how to interpret the
1297
file. The operations performed are:
1298
 
1299
   * Create a BFD by calling the internal routine `_bfd_new_bfd', then
1300
     call `bfd_find_target' with the target string supplied to
1301
     `bfd_openr' and the new BFD pointer.
1302
 
1303
   * If a null target string was provided to `bfd_find_target', look up
1304
     the environment variable `GNUTARGET' and use that as the target
1305
     string.
1306
 
1307
   * If the target string is still `NULL', or the target string is
1308
     `default', then use the first item in the target vector as the
1309
     target type, and set `target_defaulted' in the BFD to cause
1310
     `bfd_check_format' to loop through all the targets.  *Note
1311
     bfd_target::.  *Note Formats::.
1312
 
1313
   * Otherwise, inspect the elements in the target vector one by one,
1314
     until a match on target name is found. When found, use it.
1315
 
1316
   * Otherwise return the error `bfd_error_invalid_target' to
1317
     `bfd_openr'.
1318
 
1319
   * `bfd_openr' attempts to open the file using `bfd_open_file', and
1320
     returns the BFD.
1321
   Once the BFD has been opened and the target selected, the file
1322
format may be determined. This is done by calling `bfd_check_format' on
1323
the BFD with a suggested format.  If `target_defaulted' has been set,
1324
each possible target type is tried to see if it recognizes the
1325
specified format.  `bfd_check_format' returns `true' when the caller
1326
guesses right.
1327
 
1328
* Menu:
1329
 
1330
* bfd_target::
1331
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.