Coverage Report

Created: 2026-03-10 08:46

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/binutils-gdb/bfd/elf-bfd.h
Line
Count
Source
1
/* BFD back-end data structures for ELF files.
2
   Copyright (C) 1992-2026 Free Software Foundation, Inc.
3
   Written by Cygnus Support.
4
5
   This file is part of BFD, the Binary File Descriptor library.
6
7
   This program is free software; you can redistribute it and/or modify
8
   it under the terms of the GNU General Public License as published by
9
   the Free Software Foundation; either version 3 of the License, or
10
   (at your option) any later version.
11
12
   This program is distributed in the hope that it will be useful,
13
   but WITHOUT ANY WARRANTY; without even the implied warranty of
14
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
   GNU General Public License for more details.
16
17
   You should have received a copy of the GNU General Public License
18
   along with this program; if not, write to the Free Software
19
   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
20
   MA 02110-1301, USA.  */
21
22
#ifndef _LIBELF_H_
23
#define _LIBELF_H_ 1
24
25
#include <stdlib.h>
26
27
#include "doubly-linked-list.h"
28
#include "elf/common.h"
29
#include "elf/external.h"
30
#include "elf/internal.h"
31
#include "elf-attrs.h"
32
#include "bfdlink.h"
33
34
#ifndef ENABLE_CHECKING
35
#define ENABLE_CHECKING 0
36
#endif
37
38
#include "hidden.h"
39
40
#ifdef __cplusplus
41
extern "C" {
42
#endif
43
44
/* The number of entries in a section is its size divided by the size
45
   of a single entry.  This is normally only applicable to reloc and
46
   symbol table sections.
47
   PR 9934: It is possible to have relocations that do not refer to
48
   symbols, thus it is also possible to have a relocation section in
49
   an object file, but no symbol table.  */
50
84.1k
#define NUM_SHDR_ENTRIES(shdr) ((shdr)->sh_entsize > 0 ? (shdr)->sh_size / (shdr)->sh_entsize : 0)
51
52
/* If size isn't specified as 64 or 32, NAME macro should fail.  */
53
#if !defined(NAME) && defined(ARCH_SIZE)
54
#if ARCH_SIZE == 64
55
13.3M
#define NAME(x, y) x ## 64 ## _ ## y
56
#endif
57
#if ARCH_SIZE == 32
58
40.5M
#define NAME(x, y) x ## 32 ## _ ## y
59
#endif
60
#endif
61
62
#ifndef NAME
63
#define NAME(x, y) x ## NOSIZE ## _ ## y
64
#endif
65
66
#define ElfNAME(X)  NAME(Elf,X)
67
#define elfNAME(X)  NAME(elf,X)
68
69
/* Information held for an ELF symbol.  The first field is the
70
   corresponding asymbol.  Every symbol is an ELF file is actually a
71
   pointer to this structure, although it is often handled as a
72
   pointer to an asymbol.  */
73
74
typedef struct
75
{
76
  /* The BFD symbol.  */
77
  asymbol symbol;
78
  /* ELF symbol information.  */
79
  Elf_Internal_Sym internal_elf_sym;
80
  /* Backend specific information.  */
81
  union
82
    {
83
      unsigned int hppa_arg_reloc;
84
      void *mips_extr;
85
      void *any;
86
    }
87
  tc_data;
88
89
  /* Version information.  This is from an Elf_Internal_Versym
90
     structure in a SHT_GNU_versym section.  It is zero if there is no
91
     version information.  */
92
  unsigned short version;
93
94
} elf_symbol_type;
95

96
struct elf_strtab_hash;
97
struct got_entry;
98
struct plt_entry;
99
100
union gotplt_union
101
  {
102
    bfd_signed_vma refcount;
103
    bfd_vma offset;
104
    struct got_entry *glist;
105
    struct plt_entry *plist;
106
  };
107
108
struct elf_link_virtual_table_entry
109
  {
110
    /* Virtual table entry use information.  This array is nominally of size
111
       size/sizeof(target_void_pointer), though we have to be able to assume
112
       and track a size while the symbol is still undefined.  It is indexed
113
       via offset/sizeof(target_void_pointer).  */
114
    size_t size;
115
    bool *used;
116
117
    /* Virtual table derivation info.  */
118
    struct elf_link_hash_entry *parent;
119
  };
120
121
/* ELF symbol version.  */
122
enum elf_symbol_version
123
  {
124
    unknown = 0,
125
    unversioned,
126
    versioned,
127
    versioned_hidden
128
  };
129
130
/* ELF linker hash table entries.  */
131
132
struct elf_link_hash_entry
133
{
134
  struct bfd_link_hash_entry root;
135
136
  /* Symbol index in output file.  This is initialized to -1.  It is
137
     set to -2 if the symbol is used by a reloc.  It is set to -3 if
138
     this symbol is defined in a discarded section.  */
139
  long indx;
140
141
  /* Symbol index as a dynamic symbol.  Initialized to -1, and remains
142
     -1 if this is not a dynamic symbol.  */
143
  /* ??? Note that this is consistently used as a synonym for tests
144
     against whether we can perform various simplifying transformations
145
     to the code.  (E.g. changing a pc-relative jump to a PLT entry
146
     into a pc-relative jump to the target function.)  That test, which
147
     is often relatively complex, and someplaces wrong or incomplete,
148
     should really be replaced by a predicate in elflink.c.
149
150
     End result: this field -1 does not indicate that the symbol is
151
     not in the dynamic symbol table, but rather that the symbol is
152
     not visible outside this DSO.  */
153
  long dynindx;
154
155
  /* If this symbol requires an entry in the global offset table, the
156
     processor specific backend uses this field to track usage and
157
     final offset.  Two schemes are supported:  The first assumes that
158
     a symbol may only have one GOT entry, and uses REFCOUNT until
159
     size_dynamic_sections, at which point the contents of the .got is
160
     fixed.  Afterward, if OFFSET is -1, then the symbol does not
161
     require a global offset table entry.  The second scheme allows
162
     multiple GOT entries per symbol, managed via a linked list
163
     pointed to by GLIST.  */
164
  union gotplt_union got;
165
166
  /* Same, but tracks a procedure linkage table entry.  */
167
  union gotplt_union plt;
168
169
  /* Symbol size.  NB: All fields starting from here are cleared by
170
    _bfd_elf_link_hash_newfunc.  */
171
  bfd_size_type size;
172
173
  /* Track dynamic relocs copied for this symbol.  */
174
  struct elf_dyn_relocs *dyn_relocs;
175
176
  /* Symbol type (STT_NOTYPE, STT_OBJECT, etc.).  */
177
  unsigned int type : 8;
178
179
  /* Symbol st_other value, symbol visibility.  */
180
  unsigned int other : 8;
181
182
  /* The symbol's st_target_internal value (see Elf_Internal_Sym).  */
183
  unsigned int target_internal : 8;
184
185
  /* Symbol is referenced by a non-shared object (other than the object
186
     in which it is defined).  */
187
  unsigned int ref_regular : 1;
188
  /* Symbol is defined by a non-shared object.  */
189
  unsigned int def_regular : 1;
190
  /* Symbol is referenced by a shared object.  */
191
  unsigned int ref_dynamic : 1;
192
  /* Symbol is defined by a shared object.  */
193
  unsigned int def_dynamic : 1;
194
  /* Symbol has a non-weak reference from a non-shared object (other than
195
     the object in which it is defined).  */
196
  unsigned int ref_regular_nonweak : 1;
197
  /* Symbol has a non-weak reference from a LTO IR object file.  */
198
  unsigned int ref_ir_nonweak : 1;
199
  /* Dynamic symbol has been adjustd.  */
200
  unsigned int dynamic_adjusted : 1;
201
  /* Symbol needs a copy reloc.  */
202
  unsigned int needs_copy : 1;
203
  /* Symbol needs a procedure linkage table entry.  */
204
  unsigned int needs_plt : 1;
205
  /* Symbol appears in a non-ELF input file.  */
206
  unsigned int non_elf : 1;
207
  /* Symbol version information.  */
208
  ENUM_BITFIELD (elf_symbol_version) versioned : 2;
209
  /* Symbol is a base symbol.  */
210
  unsigned int base_symbol : 1;
211
  /* Symbol was forced to local scope due to a version script file.  */
212
  unsigned int forced_local : 1;
213
  /* Symbol was forced to be dynamic due to a version script file.  */
214
  unsigned int dynamic : 1;
215
  /* Symbol was marked during garbage collection.  */
216
  unsigned int mark : 1;
217
  /* Symbol is referenced by a non-GOT/non-PLT relocation.  This is
218
     not currently set by all the backends.  */
219
  unsigned int non_got_ref : 1;
220
  /* Symbol has a definition in a shared object.
221
     FIXME: There is no real need for this field if def_dynamic is never
222
     cleared and all places that test def_dynamic also test def_regular.  */
223
  unsigned int dynamic_def : 1;
224
  /* Symbol has a non-weak reference from a shared object.  */
225
  unsigned int ref_dynamic_nonweak : 1;
226
  /* Symbol is referenced with a relocation where C/C++ pointer equality
227
     matters.  */
228
  unsigned int pointer_equality_needed : 1;
229
  /* Symbol is a unique global symbol.  */
230
  unsigned int unique_global : 1;
231
  /* Symbol is defined by a shared library with non-default visibility
232
     in a read/write section.  */
233
  unsigned int protected_def : 1;
234
  /* Symbol is __start_SECNAME or __stop_SECNAME to mark section
235
     SECNAME.  */
236
  unsigned int start_stop : 1;
237
  /* Symbol is or was a weak defined symbol from a dynamic object with
238
     a strong defined symbol alias.  U.ALIAS points to a list of aliases,
239
     the definition having is_weakalias clear.  */
240
  unsigned int is_weakalias : 1;
241
  /* Symbol has a relocation.  */
242
  unsigned int has_reloc : 1;
243
244
  /* String table index in .dynstr if this is a dynamic symbol.  */
245
  unsigned long dynstr_index;
246
247
  union
248
  {
249
    /* Points to a circular list of non-function symbol aliases.  */
250
    struct elf_link_hash_entry *alias;
251
252
    /* Hash value of the name computed using the ELF hash function.
253
       Used part way through size_dynamic_sections, after we've finished
254
       with aliases.  */
255
    unsigned long elf_hash_value;
256
  } u;
257
258
  /* Version information.  */
259
  union
260
  {
261
    /* This field is used for a symbol which is not defined in a
262
       regular object.  It points to the version information read in
263
       from the dynamic object.  */
264
    Elf_Internal_Verdef *verdef;
265
    /* This field is used for a symbol which is defined in a regular
266
       object.  It is set up in size_dynamic_sections.  It points to
267
       the version information we should write out for this symbol.  */
268
    struct bfd_elf_version_tree *vertree;
269
  } verinfo;
270
271
  union
272
  {
273
    /* For __start_SECNAME and __stop_SECNAME symbols, record the first
274
       input section whose section name is SECNAME.  */
275
    asection *start_stop_section;
276
277
    /* Vtable information. */
278
    struct elf_link_virtual_table_entry *vtable;
279
  } u2;
280
};
281
282
/* Return the strong definition for a weak symbol with aliases.  */
283
284
static inline struct elf_link_hash_entry *
285
weakdef (struct elf_link_hash_entry *h)
286
0
{
287
0
  while (h->is_weakalias)
288
0
    h = h->u.alias;
289
0
  return h;
290
0
}
Unexecuted instantiation: fuzz_nm.c:weakdef
Unexecuted instantiation: bfd.c:weakdef
Unexecuted instantiation: format.c:weakdef
Unexecuted instantiation: libbfd.c:weakdef
Unexecuted instantiation: opncls.c:weakdef
Unexecuted instantiation: elf64-x86-64.c:weakdef
Unexecuted instantiation: elfxx-x86.c:weakdef
Unexecuted instantiation: elf-ifunc.c:weakdef
Unexecuted instantiation: elf-solaris2.c:weakdef
Unexecuted instantiation: elf-vxworks.c:weakdef
Unexecuted instantiation: elf64.c:weakdef
Unexecuted instantiation: elf.c:weakdef
Unexecuted instantiation: elflink.c:weakdef
Unexecuted instantiation: elf-attrs.c:weakdef
Unexecuted instantiation: elf-strtab.c:weakdef
Unexecuted instantiation: elf-eh-frame.c:weakdef
Unexecuted instantiation: elf-properties.c:weakdef
Unexecuted instantiation: elf-sframe.c:weakdef
Unexecuted instantiation: dwarf1.c:weakdef
Unexecuted instantiation: dwarf2.c:weakdef
Unexecuted instantiation: elf32-i386.c:weakdef
Unexecuted instantiation: elf32.c:weakdef
Unexecuted instantiation: cofflink.c:weakdef
Unexecuted instantiation: coffgen.c:weakdef
Unexecuted instantiation: elf64-gen.c:weakdef
Unexecuted instantiation: elf32-gen.c:weakdef
Unexecuted instantiation: elf32-aarch64.c:weakdef
Unexecuted instantiation: elf32-ia64.c:weakdef
Unexecuted instantiation: elf32-kvx.c:weakdef
Unexecuted instantiation: elf32-loongarch.c:weakdef
Unexecuted instantiation: elf32-mips.c:weakdef
Unexecuted instantiation: elf32-riscv.c:weakdef
Unexecuted instantiation: elf32-score.c:weakdef
Unexecuted instantiation: elf32-score7.c:weakdef
Unexecuted instantiation: elf64-aarch64.c:weakdef
Unexecuted instantiation: elf64-alpha.c:weakdef
Unexecuted instantiation: elf64-amdgcn.c:weakdef
Unexecuted instantiation: elf64-bpf.c:weakdef
Unexecuted instantiation: elf64-hppa.c:weakdef
Unexecuted instantiation: elf64-ia64-vms.c:weakdef
Unexecuted instantiation: elf64-ia64.c:weakdef
Unexecuted instantiation: elf64-kvx.c:weakdef
Unexecuted instantiation: elf64-loongarch.c:weakdef
Unexecuted instantiation: elf64-mips.c:weakdef
Unexecuted instantiation: elf64-mmix.c:weakdef
Unexecuted instantiation: elf64-nfp.c:weakdef
Unexecuted instantiation: elf64-ppc.c:weakdef
Unexecuted instantiation: elf64-riscv.c:weakdef
Unexecuted instantiation: elf64-s390.c:weakdef
Unexecuted instantiation: elf64-sparc.c:weakdef
Unexecuted instantiation: elf64-tilegx.c:weakdef
Unexecuted instantiation: elfn32-mips.c:weakdef
Unexecuted instantiation: elfxx-aarch64.c:weakdef
Unexecuted instantiation: elfxx-ia64.c:weakdef
Unexecuted instantiation: elfxx-kvx.c:weakdef
Unexecuted instantiation: elfxx-loongarch.c:weakdef
Unexecuted instantiation: elfxx-mips.c:weakdef
Unexecuted instantiation: elfxx-riscv.c:weakdef
Unexecuted instantiation: elf-m10200.c:weakdef
Unexecuted instantiation: elf-m10300.c:weakdef
Unexecuted instantiation: elf32-am33lin.c:weakdef
Unexecuted instantiation: elf32-arc.c:weakdef
Unexecuted instantiation: elf32-arm.c:weakdef
Unexecuted instantiation: elf32-avr.c:weakdef
Unexecuted instantiation: elf32-bfin.c:weakdef
Unexecuted instantiation: elf32-cr16.c:weakdef
Unexecuted instantiation: elf32-cris.c:weakdef
Unexecuted instantiation: elf32-crx.c:weakdef
Unexecuted instantiation: elf32-csky.c:weakdef
Unexecuted instantiation: elf32-d10v.c:weakdef
Unexecuted instantiation: elf32-d30v.c:weakdef
Unexecuted instantiation: elf32-dlx.c:weakdef
Unexecuted instantiation: elf32-epiphany.c:weakdef
Unexecuted instantiation: elf32-fr30.c:weakdef
Unexecuted instantiation: elf32-frv.c:weakdef
Unexecuted instantiation: elf32-ft32.c:weakdef
Unexecuted instantiation: elf32-h8300.c:weakdef
Unexecuted instantiation: elf32-hppa.c:weakdef
Unexecuted instantiation: elf32-ip2k.c:weakdef
Unexecuted instantiation: elf32-iq2000.c:weakdef
Unexecuted instantiation: elf32-lm32.c:weakdef
Unexecuted instantiation: elf32-m32c.c:weakdef
Unexecuted instantiation: elf32-m32r.c:weakdef
Unexecuted instantiation: elf32-m68hc11.c:weakdef
Unexecuted instantiation: elf32-m68hc12.c:weakdef
Unexecuted instantiation: elf32-m68hc1x.c:weakdef
Unexecuted instantiation: elf32-m68k.c:weakdef
Unexecuted instantiation: elf32-mcore.c:weakdef
Unexecuted instantiation: elf32-mep.c:weakdef
Unexecuted instantiation: elf32-metag.c:weakdef
Unexecuted instantiation: elf32-microblaze.c:weakdef
Unexecuted instantiation: elf32-moxie.c:weakdef
Unexecuted instantiation: elf32-msp430.c:weakdef
Unexecuted instantiation: elf32-mt.c:weakdef
Unexecuted instantiation: elf32-nds32.c:weakdef
Unexecuted instantiation: elf32-or1k.c:weakdef
Unexecuted instantiation: elf32-pj.c:weakdef
Unexecuted instantiation: elf32-ppc.c:weakdef
Unexecuted instantiation: elf32-pru.c:weakdef
Unexecuted instantiation: elf32-rl78.c:weakdef
Unexecuted instantiation: elf32-rx.c:weakdef
Unexecuted instantiation: elf32-s12z.c:weakdef
Unexecuted instantiation: elf32-s390.c:weakdef
Unexecuted instantiation: elf32-sh.c:weakdef
Unexecuted instantiation: elf32-sparc.c:weakdef
Unexecuted instantiation: elf32-spu.c:weakdef
Unexecuted instantiation: elf32-tic6x.c:weakdef
Unexecuted instantiation: elf32-tilegx.c:weakdef
Unexecuted instantiation: elf32-tilepro.c:weakdef
Unexecuted instantiation: elf32-v850.c:weakdef
Unexecuted instantiation: elf32-vax.c:weakdef
Unexecuted instantiation: elf32-visium.c:weakdef
Unexecuted instantiation: elf32-wasm32.c:weakdef
Unexecuted instantiation: elf32-xgate.c:weakdef
Unexecuted instantiation: elf32-xstormy16.c:weakdef
Unexecuted instantiation: elf32-xtensa.c:weakdef
Unexecuted instantiation: elf32-z80.c:weakdef
Unexecuted instantiation: elfxx-sparc.c:weakdef
Unexecuted instantiation: elfxx-tilegx.c:weakdef
Unexecuted instantiation: cpu-nds32.c:weakdef
Unexecuted instantiation: compress.c:weakdef
Unexecuted instantiation: merge.c:weakdef
Unexecuted instantiation: fuzz_objdump.c:weakdef
Unexecuted instantiation: arc-dis.c:weakdef
Unexecuted instantiation: arm-dis.c:weakdef
Unexecuted instantiation: csky-dis.c:weakdef
Unexecuted instantiation: kvx-dis.c:weakdef
Unexecuted instantiation: m32c-dis.c:weakdef
Unexecuted instantiation: mep-dis.c:weakdef
Unexecuted instantiation: ppc-dis.c:weakdef
Unexecuted instantiation: pru-dis.c:weakdef
Unexecuted instantiation: rl78-dis.c:weakdef
Unexecuted instantiation: score-dis.c:weakdef
Unexecuted instantiation: score7-dis.c:weakdef
Unexecuted instantiation: tilepro-dis.c:weakdef
Unexecuted instantiation: wasm32-dis.c:weakdef
Unexecuted instantiation: aarch64-dis.c:weakdef
Unexecuted instantiation: bpf-dis.c:weakdef
Unexecuted instantiation: mips-dis.c:weakdef
Unexecuted instantiation: nfp-dis.c:weakdef
Unexecuted instantiation: riscv-dis.c:weakdef
Unexecuted instantiation: tilegx-dis.c:weakdef
Unexecuted instantiation: ctf-serialize.c:weakdef
Unexecuted instantiation: ctf-open-bfd.c:weakdef
Unexecuted instantiation: fuzz_addr2line.c:weakdef
Unexecuted instantiation: fuzz_as.c:weakdef
Unexecuted instantiation: codeview.c:weakdef
Unexecuted instantiation: cond.c:weakdef
Unexecuted instantiation: depend.c:weakdef
Unexecuted instantiation: dw2gencfi.c:weakdef
Unexecuted instantiation: dwarf2dbg.c:weakdef
Unexecuted instantiation: ehopt.c:weakdef
Unexecuted instantiation: expr.c:weakdef
Unexecuted instantiation: frags.c:weakdef
Unexecuted instantiation: gen-sframe.c:weakdef
Unexecuted instantiation: input-scrub.c:weakdef
Unexecuted instantiation: listing.c:weakdef
Unexecuted instantiation: macro.c:weakdef
Unexecuted instantiation: messages.c:weakdef
Unexecuted instantiation: output-file.c:weakdef
Unexecuted instantiation: read.c:weakdef
Unexecuted instantiation: remap.c:weakdef
Unexecuted instantiation: sb.c:weakdef
Unexecuted instantiation: scfidw2gen.c:weakdef
Unexecuted instantiation: stabs.c:weakdef
Unexecuted instantiation: subsegs.c:weakdef
Unexecuted instantiation: symbols.c:weakdef
Unexecuted instantiation: write.c:weakdef
Unexecuted instantiation: app.c:weakdef
Unexecuted instantiation: atof-generic.c:weakdef
Unexecuted instantiation: ecoff.c:weakdef
Unexecuted instantiation: flonum-copy.c:weakdef
Unexecuted instantiation: ginsn.c:weakdef
Unexecuted instantiation: hash.c:weakdef
Unexecuted instantiation: input-file.c:weakdef
Unexecuted instantiation: scfi.c:weakdef
Unexecuted instantiation: sframe-opt.c:weakdef
Unexecuted instantiation: tc-i386.c:weakdef
Unexecuted instantiation: obj-elf.c:weakdef
Unexecuted instantiation: atof-ieee.c:weakdef
Unexecuted instantiation: fuzz_dwarf.c:weakdef
Unexecuted instantiation: fuzz_objcopy.c:weakdef
291
292
/* Will references to this symbol always reference the symbol
293
   in this object?  */
294
#define SYMBOL_REFERENCES_LOCAL(INFO, H) \
295
0
  _bfd_elf_symbol_refs_local_p (H, INFO, 0)
296
297
/* Will _calls_ to this symbol always call the version in this object?  */
298
#define SYMBOL_CALLS_LOCAL(INFO, H) \
299
0
  _bfd_elf_symbol_refs_local_p (H, INFO, 1)
300
301
/* Whether an undefined weak symbol should resolve to its link-time
302
   value, even in PIC or PIE objects.  The linker_def test is to
303
   handle symbols like __ehdr_start that may be undefweak in early
304
   stages of linking but are guaranteed to be defined later.  */
305
#define UNDEFWEAK_NO_DYNAMIC_RELOC(INFO, H)   \
306
0
  ((H)->root.type == bfd_link_hash_undefweak    \
307
0
   && !(H)->root.linker_def        \
308
0
   && (ELF_ST_VISIBILITY ((H)->other) != STV_DEFAULT  \
309
0
       || (INFO)->dynamic_undefined_weak == 0))
310
311
/* Common symbols that are turned into definitions don't have the
312
   DEF_REGULAR flag set, so they might appear to be undefined.
313
   Symbols defined in linker scripts also don't have DEF_REGULAR set.  */
314
#define ELF_COMMON_DEF_P(H) \
315
0
  (!(H)->def_regular              \
316
0
   && !(H)->def_dynamic              \
317
0
   && (H)->root.type == bfd_link_hash_defined)
318
319
/* Records local symbols to be emitted in the dynamic symbol table.  */
320
321
struct elf_link_local_dynamic_entry
322
{
323
  struct elf_link_local_dynamic_entry *next;
324
325
  /* The input bfd this symbol came from.  */
326
  bfd *input_bfd;
327
328
  /* The index of the local symbol being copied.  */
329
  long input_indx;
330
331
  /* The index in the outgoing dynamic symbol table.  */
332
  long dynindx;
333
334
  /* A copy of the input symbol.  */
335
  Elf_Internal_Sym isym;
336
};
337
338
struct elf_link_loaded_list
339
{
340
  struct elf_link_loaded_list *next;
341
  bfd *abfd;
342
};
343
344
/* Structures used by the eh_frame optimization code.  */
345
struct eh_cie_fde
346
{
347
  union {
348
    struct {
349
      /* If REMOVED == 1, this is the CIE that the FDE originally used.
350
   The CIE belongs to the same .eh_frame input section as the FDE.
351
352
   If REMOVED == 0, this is the CIE that we have chosen to use for
353
   the output FDE.  The CIE's REMOVED field is also 0, but the CIE
354
   might belong to a different .eh_frame input section from the FDE.
355
356
   May be NULL to signify that the FDE should be discarded.  */
357
      struct eh_cie_fde *cie_inf;
358
      struct eh_cie_fde *next_for_section;
359
    } fde;
360
    struct {
361
      /* CIEs have three states:
362
363
   - REMOVED && !MERGED: Slated for removal because we haven't yet
364
     proven that an FDE needs it.  FULL_CIE, if nonnull, points to
365
     more detailed information about the CIE.
366
367
   - REMOVED && MERGED: We have merged this CIE with MERGED_WITH,
368
     which may not belong to the same input section.
369
370
   - !REMOVED: We have decided to keep this CIE.  SEC is the
371
     .eh_frame input section that contains the CIE.  */
372
      union {
373
  struct cie *full_cie;
374
  struct eh_cie_fde *merged_with;
375
  asection *sec;
376
      } u;
377
378
      /* The offset of the personality data from the start of the CIE,
379
   or 0 if the CIE doesn't have any.  */
380
      unsigned int personality_offset : 8;
381
382
      /* Length of augmentation.  aug_str_len is the length of the
383
   string including null terminator.  aug_data_len is the length
384
   of the rest up to the initial insns.  */
385
      unsigned int aug_str_len : 3;
386
      unsigned int aug_data_len : 5;
387
388
      /* True if we have marked relocations associated with this CIE.  */
389
      unsigned int gc_mark : 1;
390
391
      /* True if we have decided to turn an absolute LSDA encoding into
392
   a PC-relative one.  */
393
      unsigned int make_lsda_relative : 1;
394
395
      /* True if we have decided to turn an absolute personality
396
   encoding into a PC-relative one.  */
397
      unsigned int make_per_encoding_relative : 1;
398
399
      /* True if the CIE contains personality data and if that
400
   data uses a PC-relative encoding.  Always true when
401
   make_per_encoding_relative is.  */
402
      unsigned int per_encoding_relative : 1;
403
404
      /* True if the CIE contains personality data aligned to a
405
   multiple of eight bytes.  */
406
      unsigned int per_encoding_aligned8 : 1;
407
408
      /* True if we need to add an 'R' (FDE encoding) entry to the
409
   CIE's augmentation data.  */
410
      unsigned int add_fde_encoding : 1;
411
412
      /* True if we have merged this CIE with another.  */
413
      unsigned int merged : 1;
414
415
      /* Unused bits.  */
416
      unsigned int pad1 : 9;
417
    } cie;
418
  } u;
419
  unsigned int reloc_index;
420
  unsigned int size;
421
  unsigned int offset;
422
  unsigned int new_offset;
423
  unsigned int fde_encoding : 8;
424
  unsigned int lsda_encoding : 8;
425
  unsigned int lsda_offset : 8;
426
427
  /* True if this entry represents a CIE, false if it represents an FDE.  */
428
  unsigned int cie : 1;
429
430
  /* True if this entry is currently marked for removal.  */
431
  unsigned int removed : 1;
432
433
  /* True if we need to add a 'z' (augmentation size) entry to the CIE's
434
     augmentation data, and an associated byte to each of the CIE's FDEs.  */
435
  unsigned int add_augmentation_size : 1;
436
437
  /* True if we have decided to convert absolute FDE relocations into
438
     relative ones.  This applies to the first relocation in the FDE,
439
     which is against the code that the FDE describes.  */
440
  unsigned int make_relative : 1;
441
442
  /* Unused bits.  */
443
  unsigned int pad1 : 4;
444
445
  unsigned int *set_loc;
446
};
447
448
struct eh_frame_sec_info
449
{
450
  unsigned int count;
451
  struct cie *cies;
452
  struct eh_cie_fde entry[1];
453
};
454
455
struct eh_frame_array_ent
456
{
457
  bfd_vma initial_loc;
458
  bfd_size_type range;
459
  bfd_vma fde;
460
};
461
462
struct htab;
463
464
0
#define DWARF2_EH_HDR 1
465
0
#define COMPACT_EH_HDR 2
466
467
/* Endian-neutral code indicating that a function cannot be unwound.  */
468
0
#define COMPACT_EH_CANT_UNWIND_OPCODE 0x015d5d01
469
470
struct dwarf_eh_frame_hdr_info
471
{
472
  struct htab *cies;
473
  unsigned int fde_count;
474
  /* TRUE if .eh_frame_hdr should contain the sorted search table.
475
     We build it if we successfully read all .eh_frame input sections
476
     and recognize them.  */
477
  bool table;
478
  struct eh_frame_array_ent *array;
479
};
480
481
struct compact_eh_frame_hdr_info
482
{
483
  unsigned int allocated_entries;
484
  /* eh_frame_entry fragments.  */
485
  asection **entries;
486
};
487
488
struct eh_frame_hdr_info
489
{
490
  asection *hdr_sec;
491
  unsigned int array_count;
492
  bool frame_hdr_is_compact;
493
  union
494
    {
495
      struct dwarf_eh_frame_hdr_info dwarf;
496
      struct compact_eh_frame_hdr_info compact;
497
    }
498
  u;
499
};
500
501
/* Additional information for each function (used at link time).  */
502
struct sframe_func_bfdinfo
503
{
504
  /* Whether the function has been discarded from the final output.  */
505
  bool func_deleted_p;
506
  /* Relocation offset.  */
507
  unsigned int func_r_offset;
508
  /* Relocation index.  */
509
  unsigned int func_reloc_index;
510
};
511
512
/* Link state information of the SFrame section.  */
513
enum sframe_sec_state
514
{
515
  SFRAME_SEC_DECODED = 1,
516
  SFRAME_SEC_MERGED,
517
};
518
519
/* SFrame decoder info.
520
   Contains all information for a decoded .sframe section.  */
521
struct sframe_dec_info
522
{
523
  /* Decoder context.  */
524
  struct sframe_decoder_ctx *sfd_ctx;
525
  /* SFrame section state as it progresses through the link process.  */
526
  enum sframe_sec_state sfd_state;
527
  /* Number of function descriptor entries in this .sframe.  */
528
  unsigned int sfd_fde_count;
529
  /* Additional information for linking.  */
530
  struct sframe_func_bfdinfo *sfd_func_bfdinfo;
531
};
532
533
/* SFrame encoder info.
534
   Contains all information for an encoded .sframe section to be
535
   written out.  */
536
struct sframe_enc_info
537
{
538
  /* Encoder context.  */
539
  struct sframe_encoder_ctx *sfe_ctx;
540
  /* Output section.  */
541
  asection *sframe_section;
542
};
543
544
/* Enum used to identify target specific extensions to the elf_obj_tdata
545
   and elf_link_hash_table structures.  Note the enums deliberately start
546
   from 1 so that we can detect an uninitialized field.  The generic value
547
   is last so that additions to this enum do not need to modify more than
548
   one line.  */
549
enum elf_target_id
550
{
551
  AARCH64_ELF_DATA = 1,
552
  ALPHA_ELF_DATA,
553
  AMDGCN_ELF_DATA,
554
  ARC_ELF_DATA,
555
  ARM_ELF_DATA,
556
  AVR_ELF_DATA,
557
  BFIN_ELF_DATA,
558
  CR16_ELF_DATA,
559
  CRIS_ELF_DATA,
560
  CSKY_ELF_DATA,
561
  FRV_ELF_DATA,
562
  HPPA32_ELF_DATA,
563
  HPPA64_ELF_DATA,
564
  I386_ELF_DATA,
565
  IA64_ELF_DATA,
566
  KVX_ELF_DATA,
567
  LARCH_ELF_DATA,
568
  LM32_ELF_DATA,
569
  M32R_ELF_DATA,
570
  M68HC11_ELF_DATA,
571
  M68K_ELF_DATA,
572
  METAG_ELF_DATA,
573
  MICROBLAZE_ELF_DATA,
574
  MIPS_ELF_DATA,
575
  MMIX_ELF_DATA,
576
  MN10300_ELF_DATA,
577
  NDS32_ELF_DATA,
578
  OR1K_ELF_DATA,
579
  PPC32_ELF_DATA,
580
  PPC64_ELF_DATA,
581
  PRU_ELF_DATA,
582
  RISCV_ELF_DATA,
583
  S390_ELF_DATA,
584
  SCORE_ELF_DATA,
585
  SH_ELF_DATA,
586
  SPARC_ELF_DATA,
587
  SPU_ELF_DATA,
588
  TIC6X_ELF_DATA,
589
  TILEGX_ELF_DATA,
590
  TILEPRO_ELF_DATA,
591
  VAX_ELF_DATA,
592
  WEBASSEMBLY_ELF_DATA,
593
  X86_64_ELF_DATA,
594
  XTENSA_ELF_DATA,
595
  GENERIC_ELF_DATA
596
};
597
598
struct elf_sym_strtab
599
{
600
  Elf_Internal_Sym sym;
601
  unsigned long dest_index;
602
};
603
604
struct bfd_link_needed_list
605
{
606
  struct bfd_link_needed_list *next;
607
  bfd *by;
608
  const char *name;
609
};
610
611
enum elf_target_os
612
{
613
  is_normal,
614
  is_solaris, /* Solaris.  */
615
  is_vxworks  /* VxWorks.  */
616
};
617
618
/* Used by bfd_sym_from_r_symndx to cache a small number of local
619
   symbols.  */
620
0
#define LOCAL_SYM_CACHE_SIZE 32
621
struct sym_cache
622
{
623
  bfd *abfd;
624
  unsigned long indx[LOCAL_SYM_CACHE_SIZE];
625
  Elf_Internal_Sym sym[LOCAL_SYM_CACHE_SIZE];
626
};
627
628
/* ELF linker hash table.  */
629
630
struct elf_link_hash_table
631
{
632
  struct bfd_link_hash_table root;
633
634
  /* An identifier used to distinguish different target
635
     specific extensions to this structure.  */
636
  enum elf_target_id hash_table_id;
637
638
  /* Whether we have created the special dynamic sections required
639
     when linking against or generating a shared object.  */
640
  bool dynamic_sections_created;
641
642
  /* Whether dynamic relocations are present.  */
643
  bool dynamic_relocs;
644
645
  /* TRUE if there are local dynamic symbols.  */
646
  bool has_local_dynsyms;
647
648
  /* True if this target has relocatable executables, so needs dynamic
649
     section symbols.  */
650
  bool is_relocatable_executable;
651
652
  /* TRUE if there are IFUNC resolvers.  */
653
  bool ifunc_resolvers;
654
655
  /* TRUE if DT_PLTGOT is a required dynamic tag.  */
656
  bool dt_pltgot_required;
657
658
  /* TRUE if DT_JMPREL is a required dynamic tag.  */
659
  bool dt_jmprel_required;
660
661
  /* TRUE when we are handling DT_NEEDED entries.  */
662
  bool handling_dt_needed;
663
664
  /* TRUE if there are base symbols.  */
665
  bool has_base_symbols;
666
667
  /* The BFD used to hold special sections created by the linker.
668
     This will be the first BFD found which requires these sections to
669
     be created.  */
670
  bfd *dynobj;
671
672
  /* The value to use when initialising got.refcount/offset and
673
     plt.refcount/offset in an elf_link_hash_entry.  Set to zero when
674
     the values are refcounts.  Set to init_got_offset/init_plt_offset
675
     in size_dynamic_sections when the values may be offsets.  */
676
  union gotplt_union init_got_refcount;
677
  union gotplt_union init_plt_refcount;
678
679
  /* The value to use for got.refcount/offset and plt.refcount/offset
680
     when the values may be offsets.  Normally (bfd_vma) -1.  */
681
  union gotplt_union init_got_offset;
682
  union gotplt_union init_plt_offset;
683
684
  /* The number of symbols found in the link which is intended for the
685
     mandatory DT_SYMTAB tag (.dynsym section) in .dynamic section.  */
686
  bfd_size_type dynsymcount;
687
  bfd_size_type local_dynsymcount;
688
689
  /* The string table of dynamic symbols, which becomes the .dynstr
690
     section.  */
691
  struct elf_strtab_hash *dynstr;
692
693
  /* The array size of the symbol string table, which becomes the
694
     .strtab section.  */
695
  bfd_size_type strtabsize;
696
697
  /* The array of strings, which becomes the .strtab section.  */
698
  struct elf_sym_strtab *strtab;
699
700
  /* The number of buckets in the hash table in the .hash section.
701
     This is based on the number of dynamic symbols.  */
702
  bfd_size_type bucketcount;
703
704
  /* A linked list of DT_NEEDED names found in dynamic objects
705
     included in the link.  */
706
  struct bfd_link_needed_list *needed;
707
708
  /* Sections in the output bfd that provides a section symbol
709
     to be used by relocations emitted against local symbols.
710
     Most targets will not use data_index_section.  */
711
  asection *text_index_section;
712
  asection *data_index_section;
713
714
  /* The _GLOBAL_OFFSET_TABLE_ symbol.  */
715
  struct elf_link_hash_entry *hgot;
716
717
  /* The _PROCEDURE_LINKAGE_TABLE_ symbol.  */
718
  struct elf_link_hash_entry *hplt;
719
720
  /* The _DYNAMIC symbol.  */
721
  struct elf_link_hash_entry *hdynamic;
722
723
  /* The __ehdr_start symbol.  */
724
  struct elf_link_hash_entry *hehdr_start;
725
726
  /* Used to link stabs in sections.  */
727
  struct stab_info stab_info;
728
729
  /* Used by eh_frame code when editing .eh_frame.  */
730
  struct eh_frame_hdr_info eh_info;
731
732
  /* Used to link stack trace info in .sframe sections.  */
733
  struct sframe_enc_info sfe_info;
734
735
  /* A linked list of local symbols to be added to .dynsym.  */
736
  struct elf_link_local_dynamic_entry *dynlocal;
737
738
  /* A linked list of DT_RPATH/DT_RUNPATH names found in dynamic
739
     objects included in the link.  */
740
  struct bfd_link_needed_list *runpath;
741
742
  /* Cached first output tls section and size of PT_TLS segment.  */
743
  asection *tls_sec;
744
  bfd_size_type tls_size;  /* Bytes.  */
745
746
  /* The offset into splt of the PLT entry for the TLS descriptor
747
     resolver.  Special values are 0, if not necessary (or not found
748
     to be necessary yet), and -1 if needed but not determined
749
     yet.  */
750
  bfd_vma tlsdesc_plt;
751
752
  /* The GOT offset for the lazy trampoline.  Communicated to the
753
     loader via DT_TLSDESC_GOT.  The magic value (bfd_vma) -1
754
     indicates an offset is not allocated.  */
755
  bfd_vma tlsdesc_got;
756
757
  /* Target OS for linker output.  */
758
  enum elf_target_os target_os;
759
760
  /* A linked list of dynamic BFD's loaded in the link.  */
761
  struct elf_link_loaded_list *dyn_loaded;
762
763
  /* Small local sym cache.  */
764
  struct sym_cache sym_cache;
765
766
  /* Hash table of symbols which are first defined in archives or shared
767
     objects when there are any IR inputs.  */
768
  struct bfd_hash_table *first_hash;
769
770
  /* Short-cuts to get to dynamic linker sections.  */
771
  asection *sgot;
772
  asection *sgotplt;
773
  asection *srelgot;
774
  asection *splt;
775
  asection *srelplt;
776
  asection *sdynbss;
777
  asection *srelbss;
778
  asection *sdynrelro;
779
  asection *sreldynrelro;
780
  asection *igotplt;
781
  asection *iplt;
782
  asection *irelplt;
783
  asection *irelifunc;
784
  asection *dynsym;
785
  asection *srelrdyn;
786
  asection *dynamic;
787
  asection *interp;
788
};
789
790
/* Returns TRUE if the hash table is a struct elf_link_hash_table.  */
791
792
static inline bool
793
is_elf_hash_table (const struct bfd_link_hash_table *htab)
794
0
{
795
0
  return htab->type == bfd_link_elf_hash_table;
796
0
}
Unexecuted instantiation: fuzz_nm.c:is_elf_hash_table
Unexecuted instantiation: bfd.c:is_elf_hash_table
Unexecuted instantiation: format.c:is_elf_hash_table
Unexecuted instantiation: libbfd.c:is_elf_hash_table
Unexecuted instantiation: opncls.c:is_elf_hash_table
Unexecuted instantiation: elf64-x86-64.c:is_elf_hash_table
Unexecuted instantiation: elfxx-x86.c:is_elf_hash_table
Unexecuted instantiation: elf-ifunc.c:is_elf_hash_table
Unexecuted instantiation: elf-solaris2.c:is_elf_hash_table
Unexecuted instantiation: elf-vxworks.c:is_elf_hash_table
Unexecuted instantiation: elf64.c:is_elf_hash_table
Unexecuted instantiation: elf.c:is_elf_hash_table
Unexecuted instantiation: elflink.c:is_elf_hash_table
Unexecuted instantiation: elf-attrs.c:is_elf_hash_table
Unexecuted instantiation: elf-strtab.c:is_elf_hash_table
Unexecuted instantiation: elf-eh-frame.c:is_elf_hash_table
Unexecuted instantiation: elf-properties.c:is_elf_hash_table
Unexecuted instantiation: elf-sframe.c:is_elf_hash_table
Unexecuted instantiation: dwarf1.c:is_elf_hash_table
Unexecuted instantiation: dwarf2.c:is_elf_hash_table
Unexecuted instantiation: elf32-i386.c:is_elf_hash_table
Unexecuted instantiation: elf32.c:is_elf_hash_table
Unexecuted instantiation: cofflink.c:is_elf_hash_table
Unexecuted instantiation: coffgen.c:is_elf_hash_table
Unexecuted instantiation: elf64-gen.c:is_elf_hash_table
Unexecuted instantiation: elf32-gen.c:is_elf_hash_table
Unexecuted instantiation: elf32-aarch64.c:is_elf_hash_table
Unexecuted instantiation: elf32-ia64.c:is_elf_hash_table
Unexecuted instantiation: elf32-kvx.c:is_elf_hash_table
Unexecuted instantiation: elf32-loongarch.c:is_elf_hash_table
Unexecuted instantiation: elf32-mips.c:is_elf_hash_table
Unexecuted instantiation: elf32-riscv.c:is_elf_hash_table
Unexecuted instantiation: elf32-score.c:is_elf_hash_table
Unexecuted instantiation: elf32-score7.c:is_elf_hash_table
Unexecuted instantiation: elf64-aarch64.c:is_elf_hash_table
Unexecuted instantiation: elf64-alpha.c:is_elf_hash_table
Unexecuted instantiation: elf64-amdgcn.c:is_elf_hash_table
Unexecuted instantiation: elf64-bpf.c:is_elf_hash_table
Unexecuted instantiation: elf64-hppa.c:is_elf_hash_table
Unexecuted instantiation: elf64-ia64-vms.c:is_elf_hash_table
Unexecuted instantiation: elf64-ia64.c:is_elf_hash_table
Unexecuted instantiation: elf64-kvx.c:is_elf_hash_table
Unexecuted instantiation: elf64-loongarch.c:is_elf_hash_table
Unexecuted instantiation: elf64-mips.c:is_elf_hash_table
Unexecuted instantiation: elf64-mmix.c:is_elf_hash_table
Unexecuted instantiation: elf64-nfp.c:is_elf_hash_table
Unexecuted instantiation: elf64-ppc.c:is_elf_hash_table
Unexecuted instantiation: elf64-riscv.c:is_elf_hash_table
Unexecuted instantiation: elf64-s390.c:is_elf_hash_table
Unexecuted instantiation: elf64-sparc.c:is_elf_hash_table
Unexecuted instantiation: elf64-tilegx.c:is_elf_hash_table
Unexecuted instantiation: elfn32-mips.c:is_elf_hash_table
Unexecuted instantiation: elfxx-aarch64.c:is_elf_hash_table
Unexecuted instantiation: elfxx-ia64.c:is_elf_hash_table
Unexecuted instantiation: elfxx-kvx.c:is_elf_hash_table
Unexecuted instantiation: elfxx-loongarch.c:is_elf_hash_table
Unexecuted instantiation: elfxx-mips.c:is_elf_hash_table
Unexecuted instantiation: elfxx-riscv.c:is_elf_hash_table
Unexecuted instantiation: elf-m10200.c:is_elf_hash_table
Unexecuted instantiation: elf-m10300.c:is_elf_hash_table
Unexecuted instantiation: elf32-am33lin.c:is_elf_hash_table
Unexecuted instantiation: elf32-arc.c:is_elf_hash_table
Unexecuted instantiation: elf32-arm.c:is_elf_hash_table
Unexecuted instantiation: elf32-avr.c:is_elf_hash_table
Unexecuted instantiation: elf32-bfin.c:is_elf_hash_table
Unexecuted instantiation: elf32-cr16.c:is_elf_hash_table
Unexecuted instantiation: elf32-cris.c:is_elf_hash_table
Unexecuted instantiation: elf32-crx.c:is_elf_hash_table
Unexecuted instantiation: elf32-csky.c:is_elf_hash_table
Unexecuted instantiation: elf32-d10v.c:is_elf_hash_table
Unexecuted instantiation: elf32-d30v.c:is_elf_hash_table
Unexecuted instantiation: elf32-dlx.c:is_elf_hash_table
Unexecuted instantiation: elf32-epiphany.c:is_elf_hash_table
Unexecuted instantiation: elf32-fr30.c:is_elf_hash_table
Unexecuted instantiation: elf32-frv.c:is_elf_hash_table
Unexecuted instantiation: elf32-ft32.c:is_elf_hash_table
Unexecuted instantiation: elf32-h8300.c:is_elf_hash_table
Unexecuted instantiation: elf32-hppa.c:is_elf_hash_table
Unexecuted instantiation: elf32-ip2k.c:is_elf_hash_table
Unexecuted instantiation: elf32-iq2000.c:is_elf_hash_table
Unexecuted instantiation: elf32-lm32.c:is_elf_hash_table
Unexecuted instantiation: elf32-m32c.c:is_elf_hash_table
Unexecuted instantiation: elf32-m32r.c:is_elf_hash_table
Unexecuted instantiation: elf32-m68hc11.c:is_elf_hash_table
Unexecuted instantiation: elf32-m68hc12.c:is_elf_hash_table
Unexecuted instantiation: elf32-m68hc1x.c:is_elf_hash_table
Unexecuted instantiation: elf32-m68k.c:is_elf_hash_table
Unexecuted instantiation: elf32-mcore.c:is_elf_hash_table
Unexecuted instantiation: elf32-mep.c:is_elf_hash_table
Unexecuted instantiation: elf32-metag.c:is_elf_hash_table
Unexecuted instantiation: elf32-microblaze.c:is_elf_hash_table
Unexecuted instantiation: elf32-moxie.c:is_elf_hash_table
Unexecuted instantiation: elf32-msp430.c:is_elf_hash_table
Unexecuted instantiation: elf32-mt.c:is_elf_hash_table
Unexecuted instantiation: elf32-nds32.c:is_elf_hash_table
Unexecuted instantiation: elf32-or1k.c:is_elf_hash_table
Unexecuted instantiation: elf32-pj.c:is_elf_hash_table
Unexecuted instantiation: elf32-ppc.c:is_elf_hash_table
Unexecuted instantiation: elf32-pru.c:is_elf_hash_table
Unexecuted instantiation: elf32-rl78.c:is_elf_hash_table
Unexecuted instantiation: elf32-rx.c:is_elf_hash_table
Unexecuted instantiation: elf32-s12z.c:is_elf_hash_table
Unexecuted instantiation: elf32-s390.c:is_elf_hash_table
Unexecuted instantiation: elf32-sh.c:is_elf_hash_table
Unexecuted instantiation: elf32-sparc.c:is_elf_hash_table
Unexecuted instantiation: elf32-spu.c:is_elf_hash_table
Unexecuted instantiation: elf32-tic6x.c:is_elf_hash_table
Unexecuted instantiation: elf32-tilegx.c:is_elf_hash_table
Unexecuted instantiation: elf32-tilepro.c:is_elf_hash_table
Unexecuted instantiation: elf32-v850.c:is_elf_hash_table
Unexecuted instantiation: elf32-vax.c:is_elf_hash_table
Unexecuted instantiation: elf32-visium.c:is_elf_hash_table
Unexecuted instantiation: elf32-wasm32.c:is_elf_hash_table
Unexecuted instantiation: elf32-xgate.c:is_elf_hash_table
Unexecuted instantiation: elf32-xstormy16.c:is_elf_hash_table
Unexecuted instantiation: elf32-xtensa.c:is_elf_hash_table
Unexecuted instantiation: elf32-z80.c:is_elf_hash_table
Unexecuted instantiation: elfxx-sparc.c:is_elf_hash_table
Unexecuted instantiation: elfxx-tilegx.c:is_elf_hash_table
Unexecuted instantiation: cpu-nds32.c:is_elf_hash_table
Unexecuted instantiation: compress.c:is_elf_hash_table
Unexecuted instantiation: merge.c:is_elf_hash_table
Unexecuted instantiation: fuzz_objdump.c:is_elf_hash_table
Unexecuted instantiation: arc-dis.c:is_elf_hash_table
Unexecuted instantiation: arm-dis.c:is_elf_hash_table
Unexecuted instantiation: csky-dis.c:is_elf_hash_table
Unexecuted instantiation: kvx-dis.c:is_elf_hash_table
Unexecuted instantiation: m32c-dis.c:is_elf_hash_table
Unexecuted instantiation: mep-dis.c:is_elf_hash_table
Unexecuted instantiation: ppc-dis.c:is_elf_hash_table
Unexecuted instantiation: pru-dis.c:is_elf_hash_table
Unexecuted instantiation: rl78-dis.c:is_elf_hash_table
Unexecuted instantiation: score-dis.c:is_elf_hash_table
Unexecuted instantiation: score7-dis.c:is_elf_hash_table
Unexecuted instantiation: tilepro-dis.c:is_elf_hash_table
Unexecuted instantiation: wasm32-dis.c:is_elf_hash_table
Unexecuted instantiation: aarch64-dis.c:is_elf_hash_table
Unexecuted instantiation: bpf-dis.c:is_elf_hash_table
Unexecuted instantiation: mips-dis.c:is_elf_hash_table
Unexecuted instantiation: nfp-dis.c:is_elf_hash_table
Unexecuted instantiation: riscv-dis.c:is_elf_hash_table
Unexecuted instantiation: tilegx-dis.c:is_elf_hash_table
Unexecuted instantiation: ctf-serialize.c:is_elf_hash_table
Unexecuted instantiation: ctf-open-bfd.c:is_elf_hash_table
Unexecuted instantiation: fuzz_addr2line.c:is_elf_hash_table
Unexecuted instantiation: fuzz_as.c:is_elf_hash_table
Unexecuted instantiation: codeview.c:is_elf_hash_table
Unexecuted instantiation: cond.c:is_elf_hash_table
Unexecuted instantiation: depend.c:is_elf_hash_table
Unexecuted instantiation: dw2gencfi.c:is_elf_hash_table
Unexecuted instantiation: dwarf2dbg.c:is_elf_hash_table
Unexecuted instantiation: ehopt.c:is_elf_hash_table
Unexecuted instantiation: expr.c:is_elf_hash_table
Unexecuted instantiation: frags.c:is_elf_hash_table
Unexecuted instantiation: gen-sframe.c:is_elf_hash_table
Unexecuted instantiation: input-scrub.c:is_elf_hash_table
Unexecuted instantiation: listing.c:is_elf_hash_table
Unexecuted instantiation: macro.c:is_elf_hash_table
Unexecuted instantiation: messages.c:is_elf_hash_table
Unexecuted instantiation: output-file.c:is_elf_hash_table
Unexecuted instantiation: read.c:is_elf_hash_table
Unexecuted instantiation: remap.c:is_elf_hash_table
Unexecuted instantiation: sb.c:is_elf_hash_table
Unexecuted instantiation: scfidw2gen.c:is_elf_hash_table
Unexecuted instantiation: stabs.c:is_elf_hash_table
Unexecuted instantiation: subsegs.c:is_elf_hash_table
Unexecuted instantiation: symbols.c:is_elf_hash_table
Unexecuted instantiation: write.c:is_elf_hash_table
Unexecuted instantiation: app.c:is_elf_hash_table
Unexecuted instantiation: atof-generic.c:is_elf_hash_table
Unexecuted instantiation: ecoff.c:is_elf_hash_table
Unexecuted instantiation: flonum-copy.c:is_elf_hash_table
Unexecuted instantiation: ginsn.c:is_elf_hash_table
Unexecuted instantiation: hash.c:is_elf_hash_table
Unexecuted instantiation: input-file.c:is_elf_hash_table
Unexecuted instantiation: scfi.c:is_elf_hash_table
Unexecuted instantiation: sframe-opt.c:is_elf_hash_table
Unexecuted instantiation: tc-i386.c:is_elf_hash_table
Unexecuted instantiation: obj-elf.c:is_elf_hash_table
Unexecuted instantiation: atof-ieee.c:is_elf_hash_table
Unexecuted instantiation: fuzz_dwarf.c:is_elf_hash_table
Unexecuted instantiation: fuzz_objcopy.c:is_elf_hash_table
797
798
/* Look up an entry in an ELF linker hash table.  */
799
800
static inline struct elf_link_hash_entry *
801
elf_link_hash_lookup (struct elf_link_hash_table *table, const char *string,
802
          bool create, bool copy, bool follow)
803
0
{
804
0
  if (ENABLE_CHECKING && !is_elf_hash_table (&table->root))
805
0
    abort ();
806
0
  return (struct elf_link_hash_entry *)
807
0
    bfd_link_hash_lookup (&table->root, string, create, copy, follow);
808
0
}
Unexecuted instantiation: fuzz_nm.c:elf_link_hash_lookup
Unexecuted instantiation: bfd.c:elf_link_hash_lookup
Unexecuted instantiation: format.c:elf_link_hash_lookup
Unexecuted instantiation: libbfd.c:elf_link_hash_lookup
Unexecuted instantiation: opncls.c:elf_link_hash_lookup
Unexecuted instantiation: elf64-x86-64.c:elf_link_hash_lookup
Unexecuted instantiation: elfxx-x86.c:elf_link_hash_lookup
Unexecuted instantiation: elf-ifunc.c:elf_link_hash_lookup
Unexecuted instantiation: elf-solaris2.c:elf_link_hash_lookup
Unexecuted instantiation: elf-vxworks.c:elf_link_hash_lookup
Unexecuted instantiation: elf64.c:elf_link_hash_lookup
Unexecuted instantiation: elf.c:elf_link_hash_lookup
Unexecuted instantiation: elflink.c:elf_link_hash_lookup
Unexecuted instantiation: elf-attrs.c:elf_link_hash_lookup
Unexecuted instantiation: elf-strtab.c:elf_link_hash_lookup
Unexecuted instantiation: elf-eh-frame.c:elf_link_hash_lookup
Unexecuted instantiation: elf-properties.c:elf_link_hash_lookup
Unexecuted instantiation: elf-sframe.c:elf_link_hash_lookup
Unexecuted instantiation: dwarf1.c:elf_link_hash_lookup
Unexecuted instantiation: dwarf2.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-i386.c:elf_link_hash_lookup
Unexecuted instantiation: elf32.c:elf_link_hash_lookup
Unexecuted instantiation: cofflink.c:elf_link_hash_lookup
Unexecuted instantiation: coffgen.c:elf_link_hash_lookup
Unexecuted instantiation: elf64-gen.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-gen.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-aarch64.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-ia64.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-kvx.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-loongarch.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-mips.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-riscv.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-score.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-score7.c:elf_link_hash_lookup
Unexecuted instantiation: elf64-aarch64.c:elf_link_hash_lookup
Unexecuted instantiation: elf64-alpha.c:elf_link_hash_lookup
Unexecuted instantiation: elf64-amdgcn.c:elf_link_hash_lookup
Unexecuted instantiation: elf64-bpf.c:elf_link_hash_lookup
Unexecuted instantiation: elf64-hppa.c:elf_link_hash_lookup
Unexecuted instantiation: elf64-ia64-vms.c:elf_link_hash_lookup
Unexecuted instantiation: elf64-ia64.c:elf_link_hash_lookup
Unexecuted instantiation: elf64-kvx.c:elf_link_hash_lookup
Unexecuted instantiation: elf64-loongarch.c:elf_link_hash_lookup
Unexecuted instantiation: elf64-mips.c:elf_link_hash_lookup
Unexecuted instantiation: elf64-mmix.c:elf_link_hash_lookup
Unexecuted instantiation: elf64-nfp.c:elf_link_hash_lookup
Unexecuted instantiation: elf64-ppc.c:elf_link_hash_lookup
Unexecuted instantiation: elf64-riscv.c:elf_link_hash_lookup
Unexecuted instantiation: elf64-s390.c:elf_link_hash_lookup
Unexecuted instantiation: elf64-sparc.c:elf_link_hash_lookup
Unexecuted instantiation: elf64-tilegx.c:elf_link_hash_lookup
Unexecuted instantiation: elfn32-mips.c:elf_link_hash_lookup
Unexecuted instantiation: elfxx-aarch64.c:elf_link_hash_lookup
Unexecuted instantiation: elfxx-ia64.c:elf_link_hash_lookup
Unexecuted instantiation: elfxx-kvx.c:elf_link_hash_lookup
Unexecuted instantiation: elfxx-loongarch.c:elf_link_hash_lookup
Unexecuted instantiation: elfxx-mips.c:elf_link_hash_lookup
Unexecuted instantiation: elfxx-riscv.c:elf_link_hash_lookup
Unexecuted instantiation: elf-m10200.c:elf_link_hash_lookup
Unexecuted instantiation: elf-m10300.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-am33lin.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-arc.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-arm.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-avr.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-bfin.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-cr16.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-cris.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-crx.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-csky.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-d10v.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-d30v.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-dlx.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-epiphany.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-fr30.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-frv.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-ft32.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-h8300.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-hppa.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-ip2k.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-iq2000.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-lm32.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-m32c.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-m32r.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-m68hc11.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-m68hc12.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-m68hc1x.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-m68k.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-mcore.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-mep.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-metag.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-microblaze.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-moxie.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-msp430.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-mt.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-nds32.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-or1k.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-pj.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-ppc.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-pru.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-rl78.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-rx.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-s12z.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-s390.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-sh.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-sparc.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-spu.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-tic6x.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-tilegx.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-tilepro.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-v850.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-vax.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-visium.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-wasm32.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-xgate.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-xstormy16.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-xtensa.c:elf_link_hash_lookup
Unexecuted instantiation: elf32-z80.c:elf_link_hash_lookup
Unexecuted instantiation: elfxx-sparc.c:elf_link_hash_lookup
Unexecuted instantiation: elfxx-tilegx.c:elf_link_hash_lookup
Unexecuted instantiation: cpu-nds32.c:elf_link_hash_lookup
Unexecuted instantiation: compress.c:elf_link_hash_lookup
Unexecuted instantiation: merge.c:elf_link_hash_lookup
Unexecuted instantiation: fuzz_objdump.c:elf_link_hash_lookup
Unexecuted instantiation: arc-dis.c:elf_link_hash_lookup
Unexecuted instantiation: arm-dis.c:elf_link_hash_lookup
Unexecuted instantiation: csky-dis.c:elf_link_hash_lookup
Unexecuted instantiation: kvx-dis.c:elf_link_hash_lookup
Unexecuted instantiation: m32c-dis.c:elf_link_hash_lookup
Unexecuted instantiation: mep-dis.c:elf_link_hash_lookup
Unexecuted instantiation: ppc-dis.c:elf_link_hash_lookup
Unexecuted instantiation: pru-dis.c:elf_link_hash_lookup
Unexecuted instantiation: rl78-dis.c:elf_link_hash_lookup
Unexecuted instantiation: score-dis.c:elf_link_hash_lookup
Unexecuted instantiation: score7-dis.c:elf_link_hash_lookup
Unexecuted instantiation: tilepro-dis.c:elf_link_hash_lookup
Unexecuted instantiation: wasm32-dis.c:elf_link_hash_lookup
Unexecuted instantiation: aarch64-dis.c:elf_link_hash_lookup
Unexecuted instantiation: bpf-dis.c:elf_link_hash_lookup
Unexecuted instantiation: mips-dis.c:elf_link_hash_lookup
Unexecuted instantiation: nfp-dis.c:elf_link_hash_lookup
Unexecuted instantiation: riscv-dis.c:elf_link_hash_lookup
Unexecuted instantiation: tilegx-dis.c:elf_link_hash_lookup
Unexecuted instantiation: ctf-serialize.c:elf_link_hash_lookup
Unexecuted instantiation: ctf-open-bfd.c:elf_link_hash_lookup
Unexecuted instantiation: fuzz_addr2line.c:elf_link_hash_lookup
Unexecuted instantiation: fuzz_as.c:elf_link_hash_lookup
Unexecuted instantiation: codeview.c:elf_link_hash_lookup
Unexecuted instantiation: cond.c:elf_link_hash_lookup
Unexecuted instantiation: depend.c:elf_link_hash_lookup
Unexecuted instantiation: dw2gencfi.c:elf_link_hash_lookup
Unexecuted instantiation: dwarf2dbg.c:elf_link_hash_lookup
Unexecuted instantiation: ehopt.c:elf_link_hash_lookup
Unexecuted instantiation: expr.c:elf_link_hash_lookup
Unexecuted instantiation: frags.c:elf_link_hash_lookup
Unexecuted instantiation: gen-sframe.c:elf_link_hash_lookup
Unexecuted instantiation: input-scrub.c:elf_link_hash_lookup
Unexecuted instantiation: listing.c:elf_link_hash_lookup
Unexecuted instantiation: macro.c:elf_link_hash_lookup
Unexecuted instantiation: messages.c:elf_link_hash_lookup
Unexecuted instantiation: output-file.c:elf_link_hash_lookup
Unexecuted instantiation: read.c:elf_link_hash_lookup
Unexecuted instantiation: remap.c:elf_link_hash_lookup
Unexecuted instantiation: sb.c:elf_link_hash_lookup
Unexecuted instantiation: scfidw2gen.c:elf_link_hash_lookup
Unexecuted instantiation: stabs.c:elf_link_hash_lookup
Unexecuted instantiation: subsegs.c:elf_link_hash_lookup
Unexecuted instantiation: symbols.c:elf_link_hash_lookup
Unexecuted instantiation: write.c:elf_link_hash_lookup
Unexecuted instantiation: app.c:elf_link_hash_lookup
Unexecuted instantiation: atof-generic.c:elf_link_hash_lookup
Unexecuted instantiation: ecoff.c:elf_link_hash_lookup
Unexecuted instantiation: flonum-copy.c:elf_link_hash_lookup
Unexecuted instantiation: ginsn.c:elf_link_hash_lookup
Unexecuted instantiation: hash.c:elf_link_hash_lookup
Unexecuted instantiation: input-file.c:elf_link_hash_lookup
Unexecuted instantiation: scfi.c:elf_link_hash_lookup
Unexecuted instantiation: sframe-opt.c:elf_link_hash_lookup
Unexecuted instantiation: tc-i386.c:elf_link_hash_lookup
Unexecuted instantiation: obj-elf.c:elf_link_hash_lookup
Unexecuted instantiation: atof-ieee.c:elf_link_hash_lookup
Unexecuted instantiation: fuzz_dwarf.c:elf_link_hash_lookup
Unexecuted instantiation: fuzz_objcopy.c:elf_link_hash_lookup
809
810
/* Traverse an ELF linker hash table.  */
811
812
static inline void
813
elf_link_hash_traverse (struct elf_link_hash_table *table,
814
      bool (*f) (struct elf_link_hash_entry *, void *),
815
      void *info)
816
0
{
817
0
  if (ENABLE_CHECKING && !is_elf_hash_table (&table->root))
818
0
    abort ();
819
0
  bfd_link_hash_traverse (&table->root,
820
0
        (bool (*) (struct bfd_link_hash_entry *, void *)) f,
821
0
        info);
822
0
}
Unexecuted instantiation: fuzz_nm.c:elf_link_hash_traverse
Unexecuted instantiation: bfd.c:elf_link_hash_traverse
Unexecuted instantiation: format.c:elf_link_hash_traverse
Unexecuted instantiation: libbfd.c:elf_link_hash_traverse
Unexecuted instantiation: opncls.c:elf_link_hash_traverse
Unexecuted instantiation: elf64-x86-64.c:elf_link_hash_traverse
Unexecuted instantiation: elfxx-x86.c:elf_link_hash_traverse
Unexecuted instantiation: elf-ifunc.c:elf_link_hash_traverse
Unexecuted instantiation: elf-solaris2.c:elf_link_hash_traverse
Unexecuted instantiation: elf-vxworks.c:elf_link_hash_traverse
Unexecuted instantiation: elf64.c:elf_link_hash_traverse
Unexecuted instantiation: elf.c:elf_link_hash_traverse
Unexecuted instantiation: elflink.c:elf_link_hash_traverse
Unexecuted instantiation: elf-attrs.c:elf_link_hash_traverse
Unexecuted instantiation: elf-strtab.c:elf_link_hash_traverse
Unexecuted instantiation: elf-eh-frame.c:elf_link_hash_traverse
Unexecuted instantiation: elf-properties.c:elf_link_hash_traverse
Unexecuted instantiation: elf-sframe.c:elf_link_hash_traverse
Unexecuted instantiation: dwarf1.c:elf_link_hash_traverse
Unexecuted instantiation: dwarf2.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-i386.c:elf_link_hash_traverse
Unexecuted instantiation: elf32.c:elf_link_hash_traverse
Unexecuted instantiation: cofflink.c:elf_link_hash_traverse
Unexecuted instantiation: coffgen.c:elf_link_hash_traverse
Unexecuted instantiation: elf64-gen.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-gen.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-aarch64.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-ia64.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-kvx.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-loongarch.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-mips.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-riscv.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-score.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-score7.c:elf_link_hash_traverse
Unexecuted instantiation: elf64-aarch64.c:elf_link_hash_traverse
Unexecuted instantiation: elf64-alpha.c:elf_link_hash_traverse
Unexecuted instantiation: elf64-amdgcn.c:elf_link_hash_traverse
Unexecuted instantiation: elf64-bpf.c:elf_link_hash_traverse
Unexecuted instantiation: elf64-hppa.c:elf_link_hash_traverse
Unexecuted instantiation: elf64-ia64-vms.c:elf_link_hash_traverse
Unexecuted instantiation: elf64-ia64.c:elf_link_hash_traverse
Unexecuted instantiation: elf64-kvx.c:elf_link_hash_traverse
Unexecuted instantiation: elf64-loongarch.c:elf_link_hash_traverse
Unexecuted instantiation: elf64-mips.c:elf_link_hash_traverse
Unexecuted instantiation: elf64-mmix.c:elf_link_hash_traverse
Unexecuted instantiation: elf64-nfp.c:elf_link_hash_traverse
Unexecuted instantiation: elf64-ppc.c:elf_link_hash_traverse
Unexecuted instantiation: elf64-riscv.c:elf_link_hash_traverse
Unexecuted instantiation: elf64-s390.c:elf_link_hash_traverse
Unexecuted instantiation: elf64-sparc.c:elf_link_hash_traverse
Unexecuted instantiation: elf64-tilegx.c:elf_link_hash_traverse
Unexecuted instantiation: elfn32-mips.c:elf_link_hash_traverse
Unexecuted instantiation: elfxx-aarch64.c:elf_link_hash_traverse
Unexecuted instantiation: elfxx-ia64.c:elf_link_hash_traverse
Unexecuted instantiation: elfxx-kvx.c:elf_link_hash_traverse
Unexecuted instantiation: elfxx-loongarch.c:elf_link_hash_traverse
Unexecuted instantiation: elfxx-mips.c:elf_link_hash_traverse
Unexecuted instantiation: elfxx-riscv.c:elf_link_hash_traverse
Unexecuted instantiation: elf-m10200.c:elf_link_hash_traverse
Unexecuted instantiation: elf-m10300.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-am33lin.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-arc.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-arm.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-avr.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-bfin.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-cr16.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-cris.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-crx.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-csky.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-d10v.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-d30v.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-dlx.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-epiphany.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-fr30.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-frv.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-ft32.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-h8300.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-hppa.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-ip2k.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-iq2000.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-lm32.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-m32c.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-m32r.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-m68hc11.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-m68hc12.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-m68hc1x.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-m68k.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-mcore.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-mep.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-metag.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-microblaze.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-moxie.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-msp430.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-mt.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-nds32.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-or1k.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-pj.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-ppc.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-pru.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-rl78.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-rx.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-s12z.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-s390.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-sh.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-sparc.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-spu.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-tic6x.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-tilegx.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-tilepro.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-v850.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-vax.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-visium.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-wasm32.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-xgate.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-xstormy16.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-xtensa.c:elf_link_hash_traverse
Unexecuted instantiation: elf32-z80.c:elf_link_hash_traverse
Unexecuted instantiation: elfxx-sparc.c:elf_link_hash_traverse
Unexecuted instantiation: elfxx-tilegx.c:elf_link_hash_traverse
Unexecuted instantiation: cpu-nds32.c:elf_link_hash_traverse
Unexecuted instantiation: compress.c:elf_link_hash_traverse
Unexecuted instantiation: merge.c:elf_link_hash_traverse
Unexecuted instantiation: fuzz_objdump.c:elf_link_hash_traverse
Unexecuted instantiation: arc-dis.c:elf_link_hash_traverse
Unexecuted instantiation: arm-dis.c:elf_link_hash_traverse
Unexecuted instantiation: csky-dis.c:elf_link_hash_traverse
Unexecuted instantiation: kvx-dis.c:elf_link_hash_traverse
Unexecuted instantiation: m32c-dis.c:elf_link_hash_traverse
Unexecuted instantiation: mep-dis.c:elf_link_hash_traverse
Unexecuted instantiation: ppc-dis.c:elf_link_hash_traverse
Unexecuted instantiation: pru-dis.c:elf_link_hash_traverse
Unexecuted instantiation: rl78-dis.c:elf_link_hash_traverse
Unexecuted instantiation: score-dis.c:elf_link_hash_traverse
Unexecuted instantiation: score7-dis.c:elf_link_hash_traverse
Unexecuted instantiation: tilepro-dis.c:elf_link_hash_traverse
Unexecuted instantiation: wasm32-dis.c:elf_link_hash_traverse
Unexecuted instantiation: aarch64-dis.c:elf_link_hash_traverse
Unexecuted instantiation: bpf-dis.c:elf_link_hash_traverse
Unexecuted instantiation: mips-dis.c:elf_link_hash_traverse
Unexecuted instantiation: nfp-dis.c:elf_link_hash_traverse
Unexecuted instantiation: riscv-dis.c:elf_link_hash_traverse
Unexecuted instantiation: tilegx-dis.c:elf_link_hash_traverse
Unexecuted instantiation: ctf-serialize.c:elf_link_hash_traverse
Unexecuted instantiation: ctf-open-bfd.c:elf_link_hash_traverse
Unexecuted instantiation: fuzz_addr2line.c:elf_link_hash_traverse
Unexecuted instantiation: fuzz_as.c:elf_link_hash_traverse
Unexecuted instantiation: codeview.c:elf_link_hash_traverse
Unexecuted instantiation: cond.c:elf_link_hash_traverse
Unexecuted instantiation: depend.c:elf_link_hash_traverse
Unexecuted instantiation: dw2gencfi.c:elf_link_hash_traverse
Unexecuted instantiation: dwarf2dbg.c:elf_link_hash_traverse
Unexecuted instantiation: ehopt.c:elf_link_hash_traverse
Unexecuted instantiation: expr.c:elf_link_hash_traverse
Unexecuted instantiation: frags.c:elf_link_hash_traverse
Unexecuted instantiation: gen-sframe.c:elf_link_hash_traverse
Unexecuted instantiation: input-scrub.c:elf_link_hash_traverse
Unexecuted instantiation: listing.c:elf_link_hash_traverse
Unexecuted instantiation: macro.c:elf_link_hash_traverse
Unexecuted instantiation: messages.c:elf_link_hash_traverse
Unexecuted instantiation: output-file.c:elf_link_hash_traverse
Unexecuted instantiation: read.c:elf_link_hash_traverse
Unexecuted instantiation: remap.c:elf_link_hash_traverse
Unexecuted instantiation: sb.c:elf_link_hash_traverse
Unexecuted instantiation: scfidw2gen.c:elf_link_hash_traverse
Unexecuted instantiation: stabs.c:elf_link_hash_traverse
Unexecuted instantiation: subsegs.c:elf_link_hash_traverse
Unexecuted instantiation: symbols.c:elf_link_hash_traverse
Unexecuted instantiation: write.c:elf_link_hash_traverse
Unexecuted instantiation: app.c:elf_link_hash_traverse
Unexecuted instantiation: atof-generic.c:elf_link_hash_traverse
Unexecuted instantiation: ecoff.c:elf_link_hash_traverse
Unexecuted instantiation: flonum-copy.c:elf_link_hash_traverse
Unexecuted instantiation: ginsn.c:elf_link_hash_traverse
Unexecuted instantiation: hash.c:elf_link_hash_traverse
Unexecuted instantiation: input-file.c:elf_link_hash_traverse
Unexecuted instantiation: scfi.c:elf_link_hash_traverse
Unexecuted instantiation: sframe-opt.c:elf_link_hash_traverse
Unexecuted instantiation: tc-i386.c:elf_link_hash_traverse
Unexecuted instantiation: obj-elf.c:elf_link_hash_traverse
Unexecuted instantiation: atof-ieee.c:elf_link_hash_traverse
Unexecuted instantiation: fuzz_dwarf.c:elf_link_hash_traverse
Unexecuted instantiation: fuzz_objcopy.c:elf_link_hash_traverse
823
824
/* Get the ELF linker hash table from a link_info structure.  */
825
826
static inline struct elf_link_hash_table *
827
elf_hash_table (const struct bfd_link_info *info)
828
0
{
829
0
  return (struct elf_link_hash_table *) info->hash;
830
0
}
Unexecuted instantiation: fuzz_nm.c:elf_hash_table
Unexecuted instantiation: bfd.c:elf_hash_table
Unexecuted instantiation: format.c:elf_hash_table
Unexecuted instantiation: libbfd.c:elf_hash_table
Unexecuted instantiation: opncls.c:elf_hash_table
Unexecuted instantiation: elf64-x86-64.c:elf_hash_table
Unexecuted instantiation: elfxx-x86.c:elf_hash_table
Unexecuted instantiation: elf-ifunc.c:elf_hash_table
Unexecuted instantiation: elf-solaris2.c:elf_hash_table
Unexecuted instantiation: elf-vxworks.c:elf_hash_table
Unexecuted instantiation: elf64.c:elf_hash_table
Unexecuted instantiation: elf.c:elf_hash_table
Unexecuted instantiation: elflink.c:elf_hash_table
Unexecuted instantiation: elf-attrs.c:elf_hash_table
Unexecuted instantiation: elf-strtab.c:elf_hash_table
Unexecuted instantiation: elf-eh-frame.c:elf_hash_table
Unexecuted instantiation: elf-properties.c:elf_hash_table
Unexecuted instantiation: elf-sframe.c:elf_hash_table
Unexecuted instantiation: dwarf1.c:elf_hash_table
Unexecuted instantiation: dwarf2.c:elf_hash_table
Unexecuted instantiation: elf32-i386.c:elf_hash_table
Unexecuted instantiation: elf32.c:elf_hash_table
Unexecuted instantiation: cofflink.c:elf_hash_table
Unexecuted instantiation: coffgen.c:elf_hash_table
Unexecuted instantiation: elf64-gen.c:elf_hash_table
Unexecuted instantiation: elf32-gen.c:elf_hash_table
Unexecuted instantiation: elf32-aarch64.c:elf_hash_table
Unexecuted instantiation: elf32-ia64.c:elf_hash_table
Unexecuted instantiation: elf32-kvx.c:elf_hash_table
Unexecuted instantiation: elf32-loongarch.c:elf_hash_table
Unexecuted instantiation: elf32-mips.c:elf_hash_table
Unexecuted instantiation: elf32-riscv.c:elf_hash_table
Unexecuted instantiation: elf32-score.c:elf_hash_table
Unexecuted instantiation: elf32-score7.c:elf_hash_table
Unexecuted instantiation: elf64-aarch64.c:elf_hash_table
Unexecuted instantiation: elf64-alpha.c:elf_hash_table
Unexecuted instantiation: elf64-amdgcn.c:elf_hash_table
Unexecuted instantiation: elf64-bpf.c:elf_hash_table
Unexecuted instantiation: elf64-hppa.c:elf_hash_table
Unexecuted instantiation: elf64-ia64-vms.c:elf_hash_table
Unexecuted instantiation: elf64-ia64.c:elf_hash_table
Unexecuted instantiation: elf64-kvx.c:elf_hash_table
Unexecuted instantiation: elf64-loongarch.c:elf_hash_table
Unexecuted instantiation: elf64-mips.c:elf_hash_table
Unexecuted instantiation: elf64-mmix.c:elf_hash_table
Unexecuted instantiation: elf64-nfp.c:elf_hash_table
Unexecuted instantiation: elf64-ppc.c:elf_hash_table
Unexecuted instantiation: elf64-riscv.c:elf_hash_table
Unexecuted instantiation: elf64-s390.c:elf_hash_table
Unexecuted instantiation: elf64-sparc.c:elf_hash_table
Unexecuted instantiation: elf64-tilegx.c:elf_hash_table
Unexecuted instantiation: elfn32-mips.c:elf_hash_table
Unexecuted instantiation: elfxx-aarch64.c:elf_hash_table
Unexecuted instantiation: elfxx-ia64.c:elf_hash_table
Unexecuted instantiation: elfxx-kvx.c:elf_hash_table
Unexecuted instantiation: elfxx-loongarch.c:elf_hash_table
Unexecuted instantiation: elfxx-mips.c:elf_hash_table
Unexecuted instantiation: elfxx-riscv.c:elf_hash_table
Unexecuted instantiation: elf-m10200.c:elf_hash_table
Unexecuted instantiation: elf-m10300.c:elf_hash_table
Unexecuted instantiation: elf32-am33lin.c:elf_hash_table
Unexecuted instantiation: elf32-arc.c:elf_hash_table
Unexecuted instantiation: elf32-arm.c:elf_hash_table
Unexecuted instantiation: elf32-avr.c:elf_hash_table
Unexecuted instantiation: elf32-bfin.c:elf_hash_table
Unexecuted instantiation: elf32-cr16.c:elf_hash_table
Unexecuted instantiation: elf32-cris.c:elf_hash_table
Unexecuted instantiation: elf32-crx.c:elf_hash_table
Unexecuted instantiation: elf32-csky.c:elf_hash_table
Unexecuted instantiation: elf32-d10v.c:elf_hash_table
Unexecuted instantiation: elf32-d30v.c:elf_hash_table
Unexecuted instantiation: elf32-dlx.c:elf_hash_table
Unexecuted instantiation: elf32-epiphany.c:elf_hash_table
Unexecuted instantiation: elf32-fr30.c:elf_hash_table
Unexecuted instantiation: elf32-frv.c:elf_hash_table
Unexecuted instantiation: elf32-ft32.c:elf_hash_table
Unexecuted instantiation: elf32-h8300.c:elf_hash_table
Unexecuted instantiation: elf32-hppa.c:elf_hash_table
Unexecuted instantiation: elf32-ip2k.c:elf_hash_table
Unexecuted instantiation: elf32-iq2000.c:elf_hash_table
Unexecuted instantiation: elf32-lm32.c:elf_hash_table
Unexecuted instantiation: elf32-m32c.c:elf_hash_table
Unexecuted instantiation: elf32-m32r.c:elf_hash_table
Unexecuted instantiation: elf32-m68hc11.c:elf_hash_table
Unexecuted instantiation: elf32-m68hc12.c:elf_hash_table
Unexecuted instantiation: elf32-m68hc1x.c:elf_hash_table
Unexecuted instantiation: elf32-m68k.c:elf_hash_table
Unexecuted instantiation: elf32-mcore.c:elf_hash_table
Unexecuted instantiation: elf32-mep.c:elf_hash_table
Unexecuted instantiation: elf32-metag.c:elf_hash_table
Unexecuted instantiation: elf32-microblaze.c:elf_hash_table
Unexecuted instantiation: elf32-moxie.c:elf_hash_table
Unexecuted instantiation: elf32-msp430.c:elf_hash_table
Unexecuted instantiation: elf32-mt.c:elf_hash_table
Unexecuted instantiation: elf32-nds32.c:elf_hash_table
Unexecuted instantiation: elf32-or1k.c:elf_hash_table
Unexecuted instantiation: elf32-pj.c:elf_hash_table
Unexecuted instantiation: elf32-ppc.c:elf_hash_table
Unexecuted instantiation: elf32-pru.c:elf_hash_table
Unexecuted instantiation: elf32-rl78.c:elf_hash_table
Unexecuted instantiation: elf32-rx.c:elf_hash_table
Unexecuted instantiation: elf32-s12z.c:elf_hash_table
Unexecuted instantiation: elf32-s390.c:elf_hash_table
Unexecuted instantiation: elf32-sh.c:elf_hash_table
Unexecuted instantiation: elf32-sparc.c:elf_hash_table
Unexecuted instantiation: elf32-spu.c:elf_hash_table
Unexecuted instantiation: elf32-tic6x.c:elf_hash_table
Unexecuted instantiation: elf32-tilegx.c:elf_hash_table
Unexecuted instantiation: elf32-tilepro.c:elf_hash_table
Unexecuted instantiation: elf32-v850.c:elf_hash_table
Unexecuted instantiation: elf32-vax.c:elf_hash_table
Unexecuted instantiation: elf32-visium.c:elf_hash_table
Unexecuted instantiation: elf32-wasm32.c:elf_hash_table
Unexecuted instantiation: elf32-xgate.c:elf_hash_table
Unexecuted instantiation: elf32-xstormy16.c:elf_hash_table
Unexecuted instantiation: elf32-xtensa.c:elf_hash_table
Unexecuted instantiation: elf32-z80.c:elf_hash_table
Unexecuted instantiation: elfxx-sparc.c:elf_hash_table
Unexecuted instantiation: elfxx-tilegx.c:elf_hash_table
Unexecuted instantiation: cpu-nds32.c:elf_hash_table
Unexecuted instantiation: compress.c:elf_hash_table
Unexecuted instantiation: merge.c:elf_hash_table
Unexecuted instantiation: fuzz_objdump.c:elf_hash_table
Unexecuted instantiation: arc-dis.c:elf_hash_table
Unexecuted instantiation: arm-dis.c:elf_hash_table
Unexecuted instantiation: csky-dis.c:elf_hash_table
Unexecuted instantiation: kvx-dis.c:elf_hash_table
Unexecuted instantiation: m32c-dis.c:elf_hash_table
Unexecuted instantiation: mep-dis.c:elf_hash_table
Unexecuted instantiation: ppc-dis.c:elf_hash_table
Unexecuted instantiation: pru-dis.c:elf_hash_table
Unexecuted instantiation: rl78-dis.c:elf_hash_table
Unexecuted instantiation: score-dis.c:elf_hash_table
Unexecuted instantiation: score7-dis.c:elf_hash_table
Unexecuted instantiation: tilepro-dis.c:elf_hash_table
Unexecuted instantiation: wasm32-dis.c:elf_hash_table
Unexecuted instantiation: aarch64-dis.c:elf_hash_table
Unexecuted instantiation: bpf-dis.c:elf_hash_table
Unexecuted instantiation: mips-dis.c:elf_hash_table
Unexecuted instantiation: nfp-dis.c:elf_hash_table
Unexecuted instantiation: riscv-dis.c:elf_hash_table
Unexecuted instantiation: tilegx-dis.c:elf_hash_table
Unexecuted instantiation: ctf-serialize.c:elf_hash_table
Unexecuted instantiation: ctf-open-bfd.c:elf_hash_table
Unexecuted instantiation: fuzz_addr2line.c:elf_hash_table
Unexecuted instantiation: fuzz_as.c:elf_hash_table
Unexecuted instantiation: codeview.c:elf_hash_table
Unexecuted instantiation: cond.c:elf_hash_table
Unexecuted instantiation: depend.c:elf_hash_table
Unexecuted instantiation: dw2gencfi.c:elf_hash_table
Unexecuted instantiation: dwarf2dbg.c:elf_hash_table
Unexecuted instantiation: ehopt.c:elf_hash_table
Unexecuted instantiation: expr.c:elf_hash_table
Unexecuted instantiation: frags.c:elf_hash_table
Unexecuted instantiation: gen-sframe.c:elf_hash_table
Unexecuted instantiation: input-scrub.c:elf_hash_table
Unexecuted instantiation: listing.c:elf_hash_table
Unexecuted instantiation: macro.c:elf_hash_table
Unexecuted instantiation: messages.c:elf_hash_table
Unexecuted instantiation: output-file.c:elf_hash_table
Unexecuted instantiation: read.c:elf_hash_table
Unexecuted instantiation: remap.c:elf_hash_table
Unexecuted instantiation: sb.c:elf_hash_table
Unexecuted instantiation: scfidw2gen.c:elf_hash_table
Unexecuted instantiation: stabs.c:elf_hash_table
Unexecuted instantiation: subsegs.c:elf_hash_table
Unexecuted instantiation: symbols.c:elf_hash_table
Unexecuted instantiation: write.c:elf_hash_table
Unexecuted instantiation: app.c:elf_hash_table
Unexecuted instantiation: atof-generic.c:elf_hash_table
Unexecuted instantiation: ecoff.c:elf_hash_table
Unexecuted instantiation: flonum-copy.c:elf_hash_table
Unexecuted instantiation: ginsn.c:elf_hash_table
Unexecuted instantiation: hash.c:elf_hash_table
Unexecuted instantiation: input-file.c:elf_hash_table
Unexecuted instantiation: scfi.c:elf_hash_table
Unexecuted instantiation: sframe-opt.c:elf_hash_table
Unexecuted instantiation: tc-i386.c:elf_hash_table
Unexecuted instantiation: obj-elf.c:elf_hash_table
Unexecuted instantiation: atof-ieee.c:elf_hash_table
Unexecuted instantiation: fuzz_dwarf.c:elf_hash_table
Unexecuted instantiation: fuzz_objcopy.c:elf_hash_table
831
832
static inline enum elf_target_id
833
elf_hash_table_id (const struct elf_link_hash_table *table)
834
0
{
835
0
  return table->hash_table_id;
836
0
}
Unexecuted instantiation: fuzz_nm.c:elf_hash_table_id
Unexecuted instantiation: bfd.c:elf_hash_table_id
Unexecuted instantiation: format.c:elf_hash_table_id
Unexecuted instantiation: libbfd.c:elf_hash_table_id
Unexecuted instantiation: opncls.c:elf_hash_table_id
Unexecuted instantiation: elf64-x86-64.c:elf_hash_table_id
Unexecuted instantiation: elfxx-x86.c:elf_hash_table_id
Unexecuted instantiation: elf-ifunc.c:elf_hash_table_id
Unexecuted instantiation: elf-solaris2.c:elf_hash_table_id
Unexecuted instantiation: elf-vxworks.c:elf_hash_table_id
Unexecuted instantiation: elf64.c:elf_hash_table_id
Unexecuted instantiation: elf.c:elf_hash_table_id
Unexecuted instantiation: elflink.c:elf_hash_table_id
Unexecuted instantiation: elf-attrs.c:elf_hash_table_id
Unexecuted instantiation: elf-strtab.c:elf_hash_table_id
Unexecuted instantiation: elf-eh-frame.c:elf_hash_table_id
Unexecuted instantiation: elf-properties.c:elf_hash_table_id
Unexecuted instantiation: elf-sframe.c:elf_hash_table_id
Unexecuted instantiation: dwarf1.c:elf_hash_table_id
Unexecuted instantiation: dwarf2.c:elf_hash_table_id
Unexecuted instantiation: elf32-i386.c:elf_hash_table_id
Unexecuted instantiation: elf32.c:elf_hash_table_id
Unexecuted instantiation: cofflink.c:elf_hash_table_id
Unexecuted instantiation: coffgen.c:elf_hash_table_id
Unexecuted instantiation: elf64-gen.c:elf_hash_table_id
Unexecuted instantiation: elf32-gen.c:elf_hash_table_id
Unexecuted instantiation: elf32-aarch64.c:elf_hash_table_id
Unexecuted instantiation: elf32-ia64.c:elf_hash_table_id
Unexecuted instantiation: elf32-kvx.c:elf_hash_table_id
Unexecuted instantiation: elf32-loongarch.c:elf_hash_table_id
Unexecuted instantiation: elf32-mips.c:elf_hash_table_id
Unexecuted instantiation: elf32-riscv.c:elf_hash_table_id
Unexecuted instantiation: elf32-score.c:elf_hash_table_id
Unexecuted instantiation: elf32-score7.c:elf_hash_table_id
Unexecuted instantiation: elf64-aarch64.c:elf_hash_table_id
Unexecuted instantiation: elf64-alpha.c:elf_hash_table_id
Unexecuted instantiation: elf64-amdgcn.c:elf_hash_table_id
Unexecuted instantiation: elf64-bpf.c:elf_hash_table_id
Unexecuted instantiation: elf64-hppa.c:elf_hash_table_id
Unexecuted instantiation: elf64-ia64-vms.c:elf_hash_table_id
Unexecuted instantiation: elf64-ia64.c:elf_hash_table_id
Unexecuted instantiation: elf64-kvx.c:elf_hash_table_id
Unexecuted instantiation: elf64-loongarch.c:elf_hash_table_id
Unexecuted instantiation: elf64-mips.c:elf_hash_table_id
Unexecuted instantiation: elf64-mmix.c:elf_hash_table_id
Unexecuted instantiation: elf64-nfp.c:elf_hash_table_id
Unexecuted instantiation: elf64-ppc.c:elf_hash_table_id
Unexecuted instantiation: elf64-riscv.c:elf_hash_table_id
Unexecuted instantiation: elf64-s390.c:elf_hash_table_id
Unexecuted instantiation: elf64-sparc.c:elf_hash_table_id
Unexecuted instantiation: elf64-tilegx.c:elf_hash_table_id
Unexecuted instantiation: elfn32-mips.c:elf_hash_table_id
Unexecuted instantiation: elfxx-aarch64.c:elf_hash_table_id
Unexecuted instantiation: elfxx-ia64.c:elf_hash_table_id
Unexecuted instantiation: elfxx-kvx.c:elf_hash_table_id
Unexecuted instantiation: elfxx-loongarch.c:elf_hash_table_id
Unexecuted instantiation: elfxx-mips.c:elf_hash_table_id
Unexecuted instantiation: elfxx-riscv.c:elf_hash_table_id
Unexecuted instantiation: elf-m10200.c:elf_hash_table_id
Unexecuted instantiation: elf-m10300.c:elf_hash_table_id
Unexecuted instantiation: elf32-am33lin.c:elf_hash_table_id
Unexecuted instantiation: elf32-arc.c:elf_hash_table_id
Unexecuted instantiation: elf32-arm.c:elf_hash_table_id
Unexecuted instantiation: elf32-avr.c:elf_hash_table_id
Unexecuted instantiation: elf32-bfin.c:elf_hash_table_id
Unexecuted instantiation: elf32-cr16.c:elf_hash_table_id
Unexecuted instantiation: elf32-cris.c:elf_hash_table_id
Unexecuted instantiation: elf32-crx.c:elf_hash_table_id
Unexecuted instantiation: elf32-csky.c:elf_hash_table_id
Unexecuted instantiation: elf32-d10v.c:elf_hash_table_id
Unexecuted instantiation: elf32-d30v.c:elf_hash_table_id
Unexecuted instantiation: elf32-dlx.c:elf_hash_table_id
Unexecuted instantiation: elf32-epiphany.c:elf_hash_table_id
Unexecuted instantiation: elf32-fr30.c:elf_hash_table_id
Unexecuted instantiation: elf32-frv.c:elf_hash_table_id
Unexecuted instantiation: elf32-ft32.c:elf_hash_table_id
Unexecuted instantiation: elf32-h8300.c:elf_hash_table_id
Unexecuted instantiation: elf32-hppa.c:elf_hash_table_id
Unexecuted instantiation: elf32-ip2k.c:elf_hash_table_id
Unexecuted instantiation: elf32-iq2000.c:elf_hash_table_id
Unexecuted instantiation: elf32-lm32.c:elf_hash_table_id
Unexecuted instantiation: elf32-m32c.c:elf_hash_table_id
Unexecuted instantiation: elf32-m32r.c:elf_hash_table_id
Unexecuted instantiation: elf32-m68hc11.c:elf_hash_table_id
Unexecuted instantiation: elf32-m68hc12.c:elf_hash_table_id
Unexecuted instantiation: elf32-m68hc1x.c:elf_hash_table_id
Unexecuted instantiation: elf32-m68k.c:elf_hash_table_id
Unexecuted instantiation: elf32-mcore.c:elf_hash_table_id
Unexecuted instantiation: elf32-mep.c:elf_hash_table_id
Unexecuted instantiation: elf32-metag.c:elf_hash_table_id
Unexecuted instantiation: elf32-microblaze.c:elf_hash_table_id
Unexecuted instantiation: elf32-moxie.c:elf_hash_table_id
Unexecuted instantiation: elf32-msp430.c:elf_hash_table_id
Unexecuted instantiation: elf32-mt.c:elf_hash_table_id
Unexecuted instantiation: elf32-nds32.c:elf_hash_table_id
Unexecuted instantiation: elf32-or1k.c:elf_hash_table_id
Unexecuted instantiation: elf32-pj.c:elf_hash_table_id
Unexecuted instantiation: elf32-ppc.c:elf_hash_table_id
Unexecuted instantiation: elf32-pru.c:elf_hash_table_id
Unexecuted instantiation: elf32-rl78.c:elf_hash_table_id
Unexecuted instantiation: elf32-rx.c:elf_hash_table_id
Unexecuted instantiation: elf32-s12z.c:elf_hash_table_id
Unexecuted instantiation: elf32-s390.c:elf_hash_table_id
Unexecuted instantiation: elf32-sh.c:elf_hash_table_id
Unexecuted instantiation: elf32-sparc.c:elf_hash_table_id
Unexecuted instantiation: elf32-spu.c:elf_hash_table_id
Unexecuted instantiation: elf32-tic6x.c:elf_hash_table_id
Unexecuted instantiation: elf32-tilegx.c:elf_hash_table_id
Unexecuted instantiation: elf32-tilepro.c:elf_hash_table_id
Unexecuted instantiation: elf32-v850.c:elf_hash_table_id
Unexecuted instantiation: elf32-vax.c:elf_hash_table_id
Unexecuted instantiation: elf32-visium.c:elf_hash_table_id
Unexecuted instantiation: elf32-wasm32.c:elf_hash_table_id
Unexecuted instantiation: elf32-xgate.c:elf_hash_table_id
Unexecuted instantiation: elf32-xstormy16.c:elf_hash_table_id
Unexecuted instantiation: elf32-xtensa.c:elf_hash_table_id
Unexecuted instantiation: elf32-z80.c:elf_hash_table_id
Unexecuted instantiation: elfxx-sparc.c:elf_hash_table_id
Unexecuted instantiation: elfxx-tilegx.c:elf_hash_table_id
Unexecuted instantiation: cpu-nds32.c:elf_hash_table_id
Unexecuted instantiation: compress.c:elf_hash_table_id
Unexecuted instantiation: merge.c:elf_hash_table_id
Unexecuted instantiation: fuzz_objdump.c:elf_hash_table_id
Unexecuted instantiation: arc-dis.c:elf_hash_table_id
Unexecuted instantiation: arm-dis.c:elf_hash_table_id
Unexecuted instantiation: csky-dis.c:elf_hash_table_id
Unexecuted instantiation: kvx-dis.c:elf_hash_table_id
Unexecuted instantiation: m32c-dis.c:elf_hash_table_id
Unexecuted instantiation: mep-dis.c:elf_hash_table_id
Unexecuted instantiation: ppc-dis.c:elf_hash_table_id
Unexecuted instantiation: pru-dis.c:elf_hash_table_id
Unexecuted instantiation: rl78-dis.c:elf_hash_table_id
Unexecuted instantiation: score-dis.c:elf_hash_table_id
Unexecuted instantiation: score7-dis.c:elf_hash_table_id
Unexecuted instantiation: tilepro-dis.c:elf_hash_table_id
Unexecuted instantiation: wasm32-dis.c:elf_hash_table_id
Unexecuted instantiation: aarch64-dis.c:elf_hash_table_id
Unexecuted instantiation: bpf-dis.c:elf_hash_table_id
Unexecuted instantiation: mips-dis.c:elf_hash_table_id
Unexecuted instantiation: nfp-dis.c:elf_hash_table_id
Unexecuted instantiation: riscv-dis.c:elf_hash_table_id
Unexecuted instantiation: tilegx-dis.c:elf_hash_table_id
Unexecuted instantiation: ctf-serialize.c:elf_hash_table_id
Unexecuted instantiation: ctf-open-bfd.c:elf_hash_table_id
Unexecuted instantiation: fuzz_addr2line.c:elf_hash_table_id
Unexecuted instantiation: fuzz_as.c:elf_hash_table_id
Unexecuted instantiation: codeview.c:elf_hash_table_id
Unexecuted instantiation: cond.c:elf_hash_table_id
Unexecuted instantiation: depend.c:elf_hash_table_id
Unexecuted instantiation: dw2gencfi.c:elf_hash_table_id
Unexecuted instantiation: dwarf2dbg.c:elf_hash_table_id
Unexecuted instantiation: ehopt.c:elf_hash_table_id
Unexecuted instantiation: expr.c:elf_hash_table_id
Unexecuted instantiation: frags.c:elf_hash_table_id
Unexecuted instantiation: gen-sframe.c:elf_hash_table_id
Unexecuted instantiation: input-scrub.c:elf_hash_table_id
Unexecuted instantiation: listing.c:elf_hash_table_id
Unexecuted instantiation: macro.c:elf_hash_table_id
Unexecuted instantiation: messages.c:elf_hash_table_id
Unexecuted instantiation: output-file.c:elf_hash_table_id
Unexecuted instantiation: read.c:elf_hash_table_id
Unexecuted instantiation: remap.c:elf_hash_table_id
Unexecuted instantiation: sb.c:elf_hash_table_id
Unexecuted instantiation: scfidw2gen.c:elf_hash_table_id
Unexecuted instantiation: stabs.c:elf_hash_table_id
Unexecuted instantiation: subsegs.c:elf_hash_table_id
Unexecuted instantiation: symbols.c:elf_hash_table_id
Unexecuted instantiation: write.c:elf_hash_table_id
Unexecuted instantiation: app.c:elf_hash_table_id
Unexecuted instantiation: atof-generic.c:elf_hash_table_id
Unexecuted instantiation: ecoff.c:elf_hash_table_id
Unexecuted instantiation: flonum-copy.c:elf_hash_table_id
Unexecuted instantiation: ginsn.c:elf_hash_table_id
Unexecuted instantiation: hash.c:elf_hash_table_id
Unexecuted instantiation: input-file.c:elf_hash_table_id
Unexecuted instantiation: scfi.c:elf_hash_table_id
Unexecuted instantiation: sframe-opt.c:elf_hash_table_id
Unexecuted instantiation: tc-i386.c:elf_hash_table_id
Unexecuted instantiation: obj-elf.c:elf_hash_table_id
Unexecuted instantiation: atof-ieee.c:elf_hash_table_id
Unexecuted instantiation: fuzz_dwarf.c:elf_hash_table_id
Unexecuted instantiation: fuzz_objcopy.c:elf_hash_table_id
837

838
/* Constant information held for an ELF backend.  */
839
840
struct elf_size_info {
841
  unsigned char sizeof_ehdr, sizeof_phdr, sizeof_shdr;
842
  unsigned char sizeof_rel, sizeof_rela, sizeof_sym, sizeof_dyn, sizeof_note;
843
844
  /* The size of entries in the .hash section.  */
845
  unsigned char sizeof_hash_entry;
846
847
  /* The number of internal relocations to allocate per external
848
     relocation entry.  */
849
  unsigned char int_rels_per_ext_rel;
850
  /* We use some fixed size arrays.  This should be large enough to
851
     handle all back-ends.  */
852
0
#define MAX_INT_RELS_PER_EXT_REL 3
853
854
  unsigned char arch_size, log_file_align;
855
  unsigned char elfclass, ev_current;
856
  int (*write_out_phdrs)
857
    (bfd *, const Elf_Internal_Phdr *, unsigned int);
858
  bool (*write_shdrs_and_ehdr) (bfd *);
859
  bool (*checksum_contents)
860
    (bfd * , void (*) (const void *, size_t, void *), void *);
861
  void (*write_relocs)
862
    (bfd *, asection *, void *);
863
  bool (*swap_symbol_in)
864
    (bfd *, const void *, const void *, Elf_Internal_Sym *);
865
  void (*swap_symbol_out)
866
    (bfd *, const Elf_Internal_Sym *, void *, void *);
867
  bool (*slurp_reloc_table)
868
    (bfd *, asection *, asymbol **, bool);
869
  long (*slurp_symbol_table)
870
    (bfd *, asymbol **, bool);
871
  void (*swap_dyn_in)
872
    (bfd *, const void *, Elf_Internal_Dyn *);
873
  void (*swap_dyn_out)
874
    (bfd *, const Elf_Internal_Dyn *, void *);
875
876
  /* This function is called to swap in a REL relocation.  If an
877
     external relocation corresponds to more than one internal
878
     relocation, then all relocations are swapped in at once.  */
879
  void (*swap_reloc_in)
880
    (bfd *, const bfd_byte *, Elf_Internal_Rela *);
881
882
  /* This function is called to swap out a REL relocation.  */
883
  void (*swap_reloc_out)
884
    (bfd *, const Elf_Internal_Rela *, bfd_byte *);
885
886
  /* This function is called to swap in a RELA relocation.  If an
887
     external relocation corresponds to more than one internal
888
     relocation, then all relocations are swapped in at once.  */
889
  void (*swap_reloca_in)
890
    (bfd *, const bfd_byte *, Elf_Internal_Rela *);
891
892
  /* This function is called to swap out a RELA relocation.  */
893
  void (*swap_reloca_out)
894
    (bfd *, const Elf_Internal_Rela *, bfd_byte *);
895
};
896
897
#define elf_symbol_from(S) \
898
43.8k
  ((((S)->flags & BSF_SYNTHETIC) == 0        \
899
43.8k
    && (S)->the_bfd != NULL          \
900
43.8k
    && (S)->the_bfd->xvec->flavour == bfd_target_elf_flavour  \
901
43.8k
    && (S)->the_bfd->tdata.elf_obj_data != 0)     \
902
43.8k
   ? (elf_symbol_type *) (S)          \
903
43.8k
   : 0)
904
905
enum elf_reloc_type_class {
906
  reloc_class_normal,
907
  reloc_class_relative,
908
  reloc_class_copy,
909
  reloc_class_ifunc,
910
  reloc_class_plt
911
};
912
913
struct elf_reloc_cookie
914
{
915
  bfd *abfd;
916
  Elf_Internal_Rela *rels, *rel, *relend;
917
  /* Number of symbols in .symtab.  */
918
  unsigned int num_sym;
919
  /* Number of symbols that may be local syms (all when bad_symtab).  */
920
  unsigned int locsymcount;
921
  /* Symbol index of first possible global sym (0 when bad_symtab).  */
922
  unsigned int extsymoff;
923
  int r_sym_shift;
924
};
925
926
/* The level of IRIX compatibility we're striving for.  */
927
928
typedef enum {
929
  ict_none,
930
  ict_irix5,
931
  ict_irix6
932
} irix_compat_t;
933
934
/* Mapping of ELF section names and types.  */
935
struct bfd_elf_special_section
936
{
937
  const char *prefix;
938
  unsigned int prefix_length;
939
  /* 0 means name must match PREFIX exactly.
940
     -1 means name must start with PREFIX followed by an arbitrary string.
941
     -2 means name must match PREFIX exactly or consist of PREFIX followed
942
     by a dot then anything.
943
     > 0 means name must start with the first PREFIX_LENGTH chars of
944
     PREFIX and finish with the last SUFFIX_LENGTH chars of PREFIX.  */
945
  signed int suffix_length;
946
  unsigned int type;
947
  bfd_vma attr;
948
};
949
950
enum action_discarded
951
  {
952
    COMPLAIN = 1,
953
    PRETEND = 2
954
  };
955
956
typedef asection * (*elf_gc_mark_hook_fn)
957
  (asection *, struct bfd_link_info *, struct elf_reloc_cookie *,
958
   struct elf_link_hash_entry *, unsigned int);
959
960
enum elf_property_kind
961
 {
962
    /* A new property.  */
963
    property_unknown = 0,
964
    /* A property ignored by backend.  */
965
    property_ignored,
966
    /* A corrupt property reported by backend.  */
967
    property_corrupt,
968
    /* A property should be removed due to property merge.  */
969
    property_remove,
970
    /* A property which is a number.  */
971
    property_number
972
 };
973
974
typedef struct elf_property
975
{
976
  unsigned int pr_type;
977
  unsigned int pr_datasz;
978
  union
979
    {
980
      /* For property_number, this is a number.  */
981
      bfd_vma number;
982
      /* Add a new one if elf_property_kind is updated.  */
983
    } u;
984
  enum elf_property_kind pr_kind;
985
} elf_property;
986
987
typedef struct elf_property_list
988
{
989
  struct elf_property_list *next;
990
  struct elf_property property;
991
} elf_property_list;
992
993
/* This structure is used to pass information to
994
   elf_backend_add_glibc_version_dependency.  */
995
996
struct elf_find_verdep_info
997
{
998
  /* General link information.  */
999
  struct bfd_link_info *info;
1000
  /* The number of dependencies.  */
1001
  unsigned int vers;
1002
  /* Whether we had a failure.  */
1003
  bool failed;
1004
};
1005
1006
struct bfd_elf_section_reloc_data;
1007
1008
struct elf_backend_data
1009
{
1010
  /* The architecture for this backend.  */
1011
  ENUM_BITFIELD (bfd_architecture) arch : 8;
1012
1013
  /* EI_OSABI.  */
1014
  unsigned elf_osabi : 8;
1015
1016
  /* The ELF machine code (EM_xxxx) for this backend.  */
1017
  unsigned elf_machine_code : 16;
1018
1019
  /* An identifier used to distinguish different target specific
1020
     extensions to elf_obj_tdata and elf_link_hash_table structures.  */
1021
  ENUM_BITFIELD (elf_target_id) target_id : 8;
1022
1023
  /* Target OS.  */
1024
  ENUM_BITFIELD (elf_target_os) target_os : 2;
1025
1026
  /* True if object files must have exactly matching osabi.  False if
1027
     other osabi values are allowed.  */
1028
  unsigned osabi_exact : 1;
1029
1030
  /* The maximum page size for this backend.  */
1031
  unsigned maxpagesize;
1032
1033
  /* The minimum page size for this backend.  An input object will not be
1034
     considered page aligned unless its sections are correctly aligned for
1035
     pages at least this large.  May be smaller than maxpagesize.  */
1036
  unsigned minpagesize;
1037
1038
  /* The common page size for this backend.  */
1039
  unsigned commonpagesize;
1040
1041
  /* The p_align value for this backend.  If it is set, p_align of
1042
      PT_LOAD alignment will be to p_align by default.  */
1043
  unsigned p_align;
1044
1045
  /* The BFD flags applied to sections created for dynamic linking.  */
1046
  flagword dynamic_sec_flags;
1047
1048
  /* Architecture-specific data for this backend.
1049
     This is actually a pointer to some type like struct elf_ARCH_data.  */
1050
  const void *arch_data;
1051
1052
  /* A function to translate an ELF RELA relocation to a BFD arelent
1053
     structure.  Returns TRUE upon success, FALSE otherwise.  */
1054
  bool (*elf_info_to_howto)
1055
    (bfd *, arelent *, Elf_Internal_Rela *);
1056
1057
  /* A function to translate an ELF REL relocation to a BFD arelent
1058
     structure.  Returns TRUE upon success, FALSE otherwise.  */
1059
  bool (*elf_info_to_howto_rel)
1060
    (bfd *, arelent *, Elf_Internal_Rela *);
1061
1062
  /* A function to determine whether a symbol is global when
1063
     partitioning the symbol table into local and global symbols.
1064
     This should be NULL for most targets, in which case the correct
1065
     thing will be done.  MIPS ELF, at least on the Irix 5, has
1066
     special requirements.  */
1067
  bool (*elf_backend_sym_is_global)
1068
    (bfd *, asymbol *);
1069
1070
  /* The remaining functions are hooks which are called only if they
1071
     are not NULL.  */
1072
1073
  /* A function to permit a backend specific check on whether a
1074
     particular BFD format is relevant for an object file, and to
1075
     permit the backend to set any global information it wishes.  When
1076
     this is called elf_elfheader is set, but anything else should be
1077
     used with caution.  If this returns FALSE, the check_format
1078
     routine will return a bfd_error_wrong_format error.  */
1079
  bool (*elf_backend_object_p)
1080
    (bfd *);
1081
1082
  /* A function to do additional symbol processing when reading the
1083
     ELF symbol table.  This is where any processor-specific special
1084
     section indices are handled.  */
1085
  void (*elf_backend_symbol_processing)
1086
    (bfd *, asymbol *);
1087
1088
  /* A function to do additional symbol processing after reading the
1089
     entire ELF symbol table.  */
1090
  bool (*elf_backend_symbol_table_processing)
1091
    (bfd *, elf_symbol_type *, unsigned int);
1092
1093
  /* A function to set the type of the info field.  Processor-specific
1094
     types should be handled here.  */
1095
  int (*elf_backend_get_symbol_type)
1096
    (Elf_Internal_Sym *, int);
1097
1098
  /* A function to return the linker hash table entry of a symbol that
1099
     might be satisfied by an archive symbol.  */
1100
  struct bfd_link_hash_entry * (*elf_backend_archive_symbol_lookup)
1101
    (bfd *, struct bfd_link_info *, const char *);
1102
1103
  /* Return true if local section symbols should have a non-null st_name.
1104
     NULL implies false.  */
1105
  bool (*elf_backend_name_local_section_symbols)
1106
    (bfd *);
1107
1108
  /* A function to do additional processing on the ELF section header
1109
     just before writing it out.  This is used to set the flags and
1110
     type fields for some sections, or to actually write out data for
1111
     unusual sections.  */
1112
  bool (*elf_backend_section_processing)
1113
    (bfd *, Elf_Internal_Shdr *);
1114
1115
  /* A function to handle unusual section types when creating BFD
1116
     sections from ELF sections.  */
1117
  bool (*elf_backend_section_from_shdr)
1118
    (bfd *, Elf_Internal_Shdr *, const char *, int);
1119
1120
  /* A function to convert machine dependent ELF section header flags to
1121
     BFD internal section header flags.  */
1122
  bool (*elf_backend_section_flags)
1123
    (const Elf_Internal_Shdr *);
1124
1125
  /* A function that returns a struct containing ELF section flags and
1126
     type for the given BFD section.   */
1127
  const struct bfd_elf_special_section * (*get_sec_type_attr)
1128
    (bfd *, asection *);
1129
1130
  /* A function to handle unusual program segment types when creating BFD
1131
     sections from ELF program segments.  */
1132
  bool (*elf_backend_section_from_phdr)
1133
    (bfd *, Elf_Internal_Phdr *, int, const char *);
1134
1135
  /* A function to set up the ELF section header for a BFD section in
1136
     preparation for writing it out.  This is where the flags and type
1137
     fields are set for unusual sections.  */
1138
  bool (*elf_backend_fake_sections)
1139
    (bfd *, Elf_Internal_Shdr *, asection *);
1140
1141
  /* A function to get the ELF section index for a BFD section.  If
1142
     this returns TRUE, the section was found.  If it is a normal ELF
1143
     section, *RETVAL should be left unchanged.  If it is not a normal
1144
     ELF section *RETVAL should be set to the SHN_xxxx index.  */
1145
  bool (*elf_backend_section_from_bfd_section)
1146
    (bfd *, asection *, int *retval);
1147
1148
  /* If this field is not NULL, it is called by the add_symbols phase
1149
     of a link just before adding a symbol to the global linker hash
1150
     table.  It may modify any of the fields as it wishes.  If *NAME
1151
     is set to NULL, the symbol will be skipped rather than being
1152
     added to the hash table.  This function is responsible for
1153
     handling all processor dependent symbol bindings and section
1154
     indices, and must set at least *FLAGS and *SEC for each processor
1155
     dependent case; failure to do so will cause a link error.  */
1156
  bool (*elf_add_symbol_hook)
1157
    (bfd *abfd, struct bfd_link_info *info, Elf_Internal_Sym *,
1158
     const char **name, flagword *flags, asection **sec, bfd_vma *value);
1159
1160
  /* If this field is not NULL, it is called by the elf_link_output_sym
1161
     phase of a link for each symbol which will appear in the object file.
1162
     On error, this function returns 0.  1 is returned when the symbol
1163
     should be output, 2 is returned when the symbol should be discarded.  */
1164
  int (*elf_backend_link_output_symbol_hook)
1165
    (struct bfd_link_info *info, const char *, Elf_Internal_Sym *,
1166
     asection *, struct elf_link_hash_entry *);
1167
1168
  /* The CREATE_DYNAMIC_SECTIONS function is called by the ELF backend
1169
     linker the first time it encounters a dynamic object in the link.
1170
     This function must create any sections required for dynamic
1171
     linking.  The ABFD argument is a dynamic object.  The .interp,
1172
     .dynamic, .dynsym, .dynstr, and .hash functions have already been
1173
     created, and this function may modify the section flags if
1174
     desired.  This function will normally create the .got and .plt
1175
     sections, but different backends have different requirements.  */
1176
  bool (*elf_backend_create_dynamic_sections)
1177
    (bfd *abfd, struct bfd_link_info *info);
1178
1179
  /* When creating a shared library, determine whether to omit the
1180
     dynamic symbol for the section.  */
1181
  bool (*elf_backend_omit_section_dynsym)
1182
    (bfd *output_bfd, struct bfd_link_info *info, asection *osec);
1183
1184
  /* Return TRUE if relocations of targets are compatible to the extent
1185
     that CHECK_RELOCS will properly process them.  PR 4424.  */
1186
  bool (*relocs_compatible) (const bfd_target *, const bfd_target *);
1187
1188
  /* The CHECK_RELOCS function is called after all input files have been
1189
     opened.  It is called once for each section with relocs of an object
1190
     file.  The function must look through the relocs and do any special
1191
     handling required.  This generally means allocating space in the
1192
     global offset table, and perhaps allocating space for a reloc.  The
1193
     relocs are always passed as Rela structures; if the section
1194
     actually uses Rel structures, the r_addend field will always be
1195
     zero.  */
1196
  bool (*check_relocs)
1197
    (bfd *abfd, struct bfd_link_info *info, asection *o,
1198
     const Elf_Internal_Rela *relocs);
1199
1200
  /* The SIZE_RELATIVE_RELOCS function is called to size relative
1201
     relocations when mappig sections to segments.  */
1202
  bool (*size_relative_relocs)
1203
    (struct bfd_link_info *info, bool *need_layout);
1204
1205
  /* The FINISH_RELATIVE_RELOCS function is called to finish relative
1206
     relocations in bfd_elf_final_link.  */
1207
  bool (*finish_relative_relocs)
1208
    (struct bfd_link_info *info);
1209
1210
  /* The CHECK_DIRECTIVES function is called once per input file by
1211
     the add_symbols phase of the ELF backend linker.  The function
1212
     must inspect the bfd and create any additional symbols according
1213
     to any custom directives in the bfd.  */
1214
  bool (*check_directives)
1215
    (bfd *abfd, struct bfd_link_info *info);
1216
1217
  /* The NOTICE_AS_NEEDED function is called as the linker is about to
1218
     handle an as-needed lib (ACT = notice_as_needed), and after the
1219
     linker has decided to keep the lib (ACT = notice_needed) or when
1220
     the lib is not needed (ACT = notice_not_needed).  */
1221
  bool (*notice_as_needed)
1222
    (bfd *abfd, struct bfd_link_info *info, enum notice_asneeded_action act);
1223
1224
  /* The ADJUST_DYNAMIC_SYMBOL function is called by the ELF backend
1225
     linker for every symbol which is defined by a dynamic object and
1226
     referenced by a regular object.  This is called after all the
1227
     input files have been seen, but before the LATE_SIZE_SECTIONS
1228
     function has been called.  The hash table entry should be
1229
     bfd_link_hash_defined ore bfd_link_hash_defweak, and it should be
1230
     defined in a section from a dynamic object.  Dynamic object
1231
     sections are not included in the final link, and this function is
1232
     responsible for changing the value to something which the rest of
1233
     the link can deal with.  This will normally involve adding an
1234
     entry to the .plt or .got or some such section, and setting the
1235
     symbol to point to that.  */
1236
  bool (*elf_backend_adjust_dynamic_symbol)
1237
    (struct bfd_link_info *info, struct elf_link_hash_entry *h);
1238
1239
  /* The EARLY_SIZE_SECTIONS and LATE_SIZE_SECTIONS functions are
1240
     called by the backend linker after all linker input files have
1241
     been seen and sections have been assigned to output sections, but
1242
     before the section sizes have been set.  Both of these functions
1243
     are called even when no dynamic object is seen by the linker.
1244
     Between them, they must set the sizes of the dynamic sections and
1245
     other backend specific sections, and may fill in their contents.
1246
     Most backends need only use LATE_SIZE_SECTIONS.
1247
     EARLY_SIZE_SECTIONS is called before --export-dynamic makes some
1248
     symbols dynamic and before ADJUST_DYNAMIC_SYMBOL processes
1249
     dynamic symbols, LATE_SIZE_SECTIONS afterwards.  The generic ELF
1250
     linker can handle the .dynsym, .dynstr and .hash sections.
1251
     Besides those, these functions must handle the .interp section
1252
     and any other sections created by CREATE_DYNAMIC_SECTIONS.  */
1253
  bool (*elf_backend_early_size_sections)
1254
    (bfd *output_bfd, struct bfd_link_info *info);
1255
  bool (*elf_backend_late_size_sections)
1256
    (bfd *output_bfd, struct bfd_link_info *info);
1257
1258
  /* The STRIP_ZERO_SIZED_DYNAMIC_SECTIONS function is called by the
1259
     ELF backend linker to strip zero-sized dynamic sections after
1260
     the section sizes have been set.  */
1261
  bool (*elf_backend_strip_zero_sized_dynamic_sections)
1262
    (struct bfd_link_info *info);
1263
1264
  /* Set TEXT_INDEX_SECTION and DATA_INDEX_SECTION, the output sections
1265
     we keep to use as a base for relocs and symbols.  */
1266
  void (*elf_backend_init_index_section)
1267
    (bfd *output_bfd, struct bfd_link_info *info);
1268
1269
  /* The RELOCATE_SECTION function is called by the ELF backend linker
1270
     to handle the relocations for a section.
1271
1272
     The relocs are always passed as Rela structures; if the section
1273
     actually uses Rel structures, the r_addend field will always be
1274
     zero.
1275
1276
     This function is responsible for adjust the section contents as
1277
     necessary, and (if using Rela relocs and generating a
1278
     relocatable output file) adjusting the reloc addend as
1279
     necessary.
1280
1281
     This function does not have to worry about setting the reloc
1282
     address or the reloc symbol index.
1283
1284
     LOCAL_SYMS is a pointer to the swapped in local symbols.
1285
1286
     LOCAL_SECTIONS is an array giving the section in the input file
1287
     corresponding to the st_shndx field of each local symbol.
1288
1289
     The global hash table entry for the global symbols can be found
1290
     via elf_sym_hashes (input_bfd).
1291
1292
     When generating relocatable output, this function must handle
1293
     STB_LOCAL/STT_SECTION symbols specially.  The output symbol is
1294
     going to be the section symbol corresponding to the output
1295
     section, which means that the addend must be adjusted
1296
     accordingly.
1297
1298
     Returns FALSE on error, TRUE on success, 2 if successful and
1299
     relocations should be written for this section.  */
1300
  int (*elf_backend_relocate_section)
1301
    (bfd *output_bfd, struct bfd_link_info *info, bfd *input_bfd,
1302
     asection *input_section, bfd_byte *contents, Elf_Internal_Rela *relocs,
1303
     Elf_Internal_Sym *local_syms, asection **local_sections);
1304
1305
  /* The FINISH_DYNAMIC_SYMBOL function is called by the ELF backend
1306
     linker just before it writes a symbol out to the .dynsym section.
1307
     The processor backend may make any required adjustment to the
1308
     symbol.  It may also take the opportunity to set contents of the
1309
     dynamic sections.  Note that FINISH_DYNAMIC_SYMBOL is called on
1310
     all .dynsym symbols, while ADJUST_DYNAMIC_SYMBOL is only called
1311
     on those symbols which are defined by a dynamic object.  */
1312
  bool (*elf_backend_finish_dynamic_symbol)
1313
    (bfd *output_bfd, struct bfd_link_info *info,
1314
     struct elf_link_hash_entry *h, Elf_Internal_Sym *sym);
1315
1316
  /* The FINISH_DYNAMIC_SECTIONS function is called by the ELF backend
1317
     linker just before it writes all the dynamic sections out to the
1318
     output file.  The FINISH_DYNAMIC_SYMBOL will have been called on
1319
     all dynamic symbols.  */
1320
  bool (*elf_backend_finish_dynamic_sections)
1321
    (bfd *output_bfd, struct bfd_link_info *info, bfd_byte *);
1322
1323
  /* A function to do any beginning processing needed for the ELF file
1324
     before building the ELF headers and computing file positions.  */
1325
  void (*elf_backend_begin_write_processing)
1326
    (bfd *, struct bfd_link_info *);
1327
1328
  /* A function to do any final processing needed for the ELF file
1329
     before writing it out.  */
1330
  bool (*elf_backend_final_write_processing)
1331
    (bfd *);
1332
1333
  /* This function is called by get_program_header_size.  It should
1334
     return the number of additional program segments which this BFD
1335
     will need.  It should return -1 on error.  */
1336
  int (*elf_backend_additional_program_headers)
1337
    (bfd *, struct bfd_link_info *);
1338
1339
  /* This function is called to modify an existing segment map in a
1340
     backend specific fashion.  */
1341
  bool (*elf_backend_modify_segment_map)
1342
    (bfd *, struct bfd_link_info *);
1343
1344
  /* This function is called to modify program headers just before
1345
     they are written.  */
1346
  bool (*elf_backend_modify_headers)
1347
    (bfd *, struct bfd_link_info *);
1348
1349
  /* This function is called to see if the PHDR header should be
1350
     checked for validity.  */
1351
  bool (*elf_backend_allow_non_load_phdr)
1352
    (bfd *,  const Elf_Internal_Phdr *, unsigned);
1353
1354
  /* This function is called before section garbage collection to
1355
     mark entry symbol sections.  */
1356
  void (*gc_keep)
1357
    (struct bfd_link_info *);
1358
1359
  /* This function is called during section garbage collection to
1360
     mark sections that define global symbols.  */
1361
  bool (*gc_mark_dynamic_ref)
1362
    (struct elf_link_hash_entry *, void *);
1363
1364
  /* This function is called during section gc to discover the section a
1365
     particular relocation refers to.  */
1366
  elf_gc_mark_hook_fn gc_mark_hook;
1367
1368
  /* This function, if defined, is called after the first gc marking pass
1369
     to allow the backend to mark additional sections.  */
1370
  bool (*gc_mark_extra_sections)
1371
    (struct bfd_link_info *, elf_gc_mark_hook_fn);
1372
1373
  /* This function is called to initialise ELF file header info.
1374
     Customised versions can modify things like the OS and ABI version.  */
1375
  bool (*elf_backend_init_file_header)
1376
    (bfd *, struct bfd_link_info *);
1377
1378
  /* This function, if defined, prints a symbol to file and returns the
1379
     name of the symbol to be printed.  It should return NULL to fall
1380
     back to default symbol printing.  */
1381
  const char *(*elf_backend_print_symbol_all)
1382
    (bfd *, void *, asymbol *);
1383
1384
  /* This function, if defined, is called after all local symbols and
1385
     global symbols converted to locals are emitted into the symtab
1386
     section.  It allows the backend to emit special local symbols
1387
     not handled in the hash table.  */
1388
  bool (*elf_backend_output_arch_local_syms)
1389
    (bfd *, struct bfd_link_info *, void *,
1390
     int (*) (void *, const char *, Elf_Internal_Sym *, asection *,
1391
        struct elf_link_hash_entry *));
1392
1393
  /* This function, if defined, is called after all symbols are emitted
1394
     into the symtab section.  It allows the backend to emit special
1395
     global symbols not handled in the hash table.  */
1396
  bool (*elf_backend_output_arch_syms)
1397
    (bfd *, struct bfd_link_info *, void *,
1398
     int (*) (void *, const char *, Elf_Internal_Sym *, asection *,
1399
        struct elf_link_hash_entry *));
1400
1401
  /* Filter what symbols of the output file to include in the import
1402
     library if one is created.  */
1403
  unsigned int (*elf_backend_filter_implib_symbols)
1404
    (bfd *, struct bfd_link_info *, asymbol **, long);
1405
1406
  /* Copy any information related to dynamic linking from a pre-existing
1407
     symbol to a newly created symbol.  Also called to copy flags and
1408
     other back-end info to a weakdef, in which case the symbol is not
1409
     newly created and plt/got refcounts and dynamic indices should not
1410
     be copied.  */
1411
  void (*elf_backend_copy_indirect_symbol)
1412
    (struct bfd_link_info *, struct elf_link_hash_entry *,
1413
     struct elf_link_hash_entry *);
1414
1415
  /* Modify any information related to dynamic linking such that the
1416
     symbol is not exported.  */
1417
  void (*elf_backend_hide_symbol)
1418
    (struct bfd_link_info *, struct elf_link_hash_entry *, bool);
1419
1420
  /* A function to do additional symbol fixup, called by
1421
     _bfd_elf_fix_symbol_flags.  */
1422
  bool (*elf_backend_fixup_symbol)
1423
    (struct bfd_link_info *, struct elf_link_hash_entry *);
1424
1425
  /* Merge the backend specific symbol attribute.  */
1426
  void (*elf_backend_merge_symbol_attribute)
1427
    (struct elf_link_hash_entry *, unsigned int, bool, bool);
1428
1429
  /* This function, if defined, will return a string containing the
1430
     name of a target-specific dynamic tag.  */
1431
  char *(*elf_backend_get_target_dtag)
1432
    (bfd_vma);
1433
1434
  /* Decide whether an undefined symbol is special and can be ignored.
1435
     This is the case for OPTIONAL symbols on IRIX.  */
1436
  bool (*elf_backend_ignore_undef_symbol)
1437
    (struct elf_link_hash_entry *);
1438
1439
  /* Emit relocations.  Overrides default routine for emitting relocs,
1440
     except during a relocatable link, or if all relocs are being emitted.  */
1441
  bool (*elf_backend_emit_relocs)
1442
    (bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *,
1443
     struct elf_link_hash_entry **);
1444
1445
  /* Update relocations.  It is allowed to change the number and the order.
1446
     In such a case hashes should be invalidated.  */
1447
  void (*elf_backend_update_relocs)
1448
    (asection *, struct bfd_elf_section_reloc_data *);
1449
1450
  /* Count relocations.  Not called for relocatable links
1451
     or if all relocs are being preserved in the output.  */
1452
  unsigned int (*elf_backend_count_relocs)
1453
    (struct bfd_link_info *, asection *);
1454
1455
  /* Count additionals relocations.  Called for relocatable links if
1456
     additional relocations needs to be created.  */
1457
  unsigned int (*elf_backend_count_additional_relocs)
1458
    (asection *);
1459
1460
  /* Say whether to sort relocs output by ld -r and ld --emit-relocs,
1461
     by r_offset.  If NULL, default to true.  */
1462
  bool (*sort_relocs_p)
1463
    (asection *);
1464
1465
  /* This function, if defined, is called when an NT_PRSTATUS note is found
1466
     in a core file.  */
1467
  bool (*elf_backend_grok_prstatus)
1468
    (bfd *, Elf_Internal_Note *);
1469
1470
  /* This function, if defined, is called when an NT_PSINFO or NT_PRPSINFO
1471
     note is found in a core file.  */
1472
  bool (*elf_backend_grok_psinfo)
1473
    (bfd *, Elf_Internal_Note *);
1474
1475
  /* This function, if defined, is called when a "FreeBSD" NT_PRSTATUS
1476
     note is found in a core file.  */
1477
  bool (*elf_backend_grok_freebsd_prstatus)
1478
    (bfd *, Elf_Internal_Note *);
1479
1480
  /* This function, if defined, is called to write a note to a corefile.  */
1481
  char *(*elf_backend_write_core_note)
1482
    (bfd *abfd, char *buf, int *bufsiz, int note_type, ...);
1483
1484
  /* This function, if defined, is called to convert target-specific
1485
     section flag names into hex values.  */
1486
  flagword (*elf_backend_lookup_section_flags_hook)
1487
    (char *);
1488
1489
  /* This function returns class of a reloc type.  */
1490
  enum elf_reloc_type_class (*elf_backend_reloc_type_class)
1491
  (const struct bfd_link_info *, const asection *, const Elf_Internal_Rela *);
1492
1493
  /* This function, if defined, removes information about discarded functions
1494
     from other sections which mention them.  */
1495
  bool (*elf_backend_discard_info)
1496
    (bfd *, struct elf_reloc_cookie *, struct bfd_link_info *);
1497
1498
  /* This function, if defined, signals that the function above has removed
1499
     the discarded relocations for this section.  */
1500
  bool (*elf_backend_ignore_discarded_relocs)
1501
    (asection *);
1502
1503
  /* What to do when ld finds relocations against symbols defined in
1504
     discarded sections.  */
1505
  unsigned int (*action_discarded)
1506
    (asection *);
1507
1508
  /* This function returns the width of FDE pointers in bytes, or 0 if
1509
     that can't be determined for some reason.  The default definition
1510
     goes by the bfd's EI_CLASS.  */
1511
  unsigned int (*elf_backend_eh_frame_address_size)
1512
    (bfd *, const asection *);
1513
1514
  /* These functions tell elf-eh-frame whether to attempt to turn
1515
     absolute or lsda encodings into pc-relative ones.  The default
1516
     definition enables these transformations.  */
1517
  bool (*elf_backend_can_make_relative_eh_frame)
1518
     (bfd *, struct bfd_link_info *, asection *);
1519
  bool (*elf_backend_can_make_lsda_relative_eh_frame)
1520
     (bfd *, struct bfd_link_info *, asection *);
1521
1522
  /* This function returns an encoding after computing the encoded
1523
     value (and storing it in ENCODED) for the given OFFSET into OSEC,
1524
     to be stored in at LOC_OFFSET into the LOC_SEC input section.
1525
     The default definition chooses a 32-bit PC-relative encoding.  */
1526
  bfd_byte (*elf_backend_encode_eh_address)
1527
     (bfd *abfd, struct bfd_link_info *info,
1528
      asection *osec, bfd_vma offset,
1529
      asection *loc_sec, bfd_vma loc_offset,
1530
      bfd_vma *encoded);
1531
1532
  /* This function, if defined, may write out the given section.
1533
     Returns TRUE if it did so and FALSE if the caller should.  */
1534
  bool (*elf_backend_write_section)
1535
    (bfd *, struct bfd_link_info *, asection *, bfd_byte *);
1536
1537
  /* This function adds glibc version dependency.  */
1538
  void (*elf_backend_add_glibc_version_dependency)
1539
    (struct elf_find_verdep_info *);
1540
1541
  /* This function, if defined, returns TRUE if it is section symbols
1542
     only that are considered local for the purpose of partitioning the
1543
     symbol table into local and global symbols.  This should be NULL
1544
     for most targets, in which case the correct thing will be done.
1545
     MIPS ELF, at least on the Irix 5, has special requirements.  */
1546
  bool (*elf_backend_elfsym_local_is_section)
1547
    (bfd *);
1548
1549
  /* The level of IRIX compatibility we're striving for.
1550
     MIPS ELF specific function.  */
1551
  irix_compat_t (*elf_backend_mips_irix_compat)
1552
    (bfd *);
1553
1554
  reloc_howto_type *(*elf_backend_mips_rtype_to_howto)
1555
    (bfd *, unsigned int, bool);
1556
1557
  /* The swapping table to use when dealing with ECOFF information.
1558
     Used for the MIPS ELF .mdebug section.  */
1559
  const struct ecoff_debug_swap *elf_backend_ecoff_debug_swap;
1560
1561
  /* This function implements `bfd_elf_bfd_from_remote_memory';
1562
     see elf.c, elfcode.h.  */
1563
  bfd *(*elf_backend_bfd_from_remote_memory)
1564
    (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
1565
     int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
1566
        bfd_size_type len));
1567
1568
  bool (*elf_backend_core_find_build_id) (bfd *, bfd_vma);
1569
1570
  /* This function is used by `_bfd_elf_get_synthetic_symtab';
1571
     see elf.c.  */
1572
  bfd_vma (*plt_sym_val) (bfd_vma, const asection *, const arelent *);
1573
1574
  /* Is symbol defined in common section?  */
1575
  bool (*common_definition) (Elf_Internal_Sym *);
1576
1577
  /* Return a common section index for section.  */
1578
  unsigned int (*common_section_index) (asection *);
1579
1580
  /* Return a common section for section.  */
1581
  asection *(*common_section) (asection *);
1582
1583
  /* Return TRUE if we can merge 2 definitions.  */
1584
  bool (*merge_symbol) (struct elf_link_hash_entry *,
1585
             const Elf_Internal_Sym *, asection **,
1586
             bool, bool,
1587
             bfd *, const asection *);
1588
1589
  /* Return TRUE if symbol should be hashed in the `.gnu.hash' section.  */
1590
  bool (*elf_hash_symbol) (struct elf_link_hash_entry *);
1591
1592
  /* If non-NULL, called to register the location of XLAT_LOC within
1593
     .MIPS.xhash at which real final dynindx for H will be written.
1594
     If XLAT_LOC is zero, the symbol is not included in
1595
     .MIPS.xhash and no dynindx will be written.  */
1596
  void (*record_xhash_symbol)
1597
    (struct elf_link_hash_entry *h, bfd_vma xlat_loc);
1598
1599
  /* Return TRUE if type is a function symbol type.  */
1600
  bool (*is_function_type) (unsigned int type);
1601
1602
  /* If the ELF symbol SYM might be a function in SEC, return the
1603
     function size and set *CODE_OFF to the function's entry point,
1604
     otherwise return zero.  */
1605
  bfd_size_type (*maybe_function_sym) (const asymbol *sym, asection *sec,
1606
               bfd_vma *code_off);
1607
1608
  /* Given NAME, the name of a relocation section stripped of its
1609
     .rel/.rela prefix, return the section in ABFD to which the
1610
     relocations apply.  */
1611
  asection *(*get_reloc_section) (bfd *abfd, const char *name);
1612
1613
  /* Called to set the sh_flags, sh_link and sh_info fields of OSECTION which
1614
     has a type >= SHT_LOOS.  Returns TRUE if the fields were initialised,
1615
     FALSE otherwise.  Can be called multiple times for a given section,
1616
     until it returns TRUE.  Most of the times it is called ISECTION will be
1617
     set to an input section that might be associated with the output section.
1618
     The last time that it is called, ISECTION will be set to NULL.  */
1619
  bool (*elf_backend_copy_special_section_fields)
1620
    (const bfd *ibfd, bfd *obfd, const Elf_Internal_Shdr *isection,
1621
     Elf_Internal_Shdr *osection);
1622
1623
  /* Used to handle bad SHF_LINK_ORDER input.  */
1624
  void (*link_order_error_handler) (const char *, ...);
1625
1626
  /* Name of the PLT relocation section.  */
1627
  const char *relplt_name;
1628
1629
  /* Alternate EM_xxxx machine codes for this backend.  */
1630
  int elf_machine_alt1;
1631
  int elf_machine_alt2;
1632
1633
  const struct elf_size_info *s;
1634
1635
  /* An array of target specific special sections.  */
1636
  const struct bfd_elf_special_section *special_sections;
1637
1638
  /* The size in bytes of the header for the GOT.  This includes the
1639
     so-called reserved entries on some systems.  */
1640
  bfd_vma got_header_size;
1641
1642
  /* The size of the GOT entry for the symbol pointed to by H if non-NULL,
1643
     otherwise by the local symbol with index SYMNDX in IBFD.  */
1644
  bfd_vma (*got_elt_size) (bfd *, struct bfd_link_info *,
1645
         struct elf_link_hash_entry *h,
1646
         bfd *ibfd, unsigned long symndx);
1647
1648
  /* The vendor name to use for a processor-standard attributes section.  */
1649
  const char *obj_attrs_vendor;
1650
1651
  /* The section name to use for a processor-standard attributes section.  */
1652
  const char *obj_attrs_section;
1653
1654
  /* Return 1, 2 or 3 to indicate what type of arguments a tag takes.  */
1655
  int (*obj_attrs_arg_type) (obj_attr_tag_t);
1656
1657
  /* The section type to use for an attributes section.  */
1658
  unsigned int obj_attrs_section_type;
1659
1660
  /* The preferred version of object attributes for the output object.  */
1661
  obj_attr_version_t default_obj_attr_version;
1662
1663
  /* Decode the object attributes version from the version number encoded in
1664
     the input object.  */
1665
  obj_attr_version_t (*obj_attrs_version_dec) (uint8_t);
1666
1667
  /* Encode the object attributes version into the output object.  */
1668
  uint8_t (*obj_attrs_version_enc) (obj_attr_version_t);
1669
1670
  /* The known subsections and attributes (v2 only).  */
1671
  const known_subsection_v2_t *obj_attr_v2_known_subsections;
1672
1673
  /* The size of the array of known subsections.  */
1674
  const size_t obj_attr_v2_known_subsections_size;
1675
1676
  /* Translate GNU properties that have object attributes v2 equivalents.  */
1677
  void (*translate_gnu_props_to_obj_attrs) (const bfd *,
1678
    const elf_property_list *);
1679
1680
  /* Translate object attributes v2 that have GNU properties equivalents.  */
1681
  void (*translate_obj_attrs_to_gnu_props) (bfd *,
1682
    const obj_attr_subsection_v2_t *);
1683
1684
  /* Get default value for an attribute.  */
1685
  bool (*obj_attr_v2_default_value) (const struct bfd_link_info *,
1686
    const obj_attr_info_t *, const obj_attr_subsection_v2_t *, obj_attr_v2_t *);
1687
1688
  /* Merge a object attribute v2.  */
1689
  obj_attr_v2_merge_result_t (*obj_attr_v2_tag_merge)
1690
    (const struct bfd_link_info *, const bfd *, const obj_attr_subsection_v2_t *,
1691
     const obj_attr_v2_t *, const obj_attr_v2_t *, const obj_attr_v2_t *);
1692
1693
  /* This function determines the order in which any attributes are
1694
     written.  It must be defined for input in the range
1695
     LEAST_KNOWN_OBJ_ATTRIBUTE..NUM_KNOWN_OBJ_ATTRIBUTES-1 (this range
1696
     is used in order to make unity easy).  The returned value is the
1697
     actual tag number to place in the input position.  */
1698
  int (*obj_attrs_order) (int);
1699
1700
  /* Handle merging unknown attributes; either warn and return TRUE,
1701
     or give an error and return FALSE.  */
1702
  bool (*obj_attrs_handle_unknown) (bfd *, int);
1703
1704
  /* Parse GNU properties.  Return the property kind.  If the property
1705
     is corrupt, issue an error message and return property_corrupt.  */
1706
  enum elf_property_kind (*parse_gnu_properties) (bfd *, unsigned int,
1707
              bfd_byte *,
1708
              unsigned int);
1709
1710
  /* Merge GNU properties.  Return TRUE if property is updated.  */
1711
  bool (*merge_gnu_properties) (struct bfd_link_info *, bfd *, bfd *,
1712
               elf_property *, elf_property *);
1713
1714
  /* Set up object attributes.  */
1715
  bfd *(*setup_object_attributes) (struct bfd_link_info *);
1716
1717
  /* Set up GNU properties.  */
1718
  bfd *(*setup_gnu_properties) (struct bfd_link_info *);
1719
1720
  /* Fix up GNU properties.  */
1721
  void (*fixup_gnu_properties) (struct bfd_link_info *,
1722
        elf_property_list **);
1723
1724
  /* Encoding used for compact EH tables.  */
1725
  int (*compact_eh_encoding) (struct bfd_link_info *);
1726
1727
  /* Opcode representing no unwind.  */
1728
  int (*cant_unwind_opcode) (struct bfd_link_info *);
1729
1730
  /* Called when emitting an ELF symbol whoes input version had an
1731
     ST_SHNDX field set to a value in the range SHN_LOPROC..SHN_HIOS.
1732
     Returns the value to be installed in the ST_SHNDX field of the
1733
     emitted symbol.  If not defined, the value is left unchanged.  */
1734
  unsigned int (*symbol_section_index) (bfd *, elf_symbol_type *);
1735
1736
  /* Called when a section has extra reloc sections.  */
1737
  bool (*init_secondary_reloc_section) (bfd *, Elf_Internal_Shdr *,
1738
          const char *, unsigned int);
1739
1740
  /* Called when after loading the normal relocs for a section.  */
1741
  bool (*slurp_secondary_relocs) (bfd *, asection *, asymbol **, bool);
1742
1743
  /* Called after writing the normal relocs for a section.  */
1744
  bool (*write_secondary_relocs) (bfd *, asection *);
1745
1746
  /* This is non-zero if static TLS segments require a special alignment.  */
1747
  unsigned static_tls_alignment;
1748
1749
  /* Alignment for the PT_GNU_STACK segment.  */
1750
  unsigned stack_align;
1751
1752
  /* This is TRUE if the linker should act like collect and gather
1753
     global constructors and destructors by name.  This is TRUE for
1754
     MIPS ELF because the Irix 5 tools can not handle the .init
1755
     section.  */
1756
  unsigned collect : 1;
1757
1758
  /* This is TRUE if the linker should ignore changes to the type of a
1759
     symbol.  This is TRUE for MIPS ELF because some Irix 5 objects
1760
     record undefined functions as STT_OBJECT although the definitions
1761
     are STT_FUNC.  */
1762
  unsigned type_change_ok : 1;
1763
1764
  /* Whether the backend may use REL relocations.  (Some backends use
1765
     both REL and RELA relocations, and this flag is set for those
1766
     backends.)  */
1767
  unsigned may_use_rel_p : 1;
1768
1769
  /* Whether the backend may use RELA relocations.  (Some backends use
1770
     both REL and RELA relocations, and this flag is set for those
1771
     backends.)  */
1772
  unsigned may_use_rela_p : 1;
1773
1774
  /* Whether the default relocation type is RELA.  If a backend with
1775
     this flag set wants REL relocations for a particular section,
1776
     it must note that explicitly.  Similarly, if this flag is clear,
1777
     and the backend wants RELA relocations for a particular
1778
     section.  */
1779
  unsigned default_use_rela_p : 1;
1780
1781
  /* True if PLT and copy relocations should be RELA by default.  */
1782
  unsigned rela_plts_and_copies_p : 1;
1783
1784
  /* Set if RELA relocations for a relocatable link can be handled by
1785
     generic code.  Backends that set this flag need do nothing in the
1786
     backend relocate_section routine for relocatable linking.  */
1787
  unsigned rela_normal : 1;
1788
1789
  /* Set if DT_REL/DT_RELA/DT_RELSZ/DT_RELASZ should not include PLT
1790
     relocations.  */
1791
  unsigned dtrel_excludes_plt : 1;
1792
1793
  /* TRUE if addresses "naturally" sign extend.  This is used when
1794
     swapping in from Elf32 when BFD64.  */
1795
  unsigned sign_extend_vma : 1;
1796
1797
  unsigned want_got_plt : 1;
1798
  unsigned plt_readonly : 1;
1799
  unsigned want_plt_sym : 1;
1800
  unsigned plt_not_loaded : 1;
1801
  unsigned plt_alignment : 4;
1802
  unsigned can_gc_sections : 1;
1803
  unsigned can_refcount : 1;
1804
  unsigned want_got_sym : 1;
1805
  unsigned want_dynbss : 1;
1806
  unsigned want_dynrelro : 1;
1807
1808
  /* Targets which do not support physical addressing often require
1809
     that the p_paddr field in the section header to be set to zero.
1810
     This field indicates whether this behavior is required.  */
1811
  unsigned want_p_paddr_set_to_zero : 1;
1812
1813
  /* Target has broken hardware and/or kernel that requires pages not
1814
     to be mapped twice with different permissions.  */
1815
  unsigned no_page_alias : 1;
1816
1817
  /* True if an object file lacking a .note.GNU-stack section
1818
     should be assumed to be requesting exec stack.  At least one
1819
     other file in the link needs to have a .note.GNU-stack section
1820
     for a PT_GNU_STACK segment to be created.  */
1821
  unsigned default_execstack : 1;
1822
1823
  /* True if elf_section_data(sec)->this_hdr.contents is sec->rawsize
1824
     in length rather than sec->size in length, if sec->rawsize is
1825
     non-zero and smaller than sec->size.  */
1826
  unsigned caches_rawsize : 1;
1827
1828
  /* Address of protected data defined in the shared library may be
1829
     external, i.e., due to copy relocation.   */
1830
  unsigned extern_protected_data : 1;
1831
1832
  /* True if `_bfd_elf_link_renumber_dynsyms' must be called even for
1833
     static binaries.  */
1834
  unsigned always_renumber_dynsyms : 1;
1835
1836
  /* True if the 32-bit Linux PRPSINFO structure's `pr_uid' and `pr_gid'
1837
     members use a 16-bit data type.  */
1838
  unsigned linux_prpsinfo32_ugid16 : 1;
1839
1840
  /* True if the 64-bit Linux PRPSINFO structure's `pr_uid' and `pr_gid'
1841
     members use a 16-bit data type.  */
1842
  unsigned linux_prpsinfo64_ugid16 : 1;
1843
1844
  /* True if the backend can use mmap to map in all input section
1845
     contents.  All bfd_malloc_and_get_section and free usages on
1846
     section contents must be replaced by _bfd_elf_mmap_section_contents
1847
     and _bfd_elf_munmap_section_contents.  */
1848
  unsigned use_mmap : 1;
1849
};
1850
1851
#ifndef __cplusplus
1852
typedef const struct elf_backend_data elf_backend_data;
1853
#endif
1854
1855
/* Information about reloc sections associated with a bfd_elf_section_data
1856
   structure.  */
