Subversion Repositories Kolibri OS

Rev

Rev 5197 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5197 Rev 6324
Line 1... Line 1...
1
/* BFD back-end data structures for ELF files.
1
/* BFD back-end data structures for ELF files.
2
   Copyright 1992-2013 Free Software Foundation, Inc.
2
   Copyright (C) 1992-2015 Free Software Foundation, Inc.
3
   Written by Cygnus Support.
3
   Written by Cygnus Support.
Line 4... Line 4...
4
 
4
 
Line 5... Line 5...
5
   This file is part of BFD, the Binary File Descriptor library.
5
   This file is part of BFD, the Binary File Descriptor library.
Line 25... Line 25...
25
#include "elf/common.h"
25
#include "elf/common.h"
26
#include "elf/external.h"
26
#include "elf/external.h"
27
#include "elf/internal.h"
27
#include "elf/internal.h"
28
#include "bfdlink.h"
28
#include "bfdlink.h"
Line -... Line 29...
-
 
29
 
-
 
30
#ifdef __cplusplus
-
 
31
extern "C" {
-
 
32
#endif
29
 
33
 
30
/* The number of entries in a section is its size divided by the size
34
/* The number of entries in a section is its size divided by the size
31
   of a single entry.  This is normally only applicable to reloc and
35
   of a single entry.  This is normally only applicable to reloc and
32
   symbol table sections.
36
   symbol table sections.
33
   PR 9934: It is possible to have relocations that do not refer to
37
   PR 9934: It is possible to have relocations that do not refer to
Line 102... Line 106...
102
 
106
 
103
    /* Virtual table derivation info.  */
107
    /* Virtual table derivation info.  */
104
    struct elf_link_hash_entry *parent;
108
    struct elf_link_hash_entry *parent;
Line -... Line 109...
-
 
109
  };
-
 
110
 
-
 
111
/* ELF symbol version.  */
-
 
112
enum elf_symbol_version
-
 
113
  {
-
 
114
    unknown = 0,
-
 
115
    unversioned,
-
 
116
    versioned,
-
 
117
    versioned_hidden
105
  };
118
  };
Line 106... Line 119...
106
 
119
 
107
/* ELF linker hash table entries.  */
120
/* ELF linker hash table entries.  */
108
 
121
 
Line 172... Line 185...
172
  unsigned int needs_copy : 1;
185
  unsigned int needs_copy : 1;
173
  /* Symbol needs a procedure linkage table entry.  */
186
  /* Symbol needs a procedure linkage table entry.  */
174
  unsigned int needs_plt : 1;
187
  unsigned int needs_plt : 1;
175
  /* Symbol appears in a non-ELF input file.  */
188
  /* Symbol appears in a non-ELF input file.  */
176
  unsigned int non_elf : 1;
189
  unsigned int non_elf : 1;
177
  /* Symbol should be marked as hidden in the version information.  */
190
  /* Symbol version information.  */
178
  unsigned int hidden : 1;
191
  ENUM_BITFIELD (elf_symbol_version) versioned : 2;
179
  /* Symbol was forced to local scope due to a version script file.  */
192
  /* Symbol was forced to local scope due to a version script file.  */
180
  unsigned int forced_local : 1;
193
  unsigned int forced_local : 1;
181
  /* Symbol was forced to be dynamic due to a version script file.  */
194
  /* Symbol was forced to be dynamic due to a version script file.  */
182
  unsigned int dynamic : 1;
195
  unsigned int dynamic : 1;
183
  /* Symbol was marked during garbage collection.  */
196
  /* Symbol was marked during garbage collection.  */
Line 194... Line 207...
194
  /* Symbol is referenced with a relocation where C/C++ pointer equality
207
  /* Symbol is referenced with a relocation where C/C++ pointer equality
195
     matters.  */
208
     matters.  */
196
  unsigned int pointer_equality_needed : 1;
209
  unsigned int pointer_equality_needed : 1;
197
  /* Symbol is a unique global symbol.  */
210
  /* Symbol is a unique global symbol.  */
198
  unsigned int unique_global : 1;
211
  unsigned int unique_global : 1;
-
 
212
  /* Symbol is defined by a shared library with non-default visibility
-
 
213
     in a read/write section.  */
-
 
214
  unsigned int protected_def : 1;
Line 199... Line 215...
199
 
215
 
200
  /* String table index in .dynstr if this is a dynamic symbol.  */
216
  /* String table index in .dynstr if this is a dynamic symbol.  */
Line 201... Line 217...
201
  unsigned long dynstr_index;
217
  unsigned long dynstr_index;
Line 237... Line 253...
237
/* Will _calls_ to this symbol always call the version in this object?  */
253
/* Will _calls_ to this symbol always call the version in this object?  */
238
#define SYMBOL_CALLS_LOCAL(INFO, H) \
254
#define SYMBOL_CALLS_LOCAL(INFO, H) \
239
  _bfd_elf_symbol_refs_local_p (H, INFO, 1)
255
  _bfd_elf_symbol_refs_local_p (H, INFO, 1)
Line 240... Line 256...
240
 
256
 
241
/* Common symbols that are turned into definitions don't have the
257
/* Common symbols that are turned into definitions don't have the
-
 
258
   DEF_REGULAR flag set, so they might appear to be undefined.
242
   DEF_REGULAR flag set, so they might appear to be undefined.  */
259
   Symbols defined in linker scripts also don't have DEF_REGULAR set.  */
243
#define ELF_COMMON_DEF_P(H) \
260
#define ELF_COMMON_DEF_P(H) \
244
  (!(H)->def_regular							\
261
  (!(H)->def_regular							\
245
   && !(H)->def_dynamic							\
262
   && !(H)->def_dynamic							\
Line 278... Line 295...
278
      /* If REMOVED == 1, this is the CIE that the FDE originally used.
295
      /* If REMOVED == 1, this is the CIE that the FDE originally used.
279
	 The CIE belongs to the same .eh_frame input section as the FDE.
296
	 The CIE belongs to the same .eh_frame input section as the FDE.
Line 280... Line 297...
280
 
297
 
281
	 If REMOVED == 0, this is the CIE that we have chosen to use for
298
	 If REMOVED == 0, this is the CIE that we have chosen to use for
282
	 the output FDE.  The CIE's REMOVED field is also 0, but the CIE
299
	 the output FDE.  The CIE's REMOVED field is also 0, but the CIE
-
 
300
	 might belong to a different .eh_frame input section from the FDE.
-
 
301
 
283
	 might belong to a different .eh_frame input section from the FDE.  */
302
	 May be NULL to signify that the FDE should be discarded.  */
284
      struct eh_cie_fde *cie_inf;
303
      struct eh_cie_fde *cie_inf;
285
      struct eh_cie_fde *next_for_section;
304
      struct eh_cie_fde *next_for_section;
286
    } fde;
305
    } fde;
287
    struct {
306
    struct {
Line 370... Line 389...
370
};
389
};
Line 371... Line 390...
371
 
390
 
372
struct eh_frame_array_ent
391
struct eh_frame_array_ent
373
{
392
{
-
 
393
  bfd_vma initial_loc;
374
  bfd_vma initial_loc;
394
  bfd_size_type range;
375
  bfd_vma fde;
395
  bfd_vma fde;
Line 376... Line 396...
376
};
396
};
Line -... Line 397...
-
 
397
 
-
 
398
struct htab;
-
 
399
 
-
 
400
#define DWARF2_EH_HDR 1
-
 
401
#define COMPACT_EH_HDR 2
-
 
402
 
377
 
403
/* Endian-neutral code indicating that a function cannot be unwound.  */
378
struct htab;
404
#define COMPACT_EH_CANT_UNWIND_OPCODE 0x015d5d01
379
 
