Remove path name from test case
[binutils-gdb.git] / bfd / libpei.h
1 /* Support for the generic parts of PE/PEI; common header information.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
3 Written by Cygnus Solutions.
4
5 This file is part of BFD, the Binary File Descriptor library.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
20 MA 02110-1301, USA. */
21
22 #ifndef _LIBPEI_H
23 #define _LIBPEI_H
24
25 /* Most of this hacked by Steve Chamberlain,
26 sac@cygnus.com
27
28 PE/PEI rearrangement (and code added): Donn Terry
29 Softway Systems, Inc. */
30
31 /* Hey look, some documentation [and in a place you expect to find it]!
32
33 The main reference for the pei format is "Microsoft Portable Executable
34 and Common Object File Format Specification 4.1". Get it if you need to
35 do some serious hacking on this code.
36
37 Another reference:
38 "Peering Inside the PE: A Tour of the Win32 Portable Executable
39 File Format", MSJ 1994, Volume 9.
40
41 The *sole* difference between the pe format and the pei format is that the
42 latter has an MSDOS 2.0 .exe header on the front that prints the message
43 "This app must be run under Windows." (or some such).
44 (FIXME: Whether that statement is *really* true or not is unknown.
45 Are there more subtle differences between pe and pei formats?
46 For now assume there aren't. If you find one, then for God sakes
47 document it here!)
48
49 The Microsoft docs use the word "image" instead of "executable" because
50 the former can also refer to a DLL (shared library). Confusion can arise
51 because the `i' in `pei' also refers to "image". The `pe' format can
52 also create images (i.e. executables), it's just that to run on a win32
53 system you need to use the pei format.
54
55 FIXME: Please add more docs here so the next poor fool that has to hack
56 on this code has a chance of getting something accomplished without
57 wasting too much time. */
58
59 #ifndef GET_FCN_LNNOPTR
60 #define GET_FCN_LNNOPTR(abfd, ext) \
61 H_GET_32 (abfd, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr)
62 #endif
63
64 #ifndef GET_FCN_ENDNDX
65 #define GET_FCN_ENDNDX(abfd, ext) \
66 H_GET_32 (abfd, ext->x_sym.x_fcnary.x_fcn.x_endndx)
67 #endif
68
69 #ifndef PUT_FCN_LNNOPTR
70 #define PUT_FCN_LNNOPTR(abfd, in, ext) \
71 H_PUT_32(abfd, in, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr)
72 #endif
73 #ifndef PUT_FCN_ENDNDX
74 #define PUT_FCN_ENDNDX(abfd, in, ext) \
75 H_PUT_32(abfd, in, ext->x_sym.x_fcnary.x_fcn.x_endndx)
76 #endif
77 #ifndef GET_LNSZ_LNNO
78 #define GET_LNSZ_LNNO(abfd, ext) \
79 H_GET_16 (abfd, ext->x_sym.x_misc.x_lnsz.x_lnno)
80 #endif
81 #ifndef GET_LNSZ_SIZE
82 #define GET_LNSZ_SIZE(abfd, ext) \
83 H_GET_16 (abfd, ext->x_sym.x_misc.x_lnsz.x_size)
84 #endif
85 #ifndef PUT_LNSZ_LNNO
86 #define PUT_LNSZ_LNNO(abfd, in, ext) \
87 H_PUT_16(abfd, in, ext->x_sym.x_misc.x_lnsz.x_lnno)
88 #endif
89 #ifndef PUT_LNSZ_SIZE
90 #define PUT_LNSZ_SIZE(abfd, in, ext) \
91 H_PUT_16(abfd, in, ext->x_sym.x_misc.x_lnsz.x_size)
92 #endif
93 #ifndef GET_SCN_SCNLEN
94 #define GET_SCN_SCNLEN(abfd, ext) \
95 H_GET_32 (abfd, ext->x_scn.x_scnlen)
96 #endif
97 #ifndef GET_SCN_NRELOC
98 #define GET_SCN_NRELOC(abfd, ext) \
99 H_GET_16 (abfd, ext->x_scn.x_nreloc)
100 #endif
101 #ifndef GET_SCN_NLINNO
102 #define GET_SCN_NLINNO(abfd, ext) \
103 H_GET_16 (abfd, ext->x_scn.x_nlinno)
104 #endif
105 #ifndef PUT_SCN_SCNLEN
106 #define PUT_SCN_SCNLEN(abfd, in, ext) \
107 H_PUT_32(abfd, in, ext->x_scn.x_scnlen)
108 #endif
109 #ifndef PUT_SCN_NRELOC
110 #define PUT_SCN_NRELOC(abfd, in, ext) \
111 H_PUT_16(abfd, in, ext->x_scn.x_nreloc)
112 #endif
113 #ifndef PUT_SCN_NLINNO
114 #define PUT_SCN_NLINNO(abfd, in, ext) \
115 H_PUT_16(abfd,in, ext->x_scn.x_nlinno)
116 #endif
117 #ifndef GET_LINENO_LNNO
118 #define GET_LINENO_LNNO(abfd, ext) \
119 H_GET_16 (abfd, ext->l_lnno);
120 #endif
121 #ifndef PUT_LINENO_LNNO
122 #define PUT_LINENO_LNNO(abfd, val, ext) \
123 H_PUT_16(abfd,val, ext->l_lnno);
124 #endif
125
126 /* The f_symptr field in the filehdr is sometimes 64 bits. */
127 #ifndef GET_FILEHDR_SYMPTR
128 #define GET_FILEHDR_SYMPTR H_GET_32
129 #endif
130 #ifndef PUT_FILEHDR_SYMPTR
131 #define PUT_FILEHDR_SYMPTR H_PUT_32
132 #endif
133
134 /* Some fields in the aouthdr are sometimes 64 bits. */
135 #ifndef GET_AOUTHDR_TSIZE
136 #define GET_AOUTHDR_TSIZE H_GET_32
137 #endif
138 #ifndef PUT_AOUTHDR_TSIZE
139 #define PUT_AOUTHDR_TSIZE H_PUT_32
140 #endif
141 #ifndef GET_AOUTHDR_DSIZE
142 #define GET_AOUTHDR_DSIZE H_GET_32
143 #endif
144 #ifndef PUT_AOUTHDR_DSIZE
145 #define PUT_AOUTHDR_DSIZE H_PUT_32
146 #endif
147 #ifndef GET_AOUTHDR_BSIZE
148 #define GET_AOUTHDR_BSIZE H_GET_32
149 #endif
150 #ifndef PUT_AOUTHDR_BSIZE
151 #define PUT_AOUTHDR_BSIZE H_PUT_32
152 #endif
153 #ifndef GET_AOUTHDR_ENTRY
154 #define GET_AOUTHDR_ENTRY H_GET_32
155 #endif
156 #ifndef PUT_AOUTHDR_ENTRY
157 #define PUT_AOUTHDR_ENTRY H_PUT_32
158 #endif
159 #ifndef GET_AOUTHDR_TEXT_START
160 #define GET_AOUTHDR_TEXT_START H_GET_32
161 #endif
162 #ifndef PUT_AOUTHDR_TEXT_START
163 #define PUT_AOUTHDR_TEXT_START H_PUT_32
164 #endif
165 #ifndef GET_AOUTHDR_DATA_START
166 #define GET_AOUTHDR_DATA_START H_GET_32
167 #endif
168 #ifndef PUT_AOUTHDR_DATA_START
169 #define PUT_AOUTHDR_DATA_START H_PUT_32
170 #endif
171
172 /* Some fields in the scnhdr are sometimes 64 bits. */
173 #ifndef GET_SCNHDR_PADDR
174 #define GET_SCNHDR_PADDR H_GET_32
175 #endif
176 #ifndef PUT_SCNHDR_PADDR
177 #define PUT_SCNHDR_PADDR H_PUT_32
178 #endif
179 #ifndef GET_SCNHDR_VADDR
180 #define GET_SCNHDR_VADDR H_GET_32
181 #endif
182 #ifndef PUT_SCNHDR_VADDR
183 #define PUT_SCNHDR_VADDR H_PUT_32
184 #endif
185 #ifndef GET_SCNHDR_SIZE
186 #define GET_SCNHDR_SIZE H_GET_32
187 #endif
188 #ifndef PUT_SCNHDR_SIZE
189 #define PUT_SCNHDR_SIZE H_PUT_32
190 #endif
191 #ifndef GET_SCNHDR_SCNPTR
192 #define GET_SCNHDR_SCNPTR H_GET_32
193 #endif
194 #ifndef PUT_SCNHDR_SCNPTR
195 #define PUT_SCNHDR_SCNPTR H_PUT_32
196 #endif
197 #ifndef GET_SCNHDR_RELPTR
198 #define GET_SCNHDR_RELPTR H_GET_32
199 #endif
200 #ifndef PUT_SCNHDR_RELPTR
201 #define PUT_SCNHDR_RELPTR H_PUT_32
202 #endif
203 #ifndef GET_SCNHDR_LNNOPTR
204 #define GET_SCNHDR_LNNOPTR H_GET_32
205 #endif
206 #ifndef PUT_SCNHDR_LNNOPTR
207 #define PUT_SCNHDR_LNNOPTR H_PUT_32
208 #endif
209
210 #ifdef COFF_WITH_pex64
211
212 #define GET_OPTHDR_IMAGE_BASE H_GET_64
213 #define PUT_OPTHDR_IMAGE_BASE H_PUT_64
214 #define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_64
215 #define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_64
216 #define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_64
217 #define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_64
218 #define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_64
219 #define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_64
220 #define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_64
221 #define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_64
222 #define GET_PDATA_ENTRY bfd_get_32
223
224 #define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pex64_bfd_copy_private_bfd_data_common
225 #define _bfd_XX_bfd_copy_private_section_data _bfd_pex64_bfd_copy_private_section_data
226 #define _bfd_XX_get_symbol_info _bfd_pex64_get_symbol_info
227 #define _bfd_XX_only_swap_filehdr_out _bfd_pex64_only_swap_filehdr_out
228 #define _bfd_XX_print_private_bfd_data_common _bfd_pex64_print_private_bfd_data_common
229 #define _bfd_XXi_final_link_postscript _bfd_pex64i_final_link_postscript
230 #define _bfd_XXi_only_swap_filehdr_out _bfd_pex64i_only_swap_filehdr_out
231 #define _bfd_XXi_swap_aouthdr_in _bfd_pex64i_swap_aouthdr_in
232 #define _bfd_XXi_swap_aouthdr_out _bfd_pex64i_swap_aouthdr_out
233 #define _bfd_XXi_swap_aux_in _bfd_pex64i_swap_aux_in
234 #define _bfd_XXi_swap_aux_out _bfd_pex64i_swap_aux_out
235 #define _bfd_XXi_swap_lineno_in _bfd_pex64i_swap_lineno_in
236 #define _bfd_XXi_swap_lineno_out _bfd_pex64i_swap_lineno_out
237 #define _bfd_XXi_swap_scnhdr_out _bfd_pex64i_swap_scnhdr_out
238 #define _bfd_XXi_swap_sym_in _bfd_pex64i_swap_sym_in
239 #define _bfd_XXi_swap_sym_out _bfd_pex64i_swap_sym_out
240 #define _bfd_XXi_swap_debugdir_in _bfd_pex64i_swap_debugdir_in
241 #define _bfd_XXi_swap_debugdir_out _bfd_pex64i_swap_debugdir_out
242 #define _bfd_XXi_write_codeview_record _bfd_pex64i_write_codeview_record
243 #define _bfd_XXi_slurp_codeview_record _bfd_pex64i_slurp_codeview_record
244
245 #elif defined COFF_WITH_pep
246
247 #define GET_OPTHDR_IMAGE_BASE H_GET_64
248 #define PUT_OPTHDR_IMAGE_BASE H_PUT_64
249 #define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_64
250 #define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_64
251 #define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_64
252 #define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_64
253 #define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_64
254 #define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_64
255 #define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_64
256 #define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_64
257 #define GET_PDATA_ENTRY bfd_get_64
258
259 #define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pep_bfd_copy_private_bfd_data_common
260 #define _bfd_XX_bfd_copy_private_section_data _bfd_pep_bfd_copy_private_section_data
261 #define _bfd_XX_get_symbol_info _bfd_pep_get_symbol_info
262 #define _bfd_XX_only_swap_filehdr_out _bfd_pep_only_swap_filehdr_out
263 #define _bfd_XX_print_private_bfd_data_common _bfd_pep_print_private_bfd_data_common
264 #define _bfd_XXi_final_link_postscript _bfd_pepi_final_link_postscript
265 #define _bfd_XXi_only_swap_filehdr_out _bfd_pepi_only_swap_filehdr_out
266 #define _bfd_XXi_swap_aouthdr_in _bfd_pepi_swap_aouthdr_in
267 #define _bfd_XXi_swap_aouthdr_out _bfd_pepi_swap_aouthdr_out
268 #define _bfd_XXi_swap_aux_in _bfd_pepi_swap_aux_in
269 #define _bfd_XXi_swap_aux_out _bfd_pepi_swap_aux_out
270 #define _bfd_XXi_swap_lineno_in _bfd_pepi_swap_lineno_in
271 #define _bfd_XXi_swap_lineno_out _bfd_pepi_swap_lineno_out
272 #define _bfd_XXi_swap_scnhdr_out _bfd_pepi_swap_scnhdr_out
273 #define _bfd_XXi_swap_sym_in _bfd_pepi_swap_sym_in
274 #define _bfd_XXi_swap_sym_out _bfd_pepi_swap_sym_out
275 #define _bfd_XXi_swap_debugdir_in _bfd_pepi_swap_debugdir_in
276 #define _bfd_XXi_swap_debugdir_out _bfd_pepi_swap_debugdir_out
277 #define _bfd_XXi_write_codeview_record _bfd_pepi_write_codeview_record
278 #define _bfd_XXi_slurp_codeview_record _bfd_pepi_slurp_codeview_record
279
280 #elif defined COFF_WITH_peAArch64
281
282 #define GET_OPTHDR_IMAGE_BASE H_GET_64
283 #define PUT_OPTHDR_IMAGE_BASE H_PUT_64
284 #define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_64
285 #define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_64
286 #define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_64
287 #define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_64
288 #define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_64
289 #define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_64
290 #define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_64
291 #define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_64
292 #define GET_PDATA_ENTRY bfd_get_32
293
294 #define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_peAArch64_bfd_copy_private_bfd_data_common
295 #define _bfd_XX_bfd_copy_private_section_data _bfd_peAArch64_bfd_copy_private_section_data
296 #define _bfd_XX_get_symbol_info _bfd_peAArch64_get_symbol_info
297 #define _bfd_XX_only_swap_filehdr_out _bfd_peAArch64_only_swap_filehdr_out
298 #define _bfd_XX_print_private_bfd_data_common _bfd_peAArch64_print_private_bfd_data_common
299 #define _bfd_XXi_final_link_postscript _bfd_peAArch64i_final_link_postscript
300 #define _bfd_XXi_only_swap_filehdr_out _bfd_peAArch64i_only_swap_filehdr_out
301 #define _bfd_XXi_swap_aouthdr_in _bfd_peAArch64i_swap_aouthdr_in
302 #define _bfd_XXi_swap_aouthdr_out _bfd_peAArch64i_swap_aouthdr_out
303 #define _bfd_XXi_swap_aux_in _bfd_peAArch64i_swap_aux_in
304 #define _bfd_XXi_swap_aux_out _bfd_peAArch64i_swap_aux_out
305 #define _bfd_XXi_swap_lineno_in _bfd_peAArch64i_swap_lineno_in
306 #define _bfd_XXi_swap_lineno_out _bfd_peAArch64i_swap_lineno_out
307 #define _bfd_XXi_swap_scnhdr_out _bfd_peAArch64i_swap_scnhdr_out
308 #define _bfd_XXi_swap_sym_in _bfd_peAArch64i_swap_sym_in
309 #define _bfd_XXi_swap_sym_out _bfd_peAArch64i_swap_sym_out
310 #define _bfd_XXi_swap_debugdir_in _bfd_peAArch64i_swap_debugdir_in
311 #define _bfd_XXi_swap_debugdir_out _bfd_peAArch64i_swap_debugdir_out
312 #define _bfd_XXi_write_codeview_record _bfd_peAArch64i_write_codeview_record
313 #define _bfd_XXi_slurp_codeview_record _bfd_peAArch64i_slurp_codeview_record
314
315 #elif defined COFF_WITH_peLoongArch64
316
317 #define GET_OPTHDR_IMAGE_BASE H_GET_64
318 #define PUT_OPTHDR_IMAGE_BASE H_PUT_64
319 #define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_64
320 #define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_64
321 #define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_64
322 #define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_64
323 #define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_64
324 #define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_64
325 #define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_64
326 #define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_64
327 #define GET_PDATA_ENTRY bfd_get_32
328
329 #define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_peLoongArch64_bfd_copy_private_bfd_data_common
330 #define _bfd_XX_bfd_copy_private_section_data _bfd_peLoongArch64_bfd_copy_private_section_data
331 #define _bfd_XX_get_symbol_info _bfd_peLoongArch64_get_symbol_info
332 #define _bfd_XX_only_swap_filehdr_out _bfd_peLoongArch64_only_swap_filehdr_out
333 #define _bfd_XX_print_private_bfd_data_common _bfd_peLoongArch64_print_private_bfd_data_common
334 #define _bfd_XXi_final_link_postscript _bfd_peLoongArch64i_final_link_postscript
335 #define _bfd_XXi_only_swap_filehdr_out _bfd_peLoongArch64i_only_swap_filehdr_out
336 #define _bfd_XXi_swap_aouthdr_in _bfd_peLoongArch64i_swap_aouthdr_in
337 #define _bfd_XXi_swap_aouthdr_out _bfd_peLoongArch64i_swap_aouthdr_out
338 #define _bfd_XXi_swap_aux_in _bfd_peLoongArch64i_swap_aux_in
339 #define _bfd_XXi_swap_aux_out _bfd_peLoongArch64i_swap_aux_out
340 #define _bfd_XXi_swap_lineno_in _bfd_peLoongArch64i_swap_lineno_in
341 #define _bfd_XXi_swap_lineno_out _bfd_peLoongArch64i_swap_lineno_out
342 #define _bfd_XXi_swap_scnhdr_out _bfd_peLoongArch64i_swap_scnhdr_out
343 #define _bfd_XXi_swap_sym_in _bfd_peLoongArch64i_swap_sym_in
344 #define _bfd_XXi_swap_sym_out _bfd_peLoongArch64i_swap_sym_out
345 #define _bfd_XXi_swap_debugdir_in _bfd_peLoongArch64i_swap_debugdir_in
346 #define _bfd_XXi_swap_debugdir_out _bfd_peLoongArch64i_swap_debugdir_out
347 #define _bfd_XXi_write_codeview_record _bfd_peLoongArch64i_write_codeview_record
348 #define _bfd_XXi_slurp_codeview_record _bfd_peLoongArch64i_slurp_codeview_record
349
350 #else /* !COFF_WITH_pep */
351
352 #define GET_OPTHDR_IMAGE_BASE H_GET_32
353 #define PUT_OPTHDR_IMAGE_BASE H_PUT_32
354 #define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_32
355 #define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_32
356 #define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_32
357 #define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_32
358 #define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_32
359 #define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_32
360 #define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_32
361 #define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_32
362 #define GET_PDATA_ENTRY bfd_get_32
363
364 #define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pe_bfd_copy_private_bfd_data_common
365 #define _bfd_XX_bfd_copy_private_section_data _bfd_pe_bfd_copy_private_section_data
366 #define _bfd_XX_get_symbol_info _bfd_pe_get_symbol_info
367 #define _bfd_XX_only_swap_filehdr_out _bfd_pe_only_swap_filehdr_out
368 #define _bfd_XX_print_private_bfd_data_common _bfd_pe_print_private_bfd_data_common
369 #define _bfd_XXi_final_link_postscript _bfd_pei_final_link_postscript
370 #define _bfd_XXi_only_swap_filehdr_out _bfd_pei_only_swap_filehdr_out
371 #define _bfd_XXi_swap_aouthdr_in _bfd_pei_swap_aouthdr_in
372 #define _bfd_XXi_swap_aouthdr_out _bfd_pei_swap_aouthdr_out
373 #define _bfd_XXi_swap_aux_in _bfd_pei_swap_aux_in
374 #define _bfd_XXi_swap_aux_out _bfd_pei_swap_aux_out
375 #define _bfd_XXi_swap_lineno_in _bfd_pei_swap_lineno_in
376 #define _bfd_XXi_swap_lineno_out _bfd_pei_swap_lineno_out
377 #define _bfd_XXi_swap_scnhdr_out _bfd_pei_swap_scnhdr_out
378 #define _bfd_XXi_swap_sym_in _bfd_pei_swap_sym_in
379 #define _bfd_XXi_swap_sym_out _bfd_pei_swap_sym_out
380 #define _bfd_XXi_swap_debugdir_in _bfd_pei_swap_debugdir_in
381 #define _bfd_XXi_swap_debugdir_out _bfd_pei_swap_debugdir_out
382 #define _bfd_XXi_write_codeview_record _bfd_pei_write_codeview_record
383 #define _bfd_XXi_slurp_codeview_record _bfd_pei_slurp_codeview_record
384
385 #endif /* !COFF_WITH_pep */
386
387 /* These functions are architecture dependent, and are in peicode.h:
388 coff_swap_reloc_in
389 int coff_swap_reloc_out
390 coff_swap_filehdr_in
391 coff_swap_scnhdr_in
392 pe_mkobject
393 pe_mkobject_hook */
394
395 /* The functions described below are common across all PE/PEI
396 implementations architecture types, and actually appear in
397 peigen.c. */
398
399 #define coff_swap_sym_in _bfd_XXi_swap_sym_in
400 #define coff_swap_sym_out _bfd_XXi_swap_sym_out
401 #define coff_swap_aux_in _bfd_XXi_swap_aux_in
402 #define coff_swap_aux_out _bfd_XXi_swap_aux_out
403 #define coff_swap_lineno_in _bfd_XXi_swap_lineno_in
404 #define coff_swap_lineno_out _bfd_XXi_swap_lineno_out
405 #define coff_swap_aouthdr_in _bfd_XXi_swap_aouthdr_in
406 #define coff_swap_aouthdr_out _bfd_XXi_swap_aouthdr_out
407 #define coff_swap_scnhdr_out _bfd_XXi_swap_scnhdr_out
408
409 #ifndef coff_final_link_postscript
410 #define coff_final_link_postscript _bfd_XXi_final_link_postscript
411 #endif
412
413 void _bfd_XXi_swap_sym_in (bfd *, void *, void *);
414 unsigned _bfd_XXi_swap_sym_out (bfd *, void *, void *);
415 void _bfd_XXi_swap_aux_in (bfd *, void *, int, int, int, int, void *);
416 unsigned _bfd_XXi_swap_aux_out (bfd *, void *, int, int, int, int, void *);
417 void _bfd_XXi_swap_lineno_in (bfd *, void *, void *);
418 unsigned _bfd_XXi_swap_lineno_out (bfd *, void *, void *);
419 void _bfd_XXi_swap_aouthdr_in (bfd *, void *, void *);
420 unsigned _bfd_XXi_swap_aouthdr_out (bfd *, void *, void *);
421 unsigned _bfd_XXi_swap_scnhdr_out (bfd *, void *, void *);
422 bool _bfd_XX_print_private_bfd_data_common (bfd *, void *);
423 bool _bfd_XX_bfd_copy_private_bfd_data_common (bfd *, bfd *);
424 void _bfd_XX_get_symbol_info (bfd *, asymbol *, symbol_info *);
425 bool _bfd_XXi_final_link_postscript (bfd *, struct coff_final_link_info *);
426 void _bfd_XXi_swap_debugdir_in (bfd *, void *, void *);
427 unsigned _bfd_XXi_swap_debugdir_out (bfd *, void *, void *);
428 unsigned _bfd_XXi_write_codeview_record
429 (bfd *, file_ptr, CODEVIEW_INFO *, const char *);
430 CODEVIEW_INFO *_bfd_XXi_slurp_codeview_record
431 (bfd * abfd, file_ptr where, unsigned long length, CODEVIEW_INFO *cvinfo,
432 char **pdb);
433
434 /* The following are needed only for ONE of pe or pei, but don't
435 otherwise vary; peicode.h fixes up ifdefs but we provide the
436 prototype. */
437
438 unsigned _bfd_XX_only_swap_filehdr_out (bfd *, void *, void *);
439 unsigned _bfd_XXi_only_swap_filehdr_out (bfd *, void *, void *);
440 bool _bfd_XX_bfd_copy_private_section_data
441 (bfd *, asection *, bfd *, asection *);
442
443 bool _bfd_pe_print_ce_compressed_pdata (bfd *, void *);
444 bool _bfd_pe64_print_ce_compressed_pdata (bfd *, void *);
445 bool _bfd_pex64_print_ce_compressed_pdata (bfd *, void *);
446 bool _bfd_peAArch64_print_ce_compressed_pdata (bfd *, void *);
447 bool _bfd_peLoongArch64_print_ce_compressed_pdata (bfd *, void *);
448 bool _bfd_pep_print_ce_compressed_pdata (bfd *, void *);
449
450 #endif /* _LIBPEI_H */