1857
struct bfd_elf_section_reloc_data
1858
{
1859
  /* The ELF header for the reloc section associated with this
1860
     section, if any.  */
1861
  Elf_Internal_Shdr *hdr;
1862
  /* The number of relocations currently assigned to HDR.  */
1863
  unsigned int count;
1864
  /* The ELF section number of the reloc section.  Only used for an
1865
     output file.  */
1866
  int idx;
1867
  /* Used by the backend linker to store the symbol hash table entries
1868
     associated with relocs against global symbols.  */
1869
  struct elf_link_hash_entry **hashes;
1870
};
1871
1872
/* Information stored for each BFD section in an ELF file.  This
1873
   structure is allocated by elf_new_section_hook.  */
1874
1875
struct bfd_elf_section_data
1876
{
1877
  /* The ELF header for this section.  */
1878
  Elf_Internal_Shdr this_hdr;
1879
1880
  /* INPUT_SECTION_FLAGS if specified in the linker script.  */
1881
  struct flag_info *section_flag_info;
1882
1883
  /* Information about the REL and RELA reloc sections associated
1884
     with this section, if any.  */
1885
  struct bfd_elf_section_reloc_data rel, rela;
1886
1887
  /* The ELF section number of this section.  */
1888
  int this_idx;
1889
1890
  /* Used by the backend linker when generating a shared library to
1891
     record the dynamic symbol index for a section symbol
1892
     corresponding to this section.  A value of 0 means that there is
1893
     no dynamic symbol for this section.  */
1894
  int dynindx;
1895
1896
  /* A pointer to the linked-to section for SHF_LINK_ORDER.  */
1897
  asection *linked_to;
1898
1899
  /* A pointer to the swapped relocs.  If the section uses REL relocs,
1900
     rather than RELA, all the r_addend fields will be zero.  This
1901
     pointer may be NULL.  It is used by the backend linker.  */
1902
  Elf_Internal_Rela *relocs;
1903
1904
  /* A pointer to a linked list tracking dynamic relocs copied for
1905
     local symbols.  */
1906
  void *local_dynrel;
1907
1908
  /* A pointer to the bfd section used for dynamic relocs.  */
1909
  asection *sreloc;
1910
1911
  union {
1912
    /* Group name, if this section is a member of a group.  */
1913
    const char *name;
1914
1915
    /* Group signature sym, if this is the SHT_GROUP section.  */
1916
    struct bfd_symbol *id;
1917
  } group;
1918
1919
  /* For a member of a group, points to the SHT_GROUP section.
1920
     NULL for the SHT_GROUP section itself and non-group sections.  */
1921
  asection *sec_group;
1922
1923
  /* A linked list of member sections in the group.  Circular when used by
1924
     the linker.  For the SHT_GROUP section, points at first member.  */
1925
  asection *next_in_group;
1926
1927
  /* The FDEs associated with this section.  The u.fde.next_in_section
1928
     field acts as a chain pointer.  */
1929
  struct eh_cie_fde *fde_list;
1930
1931
  /* Link from a text section to its .eh_frame_entry section.  */
1932
  asection *eh_frame_entry;
1933
1934
  /* If the mmapped_p flag is set, this points to the actual mmapped
1935
     address of contents.  If it is set to NULL, contents isn't
1936
     mmapped.  */
1937
  void *contents_addr;
1938
1939
  /* If the mmapped_p flag is set, this is the actual mmapped size of
1940
     contents.  */
1941
  size_t contents_size;
1942
1943
  /* TRUE if the section has secondary reloc sections associated with it.
1944
     FIXME: In the future it might be better to change this into a list
1945
     of secondary reloc sections, making lookup easier and faster.  */
1946
  bool has_secondary_relocs;
1947
};
1948
1949
5.51M
#define elf_section_data(sec) ((struct bfd_elf_section_data*)(sec)->used_by_bfd)
1950
21.3k
#define elf_linked_to_section(sec) (elf_section_data(sec)->linked_to)
1951
562k
#define elf_section_type(sec) (elf_section_data(sec)->this_hdr.sh_type)
1952
1.12M
#define elf_section_flags(sec)  (elf_section_data(sec)->this_hdr.sh_flags)
1953
162k
#define elf_section_info(sec) (elf_section_data(sec)->this_hdr.sh_info)
1954
19.7k
#define elf_group_name(sec) (elf_section_data(sec)->group.name)
1955
38
#define elf_group_id(sec) (elf_section_data(sec)->group.id)
1956
279k
#define elf_next_in_group(sec)  (elf_section_data(sec)->next_in_group)
1957
0
#define elf_fde_list(sec) (elf_section_data(sec)->fde_list)
1958
112k
#define elf_sec_group(sec)  (elf_section_data(sec)->sec_group)
1959
0
#define elf_section_eh_frame_entry(sec) (elf_section_data(sec)->eh_frame_entry)
1960
1961
#define xvec_get_elf_backend_data(xvec) \
1962
50.0M
  ((const struct elf_backend_data *) (xvec)->backend_data)