405
 
380
struct eh_frame_hdr_info
-
 
381
{
406
struct dwarf_eh_frame_hdr_info
382
  struct htab *cies;
-
 
383
  asection *hdr_sec;
-
 
384
  unsigned int fde_count, array_count;
-
 
385
  struct eh_frame_array_ent *array;
-
 
386
  /* TRUE if we should try to merge CIEs between input sections.  */
-
 
387
  bfd_boolean merge_cies;
407
{
388
  /* TRUE if all .eh_frames have been parsd.  */
408
  struct htab *cies;
389
  bfd_boolean parsed_eh_frames;
409
  unsigned int fde_count;
390
  /* TRUE if .eh_frame_hdr should contain the sorted search table.
410
  /* TRUE if .eh_frame_hdr should contain the sorted search table.
-
 
411
     We build it if we successfully read all .eh_frame input sections
-
 
412
     and recognize them.  */
-
 
413
  bfd_boolean table;
-
 
414
  struct eh_frame_array_ent *array;
-
 
415
};
-
 
416
 
-
 
417
struct compact_eh_frame_hdr_info
-
 
418
{
-
 
419
  unsigned int allocated_entries;
-
 
420
  /* eh_frame_entry fragments.  */
-
 
421
  asection **entries;
-
 
422
};
-
 
423
 
-
 
424
struct eh_frame_hdr_info
-
 
425
{
-
 
426
  asection *hdr_sec;
-
 
427
  unsigned int array_count;
-
 
428
  bfd_boolean frame_hdr_is_compact;
-
 
429
  union
-
 
430
    {
-
 
431
      struct dwarf_eh_frame_hdr_info dwarf;
391
     We build it if we successfully read all .eh_frame input sections
432
      struct compact_eh_frame_hdr_info compact;
Line 392... Line 433...
392
     and recognize them.  */
433
    }
393
  bfd_boolean table;
434
  u;
394
};
435
};
Line 417... Line 458...
417
  M68K_ELF_DATA,
458
  M68K_ELF_DATA,
418
  METAG_ELF_DATA,
459
  METAG_ELF_DATA,
419
  MICROBLAZE_ELF_DATA,
460
  MICROBLAZE_ELF_DATA,
420
  MIPS_ELF_DATA,
461
  MIPS_ELF_DATA,
421
  MN10300_ELF_DATA,
462
  MN10300_ELF_DATA,
-
 
463
  NDS32_ELF_DATA,
422
  NIOS2_ELF_DATA,
464
  NIOS2_ELF_DATA,
-
 
465
  OR1K_ELF_DATA,
423
  PPC32_ELF_DATA,
466
  PPC32_ELF_DATA,
424
  PPC64_ELF_DATA,
467
  PPC64_ELF_DATA,
425
  S390_ELF_DATA,
468
  S390_ELF_DATA,
426
  SH_ELF_DATA,
469
  SH_ELF_DATA,
427
  SPARC_ELF_DATA,
470
  SPARC_ELF_DATA,
Line 433... Line 476...
433
  TILEGX_ELF_DATA,
476
  TILEGX_ELF_DATA,
434
  TILEPRO_ELF_DATA,
477
  TILEPRO_ELF_DATA,
435
  GENERIC_ELF_DATA
478
  GENERIC_ELF_DATA
436
};
479
};
Line -... Line 480...
-
 
480
 
-
 
481
struct elf_sym_strtab
-
 
482
{
-
 
483
  Elf_Internal_Sym sym;
-
 
484
  unsigned long dest_index;
-
 
485
  unsigned long destshndx_index;
-
 
486
};
437
 
487
 
Line 438... Line 488...
438
/* ELF linker hash table.  */
488
/* ELF linker hash table.  */
439
 
489
 
440
struct elf_link_hash_table
490
struct elf_link_hash_table
Line 476... Line 526...
476
 
526
 
477
  /* The string table of dynamic symbols, which becomes the .dynstr
527
  /* The string table of dynamic symbols, which becomes the .dynstr
478
     section.  */
528
     section.  */
Line -... Line 529...
-
 
529
  struct elf_strtab_hash *dynstr;
-
 
530
 
-
 
531
  /* The number of symbol strings found in the link which must be put
-
 
532
     into the .strtab section.  */
-
 
533
  bfd_size_type strtabcount;
-
 
534
 
-
 
535
  /* The array size of the symbol string table, which becomes the
-
 
536
     .strtab section.  */
-
 
537
  bfd_size_type strtabsize;
-
 
538
 
-
 
539
  /* The array of strings, which becomes the .strtab section.  */
479
  struct elf_strtab_hash *dynstr;
540
  struct elf_sym_strtab *strtab;
480
 
541
 
481
  /* The number of buckets in the hash table in the .hash section.
542
  /* The number of buckets in the hash table in the .hash section.
Line 482... Line 543...
482
     This is based on the number of dynamic symbols.  */
543
     This is based on the number of dynamic symbols.  */
Line 532... Line 593...
532
  asection *srelplt;
593
  asection *srelplt;
533
  asection *igotplt;
594
  asection *igotplt;
534
  asection *iplt;
595
  asection *iplt;
535
  asection *irelplt;
596
  asection *irelplt;
536
  asection *irelifunc;
597
  asection *irelifunc;
-
 
598
  asection *dynsym;
537
};
599
};
Line 538... Line 600...
538
 
600
 
Line 539... Line 601...
539
/* Look up an entry in an ELF linker hash table.  */
601
/* Look up an entry in an ELF linker hash table.  */
Line 1106... Line 1168...
1106
  /* Count relocations.  Not called for relocatable links
1168
  /* Count relocations.  Not called for relocatable links
1107
     or if all relocs are being preserved in the output.  */
1169
     or if all relocs are being preserved in the output.  */
1108
  unsigned int (*elf_backend_count_relocs)
1170
  unsigned int (*elf_backend_count_relocs)
1109
    (struct bfd_link_info *, asection *);
1171
    (struct bfd_link_info *, asection *);
Line -... Line 1172...
-
 
1172
 
-
 
1173
  /* Say whether to sort relocs output by ld -r and ld --emit-relocs,
-
 
1174
     by r_offset.  If NULL, default to true.  */
-
 
1175
  bfd_boolean (*sort_relocs_p)
-
 
1176
    (asection *);
1110
 
1177
 
1111
  /* This function, if defined, is called when an NT_PRSTATUS note is found
1178
  /* This function, if defined, is called when an NT_PRSTATUS note is found
1112
     in a core file.  */
1179
     in a core file.  */
1113
  bfd_boolean (*elf_backend_grok_prstatus)
1180
  bfd_boolean (*elf_backend_grok_prstatus)
Line 1188... Line 1255...
1188
  const struct ecoff_debug_swap *elf_backend_ecoff_debug_swap;
1255
  const struct ecoff_debug_swap *elf_backend_ecoff_debug_swap;
Line 1189... Line 1256...
1189
 
1256
 
1190
  /* This function implements `bfd_elf_bfd_from_remote_memory';
1257
  /* This function implements `bfd_elf_bfd_from_remote_memory';
1191
     see elf.c, elfcode.h.  */
1258
     see elf.c, elfcode.h.  */
1192
  bfd *(*elf_backend_bfd_from_remote_memory)
1259
  bfd *(*elf_backend_bfd_from_remote_memory)
1193
     (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
1260
    (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
1194
      int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
1261
      int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
Line 1195... Line 1262...
1195
				 bfd_size_type len));
1262
				 bfd_size_type len));
1196
 
1263
 
