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