1963
1964
#define get_elf_backend_data(abfd) \
1965
50.0M
   xvec_get_elf_backend_data ((abfd)->xvec)
1966
1967
#define ABI_64_P(abfd) \
1968
10.2k
  (get_elf_backend_data (abfd)->s->elfclass == ELFCLASS64)
1969
1970
/* The least object attributes (within an attributes subsection) known
1971
   for any target.  Some code assumes that the value 0 is not used and
1972
   the field for that attribute can instead be used as a marker to
1973
   indicate that attributes have been initialized.  */
1974
0
#define LEAST_KNOWN_OBJ_ATTRIBUTE 2
1975
1976
/* The maximum number of known object attributes for any target.  */
1977
191k
#define NUM_KNOWN_OBJ_ATTRIBUTES 77
1978
1979
/* The value of an object attribute.  The type indicates whether the attribute
1980
   holds and integer, a string, or both.  It can also indicate that there can
1981
   be no default (i.e. all values must be written to file, even zero), or
1982
   that the value is in error and should not be written to file.  */
1983
1984
typedef struct obj_attribute
1985
{
1986
357k
#define ATTR_TYPE_FLAG_INT_VAL    (1 << 0)
1987
227k
#define ATTR_TYPE_FLAG_STR_VAL    (1 << 1)
1988
0
#define ATTR_TYPE_FLAG_NO_DEFAULT (1 << 2)
1989
0
#define ATTR_TYPE_FLAG_ERROR    (1 << 3)
1990
1991
0
#define ATTR_TYPE_HAS_INT_VAL(TYPE) ((TYPE) & ATTR_TYPE_FLAG_INT_VAL)
1992
0
#define ATTR_TYPE_HAS_STR_VAL(TYPE) ((TYPE) & ATTR_TYPE_FLAG_STR_VAL)
1993
0
#define ATTR_TYPE_HAS_NO_DEFAULT(TYPE)  ((TYPE) & ATTR_TYPE_FLAG_NO_DEFAULT)
1994
0
#define ATTR_TYPE_HAS_ERROR(TYPE) ((TYPE) & ATTR_TYPE_FLAG_ERROR)
1995
1996
  int type;
1997
  unsigned int i;
1998
  char *s;
1999
} obj_attribute;
2000
2001
typedef struct obj_attribute_list
2002
{
2003
  struct obj_attribute_list *next;
2004
  obj_attr_tag_t tag;
2005
  obj_attribute attr;
2006
} obj_attribute_list;
2007
2008
/* Object attributes may either be defined by the processor ABI, index
2009
   OBJ_ATTR_PROC in the *_obj_attributes arrays, or be GNU-specific
2010
   (and possibly also processor-specific), index OBJ_ATTR_GNU.  */