Line 1223... Line 1290...
1223
     function size and set *CODE_OFF to the function's entry point,
1290
     function size and set *CODE_OFF to the function's entry point,
1224
     otherwise return zero.  */
1291
     otherwise return zero.  */
1225
  bfd_size_type (*maybe_function_sym) (const asymbol *sym, asection *sec,
1292
  bfd_size_type (*maybe_function_sym) (const asymbol *sym, asection *sec,
1226
				       bfd_vma *code_off);
1293
				       bfd_vma *code_off);
Line -... Line 1294...
-
 
1294
 
-
 
1295
  /* Return the section which RELOC_SEC applies to.  */
-
 
1296
  asection *(*get_reloc_section) (asection *reloc_sec);
1227
 
1297
 
1228
  /* Used to handle bad SHF_LINK_ORDER input.  */
1298
  /* Used to handle bad SHF_LINK_ORDER input.  */
Line 1229... Line 1299...
1229
  bfd_error_handler_type link_order_error_handler;
1299
  bfd_error_handler_type link_order_error_handler;
1230
 
1300
 
Line 1272... Line 1342...
1272
 
1342
 
1273
  /* Handle merging unknown attributes; either warn and return TRUE,
1343
  /* Handle merging unknown attributes; either warn and return TRUE,
1274
     or give an error and return FALSE.  */
1344
     or give an error and return FALSE.  */
Line -... Line 1345...
-
 
1345
  bfd_boolean (*obj_attrs_handle_unknown) (bfd *, int);
-
 
1346
 
-
 
1347
  /* Encoding used for compact EH tables.  */
-
 
1348
  int (*compact_eh_encoding) (struct bfd_link_info *);
-
 
1349
 
-
 
1350
  /* Opcode representing no unwind.  */
1275
  bfd_boolean (*obj_attrs_handle_unknown) (bfd *, int);
1351
  int (*cant_unwind_opcode) (struct bfd_link_info *);
1276
 
1352
 
Line 1277... Line 1353...
1277
  /* This is non-zero if static TLS segments require a special alignment.  */
1353
  /* This is non-zero if static TLS segments require a special alignment.  */
1278
  unsigned static_tls_alignment;
1354
  unsigned static_tls_alignment;
Line 1339... Line 1415...
1339
  /* True if an object file lacking a .note.GNU-stack section
1415
  /* True if an object file lacking a .note.GNU-stack section
1340
     should be assumed to be requesting exec stack.  At least one
1416
     should be assumed to be requesting exec stack.  At least one
1341
     other file in the link needs to have a .note.GNU-stack section
1417
     other file in the link needs to have a .note.GNU-stack section
1342
     for a PT_GNU_STACK segment to be created.  */
1418
     for a PT_GNU_STACK segment to be created.  */
1343
  unsigned default_execstack : 1;
1419
  unsigned default_execstack : 1;
-
 
1420
 
-
 
1421
  /* True if elf_section_data(sec)->this_hdr.contents is sec->rawsize
-
 
1422
     in length rather than sec->size in length, if sec->rawsize is
-
 
1423
     non-zero and smaller than sec->size.  */
-
 
1424
  unsigned caches_rawsize : 1;
-
 
1425
 
-
 
1426
  /* Address of protected data defined in the shared library may be
-
 
1427
     external, i.e., due to copy relocation.   */
-
 
1428
  unsigned extern_protected_data : 1;
1344
};
1429
};
Line 1345... Line 1430...
1345
 
1430
 
1346
/* Information about reloc sections associated with a bfd_elf_section_data
1431
/* Information about reloc sections associated with a bfd_elf_section_data
1347
   structure.  */
1432
   structure.  */
Line 1417... Line 1502...
1417
 
1502
 
1418
  /* The FDEs associated with this section.  The u.fde.next_in_section
1503
  /* The FDEs associated with this section.  The u.fde.next_in_section
1419
     field acts as a chain pointer.  */
1504
     field acts as a chain pointer.  */
Line -... Line 1505...
-
 
1505
  struct eh_cie_fde *fde_list;
-
 
1506
 
-
 
1507
  /* Link from a text section to its .eh_frame_entry section.  */
1420
  struct eh_cie_fde *fde_list;
1508
  asection *eh_frame_entry;
1421
 
1509
 
1422
  /* A pointer used for various section optimizations.  */
1510
  /* A pointer used for various section optimizations.  */
Line 1423... Line 1511...
1423
  void *sec_info;
1511
  void *sec_info;
Line 1430... Line 1518...
1430
#define elf_group_name(sec)	(elf_section_data(sec)->group.name)
1518
#define elf_group_name(sec)	(elf_section_data(sec)->group.name)
1431
#define elf_group_id(sec)	(elf_section_data(sec)->group.id)
1519
#define elf_group_id(sec)	(elf_section_data(sec)->group.id)
1432
#define elf_next_in_group(sec)	(elf_section_data(sec)->next_in_group)
1520
#define elf_next_in_group(sec)	(elf_section_data(sec)->next_in_group)
1433
#define elf_fde_list(sec)	(elf_section_data(sec)->fde_list)
1521
#define elf_fde_list(sec)	(elf_section_data(sec)->fde_list)
1434
#define elf_sec_group(sec)	(elf_section_data(sec)->sec_group)
1522
#define elf_sec_group(sec)	(elf_section_data(sec)->sec_group)
-
 
1523
#define elf_section_eh_frame_entry(sec)	(elf_section_data(sec)->eh_frame_entry)
Line 1435... Line 1524...
1435
 
1524
 
1436
#define xvec_get_elf_backend_data(xvec) \
1525
#define xvec_get_elf_backend_data(xvec) \
Line 1437... Line 1526...
1437
  ((const struct elf_backend_data *) (xvec)->backend_data)
1526
  ((const struct elf_backend_data *) (xvec)->backend_data)
Line 1468... Line 1557...
1468
} obj_attribute;
1557
} obj_attribute;
Line 1469... Line 1558...
1469
 
1558
 
1470
typedef struct obj_attribute_list
1559
typedef struct obj_attribute_list
1471
{
1560
{
1472
  struct obj_attribute_list *next;
1561
  struct obj_attribute_list *next;
1473
  int tag;
1562
  unsigned int tag;
1474
  obj_attribute attr;
1563
  obj_attribute attr;
Line 1475... Line 1564...
1475
} obj_attribute_list;
1564
} obj_attribute_list;
1476
 
1565
 
Line 1500... Line 1589...
1500
  struct sdt_note *next;
1589
  struct sdt_note *next;
1501
  bfd_size_type size;
1590
  bfd_size_type size;
1502
  bfd_byte data[1];
1591
  bfd_byte data[1];
1503
};
1592
};
Line 1504... Line -...
1504
 
-
 
1505
/* NT_GNU_BUILD_ID note type info for input BFDs.  */
-
 
1506
struct elf_build_id
-
 
1507
{
-
 
1508
  size_t size;
-
 
1509
  bfd_byte data[1];
-
 
1510
};
-
 
1511
 
1593
 
