x86: Add elf_x86_backend_data
[deliverable/binutils-gdb.git] / bfd / elfxx-x86.h
1 /* x86 specific support for ELF
2 Copyright (C) 2017 Free Software Foundation, Inc.
3
4 This file is part of BFD, the Binary File Descriptor library.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
20
21 #include "sysdep.h"
22 #include "bfd.h"
23 #include "bfdlink.h"
24 #include "libbfd.h"
25 #include "elf-bfd.h"
26 #include "bfd_stdint.h"
27 #include "hashtab.h"
28
29 #define PLT_CIE_LENGTH 20
30 #define PLT_FDE_LENGTH 36
31 #define PLT_FDE_START_OFFSET 4 + PLT_CIE_LENGTH + 8
32 #define PLT_FDE_LEN_OFFSET 4 + PLT_CIE_LENGTH + 12
33
34 #define ABI_64_P(abfd) \
35 (get_elf_backend_data (abfd)->s->elfclass == ELFCLASS64)
36
37 /* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
38 copying dynamic variables from a shared lib into an app's dynbss
39 section, and instead use a dynamic relocation to point into the
40 shared lib. */
41 #define ELIMINATE_COPY_RELOCS 1
42
43 #define elf_x86_hash_table(p, id) \
44 (is_elf_hash_table ((p)->hash) \
45 && elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) == (id) \
46 ? ((struct elf_x86_link_hash_table *) ((p)->hash)) : NULL)
47
48 /* Will references to this symbol always be local in this object? */
49 #define SYMBOL_REFERENCES_LOCAL_P(INFO, H) \
50 _bfd_x86_elf_link_symbol_references_local ((INFO), (H))
51
52 /* TRUE if an undefined weak symbol should be resolved to 0. Local
53 undefined weak symbol is always resolved to 0. Reference to an
54 undefined weak symbol is resolved to 0 in executable if undefined
55 weak symbol should be resolved to 0 (zero_undefweak > 0). */
56 #define UNDEFINED_WEAK_RESOLVED_TO_ZERO(INFO, EH) \
57 ((EH)->elf.root.type == bfd_link_hash_undefweak \
58 && (SYMBOL_REFERENCES_LOCAL_P ((INFO), &(EH)->elf) \
59 || (bfd_link_executable (INFO) \
60 && (EH)->zero_undefweak > 0)))
61
62 /* Should copy relocation be generated for a symbol. Don't generate
63 copy relocation against a protected symbol defined in a shared
64 object with GNU_PROPERTY_NO_COPY_ON_PROTECTED. */
65 #define SYMBOL_NO_COPYRELOC(INFO, EH) \
66 ((EH)->def_protected \
67 && ((EH)->elf.root.type == bfd_link_hash_defined \
68 || (EH)->elf.root.type == bfd_link_hash_defweak) \
69 && elf_has_no_copy_on_protected ((EH)->elf.root.u.def.section->owner) \
70 && ((EH)->elf.root.u.def.section->owner->flags & DYNAMIC) != 0 \
71 && ((EH)->elf.root.u.def.section->flags & SEC_CODE) == 0)
72
73 /* TRUE if dynamic relocation is needed. If we are creating a shared
74 library, and this is a reloc against a global symbol, or a non PC
75 relative reloc against a local symbol, then we need to copy the reloc
76 into the shared library. However, if we are linking with -Bsymbolic,
77 we do not need to copy a reloc against a global symbol which is
78 defined in an object we are including in the link (i.e., DEF_REGULAR
79 is set). At this point we have not seen all the input files, so it
80 is possible that DEF_REGULAR is not set now but will be set later (it
81 is never cleared). In case of a weak definition, DEF_REGULAR may be
82 cleared later by a strong definition in a shared library. We account
83 for that possibility below by storing information in the relocs_copied
84 field of the hash table entry. A similar situation occurs when
85 creating shared libraries and symbol visibility changes render the
86 symbol local.
87
88 If on the other hand, we are creating an executable, we may need to
89 keep relocations for symbols satisfied by a dynamic library if we
90 manage to avoid copy relocs for the symbol.
91
92 We also need to generate dynamic pointer relocation against
93 STT_GNU_IFUNC symbol in the non-code section. */
94 #define NEED_DYNAMIC_RELOCATION_P(INFO, H, SEC, R_TYPE, POINTER_TYPE) \
95 ((bfd_link_pic (INFO) \
96 && (! X86_PCREL_TYPE_P (R_TYPE) \
97 || ((H) != NULL \
98 && (! (bfd_link_pie (INFO) \
99 || SYMBOLIC_BIND ((INFO), (H))) \
100 || (H)->root.type == bfd_link_hash_defweak \
101 || !(H)->def_regular)))) \
102 || ((H) != NULL \
103 && (H)->type == STT_GNU_IFUNC \
104 && (R_TYPE) == POINTER_TYPE \
105 && ((SEC)->flags & SEC_CODE) == 0) \
106 || (ELIMINATE_COPY_RELOCS \
107 && !bfd_link_pic (INFO) \
108 && (H) != NULL \
109 && ((H)->root.type == bfd_link_hash_defweak \
110 || !(H)->def_regular)))
111
112 /* TRUE if dynamic relocation should be generated. Don't copy a
113 pc-relative relocation into the output file if the symbol needs
114 copy reloc or the symbol is undefined when building executable.
115 Copy dynamic function pointer relocations. Don't generate dynamic
116 relocations against resolved undefined weak symbols in PIE, except
117 when PC32_RELOC is TRUE. Undefined weak symbol is bound locally
118 when PIC is false. */
119 #define GENERATE_DYNAMIC_RELOCATION_P(INFO, EH, R_TYPE, \
120 NEED_COPY_RELOC_IN_PIE, \
121 RESOLVED_TO_ZERO, PC32_RELOC) \
122 ((bfd_link_pic (INFO) \
123 && !(NEED_COPY_RELOC_IN_PIE) \
124 && ((EH) == NULL \
125 || ((ELF_ST_VISIBILITY ((EH)->elf.other) == STV_DEFAULT \
126 && (!(RESOLVED_TO_ZERO) || PC32_RELOC)) \
127 || (EH)->elf.root.type != bfd_link_hash_undefweak)) \
128 && ((!X86_PCREL_TYPE_P (R_TYPE) \
129 && !X86_SIZE_TYPE_P (R_TYPE)) \
130 || ! SYMBOL_CALLS_LOCAL ((INFO), &(EH)->elf))) \
131 || (ELIMINATE_COPY_RELOCS \
132 && !bfd_link_pic (INFO) \
133 && (EH) != NULL \
134 && (EH)->elf.dynindx != -1 \
135 && (!(EH)->elf.non_got_ref \
136 || (EH)->func_pointer_refcount > 0 \
137 || ((EH)->elf.root.type == bfd_link_hash_undefweak \
138 && !(RESOLVED_TO_ZERO))) \
139 && (((EH)->elf.def_dynamic && !(EH)->elf.def_regular) \
140 || (EH)->elf.root.type == bfd_link_hash_undefined)))
141
142 /* TRUE if this input relocation should be copied to output. H->dynindx
143 may be -1 if this symbol was marked to become local. */
144 #define COPY_INPUT_RELOC_P(INFO, H, R_TYPE) \
145 ((H) != NULL \
146 && (H)->dynindx != -1 \
147 && (X86_PCREL_TYPE_P (R_TYPE) \
148 || !(bfd_link_executable (INFO) || SYMBOLIC_BIND ((INFO), (H))) \
149 || !(H)->def_regular))
150
151 /* TRUE if this is actually a static link, or it is a -Bsymbolic link
152 and the symbol is defined locally, or the symbol was forced to be
153 local because of a version file. */
154 #define RESOLVED_LOCALLY_P(INFO, H, HTAB) \
155 (!WILL_CALL_FINISH_DYNAMIC_SYMBOL ((HTAB)->elf.dynamic_sections_created, \
156 bfd_link_pic (INFO), (H)) \
157 || (bfd_link_pic (INFO) \
158 && SYMBOL_REFERENCES_LOCAL_P ((INFO), (H))) \
159 || (ELF_ST_VISIBILITY ((H)->other) \
160 && (H)->root.type == bfd_link_hash_undefweak))
161
162 /* TRUE if relative relocation should be generated. GOT reference to
163 global symbol in PIC will lead to dynamic symbol. It becomes a
164 problem when "time" or "times" is defined as a variable in an
165 executable, clashing with functions of the same name in libc. If a
166 symbol isn't undefined weak symbol, don't make it dynamic in PIC and
167 generate relative relocation. */
168 #define GENERATE_RELATIVE_RELOC_P(INFO, H) \
169 ((H)->dynindx == -1 \
170 && !(H)->forced_local \
171 && (H)->root.type != bfd_link_hash_undefweak \
172 && bfd_link_pic (INFO))
173
174 /* TRUE if this is a pointer reference to a local IFUNC. */
175 #define POINTER_LOCAL_IFUNC_P(INFO, H) \
176 ((H)->dynindx == -1 \
177 || (H)->forced_local \
178 || bfd_link_executable (INFO))
179
180 /* TRUE if this is a PLT reference to a local IFUNC. */
181 #define PLT_LOCAL_IFUNC_P(INFO, H) \
182 ((H)->dynindx == -1 \
183 || ((bfd_link_executable (INFO) \
184 || ELF_ST_VISIBILITY ((H)->other) != STV_DEFAULT) \
185 && (H)->def_regular \
186 && (H)->type == STT_GNU_IFUNC))
187
188 /* TRUE if TLS IE->LE transition is OK. */
189 #define TLS_TRANSITION_IE_TO_LE_P(INFO, H, TLS_TYPE) \
190 (bfd_link_executable (INFO) \
191 && (H) != NULL \
192 && (H)->dynindx == -1 \
193 && (TLS_TYPE & GOT_TLS_IE))
194
195 /* Verify that the symbol has an entry in the procedure linkage table. */
196 #define VERIFY_PLT_ENTRY(INFO, H, PLT, GOTPLT, RELPLT, LOCAL_UNDEFWEAK) \
197 do \
198 { \
199 if (((H)->dynindx == -1 \
200 && !LOCAL_UNDEFWEAK \
201 && !(((H)->forced_local || bfd_link_executable (INFO)) \
202 && (H)->def_regular \
203 && (H)->type == STT_GNU_IFUNC)) \
204 || (PLT) == NULL \
205 || (GOTPLT) == NULL \
206 || (RELPLT) == NULL) \
207 abort (); \
208 } \
209 while (0);
210
211 /* Verify that the symbol supports copy relocation. */
212 #define VERIFY_COPY_RELOC(H, HTAB) \
213 do \
214 { \
215 if ((H)->dynindx == -1 \
216 || ((H)->root.type != bfd_link_hash_defined \
217 && (H)->root.type != bfd_link_hash_defweak) \
218 || (HTAB)->elf.srelbss == NULL \
219 || (HTAB)->elf.sreldynrelro == NULL) \
220 abort (); \
221 } \
222 while (0);
223
224 /* x86 ELF linker hash entry. */
225
226 struct elf_x86_link_hash_entry
227 {
228 struct elf_link_hash_entry elf;
229
230 /* Track dynamic relocs copied for this symbol. */
231 struct elf_dyn_relocs *dyn_relocs;
232
233 unsigned char tls_type;
234
235 /* Bit 0: Symbol has no GOT nor PLT relocations.
236 Bit 1: Symbol has non-GOT/non-PLT relocations in text sections.
237 zero_undefweak is initialized to 1 and undefined weak symbol
238 should be resolved to 0 if zero_undefweak > 0. */
239 unsigned int zero_undefweak : 2;
240
241 /* Don't call finish_dynamic_symbol on this symbol. */
242 unsigned int no_finish_dynamic_symbol : 1;
243
244 /* TRUE if symbol is __tls_get_addr. */
245 unsigned int tls_get_addr : 1;
246
247 /* TRUE if symbol is defined as a protected symbol. */
248 unsigned int def_protected : 1;
249
250 /* 0: Symbol references are unknown.
251 1: Symbol references aren't local.
252 2: Symbol references are local.
253 */
254 unsigned int local_ref : 2;
255
256 /* TRUE if symbol is defined by linker. */
257 unsigned int linker_def : 1;
258
259 /* TRUE if symbol is referenced by R_386_GOTOFF relocation. This is
260 only used by i386. */
261 unsigned int gotoff_ref : 1;
262
263 /* TRUE if a weak symbol with a real definition needs a copy reloc.
264 When there is a weak symbol with a real definition, the processor
265 independent code will have arranged for us to see the real
266 definition first. We need to copy the needs_copy bit from the
267 real definition and check it when allowing copy reloc in PIE. This
268 is only used by x86-64. */
269 unsigned int needs_copy : 1;
270
271 /* Reference count of C/C++ function pointer relocations in read-write
272 section which can be resolved at run-time. */
273 bfd_signed_vma func_pointer_refcount;
274
275 /* Information about the GOT PLT entry. Filled when there are both
276 GOT and PLT relocations against the same function. */
277 union gotplt_union plt_got;
278
279 /* Information about the second PLT entry. */
280 union gotplt_union plt_second;
281
282 /* Offset of the GOTPLT entry reserved for the TLS descriptor,
283 starting at the end of the jump table. */
284 bfd_vma tlsdesc_got;
285 };
286
287 struct elf_x86_lazy_plt_layout
288 {
289 /* The first entry in an absolute lazy procedure linkage table looks
290 like this. */
291 const bfd_byte *plt0_entry;
292 unsigned int plt0_entry_size; /* Size of PLT0 entry. */
293
294 /* Later entries in an absolute lazy procedure linkage table look
295 like this. */
296 const bfd_byte *plt_entry;
297 unsigned int plt_entry_size; /* Size of each PLT entry. */
298
299 /* Offsets into plt0_entry that are to be replaced with GOT[1] and
300 GOT[2]. */
301 unsigned int plt0_got1_offset;
302 unsigned int plt0_got2_offset;
303
304 /* Offset of the end of the PC-relative instruction containing
305 plt0_got2_offset. This is for x86-64 only. */
306 unsigned int plt0_got2_insn_end;
307
308 /* Offsets into plt_entry that are to be replaced with... */
309 unsigned int plt_got_offset; /* ... address of this symbol in .got. */
310 unsigned int plt_reloc_offset; /* ... offset into relocation table. */
311 unsigned int plt_plt_offset; /* ... offset to start of .plt. */
312
313 /* Length of the PC-relative instruction containing plt_got_offset.
314 This is used for x86-64 only. */
315 unsigned int plt_got_insn_size;
316
317 /* Offset of the end of the PC-relative jump to plt0_entry. This is
318 used for x86-64 only. */
319 unsigned int plt_plt_insn_end;
320
321 /* Offset into plt_entry where the initial value of the GOT entry
322 points. */
323 unsigned int plt_lazy_offset;
324
325 /* The first entry in a PIC lazy procedure linkage table looks like
326 this. */
327 const bfd_byte *pic_plt0_entry;
328
329 /* Subsequent entries in a PIC lazy procedure linkage table look
330 like this. */
331 const bfd_byte *pic_plt_entry;
332
333 /* .eh_frame covering the lazy .plt section. */
334 const bfd_byte *eh_frame_plt;
335 unsigned int eh_frame_plt_size;
336 };
337
338 struct elf_x86_non_lazy_plt_layout
339 {
340 /* Entries in an absolute non-lazy procedure linkage table look like
341 this. */
342 const bfd_byte *plt_entry;
343 /* Entries in a PIC non-lazy procedure linkage table look like this. */
344 const bfd_byte *pic_plt_entry;
345
346 unsigned int plt_entry_size; /* Size of each PLT entry. */
347
348 /* Offsets into plt_entry that are to be replaced with... */
349 unsigned int plt_got_offset; /* ... address of this symbol in .got. */
350
351 /* Length of the PC-relative instruction containing plt_got_offset.
352 This is used for x86-64 only. */
353 unsigned int plt_got_insn_size;
354
355 /* .eh_frame covering the non-lazy .plt section. */
356 const bfd_byte *eh_frame_plt;
357 unsigned int eh_frame_plt_size;
358 };
359
360 struct elf_x86_plt_layout
361 {
362 /* The first entry in a lazy procedure linkage table looks like this.
363 This is only used for i386 where absolute PLT0 and PIC PLT0 are
364 different. */
365 const bfd_byte *plt0_entry;
366 /* Entries in a procedure linkage table look like this. */
367 const bfd_byte *plt_entry;
368 unsigned int plt_entry_size; /* Size of each PLT entry. */
369
370 /* 1 has PLT0. */
371 unsigned int has_plt0;
372
373 /* Offsets into plt_entry that are to be replaced with... */
374 unsigned int plt_got_offset; /* ... address of this symbol in .got. */
375
376 /* Length of the PC-relative instruction containing plt_got_offset.
377 This is only used for x86-64. */
378 unsigned int plt_got_insn_size;
379
380 /* .eh_frame covering the .plt section. */
381 const bfd_byte *eh_frame_plt;
382 unsigned int eh_frame_plt_size;
383 };
384
385 /* Values in tls_type of x86 ELF linker hash entry. */
386 #define GOT_UNKNOWN 0
387 #define GOT_NORMAL 1
388 #define GOT_TLS_GD 2
389 #define GOT_TLS_IE 4
390 #define GOT_TLS_IE_POS 5
391 #define GOT_TLS_IE_NEG 6
392 #define GOT_TLS_IE_BOTH 7
393 #define GOT_TLS_GDESC 8
394 #define GOT_TLS_GD_BOTH_P(type) \
395 ((type) == (GOT_TLS_GD | GOT_TLS_GDESC))
396 #define GOT_TLS_GD_P(type) \
397 ((type) == GOT_TLS_GD || GOT_TLS_GD_BOTH_P (type))
398 #define GOT_TLS_GDESC_P(type) \
399 ((type) == GOT_TLS_GDESC || GOT_TLS_GD_BOTH_P (type))
400 #define GOT_TLS_GD_ANY_P(type) \
401 (GOT_TLS_GD_P (type) || GOT_TLS_GDESC_P (type))
402
403 #define elf_x86_hash_entry(ent) \
404 ((struct elf_x86_link_hash_entry *)(ent))
405
406 enum elf_x86_target_os
407 {
408 is_normal,
409 is_vxworks,
410 is_nacl
411 };
412
413 /* x86 ELF linker hash table. */
414
415 struct elf_x86_link_hash_table
416 {
417 struct elf_link_hash_table elf;
418
419 /* Short-cuts to get to dynamic linker sections. */
420 asection *interp;
421 asection *plt_eh_frame;
422 asection *plt_second;
423 asection *plt_second_eh_frame;
424 asection *plt_got;
425 asection *plt_got_eh_frame;
426
427 /* Parameters describing PLT generation, lazy or non-lazy. */
428 struct elf_x86_plt_layout plt;
429
430 /* Parameters describing lazy PLT generation. */
431 const struct elf_x86_lazy_plt_layout *lazy_plt;
432
433 /* Parameters describing non-lazy PLT generation. */
434 const struct elf_x86_non_lazy_plt_layout *non_lazy_plt;
435
436 union
437 {
438 bfd_signed_vma refcount;
439 bfd_vma offset;
440 } tls_ld_or_ldm_got;
441
442 /* The amount of space used by the jump slots in the GOT. */
443 bfd_vma sgotplt_jump_table_size;
444
445 /* Small local sym cache. */
446 struct sym_cache sym_cache;
447
448 /* _TLS_MODULE_BASE_ symbol. */
449 struct bfd_link_hash_entry *tls_module_base;
450
451 /* Used by local STT_GNU_IFUNC symbols. */
452 htab_t loc_hash_table;
453 void * loc_hash_memory;
454
455 /* The offset into sgot of the GOT entry used by the PLT entry
456 above. */
457 bfd_vma tlsdesc_got;
458
459 /* The index of the next R_X86_64_JUMP_SLOT entry in .rela.plt. */
460 bfd_vma next_jump_slot_index;
461 /* The index of the next R_X86_64_IRELATIVE entry in .rela.plt. */
462 bfd_vma next_irelative_index;
463
464 /* TRUE if there are dynamic relocs against IFUNC symbols that apply
465 to read-only sections. */
466 bfd_boolean readonly_dynrelocs_against_ifunc;
467
468 /* The (unloaded but important) .rel.plt.unloaded section on VxWorks.
469 This is used for i386 only. */
470 asection *srelplt2;
471
472 /* The index of the next unused R_386_TLS_DESC slot in .rel.plt. This
473 is only used for i386. */
474 bfd_vma next_tls_desc_index;
475
476 /* The offset into splt of the PLT entry for the TLS descriptor
477 resolver. Special values are 0, if not necessary (or not found
478 to be necessary yet), and -1 if needed but not determined
479 yet. This is only used for x86-64. */
480 bfd_vma tlsdesc_plt;
481
482 /* Value used to fill the unused bytes of the first PLT entry. This
483 is only used for i386. */
484 bfd_byte plt0_pad_byte;
485
486 bfd_vma (*r_info) (bfd_vma, bfd_vma);
487 bfd_vma (*r_sym) (bfd_vma);
488 bfd_boolean (*is_reloc_section) (const char *);
489 enum elf_target_id target_id;
490 enum elf_x86_target_os target_os;
491 unsigned int sizeof_reloc;
492 unsigned int dt_reloc;
493 unsigned int dt_reloc_sz;
494 unsigned int dt_reloc_ent;
495 unsigned int got_entry_size;
496 unsigned int pointer_r_type;
497 int dynamic_interpreter_size;
498 const char *dynamic_interpreter;
499 const char *tls_get_addr;
500 };
501
502 /* Architecture-specific backend data for x86. */
503
504 struct elf_x86_backend_data
505 {
506 /* Target system. */
507 enum elf_x86_target_os target_os;
508 };
509
510 #define get_elf_x86_backend_data(abfd) \
511 ((const struct elf_x86_backend_data *) \
512 get_elf_backend_data (abfd)->arch_data)
513
514 struct elf_x86_init_table
515 {
516 /* The lazy PLT layout. */
517 const struct elf_x86_lazy_plt_layout *lazy_plt;
518
519 /* The non-lazy PLT layout. */
520 const struct elf_x86_non_lazy_plt_layout *non_lazy_plt;
521
522 /* The lazy PLT layout for IBT. */
523 const struct elf_x86_lazy_plt_layout *lazy_ibt_plt;
524
525 /* The non-lazy PLT layout for IBT. */
526 const struct elf_x86_non_lazy_plt_layout *non_lazy_ibt_plt;
527
528 bfd_byte plt0_pad_byte;
529
530 bfd_vma (*r_info) (bfd_vma, bfd_vma);
531 bfd_vma (*r_sym) (bfd_vma);
532 };
533
534 struct elf_x86_obj_tdata
535 {
536 struct elf_obj_tdata root;
537
538 /* tls_type for each local got entry. */
539 char *local_got_tls_type;
540
541 /* GOTPLT entries for TLS descriptors. */
542 bfd_vma *local_tlsdesc_gotent;
543 };
544
545 enum elf_x86_plt_type
546 {
547 plt_non_lazy = 0,
548 plt_lazy = 1 << 0,
549 plt_pic = 1 << 1,
550 plt_second = 1 << 2,
551 plt_unknown = -1
552 };
553
554 struct elf_x86_plt
555 {
556 const char *name;
557 asection *sec;
558 bfd_byte *contents;
559 enum elf_x86_plt_type type;
560 unsigned int plt_got_offset;
561 unsigned int plt_entry_size;
562 unsigned int plt_got_insn_size; /* Only used for x86-64. */
563 long count;
564 };
565
566 #define elf_x86_tdata(abfd) \
567 ((struct elf_x86_obj_tdata *) (abfd)->tdata.any)
568
569 #define elf_x86_local_got_tls_type(abfd) \
570 (elf_x86_tdata (abfd)->local_got_tls_type)
571
572 #define elf_x86_local_tlsdesc_gotent(abfd) \
573 (elf_x86_tdata (abfd)->local_tlsdesc_gotent)
574
575 #define elf_x86_compute_jump_table_size(htab) \
576 ((htab)->elf.srelplt->reloc_count * (htab)->got_entry_size)
577
578 #define is_x86_elf(bfd, htab) \
579 (bfd_get_flavour (bfd) == bfd_target_elf_flavour \
580 && elf_tdata (bfd) != NULL \
581 && elf_object_id (bfd) == (htab)->target_id)
582
583 extern bfd_boolean _bfd_x86_elf_mkobject
584 (bfd *);
585
586 extern void _bfd_x86_elf_set_tls_module_base
587 (struct bfd_link_info *);
588
589 extern bfd_vma _bfd_x86_elf_dtpoff_base
590 (struct bfd_link_info *);
591
592 extern bfd_boolean _bfd_x86_elf_readonly_dynrelocs
593 (struct elf_link_hash_entry *, void *);
594
595 extern struct elf_link_hash_entry * _bfd_elf_x86_get_local_sym_hash
596 (struct elf_x86_link_hash_table *, bfd *, const Elf_Internal_Rela *,
597 bfd_boolean);
598
599 extern hashval_t _bfd_x86_elf_local_htab_hash
600 (const void *);
601
602 extern int _bfd_x86_elf_local_htab_eq
603 (const void *, const void *);
604
605 extern struct bfd_hash_entry * _bfd_x86_elf_link_hash_newfunc
606 (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
607
608 extern struct bfd_link_hash_table * _bfd_x86_elf_link_hash_table_create
609 (bfd *);
610
611 extern int _bfd_x86_elf_compare_relocs
612 (const void *, const void *);
613
614 extern bfd_boolean _bfd_x86_elf_link_check_relocs
615 (bfd *, struct bfd_link_info *);
616
617 extern bfd_boolean _bfd_x86_elf_size_dynamic_sections
618 (bfd *, struct bfd_link_info *);
619
620 extern struct elf_x86_link_hash_table *_bfd_x86_elf_finish_dynamic_sections
621 (bfd *, struct bfd_link_info *);
622
623 extern bfd_boolean _bfd_x86_elf_always_size_sections
624 (bfd *, struct bfd_link_info *);
625
626 extern void _bfd_x86_elf_merge_symbol_attribute
627 (struct elf_link_hash_entry *, const Elf_Internal_Sym *,
628 bfd_boolean, bfd_boolean);
629
630 extern void _bfd_x86_elf_copy_indirect_symbol
631 (struct bfd_link_info *, struct elf_link_hash_entry *,
632 struct elf_link_hash_entry *);
633
634 extern bfd_boolean _bfd_x86_elf_fixup_symbol
635 (struct bfd_link_info *, struct elf_link_hash_entry *);
636
637 extern bfd_boolean _bfd_x86_elf_hash_symbol
638 (struct elf_link_hash_entry *);
639
640 extern bfd_boolean _bfd_x86_elf_adjust_dynamic_symbol
641 (struct bfd_link_info *, struct elf_link_hash_entry *);
642
643 extern void _bfd_x86_elf_hide_symbol
644 (struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean);
645
646 extern bfd_boolean _bfd_x86_elf_link_symbol_references_local
647 (struct bfd_link_info *, struct elf_link_hash_entry *);
648
649 extern asection * _bfd_x86_elf_gc_mark_hook
650 (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
651 struct elf_link_hash_entry *, Elf_Internal_Sym *);
652
653 extern long _bfd_x86_elf_get_synthetic_symtab
654 (bfd *, long, long, bfd_vma, struct elf_x86_plt [], asymbol **,
655 asymbol **);
656
657 extern enum elf_property_kind _bfd_x86_elf_parse_gnu_properties
658 (bfd *, unsigned int, bfd_byte *, unsigned int);
659
660 extern bfd_boolean _bfd_x86_elf_merge_gnu_properties
661 (struct bfd_link_info *, bfd *, elf_property *, elf_property *);
662
663 extern bfd * _bfd_x86_elf_link_setup_gnu_properties
664 (struct bfd_link_info *, struct elf_x86_init_table *);
665
666 #define bfd_elf64_mkobject \
667 _bfd_x86_elf_mkobject
668 #define bfd_elf32_mkobject \
669 _bfd_x86_elf_mkobject
670 #define bfd_elf64_bfd_link_hash_table_create \
671 _bfd_x86_elf_link_hash_table_create
672 #define bfd_elf32_bfd_link_hash_table_create \
673 _bfd_x86_elf_link_hash_table_create
674 #define bfd_elf64_bfd_link_check_relocs \
675 _bfd_x86_elf_link_check_relocs
676 #define bfd_elf32_bfd_link_check_relocs \
677 _bfd_x86_elf_link_check_relocs
678
679 #define elf_backend_size_dynamic_sections \
680 _bfd_x86_elf_size_dynamic_sections
681 #define elf_backend_always_size_sections \
682 _bfd_x86_elf_always_size_sections
683 #define elf_backend_merge_symbol_attribute \
684 _bfd_x86_elf_merge_symbol_attribute
685 #define elf_backend_copy_indirect_symbol \
686 _bfd_x86_elf_copy_indirect_symbol
687 #define elf_backend_fixup_symbol \
688 _bfd_x86_elf_fixup_symbol
689 #define elf_backend_hash_symbol \
690 _bfd_x86_elf_hash_symbol
691 #define elf_backend_adjust_dynamic_symbol \
692 _bfd_x86_elf_adjust_dynamic_symbol
693 #define elf_backend_gc_mark_hook \
694 _bfd_x86_elf_gc_mark_hook
695 #define elf_backend_omit_section_dynsym \
696 ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true)
697 #define elf_backend_parse_gnu_properties \
698 _bfd_x86_elf_parse_gnu_properties
699 #define elf_backend_merge_gnu_properties \
700 _bfd_x86_elf_merge_gnu_properties
This page took 0.075868 seconds and 5 git commands to generate.