2011
typedef enum {
2012
  OBJ_ATTR_PROC,
2013
  OBJ_ATTR_GNU,
2014
} obj_attr_vendor_t;
2015
0
#define OBJ_ATTR_FIRST OBJ_ATTR_PROC
2016
0
#define OBJ_ATTR_LAST OBJ_ATTR_GNU
2017
2018
/* The following object attribute tags are taken as generic, for all
2019
   targets and for "gnu" where there is no target standard.  */
2020
enum
2021
{
2022
  Tag_NULL = 0,
2023
  Tag_File = 1,
2024
  Tag_Section = 2,
2025
  Tag_Symbol = 3,
2026
  Tag_compatibility = 32
2027
};
2028
2029
/* The following struct stores information about every SystemTap section
2030
   found in the object file.  */
2031
struct sdt_note
2032
{
2033
  struct sdt_note *next;
2034
  bfd_size_type size;
2035
  bfd_byte data[1];
2036
};
2037
2038
/* tdata information grabbed from an elf core file.  */
2039
struct core_elf_obj_tdata
2040
{
2041
  int signal;
2042
  int pid;
2043
  int lwpid;
2044
  char* program;
2045
  char* command;
2046
};
2047
2048
/* Extra tdata information held for output ELF BFDs.  */
2049
struct output_elf_obj_tdata
2050
{
2051
  struct elf_segment_map *seg_map;
2052
  struct elf_strtab_hash *strtab_ptr;
2053
2054
  /* STT_SECTION symbols for each section */
2055
  asymbol **section_syms;
2056
2057
  /* NT_GNU_BUILD_ID note type info.  */
2058
  struct
2059
  {
2060
    bool (*after_write_object_contents) (bfd *);
2061
    const char *style;
2062
    asection *sec;
2063
  } build_id;
2064
2065
  /* FDO_PACKAGING_METADATA note type info.  */
2066
  struct
2067
  {
2068
    bool (*after_write_object_contents) (bfd *);
2069
    const char *json;
2070
    asection *sec;
2071
  } package_metadata;
2072
2073
  /* Records the result of `get_program_header_size'.  */
2074
  bfd_size_type program_header_size;
2075
2076
  /* Used when laying out sections.  */
2077
  file_ptr next_file_pos;
2078
2079
  /* Linker information.  */
2080
  struct bfd_link_info *link_info;
2081
2082
  unsigned int num_section_syms;
2083
  unsigned int shstrtab_section, strtab_section;
2084
2085
  /* Segment flags for the PT_GNU_STACK segment.  */
2086
  unsigned int stack_flags;
2087
2088
  /* Used to determine if PT_GNU_SFRAME segment header should be
2089
     created.  */
2090
  asection *sframe;
2091
2092
  /* Holds the object attributes section if it exists.  */
2093
  asection *obj_object_attributes;
2094
2095
  /* Used to determine if the e_flags field has been initialized */
2096
  bool flags_init;
2097
};
2098
2099
/* Indicate if the bfd contains SHF_GNU_MBIND/SHF_GNU_RETAIN sections or
2100
   symbols that have the STT_GNU_IFUNC symbol type or STB_GNU_UNIQUE
2101
   binding.  Used to set the osabi field in the ELF header structure.  */