1512
/* tdata information grabbed from an elf core file.  */
1594
/* tdata information grabbed from an elf core file.  */
1513
struct core_elf_obj_tdata
1595
struct core_elf_obj_tdata
1514
{
1596
{
1515
  int signal;
1597
  int signal;
Line 1558... Line 1640...
1558
 
1640
 
1559
  /* Used to determine if the e_flags field has been initialized */
1641
  /* Used to determine if the e_flags field has been initialized */
1560
  bfd_boolean flags_init;
1642
  bfd_boolean flags_init;
Line -... Line 1643...
-
 
1643
};
-
 
1644
 
-
 
1645
/* Indicate if the bfd contains symbols that have the STT_GNU_IFUNC
-
 
1646
   symbol type or STB_GNU_UNIQUE binding.  Used to set the osabi
-
 
1647
   field in the ELF header structure.  */
-
 
1648
enum elf_gnu_symbols
-
 
1649
  {
-
 
1650
    elf_gnu_symbol_none = 0,
-
 
1651
    elf_gnu_symbol_any = 1 << 0,
-
 
1652
    elf_gnu_symbol_ifunc = (elf_gnu_symbol_any | 1 << 1),
-
 
1653
    elf_gnu_symbol_unique = (elf_gnu_symbol_any | 1 << 2),
-
 
1654
    elf_gnu_symbol_all = (elf_gnu_symbol_ifunc | elf_gnu_symbol_unique)
-
 
1655
  };
-
 
1656
 
-
 
1657
typedef struct elf_section_list
-
 
1658
{
-
 
1659
  Elf_Internal_Shdr          hdr;
-
 
1660
  unsigned int               ndx;
-
 
1661
  struct elf_section_list *  next;
-
 
1662
} elf_section_list;
1561
};
1663
  
1562
 
1664
    
Line 1563... Line 1665...
1563
/* Some private data is stashed away for future use using the tdata pointer
1665
/* Some private data is stashed away for future use using the tdata pointer
1564
   in the bfd structure.  */
1666
   in the bfd structure.  */
Line 1574... Line 1676...
1574
  Elf_Internal_Shdr dynsymtab_hdr;
1676
  Elf_Internal_Shdr dynsymtab_hdr;
1575
  Elf_Internal_Shdr dynstrtab_hdr;
1677
  Elf_Internal_Shdr dynstrtab_hdr;
1576
  Elf_Internal_Shdr dynversym_hdr;
1678
  Elf_Internal_Shdr dynversym_hdr;
1577
  Elf_Internal_Shdr dynverref_hdr;
1679
  Elf_Internal_Shdr dynverref_hdr;
1578
  Elf_Internal_Shdr dynverdef_hdr;
1680
  Elf_Internal_Shdr dynverdef_hdr;
1579
  Elf_Internal_Shdr symtab_shndx_hdr;
1681
  elf_section_list * symtab_shndx_list;
1580
  bfd_vma gp;				/* The gp value */
1682
  bfd_vma gp;				/* The gp value */
1581
  unsigned int gp_size;			/* The gp size */
1683
  unsigned int gp_size;			/* The gp size */
1582
  unsigned int num_elf_sections;	/* elf_sect_ptr size */
1684
  unsigned int num_elf_sections;	/* elf_sect_ptr size */
Line 1583... Line 1685...
1583
 
1685
 
Line 1641... Line 1743...
1641
  void *symbuf;
1743
  void *symbuf;
Line 1642... Line 1744...
1642
 
1744
 
1643
  obj_attribute known_obj_attributes[2][NUM_KNOWN_OBJ_ATTRIBUTES];
1745
  obj_attribute known_obj_attributes[2][NUM_KNOWN_OBJ_ATTRIBUTES];
Line 1644... Line -...
1644
  obj_attribute_list *other_obj_attributes[2];
-
 
1645
 
-
 
1646
  /* NT_GNU_BUILD_ID note type.  */
-
 
1647
  struct elf_build_id *build_id;
1746
  obj_attribute_list *other_obj_attributes[2];
1648
 
1747
 
1649
  /* Linked-list containing information about every Systemtap section
1748
  /* Linked-list containing information about every Systemtap section
1650
     found in the object file.  Each section corresponds to one entry
1749
     found in the object file.  Each section corresponds to one entry
Line 1651... Line 1750...
1651
     in the list.  */
1750
     in the list.  */
1652
  struct sdt_note *sdt_note_head;
1751
  struct sdt_note *sdt_note_head;
Line 1653... Line 1752...
1653
 
1752
 
1654
  Elf_Internal_Shdr **group_sect_ptr;
1753
  Elf_Internal_Shdr **group_sect_ptr;
Line 1655... Line 1754...
1655
  int num_group;
1754
  int num_group;
1656
 
1755
 
1657
  unsigned int symtab_section, symtab_shndx_section, dynsymtab_section;
1756
  unsigned int symtab_section, dynsymtab_section;
Line 1671... Line 1770...
1671
     this BFD appears to be screwed up.  If it is, we ignore the
1770
     this BFD appears to be screwed up.  If it is, we ignore the
1672
     sh_info field in the symbol table header, and always read all the
1771
     sh_info field in the symbol table header, and always read all the
1673
     symbols.  */
1772
     symbols.  */
1674
  bfd_boolean bad_symtab;
1773
  bfd_boolean bad_symtab;
Line 1675... Line -...
1675
 
-
 
1676
  /* True if the bfd contains symbols that have the STT_GNU_IFUNC
-
 
1677
     symbol type or STB_GNU_UNIQUE binding.  Used to set the osabi
-
 
1678
     field in the ELF header structure.  */
1774
 
Line 1679... Line 1775...
1679
  bfd_boolean has_gnu_symbols;
1775
  enum elf_gnu_symbols has_gnu_symbols;
1680
 
1776
 
Line 1681... Line 1777...
1681
  /* Information grabbed from an elf core file.  */
1777
  /* Information grabbed from an elf core file.  */
Line 1697... Line 1793...
1697
#define elf_eh_frame_hdr(bfd)	(elf_tdata(bfd) -> o->eh_frame_hdr)
1793
#define elf_eh_frame_hdr(bfd)	(elf_tdata(bfd) -> o->eh_frame_hdr)
1698
#define elf_linker(bfd)		(elf_tdata(bfd) -> o->linker)
1794
#define elf_linker(bfd)		(elf_tdata(bfd) -> o->linker)
1699
#define elf_stack_flags(bfd)	(elf_tdata(bfd) -> o->stack_flags)
1795
#define elf_stack_flags(bfd)	(elf_tdata(bfd) -> o->stack_flags)
1700
#define elf_shstrtab(bfd)	(elf_tdata(bfd) -> o->strtab_ptr)
1796
#define elf_shstrtab(bfd)	(elf_tdata(bfd) -> o->strtab_ptr)
1701
#define elf_onesymtab(bfd)	(elf_tdata(bfd) -> symtab_section)
1797
#define elf_onesymtab(bfd)	(elf_tdata(bfd) -> symtab_section)
1702
#define elf_symtab_shndx(bfd)	(elf_tdata(bfd) -> symtab_shndx_section)
1798
#define elf_symtab_shndx_list(bfd)	(elf_tdata(bfd) -> symtab_shndx_list)
1703
#define elf_strtab_sec(bfd)	(elf_tdata(bfd) -> o->strtab_section)
1799
#define elf_strtab_sec(bfd)	(elf_tdata(bfd) -> o->strtab_section)
1704
#define elf_shstrtab_sec(bfd)	(elf_tdata(bfd) -> o->shstrtab_section)
1800
#define elf_shstrtab_sec(bfd)	(elf_tdata(bfd) -> o->shstrtab_section)
1705
#define elf_symtab_hdr(bfd)	(elf_tdata(bfd) -> symtab_hdr)
1801
#define elf_symtab_hdr(bfd)	(elf_tdata(bfd) -> symtab_hdr)
1706
#define elf_dynsymtab(bfd)	(elf_tdata(bfd) -> dynsymtab_section)
1802
#define elf_dynsymtab(bfd)	(elf_tdata(bfd) -> dynsymtab_section)
1707
#define elf_dynversym(bfd)	(elf_tdata(bfd) -> dynversym_section)
1803
#define elf_dynversym(bfd)	(elf_tdata(bfd) -> dynversym_section)
Line 1764... Line 1860...
1764
 