2102
enum elf_gnu_osabi
2103
{
2104
  elf_gnu_osabi_mbind = 1 << 0,
2105
  elf_gnu_osabi_ifunc = 1 << 1,
2106
  elf_gnu_osabi_unique = 1 << 2,
2107
  elf_gnu_osabi_retain = 1 << 3,
2108
};
2109
2110
typedef struct elf_section_list
2111
{
2112
  Elf_Internal_Shdr      hdr;
2113
  unsigned int         ndx;
2114
  struct elf_section_list *  next;
2115
} elf_section_list;
2116
2117
enum dynamic_lib_link_class {
2118
  DYN_NORMAL = 0,
2119
  DYN_AS_NEEDED = 1,
2120
  DYN_DT_NEEDED = 2,
2121
  DYN_NO_ADD_NEEDED = 4,
2122
  DYN_NO_NEEDED = 8
2123
};
2124
2125
/* Some private data is stashed away for future use using the tdata pointer
2126
   in the bfd structure.  */
2127
2128
struct elf_obj_tdata
2129
{
2130
  Elf_Internal_Ehdr elf_header[1];  /* Actual data, but ref like ptr */
2131
  Elf_Internal_Shdr **elf_sect_ptr;
2132
  Elf_Internal_Phdr *phdr;
2133
  Elf_Internal_Shdr symtab_hdr;
2134
  Elf_Internal_Shdr shstrtab_hdr;
2135
  Elf_Internal_Shdr strtab_hdr;
2136
  Elf_Internal_Shdr dynsymtab_hdr;
2137
  Elf_Internal_Shdr dynstrtab_hdr;
2138
  Elf_Internal_Shdr dynversym_hdr;
2139
  Elf_Internal_Shdr dynverref_hdr;
2140
  Elf_Internal_Shdr dynverdef_hdr;
2141
  Elf_Internal_Sym *dt_symtab;
2142
  bfd_byte *dt_versym;
2143
  bfd_byte *dt_verdef;
2144
  bfd_byte *dt_verneed;
2145
  size_t dt_symtab_count;
2146
  size_t dt_verdef_count;
2147
  size_t dt_verneed_count;
2148
  char * dt_strtab;
2149
  size_t dt_strsz;
2150
  elf_section_list * symtab_shndx_list;
2151
  bfd_vma gp;       /* The gp value */
2152
  unsigned int gp_size;     /* The gp size */
2153
  unsigned int num_elf_sections;  /* elf_sect_ptr size */
2154
  unsigned char *being_created;
2155
2156
  /* A mapping from external symbols to entries in the linker hash
2157
     table, used when linking.  This is indexed by the symbol index
2158
     minus the sh_info field of the symbol table header.  */
2159
  struct elf_link_hash_entry **sym_hashes;
2160
2161
  /* Section indices of local symbols, used by gc-sections.  */
2162
  unsigned int *loc_shndx;
2163
2164
  /* Track usage and final offsets of GOT entries for local symbols.
2165
     This array is indexed by symbol index.  Elements are used
2166
     identically to "got" in struct elf_link_hash_entry.  */
2167
  union
2168
    {
2169
      bfd_signed_vma *refcounts;
2170
      bfd_vma *offsets;
2171
      struct got_entry **ents;
2172
    } local_got;
2173
2174
  /* The linker ELF emulation code needs to let the backend ELF linker
2175
     know what filename should be used for a dynamic object if the
2176
     dynamic object is found using a search.  The emulation code then
2177
     sometimes needs to know what name was actually used.  Until the
2178
     file has been added to the linker symbol table, this field holds
2179
     the name the linker wants.  After it has been added, it holds the
2180
     name actually used, which will be the DT_SONAME entry if there is
2181
     one.  */
2182
  const char *dt_name;
2183
2184
  /* The linker emulation needs to know what audit libs
2185
     are used by a dynamic object.  */
2186
  const char *dt_audit;
2187
2188
  /* Used by find_nearest_line entry point.  */
2189
  void *line_info;
2190
2191
  /* A place to stash dwarf1 info for this bfd.  */
2192
  void *dwarf1_find_line_info;
2193
2194
  /* A place to stash dwarf2 info for this bfd.  */
2195
  void *dwarf2_find_line_info;
2196
2197
  /* Stash away info for yet another find line/function variant.  */
2198
  void *elf_find_function_cache;
2199
2200
  /* Number of symbol version definitions we are about to emit.  */
2201
  unsigned int cverdefs;
2202
2203
  /* Number of symbol version references we are about to emit.  */
2204
  unsigned int cverrefs;
2205
2206
  /* Symbol version definitions in external objects.  */
2207
  Elf_Internal_Verdef *verdef;
2208
2209
  /* Symbol version references to external objects.  */
2210
  Elf_Internal_Verneed *verref;
2211
2212
  /* A pointer to the .eh_frame section.  */
2213
  asection *eh_frame_section;
2214
2215
  /* A pointer to the .sframe section.  */
2216
  asection *sframe_section;
2217
2218
  /* Symbol buffer.  */
2219
  void *symbuf;
2220
2221
  /* List of GNU properties.  Will be updated by setup_gnu_properties
2222
     after all input GNU properties are merged for output.  */
2223
  elf_property_list *properties;
2224
2225
  /* The version of object attributes for this object.
2226
     For an input object, the format version used to store the data.
2227
     For an output object, the targeted format version.  */
2228
  obj_attr_version_t obj_attr_version;
2229
2230
  obj_attribute known_obj_attributes[2][NUM_KNOWN_OBJ_ATTRIBUTES];
2231
  obj_attribute_list *other_obj_attributes[2];
2232
2233
  /* Object attributes v2: A subsection can only hold attributes with the
2234
     same data type (uleb128, NTBS, etc), so each type requires a separate
2235
     subsection.  */
2236
  obj_attr_subsection_list_t obj_attr_subsections;
2237
2238
  /* Linked-list containing information about every Systemtap section
2239
     found in the object file.  Each section corresponds to one entry
2240
     in the list.  */
2241
  struct sdt_note *sdt_note_head;
2242
2243
  unsigned int symtab_section, dynsymtab_section;
2244
  unsigned int dynversym_section, dynverdef_section, dynverref_section;
2245
2246
  /* An identifier used to distinguish different target
2247
     specific extensions to this structure.  */
2248
  ENUM_BITFIELD (elf_target_id) object_id : 6;
2249
2250
  /* Whether a dyanmic object was specified normally on the linker
2251
     command line, or was specified when --as-needed was in effect,
2252
     or was found via a DT_NEEDED entry.  */
2253
  ENUM_BITFIELD (dynamic_lib_link_class) dyn_lib_class : 4;
2254
2255
  /* Whether the bfd uses OS specific bits that require ELFOSABI_GNU.  */
2256
  ENUM_BITFIELD (elf_gnu_osabi) has_gnu_osabi : 4;
2257
2258
  /* Whether if the bfd contains the GNU_PROPERTY_NO_COPY_ON_PROTECTED
2259
     property.  */
2260
  unsigned int has_no_copy_on_protected : 1;
2261
2262
  /* Whether if the bfd contains the
2263
     GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS property.  */
2264
  unsigned int has_indirect_extern_access : 1;
2265
2266
  /* Irix 5 often screws up the symbol table, sorting local symbols
2267
     after global symbols.  This flag is set if the symbol table in
2268
     this BFD appears to be screwed up.  If it is, we ignore the
2269
     sh_info field in the symbol table header, and always read all the
2270
     symbols.  */
2271
  unsigned int bad_symtab : 1;
2272
2273
  /* Set if DT_FLAGS_1 has DF_1_PIE set.  */
2274
  unsigned int is_pie : 1;
2275
2276
  /* Information grabbed from an elf core file.  */
2277
  struct core_elf_obj_tdata *core;
2278
2279
  /* More information held for output ELF BFDs.  */
2280
  struct output_elf_obj_tdata *o;
2281
};
2282
2283
25.1M
#define elf_tdata(bfd)    ((bfd) -> tdata.elf_obj_data)
2284
2285
2.24M
#define elf_object_id(bfd)  (elf_tdata(bfd) -> object_id)
2286
1.65k
#define elf_program_header_size(bfd) (elf_tdata(bfd) -> o->program_header_size)
2287
7.99M
#define elf_elfheader(bfd)  (elf_tdata(bfd) -> elf_header)
2288
5.04M
#define elf_elfsections(bfd)  (elf_tdata(bfd) -> elf_sect_ptr)
2289
3.55M
#define elf_numsections(bfd)  (elf_tdata(bfd) -> num_elf_sections)
2290
1.80k
#define elf_seg_map(bfd)  (elf_tdata(bfd) -> o->seg_map)
2291
0
#define elf_link_info(bfd)  (elf_tdata(bfd) -> o->link_info)
2292
1.50k
#define elf_next_file_pos(bfd)  (elf_tdata(bfd) -> o->next_file_pos)
2293
18
#define elf_stack_flags(bfd)  (elf_tdata(bfd) -> o->stack_flags)
2294
18
#define elf_sframe(bfd)   (elf_tdata(bfd) -> o->sframe)
2295
#define elf_obj_object_attributes(bfd) \
2296
0
        (elf_tdata(bfd) -> o->obj_object_attributes)
2297
8.27k
#define elf_shstrtab(bfd) (elf_tdata(bfd) -> o->strtab_ptr)
2298
348k
#define elf_onesymtab(bfd)  (elf_tdata(bfd) -> symtab_section)
2299
54.2k
#define elf_symtab_shndx_list(bfd)  (elf_tdata(bfd) -> symtab_shndx_list)
2300
1.83k
#define elf_strtab_sec(bfd) (elf_tdata(bfd) -> o->strtab_section)
2301
2.06k
#define elf_shstrtab_sec(bfd) (elf_tdata(bfd) -> o->shstrtab_section)
2302
30.4k
#define elf_symtab_hdr(bfd) (elf_tdata(bfd) -> symtab_hdr)
2303
61.7k
#define elf_dynsymtab(bfd)  (elf_tdata(bfd) -> dynsymtab_section)
2304
48.3k
#define elf_dynversym(bfd)  (elf_tdata(bfd) -> dynversym_section)
2305
25.5k
#define elf_dynverdef(bfd)  (elf_tdata(bfd) -> dynverdef_section)
2306
26.1k
#define elf_dynverref(bfd)  (elf_tdata(bfd) -> dynverref_section)
2307
#define elf_eh_frame_section(bfd) \
2308
0
        (elf_tdata(bfd) -> eh_frame_section)
2309
#define elf_sframe_section(bfd) \
2310
0
        (elf_tdata(bfd) -> sframe_section)
2311
39
#define elf_section_syms(bfd) (elf_tdata(bfd) -> o->section_syms)
2312
39
#define elf_num_section_syms(bfd) (elf_tdata(bfd) -> o->num_section_syms)
2313
#define core_prpsinfo(bfd)  (elf_tdata(bfd) -> prpsinfo)
2314
#define core_prstatus(bfd)  (elf_tdata(bfd) -> prstatus)
2315
827
#define elf_gp(bfd)   (elf_tdata(bfd) -> gp)
2316
43
#define elf_gp_size(bfd)  (elf_tdata(bfd) -> gp_size)
2317
0
#define elf_sym_hashes(bfd) (elf_tdata(bfd) -> sym_hashes)
2318
0
#define elf_loc_shndx(bfd)  (elf_tdata(bfd) -> loc_shndx)
2319
0
#define elf_local_got_refcounts(bfd) (elf_tdata(bfd) -> local_got.refcounts)
2320
0
#define elf_local_got_offsets(bfd) (elf_tdata(bfd) -> local_got.offsets)
2321
0
#define elf_local_got_ents(bfd) (elf_tdata(bfd) -> local_got.ents)
2322
0
#define elf_dt_name(bfd)  (elf_tdata(bfd) -> dt_name)
2323
0
#define elf_dt_audit(bfd) (elf_tdata(bfd) -> dt_audit)
2324
0
#define elf_dyn_lib_class(bfd)  (elf_tdata(bfd) -> dyn_lib_class)
2325
7.60k
#define elf_bad_symtab(bfd) (elf_tdata(bfd) -> bad_symtab)
2326
644
#define elf_flags_init(bfd) (elf_tdata(bfd) -> o->flags_init)
2327
195k
#define elf_use_dt_symtab_p(bfd) (elf_tdata(bfd) -> dt_symtab_count != 0)
2328
7.90k
#define elf_obj_attr_version(bfd) (elf_tdata (bfd) -> obj_attr_version)
2329
159k
#define elf_known_obj_attributes(bfd) (elf_tdata (bfd) -> known_obj_attributes)
2330
33.1k
#define elf_other_obj_attributes(bfd) (elf_tdata (bfd) -> other_obj_attributes)
2331
#define elf_known_obj_attributes_proc(bfd) \
2332
0
  (elf_known_obj_attributes (bfd) [OBJ_ATTR_PROC])
2333
#define elf_other_obj_attributes_proc(bfd) \
2334
0
  (elf_other_obj_attributes (bfd) [OBJ_ATTR_PROC])
2335
51.4k
#define elf_obj_attr_subsections(bfd) (elf_tdata (bfd) -> obj_attr_subsections)
2336
1.59k
#define elf_properties(bfd) (elf_tdata (bfd) -> properties)
2337
#define elf_has_no_copy_on_protected(bfd) \
2338
94
  (elf_tdata(bfd) -> has_no_copy_on_protected)
2339
#define elf_has_indirect_extern_access(bfd) \
2340
15
  (elf_tdata(bfd) -> has_indirect_extern_access)
2341

2342
extern void _bfd_elf_swap_verdef_in
2343
  (bfd *, const Elf_External_Verdef *, Elf_Internal_Verdef *) ATTRIBUTE_HIDDEN;
2344
extern void _bfd_elf_swap_verdef_out
2345
  (bfd *, const Elf_Internal_Verdef *, Elf_External_Verdef *) ATTRIBUTE_HIDDEN;
2346
extern void _bfd_elf_swap_verdaux_in
2347
  (bfd *, const Elf_External_Verdaux *, Elf_Internal_Verdaux *)
2348
  ATTRIBUTE_HIDDEN;
2349
extern void _bfd_elf_swap_verdaux_out
2350
  (bfd *, const Elf_Internal_Verdaux *, Elf_External_Verdaux *)
2351
  ATTRIBUTE_HIDDEN;
2352
extern void _bfd_elf_swap_verneed_in
2353
  (bfd *, const Elf_External_Verneed *, Elf_Internal_Verneed *)
2354
  ATTRIBUTE_HIDDEN;
2355
extern void _bfd_elf_swap_verneed_out
2356
  (bfd *, const Elf_Internal_Verneed *, Elf_External_Verneed *)
2357
  ATTRIBUTE_HIDDEN;
2358
extern void _bfd_elf_swap_vernaux_in
2359
  (bfd *, const Elf_External_Vernaux *, Elf_Internal_Vernaux *)
2360
  ATTRIBUTE_HIDDEN;
2361
extern void _bfd_elf_swap_vernaux_out
2362
  (bfd *, const Elf_Internal_Vernaux *, Elf_External_Vernaux *)
2363
  ATTRIBUTE_HIDDEN;
2364
extern void _bfd_elf_swap_versym_in
2365
  (bfd *, const Elf_External_Versym *, Elf_Internal_Versym *) ATTRIBUTE_HIDDEN;
2366
extern void _bfd_elf_swap_versym_out
2367
  (bfd *, const Elf_Internal_Versym *, Elf_External_Versym *) ATTRIBUTE_HIDDEN;
2368
2369
extern unsigned int _bfd_elf_section_from_bfd_section
2370
  (bfd *, asection *) ATTRIBUTE_HIDDEN;
2371
extern char *bfd_elf_string_from_elf_section
2372
  (bfd *, unsigned, unsigned);
2373
extern Elf_Internal_Sym *bfd_elf_get_elf_syms
2374
  (bfd *, Elf_Internal_Shdr *, size_t, size_t, Elf_Internal_Sym *, void *,
2375
   Elf_External_Sym_Shndx *);
2376
extern char * bfd_elf_get_str_section (bfd *, unsigned int);
2377
extern const char *bfd_elf_sym_name
2378
  (bfd *, Elf_Internal_Shdr *, Elf_Internal_Sym *, asection *);
2379
2380
extern bool _bfd_elf_copy_private_bfd_data
2381
  (bfd *, bfd *) ATTRIBUTE_HIDDEN;
2382
extern bool _bfd_elf_print_private_bfd_data
2383
  (bfd *, void *) ATTRIBUTE_HIDDEN;
2384
const char * _bfd_elf_get_symbol_version_string
2385
  (bfd *, asymbol *, bool, bool *) ATTRIBUTE_HIDDEN;
2386
extern void _bfd_elf_print_symbol
2387
  (bfd *, void *, asymbol *, bfd_print_symbol_type) ATTRIBUTE_HIDDEN;
2388
2389
extern unsigned int _bfd_elf_eh_frame_address_size
2390
  (bfd *, const asection *) ATTRIBUTE_HIDDEN;
2391
extern bfd_byte _bfd_elf_encode_eh_address
2392
  (bfd *abfd, struct bfd_link_info *info, asection *osec, bfd_vma offset,
2393
   asection *loc_sec, bfd_vma loc_offset, bfd_vma *encoded) ATTRIBUTE_HIDDEN;
2394
extern bool _bfd_elf_can_make_relative
2395
  (bfd *input_bfd, struct bfd_link_info *info, asection *eh_frame_section)
2396
  ATTRIBUTE_HIDDEN;
2397
2398
extern enum elf_reloc_type_class _bfd_elf_reloc_type_class
2399
  (const struct bfd_link_info *, const asection *,
2400
   const Elf_Internal_Rela *) ATTRIBUTE_HIDDEN;
2401
extern bfd_vma _bfd_elf_rela_local_sym
2402
  (bfd *, Elf_Internal_Sym *, asection **, Elf_Internal_Rela *)
2403
  ATTRIBUTE_HIDDEN;
2404
extern bfd_vma _bfd_elf_rel_local_sym
2405
  (bfd *, Elf_Internal_Sym *, asection **, bfd_vma) ATTRIBUTE_HIDDEN;
2406
extern bfd_vma _bfd_elf_section_offset
2407
  (bfd *, struct bfd_link_info *, asection *, bfd_vma) ATTRIBUTE_HIDDEN;
2408
2409
extern unsigned long bfd_elf_hash
2410
  (const char *);
2411
extern unsigned long bfd_elf_gnu_hash
2412
  (const char *);