1860
 
1765
extern bfd_boolean _bfd_elf_copy_private_bfd_data
1861
extern bfd_boolean _bfd_elf_copy_private_bfd_data
1766
  (bfd *, bfd *);
1862
  (bfd *, bfd *);
1767
extern bfd_boolean _bfd_elf_print_private_bfd_data
1863
extern bfd_boolean _bfd_elf_print_private_bfd_data
-
 
1864
  (bfd *, void *);
-
 
1865
const char * _bfd_elf_get_symbol_version_string
1768
  (bfd *, void *);
1866
  (bfd *, asymbol *, bfd_boolean *);
1769
extern void bfd_elf_print_symbol
1867
extern void bfd_elf_print_symbol
Line 1770... Line 1868...
1770
  (bfd *, void *, asymbol *, bfd_print_symbol_type);
1868
  (bfd *, void *, asymbol *, bfd_print_symbol_type);
1771
 
1869
 
Line 1807... Line 1905...
1807
extern struct bfd_hash_entry *_bfd_elf_link_hash_newfunc
1905
extern struct bfd_hash_entry *_bfd_elf_link_hash_newfunc
1808
  (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
1906
  (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
1809
extern struct bfd_link_hash_table *_bfd_elf_link_hash_table_create
1907
extern struct bfd_link_hash_table *_bfd_elf_link_hash_table_create
1810
  (bfd *);
1908
  (bfd *);
1811
extern void _bfd_elf_link_hash_table_free
1909
extern void _bfd_elf_link_hash_table_free
1812
  (struct bfd_link_hash_table *);
1910
  (bfd *);
1813
extern void _bfd_elf_link_hash_copy_indirect
1911
extern void _bfd_elf_link_hash_copy_indirect
1814
  (struct bfd_link_info *, struct elf_link_hash_entry *,
1912
  (struct bfd_link_info *, struct elf_link_hash_entry *,
1815
   struct elf_link_hash_entry *);
1913
   struct elf_link_hash_entry *);
1816
extern void _bfd_elf_link_hash_hide_symbol
1914
extern void _bfd_elf_link_hash_hide_symbol
1817
  (struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean);
1915
  (struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean);
Line 1890... Line 1988...
1890
extern alent *_bfd_elf_get_lineno
1988
extern alent *_bfd_elf_get_lineno
1891
  (bfd *, asymbol *);
1989
  (bfd *, asymbol *);
1892
extern bfd_boolean _bfd_elf_set_arch_mach
1990
extern bfd_boolean _bfd_elf_set_arch_mach
1893
  (bfd *, enum bfd_architecture, unsigned long);
1991
  (bfd *, enum bfd_architecture, unsigned long);
1894
extern bfd_boolean _bfd_elf_find_nearest_line
1992
extern bfd_boolean _bfd_elf_find_nearest_line
1895
  (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **,
-
 
1896
   unsigned int *);
-
 
1897
extern bfd_boolean _bfd_elf_find_nearest_line_discriminator
-
 
1898
  (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **,
1993
  (bfd *, asymbol **, asection *, bfd_vma,
1899
   unsigned int *, unsigned int *);
1994
   const char **, const char **, unsigned int *, unsigned int *);
1900
extern bfd_boolean _bfd_elf_find_line
1995
extern bfd_boolean _bfd_elf_find_line
1901
  (bfd *, asymbol **, asymbol *, const char **, unsigned int *);
1996
  (bfd *, asymbol **, asymbol *, const char **, unsigned int *);
1902
extern bfd_boolean _bfd_elf_find_line_discriminator
-
 
1903
  (bfd *, asymbol **, asymbol *, const char **, unsigned int *, unsigned int *);
-
 
1904
#define _bfd_generic_find_line _bfd_elf_find_line
-
 
1905
#define _bfd_generic_find_nearest_line_discriminator \
-
 
1906
        _bfd_elf_find_nearest_line_discriminator
-
 
1907
extern bfd_boolean _bfd_elf_find_inliner_info
1997
extern bfd_boolean _bfd_elf_find_inliner_info
1908
  (bfd *, const char **, const char **, unsigned int *);
1998
  (bfd *, const char **, const char **, unsigned int *);
-
 
1999
extern asymbol *_bfd_elf_find_function
-
 
2000
  (bfd *, asymbol **, asection *, bfd_vma, const char **, const char **);
1909
#define _bfd_elf_read_minisymbols _bfd_generic_read_minisymbols
2001
#define _bfd_elf_read_minisymbols _bfd_generic_read_minisymbols
1910
#define _bfd_elf_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
2002
#define _bfd_elf_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
1911
extern int _bfd_elf_sizeof_headers
2003
extern int _bfd_elf_sizeof_headers
1912
  (bfd *, struct bfd_link_info *);
2004
  (bfd *, struct bfd_link_info *);
1913
extern bfd_boolean _bfd_elf_new_section_hook
2005
extern bfd_boolean _bfd_elf_new_section_hook
Line 1931... Line 2023...
1931
 
2023
 
1932
extern Elf_Internal_Sym *bfd_sym_from_r_symndx
2024
extern Elf_Internal_Sym *bfd_sym_from_r_symndx
1933
  (struct sym_cache *, bfd *, unsigned long);
2025
  (struct sym_cache *, bfd *, unsigned long);
1934
extern asection *bfd_section_from_elf_index
2026
extern asection *bfd_section_from_elf_index
1935
  (bfd *, unsigned int);
-
 
1936
extern struct bfd_strtab_hash *_bfd_elf_stringtab_init
-
 
Line 1937... Line 2027...
1937
  (void);
2027
  (bfd *, unsigned int);
1938
 
2028
 
1939
extern struct elf_strtab_hash * _bfd_elf_strtab_init
2029
extern struct elf_strtab_hash * _bfd_elf_strtab_init
1940
  (void);
2030
  (void);
Line 1959... Line 2049...
1959
extern bfd_boolean _bfd_elf_strtab_emit
2049
extern bfd_boolean _bfd_elf_strtab_emit
1960
  (bfd *, struct elf_strtab_hash *);
2050
  (bfd *, struct elf_strtab_hash *);
1961
extern void _bfd_elf_strtab_finalize
2051
extern void _bfd_elf_strtab_finalize
1962
  (struct elf_strtab_hash *);
2052
  (struct elf_strtab_hash *);
Line 1963... Line 2053...
1963
 
2053
 
1964
extern void _bfd_elf_begin_eh_frame_parsing
2054
extern bfd_boolean bfd_elf_parse_eh_frame_entries
-
 
2055
  (bfd *, struct bfd_link_info *);
-
 
2056
extern bfd_boolean _bfd_elf_parse_eh_frame_entry
1965
  (struct bfd_link_info *info);
2057
  (struct bfd_link_info *, asection *, struct elf_reloc_cookie *);
1966
extern void _bfd_elf_parse_eh_frame
2058
extern void _bfd_elf_parse_eh_frame
1967
  (bfd *, struct bfd_link_info *, asection *, struct elf_reloc_cookie *);
2059
  (bfd *, struct bfd_link_info *, asection *, struct elf_reloc_cookie *);
1968
extern void _bfd_elf_end_eh_frame_parsing
2060
extern bfd_boolean _bfd_elf_end_eh_frame_parsing
Line 1969... Line 2061...
1969
  (struct bfd_link_info *info);
2061
  (struct bfd_link_info *info);
1970
 
2062
 
1971
extern bfd_boolean _bfd_elf_discard_section_eh_frame
2063
extern bfd_boolean _bfd_elf_discard_section_eh_frame
Line 1975... Line 2067...
1975
  (bfd *, struct bfd_link_info *);
2067
  (bfd *, struct bfd_link_info *);
1976
extern bfd_vma _bfd_elf_eh_frame_section_offset
2068
extern bfd_vma _bfd_elf_eh_frame_section_offset
1977
  (bfd *, struct bfd_link_info *, asection *, bfd_vma);
2069
  (bfd *, struct bfd_link_info *, asection *, bfd_vma);
1978
extern bfd_boolean _bfd_elf_write_section_eh_frame
2070
extern bfd_boolean _bfd_elf_write_section_eh_frame
1979
  (bfd *, struct bfd_link_info *, asection *, bfd_byte *);
2071
  (bfd *, struct bfd_link_info *, asection *, bfd_byte *);
-
 
2072
bfd_boolean _bfd_elf_write_section_eh_frame_entry
-
 
2073
  (bfd *, struct bfd_link_info *, asection *, bfd_byte *);
-
 
2074
extern bfd_boolean _bfd_elf_fixup_eh_frame_hdr (struct bfd_link_info *);
1980
extern bfd_boolean _bfd_elf_write_section_eh_frame_hdr
2075
extern bfd_boolean _bfd_elf_write_section_eh_frame_hdr
1981
  (bfd *, struct bfd_link_info *);
2076
  (bfd *, struct bfd_link_info *);
1982
extern bfd_boolean _bfd_elf_eh_frame_present
2077
extern bfd_boolean _bfd_elf_eh_frame_present
1983
  (struct bfd_link_info *);
2078
  (struct bfd_link_info *);
-
 
2079
extern bfd_boolean _bfd_elf_eh_frame_entry_present
-
 
2080
  (struct bfd_link_info *);
1984
extern bfd_boolean _bfd_elf_maybe_strip_eh_frame_hdr
2081
extern bfd_boolean _bfd_elf_maybe_strip_eh_frame_hdr
1985
  (struct bfd_link_info *);
2082
  (struct bfd_link_info *);
Line 1986... Line 2083...
1986
 
2083
 
Line 1987... Line 2084...
1987
extern bfd_boolean _bfd_elf_hash_symbol (struct elf_link_hash_entry *);
2084
extern bfd_boolean _bfd_elf_hash_symbol (struct elf_link_hash_entry *);
1988
 
2085
 
1989
extern long _bfd_elf_link_lookup_local_dynindx
2086
extern long _bfd_elf_link_lookup_local_dynindx
1990
  (struct bfd_link_info *, bfd *, long);
2087
  (struct bfd_link_info *, bfd *, long);
1991
extern bfd_boolean _bfd_elf_compute_section_file_positions
-
 
1992
  (bfd *, struct bfd_link_info *);
-
 
1993
extern void _bfd_elf_assign_file_positions_for_relocs
2088
extern bfd_boolean _bfd_elf_compute_section_file_positions
1994
  (bfd *);
2089
  (bfd *, struct bfd_link_info *);
Line 1995... Line 2090...
1995
extern file_ptr _bfd_elf_assign_file_position_for_section
2090
extern file_ptr _bfd_elf_assign_file_position_for_section
1996
  (Elf_Internal_Shdr *, file_ptr, bfd_boolean);
2091
  (Elf_Internal_Shdr *, file_ptr, bfd_boolean);
Line 2004... Line 2099...
2004
  (bfd *, struct bfd_link_info *, asection *);
2099
  (bfd *, struct bfd_link_info *, asection *);
2005
extern bfd_boolean _bfd_elf_create_dynamic_sections
2100
extern bfd_boolean _bfd_elf_create_dynamic_sections
2006
  (bfd *, struct bfd_link_info *);
2101
  (bfd *, struct bfd_link_info *);
2007
extern bfd_boolean _bfd_elf_create_got_section
2102
extern bfd_boolean _bfd_elf_create_got_section
2008
  (bfd *, struct bfd_link_info *);
2103
  (bfd *, struct bfd_link_info *);
-
 
2104
extern asection *_bfd_elf_section_for_symbol
-
 
2105
  (struct elf_reloc_cookie *, unsigned long, bfd_boolean);
2009
extern struct elf_link_hash_entry *_bfd_elf_define_linkage_sym
2106
extern struct elf_link_hash_entry *_bfd_elf_define_linkage_sym
2010
  (bfd *, struct bfd_link_info *, asection *, const char *);
2107
  (bfd *, struct bfd_link_info *, asection *, const char *);
2011
extern void _bfd_elf_init_1_index_section
2108
extern void _bfd_elf_init_1_index_section
2012
  (bfd *, struct bfd_link_info *);
2109
  (bfd *, struct bfd_link_info *);
2013
extern void _bfd_elf_init_2_index_sections
2110
extern void _bfd_elf_init_2_index_sections
Line 2024... Line 2121...
2024
extern bfd_boolean _bfd_elf_link_output_relocs
2121
extern bfd_boolean _bfd_elf_link_output_relocs
2025
  (bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *,
2122
  (bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *,
2026
   struct elf_link_hash_entry **);
2123
   struct elf_link_hash_entry **);
Line 2027... Line 2124...
2027
 
2124
 
2028
extern bfd_boolean _bfd_elf_adjust_dynamic_copy
2125
extern bfd_boolean _bfd_elf_adjust_dynamic_copy
Line 2029... Line 2126...
2029
  (struct elf_link_hash_entry *, asection *);
2126
  (struct bfd_link_info *, struct elf_link_hash_entry *, asection *);
2030
 
2127
 
Line 2031... Line 2128...
2031
extern bfd_boolean _bfd_elf_dynamic_symbol_p
2128
extern bfd_boolean _bfd_elf_dynamic_symbol_p
Line 2038... Line 2135...
2038
  (bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, bfd_vma);
2135
  (bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, bfd_vma);
Line 2039... Line 2136...
2039
 
2136
 
2040
extern bfd_boolean _bfd_elf_setup_sections
2137
extern bfd_boolean _bfd_elf_setup_sections
Line 2041... Line 2138...
2041
  (bfd *);
2138
  (bfd *);
Line 2042... Line 2139...
2042
 
2139
 
2043
extern void _bfd_elf_set_osabi (bfd * , struct bfd_link_info *);
2140
extern void _bfd_elf_post_process_headers (bfd * , struct bfd_link_info *);
2044
 
2141
 
2045
extern const bfd_target *bfd_elf32_object_p
2142
extern const bfd_target *bfd_elf32_object_p
Line 2197... Line 2294...
2197
  (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
2294
  (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
2198
   struct elf_link_hash_entry *, Elf_Internal_Sym *);
2295
   struct elf_link_hash_entry *, Elf_Internal_Sym *);
Line 2199... Line 2296...
2199
 
2296
 
2200
extern asection *_bfd_elf_gc_mark_rsec
2297
extern asection *_bfd_elf_gc_mark_rsec
2201
  (struct bfd_link_info *, asection *, elf_gc_mark_hook_fn,
2298
  (struct bfd_link_info *, asection *, elf_gc_mark_hook_fn,
Line 2202... Line 2299...
2202
   struct elf_reloc_cookie *);
2299
   struct elf_reloc_cookie *, bfd_boolean *);
2203
 
2300
 
2204
extern bfd_boolean _bfd_elf_gc_mark_reloc
2301
extern bfd_boolean _bfd_elf_gc_mark_reloc
Line 2233... Line 2330...
2233
extern bfd_boolean _bfd_elf_is_function_type (unsigned int);
2330
extern bfd_boolean _bfd_elf_is_function_type (unsigned int);
Line 2234... Line 2331...
2234
 
2331
 
2235
extern bfd_size_type _bfd_elf_maybe_function_sym (const asymbol *, asection *,
2332
extern bfd_size_type _bfd_elf_maybe_function_sym (const asymbol *, asection *,
Line -... Line 2333...
-
 
2333
						  bfd_vma *);
-
 
2334
 
2236
						  bfd_vma *);
2335
extern asection *_bfd_elf_get_reloc_section (asection *);
Line 2237... Line 2336...
2237
 
2336
 
2238
extern int bfd_elf_get_default_section_type (flagword);
2337
extern int bfd_elf_get_default_section_type (flagword);
Line 2276... Line 2375...
2276
  (bfd *, char *, int *, const void *, int);
2375
  (bfd *, char *, int *, const void *, int);
2277
extern char *elfcore_write_s390_system_call
2376
extern char *elfcore_write_s390_system_call
2278
  (bfd *, char *, int *, const void *, int);
2377
  (bfd *, char *, int *, const void *, int);
2279
extern char *elfcore_write_s390_tdb
2378
extern char *elfcore_write_s390_tdb
2280
  (bfd *, char *, int *, const void *, int);
2379
  (bfd *, char *, int *, const void *, int);
-
 
2380
extern char *elfcore_write_s390_vxrs_low
-
 
2381
  (bfd *, char *, int *, const void *, int);
-
 
2382
extern char *elfcore_write_s390_vxrs_high
-
 
2383
  (bfd *, char *, int *, const void *, int);
2281
extern char *elfcore_write_arm_vfp
2384
extern char *elfcore_write_arm_vfp
2282
  (bfd *, char *, int *, const void *, int);
2385
  (bfd *, char *, int *, const void *, int);
2283
extern char *elfcore_write_aarch_tls
2386
extern char *elfcore_write_aarch_tls
2284
  (bfd *, char *, int *, const void *, int);
2387
  (bfd *, char *, int *, const void *, int);
2285
extern char *elfcore_write_aarch_hw_break
2388
extern char *elfcore_write_aarch_hw_break
Line 2326... Line 2429...
2326
/* Linux/PPC32 uses different layout compared to most archs.  */
2429
/* Linux/PPC32 uses different layout compared to most archs.  */
2327
extern char *elfcore_write_ppc_linux_prpsinfo32
2430
extern char *elfcore_write_ppc_linux_prpsinfo32
2328
  (bfd *, char *, int *, const struct elf_internal_linux_prpsinfo *);
2431
  (bfd *, char *, int *, const struct elf_internal_linux_prpsinfo *);
Line 2329... Line 2432...
2329
 
2432
 
2330
extern bfd *_bfd_elf32_bfd_from_remote_memory
2433
extern bfd *_bfd_elf32_bfd_from_remote_memory
2331
  (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
2434
  (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
2332
   int (*target_read_memory) (bfd_vma, bfd_byte *, bfd_size_type));
2435
   int (*target_read_memory) (bfd_vma, bfd_byte *, bfd_size_type));
2333
extern bfd *_bfd_elf64_bfd_from_remote_memory
2436
extern bfd *_bfd_elf64_bfd_from_remote_memory
2334
  (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
2437
  (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
Line 2335... Line 2438...
2335
   int (*target_read_memory) (bfd_vma, bfd_byte *, bfd_size_type));
2438
   int (*target_read_memory) (bfd_vma, bfd_byte *, bfd_size_type));
2336
 
2439
 
2337
extern bfd_vma bfd_elf_obj_attr_size (bfd *);
2440
extern bfd_vma bfd_elf_obj_attr_size (bfd *);
2338
extern void bfd_elf_set_obj_attr_contents (bfd *, bfd_byte *, bfd_vma);
2441
extern void bfd_elf_set_obj_attr_contents (bfd *, bfd_byte *, bfd_vma);
2339
extern int bfd_elf_get_obj_attr_int (bfd *, int, int);
2442
extern int bfd_elf_get_obj_attr_int (bfd *, int, unsigned int);
2340
extern void bfd_elf_add_obj_attr_int (bfd *, int, int, unsigned int);
2443
extern void bfd_elf_add_obj_attr_int (bfd *, int, unsigned int, unsigned int);
2341
#define bfd_elf_add_proc_attr_int(BFD, TAG, VALUE) \
2444
#define bfd_elf_add_proc_attr_int(BFD, TAG, VALUE) \
2342
  bfd_elf_add_obj_attr_int ((BFD), OBJ_ATTR_PROC, (TAG), (VALUE))
2445
  bfd_elf_add_obj_attr_int ((BFD), OBJ_ATTR_PROC, (TAG), (VALUE))
2343
extern void bfd_elf_add_obj_attr_string (bfd *, int, int, const char *);
2446
extern void bfd_elf_add_obj_attr_string (bfd *, int, unsigned int, const char *);
2344
#define bfd_elf_add_proc_attr_string(BFD, TAG, VALUE) \
2447
#define bfd_elf_add_proc_attr_string(BFD, TAG, VALUE) \
2345
  bfd_elf_add_obj_attr_string ((BFD), OBJ_ATTR_PROC, (TAG), (VALUE))
2448
  bfd_elf_add_obj_attr_string ((BFD), OBJ_ATTR_PROC, (TAG), (VALUE))
2346
extern void bfd_elf_add_obj_attr_int_string (bfd *, int, int, unsigned int,
2449
extern void bfd_elf_add_obj_attr_int_string (bfd *, int, unsigned int,
2347
					     const char *);
2450
					     unsigned int, const char *);
2348
#define bfd_elf_add_proc_attr_int_string(BFD, TAG, INTVAL, STRVAL) \
2451
#define bfd_elf_add_proc_attr_int_string(BFD, TAG, INTVAL, STRVAL) \
Line 2349... Line 2452...
2349
  bfd_elf_add_obj_attr_int_string ((BFD), OBJ_ATTR_PROC, (TAG), \
2452
  bfd_elf_add_obj_attr_int_string ((BFD), OBJ_ATTR_PROC, (TAG), \
2350
				   (INTVAL), (STRVAL))
2453
				   (INTVAL), (STRVAL))
2351
 
2454
 
2352
extern char *_bfd_elf_attr_strdup (bfd *, const char *);
2455
extern char *_bfd_elf_attr_strdup (bfd *, const char *);
2353
extern void _bfd_elf_copy_obj_attributes (bfd *, bfd *);
2456
extern void _bfd_elf_copy_obj_attributes (bfd *, bfd *);
2354
extern int _bfd_elf_obj_attrs_arg_type (bfd *, int, int);
2457
extern int _bfd_elf_obj_attrs_arg_type (bfd *, int, unsigned int);
2355
extern void _bfd_elf_parse_attributes (bfd *, Elf_Internal_Shdr *);
2458
extern void _bfd_elf_parse_attributes (bfd *, Elf_Internal_Shdr *);
2356
extern bfd_boolean _bfd_elf_merge_object_attributes (bfd *, bfd *);
2459
extern bfd_boolean _bfd_elf_merge_object_attributes (bfd *, bfd *);
Line 2381... Line 2484...
2381
extern bfd_boolean _bfd_elf_create_ifunc_sections
2484
extern bfd_boolean _bfd_elf_create_ifunc_sections
2382
  (bfd *, struct bfd_link_info *);
2485
  (bfd *, struct bfd_link_info *);
2383
extern bfd_boolean _bfd_elf_allocate_ifunc_dyn_relocs
2486
extern bfd_boolean _bfd_elf_allocate_ifunc_dyn_relocs
2384
  (struct bfd_link_info *, struct elf_link_hash_entry *,
2487
  (struct bfd_link_info *, struct elf_link_hash_entry *,
2385
   struct elf_dyn_relocs **, unsigned int, unsigned int, unsigned int);
2488
   struct elf_dyn_relocs **, unsigned int, unsigned int, unsigned int);
-
 
2489
extern long _bfd_elf_ifunc_get_synthetic_symtab
-
 
2490
  (bfd *, long, asymbol **, long, asymbol **, asymbol **, asection *,
-
 
2491
   bfd_vma *(*) (bfd *, asymbol **, asection *, asection *));
Line 2386... Line 2492...
2386
 
2492
 
2387
extern void elf_append_rela (bfd *, asection *, Elf_Internal_Rela *);
2493
extern void elf_append_rela (bfd *, asection *, Elf_Internal_Rela *);
Line 2388... Line 2494...
2388
extern void elf_append_rel (bfd *, asection *, Elf_Internal_Rela *);
2494
extern void elf_append_rel (bfd *, asection *, Elf_Internal_Rela *);
Line 2412... Line 2518...
2412
/* This macro is to avoid lots of duplicated code in the body
2518
/* This macro is to avoid lots of duplicated code in the body
2413
   of xxx_relocate_section() in the various elfxx-xxxx.c files.  */
2519
   of xxx_relocate_section() in the various elfxx-xxxx.c files.  */
2414
#define RELOC_FOR_GLOBAL_SYMBOL(info, input_bfd, input_section, rel,	\
2520
#define RELOC_FOR_GLOBAL_SYMBOL(info, input_bfd, input_section, rel,	\
2415
				r_symndx, symtab_hdr, sym_hashes,	\
2521
				r_symndx, symtab_hdr, sym_hashes,	\
2416
				h, sec, relocation,			\
2522
				h, sec, relocation,			\
2417
				unresolved_reloc, warned)		\
2523
				unresolved_reloc, warned, ignored)	\
2418
  do									\
2524
  do									\
2419
    {									\
2525
    {									\
2420
      /* It seems this can happen with erroneous or unsupported		\
2526
      /* It seems this can happen with erroneous or unsupported		\
2421
	 input (mixing a.out and elf in an archive, for example.)  */	\
2527
	 input (mixing a.out and elf in an archive, for example.)  */	\
2422
      if (sym_hashes == NULL)						\
2528
      if (sym_hashes == NULL)						\
2423
	return FALSE;							\
2529
	return FALSE;							\
2424
									\
2530
									\
2425
      h = sym_hashes[r_symndx - symtab_hdr->sh_info];			\
2531
      h = sym_hashes[r_symndx - symtab_hdr->sh_info];			\
2426
									\
2532
									\
-
 
2533
      if (info->wrap_hash != NULL					\
-
 
2534
	  && (input_section->flags & SEC_DEBUGGING) != 0)		\
-
 
2535
	h = ((struct elf_link_hash_entry *)				\
-
 
2536
	     unwrap_hash_lookup (info, input_bfd, &h->root));		\
-
 
2537
									\
2427
      while (h->root.type == bfd_link_hash_indirect			\
2538
      while (h->root.type == bfd_link_hash_indirect			\
2428
	     || h->root.type == bfd_link_hash_warning)			\
2539
	     || h->root.type == bfd_link_hash_warning)			\
2429
	h = (struct elf_link_hash_entry *) h->root.u.i.link;		\
2540
	h = (struct elf_link_hash_entry *) h->root.u.i.link;		\
2430
									\
2541
									\
2431
      warned = FALSE;							\
2542
      warned = FALSE;							\
-
 
2543
      ignored = FALSE;							\
2432
      unresolved_reloc = FALSE;						\
2544
      unresolved_reloc = FALSE;						\
2433
      relocation = 0;							\
2545
      relocation = 0;							\
2434
      if (h->root.type == bfd_link_hash_defined				\
2546
      if (h->root.type == bfd_link_hash_defined				\
2435
	  || h->root.type == bfd_link_hash_defweak)			\
2547
	  || h->root.type == bfd_link_hash_defweak)			\
2436
	{								\
2548
	{								\
Line 2449... Line 2561...
2449
	}								\
2561
	}								\
2450
      else if (h->root.type == bfd_link_hash_undefweak)			\
2562
      else if (h->root.type == bfd_link_hash_undefweak)			\
2451
	;								\
2563
	;								\
2452
      else if (info->unresolved_syms_in_objects == RM_IGNORE		\
2564
      else if (info->unresolved_syms_in_objects == RM_IGNORE		\
2453
	       && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)		\
2565
	       && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)		\
2454
	;								\
2566
	ignored = TRUE;							\
2455
      else if (!info->relocatable)					\
2567
      else if (!bfd_link_relocatable (info))				\
2456
	{								\
2568
	{								\
2457
	  bfd_boolean err;						\
2569
	  bfd_boolean err;						\
2458
	  err = (info->unresolved_syms_in_objects == RM_GENERATE_ERROR	\
2570
	  err = (info->unresolved_syms_in_objects == RM_GENERATE_ERROR	\
2459
		 || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT);	\
2571
		 || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT);	\
2460
	  if (!info->callbacks->undefined_symbol (info,			\
2572
	  if (!info->callbacks->undefined_symbol (info,			\
Line 2465... Line 2577...
2465
	    return FALSE;						\
2577
	    return FALSE;						\
2466
	  warned = TRUE;						\
2578
	  warned = TRUE;						\
2467
	}								\
2579
	}								\
2468
      (void) unresolved_reloc;						\
2580
      (void) unresolved_reloc;						\
2469
      (void) warned;							\
2581
      (void) warned;							\
-
 
2582
      (void) ignored;							\
2470
    }									\
2583
    }									\
2471
  while (0)
2584
  while (0)
Line 2472... Line 2585...
2472
 
2585
 
2473
/* This macro is to avoid lots of duplicated code in the body of the
2586
/* This macro is to avoid lots of duplicated code in the body of the
Line 2484... Line 2597...
2484
  {									\
2597
  {									\
2485
    int i_;								\
2598
    int i_;								\
2486
    _bfd_clear_contents (howto, input_bfd, input_section,		\
2599
    _bfd_clear_contents (howto, input_bfd, input_section,		\
2487
			 contents + rel[index].r_offset);		\
2600
			 contents + rel[index].r_offset);		\
2488
									\
2601
									\
2489
    if (info->relocatable						\
2602
    if (bfd_link_relocatable (info)					\
2490
	&& (input_section->flags & SEC_DEBUGGING))			\
2603
	&& (input_section->flags & SEC_DEBUGGING))			\
2491
      {									\
2604
      {									\
2492
	/* Only remove relocations in debug sections since other	\
2605
	/* Only remove relocations in debug sections since other	\
2493
	   sections may require relocations.  */			\
2606
	   sections may require relocations.  */			\
2494
	Elf_Internal_Shdr *rel_hdr;					\
2607
	Elf_Internal_Shdr *rel_hdr;					\
Line 2525... Line 2638...
2525
   library, if any.  A unique symbol can never be bound locally.  */
2638
   library, if any.  A unique symbol can never be bound locally.  */
2526
#define SYMBOLIC_BIND(INFO, H) \
2639
#define SYMBOLIC_BIND(INFO, H) \
2527
    (!(H)->unique_global \
2640
    (!(H)->unique_global \
2528
     && ((INFO)->symbolic || ((INFO)->dynamic && !(H)->dynamic)))
2641
     && ((INFO)->symbolic || ((INFO)->dynamic && !(H)->dynamic)))
Line -... Line 2642...
-
 
2642
 
-
 
2643
#ifdef __cplusplus
-
 
2644
}
2529
 
2645
#endif