2413
2414
extern bfd_reloc_status_type bfd_elf_generic_reloc
2415
  (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
2416
extern bool bfd_elf_allocate_object
2417
  (bfd *, size_t);
2418
extern bool bfd_elf_make_object
2419
  (bfd *);
2420
extern bool bfd_elf_mkcorefile
2421
  (bfd *);
2422
extern bool _bfd_elf_make_section_from_shdr
2423
  (bfd *, Elf_Internal_Shdr *, const char *, int) ATTRIBUTE_HIDDEN;
2424
extern bool _bfd_elf_make_section_from_phdr
2425
  (bfd *, Elf_Internal_Phdr *, int, const char *) ATTRIBUTE_HIDDEN;
2426
extern struct bfd_hash_entry *_bfd_elf_link_hash_newfunc
2427
  (struct bfd_hash_entry *, struct bfd_hash_table *, const char *)
2428
  ATTRIBUTE_HIDDEN;
2429
extern struct bfd_link_hash_table *_bfd_elf_link_hash_table_create
2430
  (bfd *) ATTRIBUTE_HIDDEN;
2431
extern void _bfd_elf_link_hash_table_free
2432
  (bfd *) ATTRIBUTE_HIDDEN;
2433
extern void _bfd_elf_link_hash_copy_indirect
2434
  (struct bfd_link_info *, struct elf_link_hash_entry *,
2435
   struct elf_link_hash_entry *) ATTRIBUTE_HIDDEN;
2436
extern void _bfd_elf_link_hash_hide_symbol
2437
  (struct bfd_link_info *, struct elf_link_hash_entry *, bool)
2438
  ATTRIBUTE_HIDDEN;
2439
extern void _bfd_elf_link_hide_symbol
2440
  (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *)
2441
  ATTRIBUTE_HIDDEN;
2442
extern bool _bfd_elf_link_hash_fixup_symbol
2443
  (struct bfd_link_info *, struct elf_link_hash_entry *) ATTRIBUTE_HIDDEN;
2444
extern bool _bfd_elf_link_hash_table_init
2445
  (struct elf_link_hash_table *, bfd *,
2446
   struct bfd_hash_entry *(*)
2447
     (struct bfd_hash_entry *, struct bfd_hash_table *, const char *),
2448
   unsigned int) ATTRIBUTE_HIDDEN;
2449
extern bool _bfd_elf_slurp_version_tables
2450
  (bfd *, bool) ATTRIBUTE_HIDDEN;
2451
extern bool bfd_elf_match_sections_by_type
2452
  (bfd *, const asection *, bfd *, const asection *);
2453
extern bool bfd_elf_is_group_section
2454
  (bfd *, const struct bfd_section *);
2455
extern const char *bfd_elf_group_name
2456
  (bfd *, const struct bfd_section *);
2457
extern bool _bfd_elf_section_already_linked
2458
  (bfd *, asection *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2459
extern void bfd_elf_set_group_contents
2460
  (bfd *, asection *, void *);
2461
extern unsigned int _bfd_elf_filter_global_symbols
2462
  (bfd *, struct bfd_link_info *, asymbol **, long) ATTRIBUTE_HIDDEN;
2463
extern asection *_bfd_elf_check_kept_section
2464
  (asection *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2465
0
#define _bfd_elf_link_just_syms _bfd_generic_link_just_syms
2466
extern void _bfd_elf_copy_link_hash_symbol_type
2467
  (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *)
2468
  ATTRIBUTE_HIDDEN;
2469
extern bool bfd_elf_size_group_sections
2470
  (struct bfd_link_info *);
2471
extern bool _bfd_elf_fixup_group_sections
2472
  (bfd *, asection *) ATTRIBUTE_HIDDEN;
2473
extern bool _bfd_elf_copy_private_header_data
2474
  (bfd *, bfd *) ATTRIBUTE_HIDDEN;
2475
extern bool _bfd_elf_copy_private_symbol_data
2476
  (bfd *, asymbol **, bfd *, asymbol **) ATTRIBUTE_HIDDEN;
2477
extern bool _bfd_elf_copy_private_section_data
2478
  (bfd *, asection *, bfd *, asection *, struct bfd_link_info *)
2479
  ATTRIBUTE_HIDDEN;
2480
extern bool _bfd_elf_write_object_contents
2481
  (bfd *) ATTRIBUTE_HIDDEN;
2482
extern bool _bfd_elf_write_corefile_contents
2483
  (bfd *) ATTRIBUTE_HIDDEN;
2484
extern bool _bfd_elf_set_section_contents
2485
  (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type) ATTRIBUTE_HIDDEN;
2486
extern long _bfd_elf_get_symtab_upper_bound
2487
  (bfd *) ATTRIBUTE_HIDDEN;
2488
extern long _bfd_elf_canonicalize_symtab
2489
  (bfd *, asymbol **) ATTRIBUTE_HIDDEN;
2490
extern long _bfd_elf_get_dynamic_symtab_upper_bound
2491
  (bfd *) ATTRIBUTE_HIDDEN;
2492
extern long _bfd_elf_canonicalize_dynamic_symtab
2493
  (bfd *, asymbol **) ATTRIBUTE_HIDDEN;
2494
extern long _bfd_elf_get_synthetic_symtab
2495
  (bfd *, long, asymbol **, long, asymbol **, asymbol **) ATTRIBUTE_HIDDEN;
2496
extern long _bfd_elf_get_reloc_upper_bound
2497
  (bfd *, sec_ptr) ATTRIBUTE_HIDDEN;
2498
extern long _bfd_elf_canonicalize_reloc
2499
  (bfd *, sec_ptr, arelent **, asymbol **) ATTRIBUTE_HIDDEN;
2500
extern asection * _bfd_elf_get_dynamic_reloc_section
2501
  (bfd *, asection *, bool) ATTRIBUTE_HIDDEN;
2502
extern asection * _bfd_elf_make_dynamic_reloc_section
2503
  (asection *, bfd *, unsigned int, bfd *, bool) ATTRIBUTE_HIDDEN;
2504
extern long _bfd_elf_get_dynamic_reloc_upper_bound
2505
  (bfd *) ATTRIBUTE_HIDDEN;
2506
extern long _bfd_elf_canonicalize_dynamic_reloc
2507
  (bfd *, arelent **, asymbol **) ATTRIBUTE_HIDDEN;
2508
extern asymbol *_bfd_elf_make_empty_symbol
2509
  (bfd *) ATTRIBUTE_HIDDEN;
2510
extern void _bfd_elf_get_symbol_info
2511
  (bfd *, asymbol *, symbol_info *) ATTRIBUTE_HIDDEN;
2512
extern bool _bfd_elf_is_local_label_name
2513
  (bfd *, const char *) ATTRIBUTE_HIDDEN;
2514
extern alent *_bfd_elf_get_lineno
2515
  (bfd *, asymbol *) ATTRIBUTE_HIDDEN;
2516
extern bool _bfd_elf_set_arch_mach
2517
  (bfd *, enum bfd_architecture, unsigned long) ATTRIBUTE_HIDDEN;
2518
extern bool _bfd_elf_find_nearest_line
2519
  (bfd *, asymbol **, asection *, bfd_vma,
2520
   const char **, const char **, unsigned int *, unsigned int *)
2521
  ATTRIBUTE_HIDDEN;
2522
extern bool _bfd_elf_find_nearest_line_with_alt
2523
  (bfd *, const char *, asymbol **, asection *, bfd_vma,
2524
   const char **, const char **, unsigned int *, unsigned int *)
2525
  ATTRIBUTE_HIDDEN;
2526
extern bool _bfd_elf_find_line
2527
  (bfd *, asymbol **, asymbol *, const char **, unsigned int *)
2528
  ATTRIBUTE_HIDDEN;
2529
extern bool _bfd_elf_find_inliner_info
2530
  (bfd *, const char **, const char **, unsigned int *) ATTRIBUTE_HIDDEN;
2531
extern asymbol *_bfd_elf_find_function
2532
  (bfd *, asymbol **, asection *, bfd_vma, const char **, const char **)
2533
  ATTRIBUTE_HIDDEN;
2534
#define _bfd_elf_read_minisymbols _bfd_generic_read_minisymbols
2535
#define _bfd_elf_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
2536
extern int _bfd_elf_sizeof_headers
2537
  (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2538
extern bool _bfd_elf_new_section_hook
2539
  (bfd *, asection *) ATTRIBUTE_HIDDEN;
2540
extern const struct bfd_elf_special_section *_bfd_elf_get_special_section
2541
  (const char *, const struct bfd_elf_special_section *, unsigned int)
2542
  ATTRIBUTE_HIDDEN;
2543
extern const struct bfd_elf_special_section *_bfd_elf_get_sec_type_attr
2544
  (bfd *, asection *) ATTRIBUTE_HIDDEN;
2545
2546
extern bool _bfd_elf_link_hide_sym_by_version
2547
  (struct bfd_link_info *, struct elf_link_hash_entry *) ATTRIBUTE_HIDDEN;
2548
2549
/* If the target doesn't have reloc handling written yet:  */
2550
extern bool _bfd_elf_no_info_to_howto
2551
  (bfd *, arelent *, Elf_Internal_Rela *) ATTRIBUTE_HIDDEN;
2552
2553
extern bool bfd_section_from_shdr
2554
  (bfd *, unsigned int shindex);
2555
extern bool bfd_section_from_phdr
2556
  (bfd *, Elf_Internal_Phdr *, int);
2557
2558
extern int _bfd_elf_symbol_from_bfd_symbol
2559
  (bfd *, asymbol **) ATTRIBUTE_HIDDEN;
2560
2561
extern Elf_Internal_Sym *bfd_sym_from_r_symndx
2562
  (struct sym_cache *, bfd *, unsigned long);
2563
extern asection *bfd_section_from_elf_index
2564
  (bfd *, unsigned int);
2565
2566
extern struct elf_strtab_hash * _bfd_elf_strtab_init
2567
  (void) ATTRIBUTE_HIDDEN;
2568
extern void _bfd_elf_strtab_free
2569
  (struct elf_strtab_hash *) ATTRIBUTE_HIDDEN;
2570
extern size_t _bfd_elf_strtab_add
2571
  (struct elf_strtab_hash *, const char *, bool) ATTRIBUTE_HIDDEN;
2572
extern void _bfd_elf_strtab_addref
2573
  (struct elf_strtab_hash *, size_t) ATTRIBUTE_HIDDEN;
2574
extern void _bfd_elf_strtab_delref
2575
  (struct elf_strtab_hash *, size_t) ATTRIBUTE_HIDDEN;
2576
extern unsigned int _bfd_elf_strtab_refcount
2577
  (struct elf_strtab_hash *, size_t) ATTRIBUTE_HIDDEN;
2578
extern void _bfd_elf_strtab_clear_all_refs
2579
  (struct elf_strtab_hash *) ATTRIBUTE_HIDDEN;
2580
extern void *_bfd_elf_strtab_save
2581
  (struct elf_strtab_hash *) ATTRIBUTE_HIDDEN;
2582
extern void _bfd_elf_strtab_restore
2583
  (struct elf_strtab_hash *, void *) ATTRIBUTE_HIDDEN;
2584
extern bfd_size_type _bfd_elf_strtab_size
2585
  (struct elf_strtab_hash *) ATTRIBUTE_HIDDEN;
2586
extern bfd_size_type bfd_elf_strtab_len
2587
  (struct elf_strtab_hash *);
2588
extern bfd_size_type _bfd_elf_strtab_offset
2589
  (struct elf_strtab_hash *, size_t) ATTRIBUTE_HIDDEN;
2590
extern const char *bfd_elf_strtab_str
2591
  (struct elf_strtab_hash *, size_t idx, bfd_size_type *offset);
2592
extern bool _bfd_elf_strtab_emit
2593
  (bfd *, struct elf_strtab_hash *) ATTRIBUTE_HIDDEN;
2594
extern void _bfd_elf_strtab_finalize
2595
  (struct elf_strtab_hash *) ATTRIBUTE_HIDDEN;
2596
2597
extern bool bfd_elf_parse_eh_frame_entries
2598
  (bfd *, struct bfd_link_info *);
2599
extern bool _bfd_elf_parse_eh_frame_entry
2600
  (struct bfd_link_info *, asection *, struct elf_reloc_cookie *)
2601
  ATTRIBUTE_HIDDEN;
2602
extern void _bfd_elf_parse_eh_frame
2603
  (bfd *, struct bfd_link_info *, asection *, struct elf_reloc_cookie *)
2604
  ATTRIBUTE_HIDDEN;
2605
extern bool _bfd_elf_end_eh_frame_parsing
2606
  (struct bfd_link_info *info) ATTRIBUTE_HIDDEN;
2607
2608
extern int _bfd_elf_discard_section_eh_frame
2609
  (bfd *, struct bfd_link_info *, asection *,
2610
   bool (*) (bfd_vma, void *), struct elf_reloc_cookie *) ATTRIBUTE_HIDDEN;
2611
extern bool _bfd_elf_adjust_eh_frame_global_symbol
2612
  (struct elf_link_hash_entry *, void *) ATTRIBUTE_HIDDEN;
2613
extern bool _bfd_elf_discard_section_eh_frame_hdr
2614
  (struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2615
extern bfd_vma _bfd_elf_eh_frame_section_offset
2616
  (bfd *, struct bfd_link_info *, asection *, bfd_vma) ATTRIBUTE_HIDDEN;
2617
extern bool _bfd_elf_write_section_eh_frame
2618
  (bfd *, struct bfd_link_info *, asection *, bfd_byte *) ATTRIBUTE_HIDDEN;
2619
extern bool _bfd_elf_write_linker_section_eh_frame
2620
  (bfd *, struct bfd_link_info *, asection *, bfd_byte *) ATTRIBUTE_HIDDEN;
2621
extern bool _bfd_elf_write_section_eh_frame_entry
2622
  (bfd *, struct bfd_link_info *, asection *, bfd_byte *) ATTRIBUTE_HIDDEN;
2623
extern bool _bfd_elf_fixup_eh_frame_hdr
2624
  (struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2625
extern bool _bfd_elf_write_section_eh_frame_hdr
2626
  (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2627
extern bool _bfd_elf_eh_frame_present
2628
  (struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2629
extern bool _bfd_elf_eh_frame_entry_present
2630
  (struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2631
extern bool _bfd_elf_maybe_strip_eh_frame_hdr
2632
  (struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2633
2634
extern bool _bfd_elf_sframe_present
2635
  (struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2636
extern bool _bfd_elf_sframe_present_input_bfds
2637
  (struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2638
extern bool _bfd_elf_parse_sframe
2639
  (bfd *, struct bfd_link_info *, asection *, struct elf_reloc_cookie *)
2640
  ATTRIBUTE_HIDDEN;
2641
extern bool _bfd_elf_discard_section_sframe
2642
  (asection *, bool (*) (bfd_vma, void *), struct elf_reloc_cookie *)
2643
  ATTRIBUTE_HIDDEN;
2644
extern bool _bfd_elf_merge_section_sframe
2645
  (bfd *, struct bfd_link_info *, asection *, bfd_byte *) ATTRIBUTE_HIDDEN;
2646
extern bfd_vma _bfd_elf_sframe_section_offset
2647
  (bfd *, struct bfd_link_info *, asection *, bfd_vma) ATTRIBUTE_HIDDEN;
2648
extern bool _bfd_elf_write_section_sframe
2649
  (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2650
extern bool _bfd_elf_set_section_sframe
2651
  (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2652
2653
extern bool _bfd_elf_hash_symbol
2654
  (struct elf_link_hash_entry *) ATTRIBUTE_HIDDEN;
2655
2656
extern long _bfd_elf_link_lookup_local_dynindx
2657
  (struct bfd_link_info *, bfd *, long) ATTRIBUTE_HIDDEN;
2658
extern bool _bfd_elf_compute_section_file_positions
2659
  (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2660
extern file_ptr _bfd_elf_assign_file_position_for_section
2661
  (Elf_Internal_Shdr *, file_ptr, bool, unsigned char) ATTRIBUTE_HIDDEN;
2662
extern bool _bfd_elf_modify_headers
2663
  (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2664
2665
extern bool _bfd_elf_validate_reloc
2666
  (bfd *, arelent *) ATTRIBUTE_HIDDEN;
2667
2668
extern bool bfd_elf_record_link_assignment
2669
  (bfd *, struct bfd_link_info *, const char *, bool,
2670
   bool);
2671
extern bool bfd_elf_stack_segment_size (bfd *, struct bfd_link_info *,
2672
          const char *, bfd_vma);
2673
extern bool bfd_elf_size_dynamic_sections
2674
  (bfd *, const char *, const char *, const char *, const char *, const char *,
2675
   const char * const *, struct bfd_link_info *, struct bfd_section **);
2676
extern bool bfd_elf_size_dynsym_hash_dynstr
2677
  (bfd *, struct bfd_link_info *);
2678
extern bool bfd_elf_get_bfd_needed_list
2679
  (bfd *, struct bfd_link_needed_list **);
2680
extern struct bfd_link_needed_list *bfd_elf_get_needed_list
2681
  (bfd *, struct bfd_link_info *);
2682
extern void bfd_elf_set_dt_needed_name
2683
  (bfd *, const char *);
2684
extern const char *bfd_elf_get_dt_soname
2685
  (bfd *);
2686
extern void bfd_elf_set_dyn_lib_class
2687
  (bfd *, enum dynamic_lib_link_class);
2688
extern int bfd_elf_get_dyn_lib_class
2689
  (bfd *);
2690
extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
2691
  (bfd *, struct bfd_link_info *);
2692
extern int bfd_elf_discard_info
2693
  (bfd *, struct bfd_link_info *);
2694
extern unsigned int _bfd_elf_default_action_discarded
2695
  (struct bfd_section *) ATTRIBUTE_HIDDEN;
2696
extern struct bfd_section *bfd_elf_tls_setup
2697
  (bfd *, struct bfd_link_info *);
2698
2699
extern bool bfd_elf_link_create_dynamic_sections
2700
  (bfd *, struct bfd_link_info *);
2701
extern bool _bfd_elf_omit_section_dynsym_default
2702
  (bfd *, struct bfd_link_info *, asection *) ATTRIBUTE_HIDDEN;
2703
extern bool _bfd_elf_omit_section_dynsym_all
2704
  (bfd *, struct bfd_link_info *, asection *) ATTRIBUTE_HIDDEN;
2705
extern bool _bfd_elf_create_dynamic_sections
2706
  (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2707
extern bool _bfd_elf_create_got_section
2708
  (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2709
extern asection *_bfd_elf_section_for_symbol
2710
  (struct elf_reloc_cookie *, unsigned long) ATTRIBUTE_HIDDEN;
2711
extern struct elf_link_hash_entry *_bfd_elf_define_linkage_sym
2712
  (bfd *, struct bfd_link_info *, asection *, const char *) ATTRIBUTE_HIDDEN;
2713
extern void _bfd_elf_init_1_index_section
2714
  (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2715
extern void _bfd_elf_init_2_index_sections
2716
  (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2717
2718
extern bool _bfd_elfcore_make_pseudosection
2719
  (bfd *, char *, size_t, ufile_ptr) ATTRIBUTE_HIDDEN;
2720
extern char *_bfd_elfcore_strndup
2721
  (bfd *, char *, size_t) ATTRIBUTE_HIDDEN;
2722
2723
extern Elf_Internal_Rela *_bfd_elf_link_read_relocs
2724
  (bfd *, const asection *, void *, Elf_Internal_Rela *, bool);
2725
extern Elf_Internal_Rela *_bfd_elf_link_info_read_relocs
2726
  (bfd *, struct bfd_link_info *, const asection *, void *, Elf_Internal_Rela *,
2727
   bool) ATTRIBUTE_HIDDEN;
2728
2729
extern bool _bfd_elf_link_output_relocs
2730
  (bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *,
2731
   struct elf_link_hash_entry **) ATTRIBUTE_HIDDEN;
2732
2733
extern bool _bfd_elf_link_add_glibc_version_dependency
2734
  (struct elf_find_verdep_info *, const char *const [], bool *)
2735
  ATTRIBUTE_HIDDEN;
2736
2737
extern void _bfd_elf_link_add_dt_relr_dependency
2738
  (struct elf_find_verdep_info *) ATTRIBUTE_HIDDEN;
2739
2740
extern bool _bfd_elf_adjust_dynamic_copy
2741
  (struct bfd_link_info *, struct elf_link_hash_entry *, asection *)
2742
  ATTRIBUTE_HIDDEN;
2743
2744
extern bool _bfd_elf_dynamic_symbol_p
2745
  (struct elf_link_hash_entry *, struct bfd_link_info *, bool) ATTRIBUTE_HIDDEN;
2746
2747
extern bool _bfd_elf_symbol_refs_local_p
2748
  (struct elf_link_hash_entry *, struct bfd_link_info *, bool) ATTRIBUTE_HIDDEN;
2749
2750
extern bfd_reloc_status_type bfd_elf_perform_complex_relocation
2751
  (bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, bfd_vma);
2752
2753
extern bool _bfd_elf_setup_sections
2754
  (bfd *) ATTRIBUTE_HIDDEN;
2755
2756
extern bool _bfd_elf_get_dynamic_symbols
2757
  (bfd *, Elf_Internal_Phdr *, Elf_Internal_Phdr *, size_t,
2758
   bfd_size_type) ATTRIBUTE_HIDDEN;
2759
extern asection *_bfd_elf_get_section_from_dynamic_symbol
2760
  (bfd *, Elf_Internal_Sym *) ATTRIBUTE_HIDDEN;
2761
2762
extern struct bfd_link_hash_entry *bfd_elf_define_start_stop
2763
  (struct bfd_link_info *, const char *, asection *);
2764
2765
extern bool _bfd_elf_init_file_header (bfd *, struct bfd_link_info *)
2766
  ATTRIBUTE_HIDDEN;
2767
2768
extern bool _bfd_elf_final_write_processing (bfd *) ATTRIBUTE_HIDDEN;
2769
2770
extern bfd_cleanup bfd_elf32_object_p
2771
  (bfd *);
2772
extern bfd_cleanup bfd_elf32_core_file_p
2773
  (bfd *);
2774
extern char *bfd_elf32_core_file_failing_command
2775
  (bfd *);
2776
extern int bfd_elf32_core_file_failing_signal
2777
  (bfd *);
2778
extern bool bfd_elf32_core_file_matches_executable_p
2779
  (bfd *, bfd *);
2780
extern int bfd_elf32_core_file_pid
2781
  (bfd *);
2782
extern bool _bfd_elf32_core_find_build_id
2783
  (bfd *, bfd_vma) ATTRIBUTE_HIDDEN;
2784
2785
extern bool bfd_elf32_swap_symbol_in
2786
  (bfd *, const void *, const void *, Elf_Internal_Sym *);
2787
extern void bfd_elf32_swap_symbol_out
2788
  (bfd *, const Elf_Internal_Sym *, void *, void *);
2789
extern void bfd_elf32_swap_reloc_in
2790
  (bfd *, const bfd_byte *, Elf_Internal_Rela *);
2791
extern void bfd_elf32_swap_reloc_out
2792
  (bfd *, const Elf_Internal_Rela *, bfd_byte *);
2793
extern void bfd_elf32_swap_reloca_in
2794
  (bfd *, const bfd_byte *, Elf_Internal_Rela *);
2795
extern void bfd_elf32_swap_reloca_out
2796
  (bfd *, const Elf_Internal_Rela *, bfd_byte *);
2797
extern void bfd_elf32_swap_phdr_in
2798
  (bfd *, const Elf32_External_Phdr *, Elf_Internal_Phdr *);
2799
extern void bfd_elf32_swap_phdr_out
2800
  (bfd *, const Elf_Internal_Phdr *, Elf32_External_Phdr *);
2801
extern void bfd_elf32_swap_dyn_in
2802
  (bfd *, const void *, Elf_Internal_Dyn *);
2803
extern void bfd_elf32_swap_dyn_out
2804
  (bfd *, const Elf_Internal_Dyn *, void *);
2805
extern long bfd_elf32_slurp_symbol_table
2806
  (bfd *, asymbol **, bool);
2807
extern bool bfd_elf32_write_shdrs_and_ehdr
2808
  (bfd *);
2809
extern int bfd_elf32_write_out_phdrs
2810
  (bfd *, const Elf_Internal_Phdr *, unsigned int);
2811
extern bool bfd_elf32_checksum_contents
2812
  (bfd * , void (*) (const void *, size_t, void *), void *);
2813
extern void bfd_elf32_write_relocs
2814
  (bfd *, asection *, void *);
2815
extern bool bfd_elf32_slurp_reloc_table
2816
  (bfd *, asection *, asymbol **, bool);
2817
2818
extern bfd_cleanup bfd_elf64_object_p
2819
  (bfd *);
2820
extern bfd_cleanup bfd_elf64_core_file_p
2821
  (bfd *);
2822
extern char *bfd_elf64_core_file_failing_command
2823
  (bfd *);
2824
extern int bfd_elf64_core_file_failing_signal
2825
  (bfd *);
2826
extern bool bfd_elf64_core_file_matches_executable_p
2827
  (bfd *, bfd *);
2828
extern int bfd_elf64_core_file_pid
2829
  (bfd *);
2830
extern bool _bfd_elf64_core_find_build_id
2831
  (bfd *, bfd_vma) ATTRIBUTE_HIDDEN;
2832
2833
extern bool bfd_elf64_swap_symbol_in
2834
  (bfd *, const void *, const void *, Elf_Internal_Sym *);
2835
extern void bfd_elf64_swap_symbol_out
2836
  (bfd *, const Elf_Internal_Sym *, void *, void *);
2837
extern void bfd_elf64_swap_reloc_in
2838
  (bfd *, const bfd_byte *, Elf_Internal_Rela *);
2839
extern void bfd_elf64_swap_reloc_out
2840
  (bfd *, const Elf_Internal_Rela *, bfd_byte *);
2841
extern void bfd_elf64_swap_reloca_in
2842
  (bfd *, const bfd_byte *, Elf_Internal_Rela *);
2843
extern void bfd_elf64_swap_reloca_out
2844
  (bfd *, const Elf_Internal_Rela *, bfd_byte *);
2845
extern void bfd_elf64_swap_phdr_in
2846
  (bfd *, const Elf64_External_Phdr *, Elf_Internal_Phdr *);
2847
extern void bfd_elf64_swap_phdr_out
2848
  (bfd *, const Elf_Internal_Phdr *, Elf64_External_Phdr *);
2849
extern void bfd_elf64_swap_dyn_in
2850
  (bfd *, const void *, Elf_Internal_Dyn *);
2851
extern void bfd_elf64_swap_dyn_out
2852
  (bfd *, const Elf_Internal_Dyn *, void *);
2853
extern long bfd_elf64_slurp_symbol_table
2854
  (bfd *, asymbol **, bool);
2855
extern bool bfd_elf64_write_shdrs_and_ehdr
2856
  (bfd *);
2857
extern int bfd_elf64_write_out_phdrs
2858
  (bfd *, const Elf_Internal_Phdr *, unsigned int);
2859
extern bool bfd_elf64_checksum_contents
2860
  (bfd * , void (*) (const void *, size_t, void *), void *);
2861
extern void bfd_elf64_write_relocs
2862
  (bfd *, asection *, void *);
2863
extern bool bfd_elf64_slurp_reloc_table
2864
  (bfd *, asection *, asymbol **, bool);
2865
2866
extern bool _bfd_elf_default_relocs_compatible
2867
  (const bfd_target *, const bfd_target *) ATTRIBUTE_HIDDEN;
2868
2869
extern bool _bfd_elf_relocs_compatible
2870
  (const bfd_target *, const bfd_target *) ATTRIBUTE_HIDDEN;
2871
extern bool _bfd_elf_notice_as_needed
2872
  (bfd *, struct bfd_link_info *, enum notice_asneeded_action) ATTRIBUTE_HIDDEN;
2873
2874
extern struct bfd_link_hash_entry *_bfd_elf_archive_symbol_lookup
2875
  (bfd *, struct bfd_link_info *, const char *) ATTRIBUTE_HIDDEN;
2876
extern bool bfd_elf_link_add_symbols
2877
  (bfd *, struct bfd_link_info *);
2878
extern bool _bfd_elf_add_dynamic_entry
2879
  (struct bfd_link_info *, bfd_vma, bfd_vma) ATTRIBUTE_HIDDEN;
2880
extern bool _bfd_elf_strip_zero_sized_dynamic_sections
2881
  (struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2882
extern int bfd_elf_add_dt_needed_tag
2883
  (bfd *, struct bfd_link_info *);
2884
extern bool _bfd_elf_link_check_relocs
2885
  (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2886
extern bool _bfd_elf_link_iterate_on_relocs
2887
  (bfd *, struct bfd_link_info *,
2888
   bool (*) (bfd *, struct bfd_link_info *, asection *,
2889
       const Elf_Internal_Rela *)) ATTRIBUTE_HIDDEN;
2890
2891
extern bool bfd_elf_link_record_dynamic_symbol
2892
  (struct bfd_link_info *, struct elf_link_hash_entry *);
2893
2894
extern int bfd_elf_link_record_local_dynamic_symbol
2895
  (struct bfd_link_info *, bfd *, long);
2896
2897
extern bool _bfd_elf_free_cached_info
2898
  (bfd *) ATTRIBUTE_HIDDEN;
2899
2900
extern bool _bfd_elf_common_definition
2901
  (Elf_Internal_Sym *) ATTRIBUTE_HIDDEN;
2902
2903
extern unsigned int _bfd_elf_common_section_index
2904
  (asection *) ATTRIBUTE_HIDDEN;
2905
2906
extern asection *_bfd_elf_common_section
2907
  (asection *) ATTRIBUTE_HIDDEN;
2908
2909
extern bfd_vma _bfd_elf_default_got_elt_size
2910
  (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, bfd *,
2911
   unsigned long) ATTRIBUTE_HIDDEN;
2912
2913
extern bfd_reloc_status_type _bfd_elf_rel_vtable_reloc_fn
2914
  (bfd *, arelent *, struct bfd_symbol *, void *,
2915
   asection *, bfd *, char **) ATTRIBUTE_HIDDEN;
2916
2917
extern bool _bfd_elf_final_link
2918
  (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2919
2920
extern void _bfd_elf_gc_keep
2921
  (struct bfd_link_info *info) ATTRIBUTE_HIDDEN;
2922
2923
extern bool bfd_elf_gc_mark_dynamic_ref_symbol
2924
  (struct elf_link_hash_entry *h, void *inf);
2925
2926
extern bool bfd_elf_gc_sections
2927
  (bfd *, struct bfd_link_info *);
2928
2929
extern bool bfd_elf_gc_record_vtinherit
2930
  (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma);
2931
2932
extern bool bfd_elf_gc_record_vtentry
2933
  (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma);
2934
2935
extern asection *_bfd_elf_gc_mark_hook
2936
  (asection *, struct bfd_link_info *, struct elf_reloc_cookie *,
2937
   struct elf_link_hash_entry *, unsigned int) ATTRIBUTE_HIDDEN;
2938
2939
extern asection *_bfd_elf_gc_mark_rsec
2940
  (struct bfd_link_info *, asection *, elf_gc_mark_hook_fn,
2941
   struct elf_reloc_cookie *, bool *) ATTRIBUTE_HIDDEN;
2942
2943
extern bool _bfd_elf_gc_mark_reloc
2944
  (struct bfd_link_info *, asection *, elf_gc_mark_hook_fn,
2945
   struct elf_reloc_cookie *) ATTRIBUTE_HIDDEN;
2946
2947
extern bool _bfd_elf_gc_mark_fdes
2948
  (struct bfd_link_info *, asection *, asection *, elf_gc_mark_hook_fn,
2949
   struct elf_reloc_cookie *) ATTRIBUTE_HIDDEN;
2950
2951
extern bool _bfd_elf_gc_mark
2952
  (struct bfd_link_info *, asection *, elf_gc_mark_hook_fn) ATTRIBUTE_HIDDEN;
2953
2954
extern bool _bfd_elf_gc_mark_extra_sections
2955
  (struct bfd_link_info *, elf_gc_mark_hook_fn) ATTRIBUTE_HIDDEN;
2956
2957
extern bool bfd_elf_gc_common_finalize_got_offsets
2958
  (bfd *, struct bfd_link_info *);
2959
2960
extern bool _bfd_elf_gc_common_final_link
2961
  (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
2962
2963
extern bool bfd_elf_reloc_symbol_deleted_p
2964
  (bfd_vma, void *);
2965
2966
extern struct elf_segment_map * _bfd_elf_make_dynamic_segment
2967
  (bfd *, asection *) ATTRIBUTE_HIDDEN;
2968
2969
extern bool bfd_elf_map_sections_to_segments
2970
  (bfd *, struct bfd_link_info *, bool *);
2971
2972
extern bool _bfd_elf_is_function_type
2973
  (unsigned int) ATTRIBUTE_HIDDEN;
2974
2975
extern bfd_size_type _bfd_elf_maybe_function_sym
2976
  (const asymbol *, asection *, bfd_vma *) ATTRIBUTE_HIDDEN;
2977
2978
extern asection *_bfd_elf_plt_get_reloc_section
2979
  (bfd *, const char *) ATTRIBUTE_HIDDEN;
2980
2981
extern int bfd_elf_get_default_section_type (flagword);
2982
2983
extern bool bfd_elf_lookup_section_flags
2984
  (struct bfd_link_info *, struct flag_info *, asection *);
2985
2986
extern Elf_Internal_Phdr * _bfd_elf_find_segment_containing_section
2987
  (bfd * abfd, asection * section) ATTRIBUTE_HIDDEN;
2988
2989
/* PowerPC @tls opcode transform/validate.  */
2990
extern unsigned int bfd_elf_ppc_at_tls_transform
2991
  (unsigned int, unsigned int);
2992
/* PowerPC @tprel opcode transform/validate.  */
2993
extern unsigned int _bfd_elf_ppc_at_tprel_transform
2994
  (unsigned int, unsigned int) ATTRIBUTE_HIDDEN;
2995
/* PowerPC elf_object_p tweak.  */
2996
extern bool _bfd_elf_ppc_set_arch
2997
  (bfd *) ATTRIBUTE_HIDDEN;
2998
/* PowerPC .gnu.attributes handling common to both 32-bit and 64-bit.  */
2999
extern bool _bfd_elf_ppc_merge_fp_attributes
3000
  (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
3001
3002
/* Return an upper bound on the number of bytes required to store a
3003
   copy of ABFD's program header table entries.  Return -1 if an error
3004
   occurs; bfd_get_error will return an appropriate code.  */
3005
extern long bfd_get_elf_phdr_upper_bound
3006
  (bfd *abfd);
3007
3008
/* Copy ABFD's program header table entries to *PHDRS.  The entries
3009
   will be stored as an array of Elf_Internal_Phdr structures, as
3010
   defined in include/elf/internal.h.  To find out how large the
3011
   buffer needs to be, call bfd_get_elf_phdr_upper_bound.
3012
3013
   Return the number of program header table entries read, or -1 if an
3014
   error occurs; bfd_get_error will return an appropriate code.  */
3015
extern int bfd_get_elf_phdrs
3016
  (bfd *abfd, void *phdrs);
3017
3018
/* Exported interface for writing elf corefile notes.  */
3019
extern char *elfcore_write_note
3020
  (bfd *, char *, int *, const char *, int, const void *, int);
3021
extern char *elfcore_write_prpsinfo
3022
  (bfd *, char *, int *, const char *, const char *);
3023
extern char *elfcore_write_prstatus
3024
  (bfd *, char *, int *, long, int, const void *);
3025
extern char * elfcore_write_pstatus
3026
  (bfd *, char *, int *, long, int, const void *);
3027
extern char *elfcore_write_prfpreg
3028
  (bfd *, char *, int *, const void *, int);
3029
extern char *elfcore_write_prxfpreg
3030
  (bfd *, char *, int *, const void *, int);
3031
extern char *elfcore_write_xstatereg
3032
  (bfd *, char *, int *, const void *, int);
3033
extern char *elfcore_write_xsave_layout
3034
  (bfd *, char *, int *, const void *, int);
3035
extern char *elfcore_write_x86_segbases
3036
  (bfd *, char *, int *, const void *, int);
3037
extern char *elfcore_write_i386_tls
3038
  (bfd *, char *, int *, const void *, int);
3039
extern char *elfcore_write_ppc_vmx
3040
  (bfd *, char *, int *, const void *, int);
3041
extern char *elfcore_write_ppc_vsx
3042
  (bfd *, char *, int *, const void *, int);
3043
extern char *elfcore_write_ppc_tar
3044
  (bfd *, char *, int *, const void *, int);
3045
extern char *elfcore_write_ppc_ppr
3046
  (bfd *, char *, int *, const void *, int);
3047
extern char *elfcore_write_ppc_dscr
3048
  (bfd *, char *, int *, const void *, int);
3049
extern char *elfcore_write_ppc_ebb
3050
  (bfd *, char *, int *, const void *, int);
3051
extern char *elfcore_write_ppc_pmu
3052
  (bfd *, char *, int *, const void *, int);
3053
extern char *elfcore_write_ppc_tm_cgpr
3054
  (bfd *, char *, int *, const void *, int);
3055
extern char *elfcore_write_ppc_tm_cfpr
3056
  (bfd *, char *, int *, const void *, int);
3057
extern char *elfcore_write_ppc_tm_cvmx
3058
  (bfd *, char *, int *, const void *, int);
3059
extern char *elfcore_write_ppc_tm_cvsx
3060
  (bfd *, char *, int *, const void *, int);
3061
extern char *elfcore_write_ppc_tm_spr
3062
  (bfd *, char *, int *, const void *, int);
3063
extern char *elfcore_write_ppc_tm_ctar
3064
  (bfd *, char *, int *, const void *, int);
3065
extern char *elfcore_write_ppc_tm_cppr
3066
  (bfd *, char *, int *, const void *, int);
3067
extern char *elfcore_write_ppc_tm_cdscr
3068
  (bfd *, char *, int *, const void *, int);
3069
extern char *elfcore_write_s390_timer
3070
  (bfd *, char *, int *, const void *, int);
3071
extern char *elfcore_write_s390_todcmp
3072
  (bfd *, char *, int *, const void *, int);
3073
extern char *elfcore_write_s390_todpreg
3074
  (bfd *, char *, int *, const void *, int);
3075
extern char *elfcore_write_s390_ctrs
3076
  (bfd *, char *, int *, const void *, int);
3077
extern char *elfcore_write_s390_prefix
3078
  (bfd *, char *, int *, const void *, int);
3079
extern char *elfcore_write_s390_last_break
3080
  (bfd *, char *, int *, const void *, int);
3081
extern char *elfcore_write_s390_system_call
3082
  (bfd *, char *, int *, const void *, int);
3083
extern char *elfcore_write_s390_tdb
3084
  (bfd *, char *, int *, const void *, int);
3085
extern char *elfcore_write_s390_vxrs_low
3086
  (bfd *, char *, int *, const void *, int);
3087
extern char *elfcore_write_s390_vxrs_high
3088
  (bfd *, char *, int *, const void *, int);
3089
extern char *elfcore_write_s390_gs_cb
3090
  (bfd *, char *, int *, const void *, int);
3091
extern char *elfcore_write_s390_gs_bc
3092
  (bfd *, char *, int *, const void *, int);
3093
extern char *elfcore_write_arm_vfp
3094
  (bfd *, char *, int *, const void *, int);
3095
extern char *elfcore_write_aarch_tls
3096
  (bfd *, char *, int *, const void *, int);
3097
extern char *elfcore_write_aarch_hw_break
3098
  (bfd *, char *, int *, const void *, int);
3099
extern char *elfcore_write_aarch_hw_watch
3100
  (bfd *, char *, int *, const void *, int);
3101
extern char *elfcore_write_aarch_sve
3102
  (bfd *, char *, int *, const void *, int);
3103
extern char *elfcore_write_aarch_pauth
3104
  (bfd *, char *, int *, const void *, int);
3105
extern char *elfcore_write_aarch_mte
3106
  (bfd *, char *, int *, const void *, int);
3107
extern char *elfcore_write_aarch_ssve
3108
  (bfd *, char *, int *, const void *, int);
3109
extern char *elfcore_write_aarch_za
3110
  (bfd *, char *, int *, const void *, int);
3111
extern char *elfcore_write_aarch_zt
3112
  (bfd *, char *, int *, const void *, int);
3113
extern char *elfcore_write_aarch_fpmr
3114
  (bfd *, char *, int *, const void *, int);
3115
extern char *elfcore_write_arc_v2
3116
  (bfd *, char *, int *, const void *, int);
3117
extern char *elfcore_write_riscv_csr
3118
  (bfd *, char *, int *, const void *, int);
3119
extern char *elfcore_write_gdb_tdesc
3120
  (bfd *, char *, int *, const void *, int);
3121
extern char *elfcore_write_lwpstatus
3122
  (bfd *, char *, int *, long, int, const void *);
3123
extern char *elfcore_write_register_note
3124
  (bfd *, char *, int *, const char *, const void *, int);
3125
extern char *elfcore_write_file_note
3126
  (bfd *, char *, int *, const void*, int);
3127
extern char *elfcore_write_loongarch_cpucfg
3128
  (bfd *, char *, int *, const void*, int);
3129
extern char *elfcore_write_loongarch_lbt
3130
  (bfd *, char *, int *, const void*, int);
3131
extern char *elfcore_write_loongarch_lsx
3132
  (bfd *, char *, int *, const void*, int);
3133
extern char *elfcore_write_loongarch_lasx
3134
  (bfd *, char *, int *, const void*, int);
3135
3136
/* Internal structure which holds information to be included in the
3137
   PRPSINFO section of Linux core files.
3138
3139
   This is an "internal" structure in the sense that it should be used
3140
   to pass information to BFD (via the `elfcore_write_linux_prpsinfo'
3141
   function), so things like endianess shouldn't be an issue.  This
3142
   structure will eventually be converted in one of the
3143
   `elf_external_linux_*' structures and written out to an output bfd
3144
   by one of the functions declared below.  */
3145
3146
struct elf_internal_linux_prpsinfo
3147
  {
3148
    char pr_state;      /* Numeric process state.  */
3149
    char pr_sname;      /* Char for pr_state.  */
3150
    char pr_zomb;     /* Zombie.  */
3151
    char pr_nice;     /* Nice val.  */
3152
    unsigned long pr_flag;    /* Flags.  */
3153
    unsigned int pr_uid;
3154
    unsigned int pr_gid;
3155
    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
3156
    char pr_fname[16 + 1];    /* Filename of executable.  */
3157
    char pr_psargs[80 + 1];   /* Initial part of arg list.  */
3158
  };
3159
3160
/* Linux/most 32-bit archs.  */
3161
extern char *elfcore_write_linux_prpsinfo32
3162
  (bfd *, char *, int *, const struct elf_internal_linux_prpsinfo *);
3163
3164
/* Linux/most 64-bit archs.  */
3165
extern char *elfcore_write_linux_prpsinfo64
3166
  (bfd *, char *, int *, const struct elf_internal_linux_prpsinfo *);
3167
3168
extern bfd *_bfd_elf32_bfd_from_remote_memory
3169
  (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
3170
   int (*target_read_memory) (bfd_vma, bfd_byte *, bfd_size_type))
3171
  ATTRIBUTE_HIDDEN;
3172
extern bfd *_bfd_elf64_bfd_from_remote_memory
3173
  (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
3174
   int (*target_read_memory) (bfd_vma, bfd_byte *, bfd_size_type))
3175
  ATTRIBUTE_HIDDEN;
3176
3177
extern obj_attr_version_t _bfd_obj_attrs_version_dec (uint8_t)
3178
  ATTRIBUTE_HIDDEN;
3179
extern uint8_t _bfd_obj_attrs_version_enc (obj_attr_version_t)
3180
  ATTRIBUTE_HIDDEN;
3181
extern bfd_vma bfd_elf_obj_attr_size (bfd *);
3182
extern void bfd_elf_set_obj_attr_contents (bfd *, bfd_byte *, bfd_vma);
3183
extern obj_attribute *
3184
bfd_elf_new_obj_attr (bfd *, obj_attr_vendor_t, obj_attr_tag_t);
3185
extern int bfd_elf_get_obj_attr_int (bfd *, obj_attr_vendor_t, obj_attr_tag_t);
3186
extern obj_attribute *bfd_elf_add_obj_attr_int
3187
  (bfd *, obj_attr_vendor_t, obj_attr_tag_t, unsigned int);
3188
#define bfd_elf_add_proc_attr_int(BFD, TAG, VALUE) \
3189
  bfd_elf_add_obj_attr_int ((BFD), OBJ_ATTR_PROC, (TAG), (VALUE))
3190
extern obj_attribute *bfd_elf_add_obj_attr_string
3191
  (bfd *, obj_attr_vendor_t, obj_attr_tag_t, const char *);
3192
#define bfd_elf_add_proc_attr_string(BFD, TAG, VALUE) \
3193
  bfd_elf_add_obj_attr_string ((BFD), OBJ_ATTR_PROC, (TAG), (VALUE))
3194
extern obj_attribute *bfd_elf_add_obj_attr_int_string
3195
  (bfd *, obj_attr_vendor_t, obj_attr_tag_t, unsigned int, const char *);
3196
#define bfd_elf_add_proc_attr_int_string(BFD, TAG, INTVAL, STRVAL) \
3197
  bfd_elf_add_obj_attr_int_string ((BFD), OBJ_ATTR_PROC, (TAG), \
3198
           (INTVAL), (STRVAL))
3199
3200
extern bool _bfd_elf_write_section_object_attributes
3201
  (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
3202
extern char *_bfd_elf_attr_strdup
3203
  (bfd *, const char *) ATTRIBUTE_HIDDEN;
3204
extern void _bfd_elf_copy_obj_attributes
3205
  (bfd *, bfd *) ATTRIBUTE_HIDDEN;
3206
extern int bfd_elf_obj_attrs_arg_type
3207
  (bfd *, obj_attr_vendor_t, obj_attr_tag_t);
3208
extern void _bfd_elf_parse_attributes
3209
  (bfd *, Elf_Internal_Shdr *) ATTRIBUTE_HIDDEN;
3210
extern void _bfd_elf_cleanup_object_attributes
3211
  (bfd *) ATTRIBUTE_HIDDEN;
3212
extern bfd *_bfd_elf_link_setup_object_attributes
3213
  (struct bfd_link_info *) ATTRIBUTE_HIDDEN;
3214
extern bool _bfd_elf_merge_object_attributes
3215
  (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
3216
extern bool _bfd_elf_merge_unknown_attribute_low
3217
  (bfd *, bfd *, int) ATTRIBUTE_HIDDEN;
3218
extern bool _bfd_elf_merge_unknown_attribute_list
3219
  (bfd *, bfd *) ATTRIBUTE_HIDDEN;
3220
extern Elf_Internal_Shdr *_bfd_elf_single_rel_hdr
3221
  (asection *sec);
3222
extern bool _bfd_elf_read_notes
3223
  (bfd *, file_ptr, bfd_size_type, size_t) ATTRIBUTE_HIDDEN;
3224
3225
extern obj_attr_v2_t *bfd_elf_obj_attr_v2_init (obj_attr_tag_t,
3226
  union obj_attr_value_v2);
3227
extern void _bfd_elf_obj_attr_v2_free (obj_attr_v2_t *, obj_attr_encoding_v2_t)
3228
  ATTRIBUTE_HIDDEN;
3229
extern obj_attr_v2_t *_bfd_elf_obj_attr_v2_copy (const obj_attr_v2_t *,
3230
  obj_attr_encoding_v2_t) ATTRIBUTE_HIDDEN;
3231
extern int _bfd_elf_obj_attr_v2_cmp (const obj_attr_v2_t *,
3232
  const obj_attr_v2_t *) ATTRIBUTE_HIDDEN;
3233
extern obj_attr_v2_t *bfd_obj_attr_v2_find_by_tag
3234
  (const obj_attr_subsection_v2_t *, obj_attr_tag_t, bool);
3235
extern void bfd_obj_attr_subsection_v2_append
3236
  (obj_attr_subsection_v2_t *, obj_attr_v2_t *);
3237
LINKED_LIST_MUTATIVE_OPS_PROTOTYPE (obj_attr_subsection_v2_t,
3238
            obj_attr_v2_t, ATTRIBUTE_HIDDEN);
3239
LINKED_LIST_MERGE_SORT_PROTOTYPE_ (obj_attr_v2_t, ATTRIBUTE_HIDDEN);
3240
LINKED_LIST_MERGE_SORT_PROTOTYPE (obj_attr_subsection_v2_t,
3241
          obj_attr_v2_t, ATTRIBUTE_HIDDEN);
3242
extern obj_attr_subsection_v2_t *bfd_elf_obj_attr_subsection_v2_init
3243
  (const char *, obj_attr_subsection_scope_v2_t, bool, obj_attr_encoding_v2_t);
3244
extern void _bfd_elf_obj_attr_subsection_v2_free (obj_attr_subsection_v2_t *)
3245
  ATTRIBUTE_HIDDEN;
3246
extern int _bfd_elf_obj_attr_subsection_v2_cmp
3247
  (const obj_attr_subsection_v2_t *, const obj_attr_subsection_v2_t *)
3248
  ATTRIBUTE_HIDDEN;
3249
extern obj_attr_subsection_v2_t *bfd_obj_attr_subsection_v2_find_by_name
3250
  (obj_attr_subsection_v2_t *, const char *, bool);
3251
extern obj_attr_subsection_scope_v2_t bfd_elf_obj_attr_subsection_v2_scope
3252
  (const bfd *, const char *);
3253
extern void bfd_obj_attr_subsection_v2_list_append
3254
  (obj_attr_subsection_list_t *, obj_attr_subsection_v2_t *);
3255
extern obj_attr_subsection_v2_t *bfd_obj_attr_subsection_v2_list_remove
3256
  (obj_attr_subsection_list_t *, obj_attr_subsection_v2_t *);
3257
LINKED_LIST_MUTATIVE_OPS_PROTOTYPE (obj_attr_subsection_list_t,
3258
            obj_attr_subsection_v2_t,
3259
            ATTRIBUTE_HIDDEN);
3260
LINKED_LIST_MERGE_SORT_PROTOTYPE_ (obj_attr_subsection_v2_t, ATTRIBUTE_HIDDEN);
3261
LINKED_LIST_MERGE_SORT_PROTOTYPE (obj_attr_subsection_list_t,
3262
          obj_attr_subsection_v2_t, ATTRIBUTE_HIDDEN);
3263
3264
extern bool _bfd_elf_parse_gnu_properties
3265
  (bfd *, Elf_Internal_Note *) ATTRIBUTE_HIDDEN;
3266
extern elf_property_list * _bfd_elf_find_property
3267
  (elf_property_list *, unsigned int, elf_property_list **) ATTRIBUTE_HIDDEN;
3268
extern elf_property * _bfd_elf_get_property
3269
  (bfd *, unsigned int, unsigned int) ATTRIBUTE_HIDDEN;
3270
extern bfd *_bfd_elf_link_setup_gnu_properties
3271
  (struct bfd_link_info *) ATTRIBUTE_HIDDEN;
3272
extern bfd_size_type _bfd_elf_convert_gnu_property_size
3273
  (bfd *, bfd *) ATTRIBUTE_HIDDEN;
3274
extern bool _bfd_elf_convert_gnu_properties
3275
  (bfd *, asection *, bfd *, bfd_byte **, bfd_size_type *) ATTRIBUTE_HIDDEN;
3276
3277
/* The linker may need to keep track of the number of relocs that it
3278
   decides to copy as dynamic relocs in check_relocs for each symbol.
3279
   This is so that it can later discard them if they are found to be
3280
   unnecessary.  We can store the information in a field extending the
3281
   regular ELF linker hash table.  */
3282
3283
struct elf_dyn_relocs
3284
{
3285
  struct elf_dyn_relocs *next;
3286
3287
  /* The input section of the reloc.  */
3288
  asection *sec;
3289
3290
  /* Total number of relocs copied for the input section.  */
3291
  bfd_size_type count;
3292
3293
  /* Number of pc-relative relocs copied for the input section.  */
3294
  bfd_size_type pc_count;
3295
};
3296
3297
extern bool _bfd_elf_create_ifunc_sections
3298
  (bfd *, struct bfd_link_info *) ATTRIBUTE_HIDDEN;
3299
extern bool _bfd_elf_allocate_ifunc_dyn_relocs
3300
  (struct bfd_link_info *, struct elf_link_hash_entry *,
3301
   struct elf_dyn_relocs **, unsigned int, unsigned int,
3302
   unsigned int, bool) ATTRIBUTE_HIDDEN;
3303
3304
extern void _bfd_elf_append_rela
3305
  (bfd *, asection *, Elf_Internal_Rela *) ATTRIBUTE_HIDDEN;
3306
extern void _bfd_elf_append_rel
3307
  (bfd *, asection *, Elf_Internal_Rela *) ATTRIBUTE_HIDDEN;
3308
3309
extern bfd_vma elf64_r_info (bfd_vma, bfd_vma);
3310
extern bfd_vma elf64_r_sym (bfd_vma);
3311
extern bfd_vma elf32_r_info (bfd_vma, bfd_vma);
3312
extern bfd_vma elf32_r_sym (bfd_vma);
3313
3314
extern bool is_debuginfo_file (bfd *);
3315
3316
3317
extern bool _bfd_elf_init_secondary_reloc_section
3318
  (bfd *, Elf_Internal_Shdr *, const char *, unsigned int) ATTRIBUTE_HIDDEN;
3319
extern bool _bfd_elf_slurp_secondary_reloc_section
3320
  (bfd *, asection *, asymbol **, bool) ATTRIBUTE_HIDDEN;
3321
extern bool _bfd_elf_copy_special_section_fields
3322
  (const bfd *, bfd *, const Elf_Internal_Shdr *, Elf_Internal_Shdr *)
3323
  ATTRIBUTE_HIDDEN;
3324
extern bool _bfd_elf_write_secondary_reloc_section
3325
  (bfd *, asection *) ATTRIBUTE_HIDDEN;
3326
extern unsigned int _bfd_elf_symbol_section_index
3327
  (bfd *, elf_symbol_type *) ATTRIBUTE_HIDDEN;
3328
3329
extern asection *_bfd_elf_readonly_dynrelocs
3330
  (struct elf_link_hash_entry *) ATTRIBUTE_HIDDEN;
3331
extern bool _bfd_elf_maybe_set_textrel
3332
  (struct elf_link_hash_entry *, void *) ATTRIBUTE_HIDDEN;
3333
3334
extern bool _bfd_elf_add_dynamic_tags
3335
  (bfd *, struct bfd_link_info *, bool) ATTRIBUTE_HIDDEN;
3336
3337
extern bool _bfd_elf_mmap_section_contents
3338
  (bfd *abfd, asection *section, bfd_byte **buf) ATTRIBUTE_HIDDEN;
3339
extern void _bfd_elf_munmap_section_contents
3340
  (asection *, void *) ATTRIBUTE_HIDDEN;
3341
extern bool _bfd_elf_link_mmap_section_contents
3342
  (bfd *abfd, asection *section, bfd_byte **buf) ATTRIBUTE_HIDDEN;
3343
extern void _bfd_elf_link_munmap_section_contents
3344
  (asection *) ATTRIBUTE_HIDDEN;
3345
3346
extern struct elf_link_hash_entry * _bfd_elf_get_link_hash_entry
3347
  (struct elf_link_hash_entry **, unsigned int, unsigned int, unsigned int)
3348
  ATTRIBUTE_HIDDEN;
3349
extern asection *_bfd_get_local_sym_section
3350
  (struct elf_reloc_cookie *, unsigned int) ATTRIBUTE_HIDDEN;
3351
3352
/* Large common section (x86 only).  */
3353
extern asection bfd_elf_large_com_section;
3354
3355
/* Hash for local symbol with the first section id, ID, in the input
3356
   file and the local symbol index, SYM.  */
3357
#define ELF_LOCAL_SYMBOL_HASH(ID, SYM) \
3358
0
  (((((ID) & 0xffU) << 24) | (((ID) & 0xff00) << 8)) \
3359
0
   ^ (SYM) ^ (((ID) & 0xffff0000U) >> 16))
3360
3361
/* This is the condition under which finish_dynamic_symbol will be called.
3362
   If our finish_dynamic_symbol isn't called, we'll need to do something
3363
   about initializing any .plt and .got entries in relocate_section.  */
3364
#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
3365
0
  ((DYN)                \
3366
0
   && ((SHARED) || !(H)->forced_local)         \
3367
0
   && ((H)->dynindx != -1 || (H)->forced_local))
3368
3369
/* This macro is to avoid lots of duplicated code in the body
3370
   of xxx_relocate_section() in the various elfxx-xxxx.c files.  */
3371
#define RELOC_FOR_GLOBAL_SYMBOL(info, input_bfd, input_section, rel,  \
3372
        r_symndx, symtab_hdr, sym_hashes, \
3373
        h, sec, relocation,     \
3374
        unresolved_reloc, warned, ignored)  \
3375
0
  do                  \
3376
0
    {                 \
3377
0
      /* It seems this can happen with erroneous or unsupported   \
3378
0
   input (mixing a.out and elf in an archive, for example.)  */ \
3379
0
      if (sym_hashes == NULL)           \
3380
0
  return false;             \
3381
0
                  \
3382
0
      h = sym_hashes[r_symndx - symtab_hdr->sh_info];     \
3383
0
                  \
3384
0
      if (info->wrap_hash != NULL          \
3385
0
    && (input_section->flags & SEC_DEBUGGING) != 0)   \
3386
0
  {               \
3387
0
    struct bfd_link_hash_entry * new_h;       \
3388
0
    new_h = unwrap_hash_lookup (info, input_bfd, &h->root); \
3389
0
    /* PR 31710: This lookup can fail if the input source has a \
3390
0
       symbol that starts with __wrap_.  */     \
3391
0
    if (new_h != NULL)           \
3392
0
      h = (struct elf_link_hash_entry *) new_h;     \
3393
0
  }               \
3394
0
                  \
3395
0
      while (h->root.type == bfd_link_hash_indirect      \
3396
0
       || h->root.type == bfd_link_hash_warning)     \
3397
0
  h = (struct elf_link_hash_entry *) h->root.u.i.link;   \
3398
0
                  \
3399
0
      warned = false;             \
3400
0
      ignored = false;              \
3401
0
      unresolved_reloc = false;           \
3402
0
      relocation = 0;             \
3403
0
      if (h->root.type == bfd_link_hash_defined        \
3404
0
    || h->root.type == bfd_link_hash_defweak)     \
3405
0
  {               \
3406
0
    sec = h->root.u.def.section;          \
3407
0
    if (sec == NULL            \
3408
0
        || sec->output_section == NULL)       \
3409
0
      /* Set a flag that will be cleared later if we find a \
3410
0
         relocation value for this symbol.  output_section  \
3411
0
         is typically NULL for symbols satisfied by a shared  \
3412
0
         library.  */           \
3413
0
      unresolved_reloc = true;         \
3414
0
    else                \
3415
0
      relocation = (h->root.u.def.value       \
3416
0
        + sec->output_section->vma      \
3417
0
        + sec->output_offset);     \
3418
0
  }               \
3419
0
      else if (h->root.type == bfd_link_hash_undefweak)     \
3420
0
  ;                \
3421
0
      else if (info->unresolved_syms_in_objects == RM_IGNORE    \
3422
0
         && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)   \
3423
0
  ignored = true;             \
3424
0
      else if (!bfd_link_relocatable (info))        \
3425
0
  {               \
3426
0
    bool err = ((info->unresolved_syms_in_objects == RM_DIAGNOSE  \
3427
0
           && !info->warn_unresolved_syms)     \
3428
0
          || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT);  \
3429
0
    (*info->callbacks->undefined_symbol) (info,     \
3430
0
            h->root.root.string,  \
3431
0
            input_bfd,    \
3432
0
            input_section,    \
3433
0
            rel->r_offset, err);  \
3434
0
    warned = true;            \
3435
0
  }               \
3436
0
      (void) unresolved_reloc;            \
3437
0
      (void) warned;              \
3438
0
      (void) ignored;             \
3439
0
    }                 \
3440
0
  while (0)
3441
3442
/* This macro is to avoid lots of duplicated code in the body of the
3443
   loop over relocations in xxx_relocate_section() in the various
3444
   elfxx-xxxx.c files.
3445
3446
   Handle relocations against symbols from removed linkonce sections,
3447
   or sections discarded by a linker script.  When doing a relocatable
3448
   link, we remove such relocations.  Otherwise, we just want the
3449
   section contents zeroed and avoid any special processing.  */
3450
#define RELOC_AGAINST_DISCARDED_SECTION(info, input_bfd, input_section, \
3451
          rel, count, relend, rnone,  \
3452
          howto, index, contents)   \
3453
0
  {                 \
3454
0
    _bfd_clear_contents (howto, input_bfd, input_section,   \
3455
0
       contents, rel[index].r_offset);    \
3456
0
                  \
3457
0
    /* For ld -r, remove relocations in debug and sframe sections \
3458
0
       against symbols defined in discarded sections.  Not done for \
3459
0
       others.  In particular the .eh_frame editing code expects  \
3460
0
       such relocs to be present.  */         \
3461
0
    if (bfd_link_relocatable (info)         \
3462
0
  && ((input_section->flags & SEC_DEBUGGING) != 0      \
3463
0
      || elf_section_type (input_section) == SHT_GNU_SFRAME))  \
3464
0
      {                 \
3465
0
  Elf_Internal_Shdr *rel_hdr          \
3466
0
    = _bfd_elf_single_rel_hdr (input_section->output_section);  \
3467
0
                  \
3468
0
  rel_hdr->sh_size -= rel_hdr->sh_entsize;      \
3469
0
  rel_hdr = _bfd_elf_single_rel_hdr (input_section);    \
3470
0
  rel_hdr->sh_size -= rel_hdr->sh_entsize;      \
3471
0
                  \
3472
0
  memmove (rel, rel + count,          \
3473
0
     (relend - rel - count) * sizeof (*rel));   \
3474
0
                  \
3475
0
  input_section->reloc_count -= count;        \
3476
0
  relend -= count;            \
3477
0
  rel--;                \
3478
0
  continue;             \
3479
0
      }                  \
3480
0
                  \
3481
0
    for (int i_ = 0; i_ < count; i_++)         \
3482
0
      {                 \
3483
0
  rel[i_].r_info = rnone;           \
3484
0
  rel[i_].r_addend = 0;           \
3485
0
      }                  \
3486
0
    rel += count - 1;             \
3487
0
    continue;               \
3488
0
  }
3489
3490
/* Will a symbol be bound to the definition within the shared
3491
   library, if any.  A unique symbol can never be bound locally.  */
3492
#define SYMBOLIC_BIND(INFO, H) \
3493
0
    (!(H)->unique_global \
3494
0
     && ((INFO)->symbolic \
3495
0
   || (H)->start_stop \
3496
0
   || ((INFO)->dynamic && !(H)->dynamic)))
3497
3498
/* Determine if a section contains CTF data, using its name.  */
3499
static inline bool
3500
bfd_section_is_ctf (const asection *sec)
3501
0
{
3502
0
  const char *name = bfd_section_name (sec);
3503
0
  return startswith (name, ".ctf") && (name[4] == 0 || name[4] == '.');
3504
0
}
Unexecuted instantiation: fuzz_nm.c:bfd_section_is_ctf
Unexecuted instantiation: bfd.c:bfd_section_is_ctf
Unexecuted instantiation: format.c:bfd_section_is_ctf
Unexecuted instantiation: libbfd.c:bfd_section_is_ctf
Unexecuted instantiation: opncls.c:bfd_section_is_ctf
Unexecuted instantiation: elf64-x86-64.c:bfd_section_is_ctf
Unexecuted instantiation: elfxx-x86.c:bfd_section_is_ctf
Unexecuted instantiation: elf-ifunc.c:bfd_section_is_ctf
Unexecuted instantiation: elf-solaris2.c:bfd_section_is_ctf
Unexecuted instantiation: elf-vxworks.c:bfd_section_is_ctf
Unexecuted instantiation: elf64.c:bfd_section_is_ctf
Unexecuted instantiation: elf.c:bfd_section_is_ctf
Unexecuted instantiation: elflink.c:bfd_section_is_ctf
Unexecuted instantiation: elf-attrs.c:bfd_section_is_ctf
Unexecuted instantiation: elf-strtab.c:bfd_section_is_ctf
Unexecuted instantiation: elf-eh-frame.c:bfd_section_is_ctf
Unexecuted instantiation: elf-properties.c:bfd_section_is_ctf
Unexecuted instantiation: elf-sframe.c:bfd_section_is_ctf
Unexecuted instantiation: dwarf1.c:bfd_section_is_ctf
Unexecuted instantiation: dwarf2.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-i386.c:bfd_section_is_ctf
Unexecuted instantiation: elf32.c:bfd_section_is_ctf
Unexecuted instantiation: cofflink.c:bfd_section_is_ctf
Unexecuted instantiation: coffgen.c:bfd_section_is_ctf
Unexecuted instantiation: elf64-gen.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-gen.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-aarch64.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-ia64.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-kvx.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-loongarch.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-mips.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-riscv.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-score.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-score7.c:bfd_section_is_ctf
Unexecuted instantiation: elf64-aarch64.c:bfd_section_is_ctf
Unexecuted instantiation: elf64-alpha.c:bfd_section_is_ctf
Unexecuted instantiation: elf64-amdgcn.c:bfd_section_is_ctf
Unexecuted instantiation: elf64-bpf.c:bfd_section_is_ctf
Unexecuted instantiation: elf64-hppa.c:bfd_section_is_ctf
Unexecuted instantiation: elf64-ia64-vms.c:bfd_section_is_ctf
Unexecuted instantiation: elf64-ia64.c:bfd_section_is_ctf
Unexecuted instantiation: elf64-kvx.c:bfd_section_is_ctf
Unexecuted instantiation: elf64-loongarch.c:bfd_section_is_ctf
Unexecuted instantiation: elf64-mips.c:bfd_section_is_ctf
Unexecuted instantiation: elf64-mmix.c:bfd_section_is_ctf
Unexecuted instantiation: elf64-nfp.c:bfd_section_is_ctf
Unexecuted instantiation: elf64-ppc.c:bfd_section_is_ctf
Unexecuted instantiation: elf64-riscv.c:bfd_section_is_ctf
Unexecuted instantiation: elf64-s390.c:bfd_section_is_ctf
Unexecuted instantiation: elf64-sparc.c:bfd_section_is_ctf
Unexecuted instantiation: elf64-tilegx.c:bfd_section_is_ctf
Unexecuted instantiation: elfn32-mips.c:bfd_section_is_ctf
Unexecuted instantiation: elfxx-aarch64.c:bfd_section_is_ctf
Unexecuted instantiation: elfxx-ia64.c:bfd_section_is_ctf
Unexecuted instantiation: elfxx-kvx.c:bfd_section_is_ctf
Unexecuted instantiation: elfxx-loongarch.c:bfd_section_is_ctf
Unexecuted instantiation: elfxx-mips.c:bfd_section_is_ctf
Unexecuted instantiation: elfxx-riscv.c:bfd_section_is_ctf
Unexecuted instantiation: elf-m10200.c:bfd_section_is_ctf
Unexecuted instantiation: elf-m10300.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-am33lin.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-arc.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-arm.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-avr.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-bfin.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-cr16.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-cris.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-crx.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-csky.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-d10v.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-d30v.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-dlx.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-epiphany.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-fr30.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-frv.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-ft32.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-h8300.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-hppa.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-ip2k.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-iq2000.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-lm32.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-m32c.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-m32r.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-m68hc11.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-m68hc12.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-m68hc1x.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-m68k.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-mcore.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-mep.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-metag.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-microblaze.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-moxie.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-msp430.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-mt.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-nds32.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-or1k.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-pj.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-ppc.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-pru.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-rl78.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-rx.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-s12z.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-s390.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-sh.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-sparc.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-spu.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-tic6x.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-tilegx.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-tilepro.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-v850.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-vax.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-visium.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-wasm32.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-xgate.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-xstormy16.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-xtensa.c:bfd_section_is_ctf
Unexecuted instantiation: elf32-z80.c:bfd_section_is_ctf
Unexecuted instantiation: elfxx-sparc.c:bfd_section_is_ctf
Unexecuted instantiation: elfxx-tilegx.c:bfd_section_is_ctf
Unexecuted instantiation: cpu-nds32.c:bfd_section_is_ctf
Unexecuted instantiation: compress.c:bfd_section_is_ctf
Unexecuted instantiation: merge.c:bfd_section_is_ctf
Unexecuted instantiation: fuzz_objdump.c:bfd_section_is_ctf
Unexecuted instantiation: arc-dis.c:bfd_section_is_ctf
Unexecuted instantiation: arm-dis.c:bfd_section_is_ctf
Unexecuted instantiation: csky-dis.c:bfd_section_is_ctf
Unexecuted instantiation: kvx-dis.c:bfd_section_is_ctf
Unexecuted instantiation: m32c-dis.c:bfd_section_is_ctf
Unexecuted instantiation: mep-dis.c:bfd_section_is_ctf
Unexecuted instantiation: ppc-dis.c:bfd_section_is_ctf
Unexecuted instantiation: pru-dis.c:bfd_section_is_ctf
Unexecuted instantiation: rl78-dis.c:bfd_section_is_ctf
Unexecuted instantiation: score-dis.c:bfd_section_is_ctf
Unexecuted instantiation: score7-dis.c:bfd_section_is_ctf
Unexecuted instantiation: tilepro-dis.c:bfd_section_is_ctf
Unexecuted instantiation: wasm32-dis.c:bfd_section_is_ctf
Unexecuted instantiation: aarch64-dis.c:bfd_section_is_ctf
Unexecuted instantiation: bpf-dis.c:bfd_section_is_ctf
Unexecuted instantiation: mips-dis.c:bfd_section_is_ctf
Unexecuted instantiation: nfp-dis.c:bfd_section_is_ctf
Unexecuted instantiation: riscv-dis.c:bfd_section_is_ctf
Unexecuted instantiation: tilegx-dis.c:bfd_section_is_ctf
Unexecuted instantiation: ctf-serialize.c:bfd_section_is_ctf
Unexecuted instantiation: ctf-open-bfd.c:bfd_section_is_ctf
Unexecuted instantiation: fuzz_addr2line.c:bfd_section_is_ctf
Unexecuted instantiation: fuzz_as.c:bfd_section_is_ctf
Unexecuted instantiation: codeview.c:bfd_section_is_ctf
Unexecuted instantiation: cond.c:bfd_section_is_ctf
Unexecuted instantiation: depend.c:bfd_section_is_ctf
Unexecuted instantiation: dw2gencfi.c:bfd_section_is_ctf
Unexecuted instantiation: dwarf2dbg.c:bfd_section_is_ctf
Unexecuted instantiation: ehopt.c:bfd_section_is_ctf
Unexecuted instantiation: expr.c:bfd_section_is_ctf
Unexecuted instantiation: frags.c:bfd_section_is_ctf
Unexecuted instantiation: gen-sframe.c:bfd_section_is_ctf
Unexecuted instantiation: input-scrub.c:bfd_section_is_ctf
Unexecuted instantiation: listing.c:bfd_section_is_ctf
Unexecuted instantiation: macro.c:bfd_section_is_ctf
Unexecuted instantiation: messages.c:bfd_section_is_ctf
Unexecuted instantiation: output-file.c:bfd_section_is_ctf
Unexecuted instantiation: read.c:bfd_section_is_ctf
Unexecuted instantiation: remap.c:bfd_section_is_ctf
Unexecuted instantiation: sb.c:bfd_section_is_ctf
Unexecuted instantiation: scfidw2gen.c:bfd_section_is_ctf
Unexecuted instantiation: stabs.c:bfd_section_is_ctf
Unexecuted instantiation: subsegs.c:bfd_section_is_ctf
Unexecuted instantiation: symbols.c:bfd_section_is_ctf
Unexecuted instantiation: write.c:bfd_section_is_ctf
Unexecuted instantiation: app.c:bfd_section_is_ctf
Unexecuted instantiation: atof-generic.c:bfd_section_is_ctf
Unexecuted instantiation: ecoff.c:bfd_section_is_ctf
Unexecuted instantiation: flonum-copy.c:bfd_section_is_ctf
Unexecuted instantiation: ginsn.c:bfd_section_is_ctf
Unexecuted instantiation: hash.c:bfd_section_is_ctf
Unexecuted instantiation: input-file.c:bfd_section_is_ctf
Unexecuted instantiation: scfi.c:bfd_section_is_ctf
Unexecuted instantiation: sframe-opt.c:bfd_section_is_ctf
Unexecuted instantiation: tc-i386.c:bfd_section_is_ctf
Unexecuted instantiation: obj-elf.c:bfd_section_is_ctf
Unexecuted instantiation: atof-ieee.c:bfd_section_is_ctf
Unexecuted instantiation: fuzz_dwarf.c:bfd_section_is_ctf
Unexecuted instantiation: fuzz_objcopy.c:bfd_section_is_ctf
3505
3506
#ifdef __cplusplus
3507
}
3508
#endif
3509
#endif /* _LIBELF_H_ */