Updated Malay translation for the bfd sub-directory
[binutils-gdb.git] / ld / emultempl / elf.em
blob4d431995d2ec1e8def148e1f0ee86af3808e7a61
1 # This shell script emits a C file. -*- C -*-
2 # It does some substitutions.
3 test -z "${ELFSIZE}" && ELFSIZE=32
4 if [ -z "$MACHINE" ]; then
5   OUTPUT_ARCH=${ARCH}
6 else
7   OUTPUT_ARCH=${ARCH}:${MACHINE}
8 fi
9 fragment <<EOF
10 /* This file is is generated by a shell script.  DO NOT EDIT! */
12 /* ${ELFSIZE} bit ELF emulation code for ${EMULATION_NAME}
13    Copyright (C) 1991-2025 Free Software Foundation, Inc.
14    Written by Steve Chamberlain <sac@cygnus.com>
15    ELF support by Ian Lance Taylor <ian@cygnus.com>
17    This file is part of the GNU Binutils.
19    This program is free software; you can redistribute it and/or modify
20    it under the terms of the GNU General Public License as published by
21    the Free Software Foundation; either version 3 of the License, or
22    (at your option) any later version.
24    This program is distributed in the hope that it will be useful,
25    but WITHOUT ANY WARRANTY; without even the implied warranty of
26    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27    GNU General Public License for more details.
29    You should have received a copy of the GNU General Public License
30    along with this program; if not, write to the Free Software
31    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
32    MA 02110-1301, USA.  */
34 #define TARGET_IS_${EMULATION_NAME}
36 #include "sysdep.h"
37 #include "bfd.h"
38 #include "libiberty.h"
39 #include "getopt.h"
40 #include "bfdlink.h"
41 #include "ctf-api.h"
42 #include "ld.h"
43 #include "ldmain.h"
44 #include "ldmisc.h"
45 #include "ldexp.h"
46 #include "ldlang.h"
47 #include "ldfile.h"
48 #include "ldlex.h"
49 #include "ldemul.h"
50 #include <ldgram.h>
51 #include "elf-bfd.h"
52 #include "ldelf.h"
53 #include "ldelfgen.h"
55 /* Declare functions used by various EXTRA_EM_FILEs.  */
56 static void gld${EMULATION_NAME}_before_parse (void);
57 static void gld${EMULATION_NAME}_before_plugin_all_symbols_read
58   (void);
59 static void gld${EMULATION_NAME}_after_open (void);
60 static void gld${EMULATION_NAME}_before_allocation (void);
61 static void gld${EMULATION_NAME}_after_allocation (void);
62 EOF
64 # Import any needed special functions and/or overrides.
66 source_em ${srcdir}/emultempl/elf-generic.em
67 if test -n "$EXTRA_EM_FILE" ; then
68   source_em ${srcdir}/emultempl/${EXTRA_EM_FILE}.em
71 # Functions in this file can be overridden by setting the LDEMUL_* shell
72 # variables.  If the name of the overriding function is the same as is
73 # defined in this file, then don't output this file's version.
74 # If a different overriding name is given then output the standard function
75 # as presumably it is called from the overriding function.
77 if test x"$LDEMUL_BEFORE_PARSE" != xgld"$EMULATION_NAME"_before_parse; then
78 fragment <<EOF
80 static void
81 gld${EMULATION_NAME}_before_parse (void)
83   ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
84   input_flags.dynamic = ${DYNAMIC_LINK-true};
85   config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`;
86   config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo true ; else echo false ; fi`;
87   link_info.check_relocs_after_open_input = true;
88 EOF
89 if test -n "$COMMONPAGESIZE"; then
90 fragment <<EOF
91   link_info.relro = DEFAULT_LD_Z_RELRO;
92 EOF
94 fragment <<EOF
95   link_info.separate_code = DEFAULT_LD_Z_SEPARATE_CODE;
96   link_info.one_rosegment = DEFAULT_LD_ROSEGMENT;
97   link_info.warn_execstack = DEFAULT_LD_WARN_EXECSTACK;
98   link_info.no_warn_rwx_segments = ! DEFAULT_LD_WARN_RWX_SEGMENTS;
99   link_info.default_execstack = DEFAULT_LD_EXECSTACK;
100   link_info.error_execstack = DEFAULT_LD_ERROR_EXECSTACK;
101   link_info.warn_is_error_for_rwx_segments = DEFAULT_LD_ERROR_RWX_SEGMENTS;
107 fragment <<EOF
109 /* These variables are used to implement target options */
111 static char *audit; /* colon (typically) separated list of libs */
112 static char *depaudit; /* colon (typically) separated list of libs */
116 if test x"$LDEMUL_AFTER_OPEN" != xgld"$EMULATION_NAME"_after_open; then
118   IS_LINUX_TARGET=false
119   IS_FREEBSD_TARGET=false
120   case ${target} in
121     *-*-linux-* | *-*-k*bsd*-* | *-*-gnu*)
122       IS_LINUX_TARGET=true ;;
123     *-*-freebsd* | *-*-dragonfly*)
124       IS_FREEBSD_TARGET=true ;;
125   esac
126   IS_LIBPATH=false
127   if test "x${USE_LIBPATH}" = xyes; then
128     IS_LIBPATH=true
129   fi
130   IS_NATIVE=false
131   if test "x${NATIVE}" = xyes; then
132     IS_NATIVE=true
133   fi
135 fragment <<EOF
137 /* This is called before calling plugin 'all symbols read' hook.  */
139 static void
140 gld${EMULATION_NAME}_before_plugin_all_symbols_read (void)
142   ldelf_before_plugin_all_symbols_read ($IS_LIBPATH, $IS_NATIVE,
143                                         $IS_LINUX_TARGET,
144                                         $IS_FREEBSD_TARGET,
145                                         $ELFSIZE, "$prefix");
148 /* This is called after all the input files have been opened.  */
150 static void
151 gld${EMULATION_NAME}_after_open (void)
153   ldelf_after_open ($IS_LIBPATH, $IS_NATIVE,
154                     $IS_LINUX_TARGET, $IS_FREEBSD_TARGET, $ELFSIZE, "$prefix");
160 if test x"$LDEMUL_BEFORE_ALLOCATION" != xgld"$EMULATION_NAME"_before_allocation; then
161   if test x"${ELF_INTERPRETER_NAME}" = x; then
162     ELF_INTERPRETER_NAME=NULL
163   fi
164 fragment <<EOF
166 /* This is called after the sections have been attached to output
167    sections, but before any sizes or addresses have been set.  */
169 static void
170 gld${EMULATION_NAME}_before_allocation (void)
172   ldelf_before_allocation (audit, depaudit, ${ELF_INTERPRETER_NAME});
178 if test x"$LDEMUL_AFTER_ALLOCATION" != xgld"$EMULATION_NAME"_after_allocation; then
179 fragment <<EOF
181 static void
182 gld${EMULATION_NAME}_after_allocation (void)
184   int need_layout = bfd_elf_discard_info (link_info.output_bfd, &link_info);
186   if (need_layout < 0)
187     einfo (_("%X%P: .eh_frame/.stab edit: %E\n"));
188   else
189     ldelf_map_segments (need_layout);
194 if test x"$LDEMUL_GET_SCRIPT" != xgld"$EMULATION_NAME"_get_script; then
195 fragment <<EOF
197 static char *
198 gld${EMULATION_NAME}_get_script (int *isfile)
201 if test x"$COMPILE_IN" = xyes
202 then
203 # Scripts compiled in.
205 # sed commands to quote an ld script as a C string.
206 sc="-f ${srcdir}/emultempl/stringify.sed"
208 fragment <<EOF
210   *isfile = 0;
212   if (bfd_link_relocatable (&link_info) && config.build_constructors)
213     return
215 sed $sc ldscripts/${EMULATION_NAME}.xu                  >> e${EMULATION_NAME}.c
217 echo '  ; else if (bfd_link_relocatable (&link_info)) return' >> e${EMULATION_NAME}.c
218 sed $sc ldscripts/${EMULATION_NAME}.xr                  >> e${EMULATION_NAME}.c
220 echo '  ; else if (!config.text_read_only) return'      >> e${EMULATION_NAME}.c
221 sed $sc ldscripts/${EMULATION_NAME}.xbn                 >> e${EMULATION_NAME}.c
223 if cmp -s ldscripts/${EMULATION_NAME}.x ldscripts/${EMULATION_NAME}.xn; then : ; else
224   echo '  ; else if (!config.magic_demand_paged) return'        >> e${EMULATION_NAME}.c
225   sed $sc ldscripts/${EMULATION_NAME}.xn                        >> e${EMULATION_NAME}.c
228 if test -n "$GENERATE_PIE_SCRIPT" ; then
229 if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
231 echo '  ; else if (bfd_link_pie (&link_info)'           >> e${EMULATION_NAME}.c
232 echo '             && link_info.combreloc'              >> e${EMULATION_NAME}.c
233 echo '             && link_info.separate_code'          >> e${EMULATION_NAME}.c
234 echo '             && link_info.one_rosegment'          >> e${EMULATION_NAME}.c
235 echo '             && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c
236 sed $sc ldscripts/${EMULATION_NAME}.xdwer               >> e${EMULATION_NAME}.c
238 echo '  ; else if (bfd_link_pie (&link_info)'           >> e${EMULATION_NAME}.c
239 echo '             && link_info.combreloc'              >> e${EMULATION_NAME}.c
240 echo '             && link_info.separate_code'          >> e${EMULATION_NAME}.c
241 echo '             && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c
242 sed $sc ldscripts/${EMULATION_NAME}.xdwe                >> e${EMULATION_NAME}.c
244 echo '  ; else if (bfd_link_pie (&link_info)'           >> e${EMULATION_NAME}.c
245 echo '             && link_info.combreloc'              >> e${EMULATION_NAME}.c
246 echo '             && link_info.relro'                  >> e${EMULATION_NAME}.c
247 echo '             && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c
248 sed $sc ldscripts/${EMULATION_NAME}.xdw                 >> e${EMULATION_NAME}.c
250 if test -n "$GENERATE_RELRO_SCRIPT" ; then
252 echo '  ; else if (bfd_link_pie (&link_info)'          >> e${EMULATION_NAME}.c
253 echo '             && link_info.combreloc'             >> e${EMULATION_NAME}.c
254 echo '             && link_info.separate_code'         >> e${EMULATION_NAME}.c
255 echo '             && link_info.one_rosegment'         >> e${EMULATION_NAME}.c
256 echo '             && link_info.relro) return'         >> e${EMULATION_NAME}.c
257 sed $sc ldscripts/${EMULATION_NAME}.xdceor             >> e${EMULATION_NAME}.c
259 echo '  ; else if (bfd_link_pie (&link_info)'          >> e${EMULATION_NAME}.c
260 echo '             && link_info.combreloc'             >> e${EMULATION_NAME}.c
261 echo '             && link_info.separate_code'         >> e${EMULATION_NAME}.c
262 echo '             && link_info.relro) return'         >> e${EMULATION_NAME}.c
263 sed $sc ldscripts/${EMULATION_NAME}.xdceo              >> e${EMULATION_NAME}.c
267 echo '  ; else if (bfd_link_pie (&link_info)'           >> e${EMULATION_NAME}.c
268 echo '             && link_info.separate_code'          >> e${EMULATION_NAME}.c
269 echo '             && link_info.one_rosegment'          >> e${EMULATION_NAME}.c
270 echo '             && link_info.combreloc) return'      >> e${EMULATION_NAME}.c
271 sed $sc ldscripts/${EMULATION_NAME}.xdcer               >> e${EMULATION_NAME}.c
273 echo '  ; else if (bfd_link_pie (&link_info)'           >> e${EMULATION_NAME}.c
274 echo '             && link_info.separate_code'          >> e${EMULATION_NAME}.c
275 echo '             && link_info.combreloc) return'      >> e${EMULATION_NAME}.c
276 sed $sc ldscripts/${EMULATION_NAME}.xdce                >> e${EMULATION_NAME}.c
278 if test -n "$GENERATE_RELRO_SCRIPT" ; then
280 echo '  ; else if (bfd_link_pie (&link_info)'          >> e${EMULATION_NAME}.c
281 echo '             && link_info.combreloc'             >> e${EMULATION_NAME}.c
282 echo '             && link_info.relro) return'         >> e${EMULATION_NAME}.c
283 sed $sc ldscripts/${EMULATION_NAME}.xdco               >> e${EMULATION_NAME}.c
287 echo '  ; else if (bfd_link_pie (&link_info)'           >> e${EMULATION_NAME}.c
288 echo '             && link_info.combreloc) return'      >> e${EMULATION_NAME}.c
289 sed $sc ldscripts/${EMULATION_NAME}.xdc                 >> e${EMULATION_NAME}.c
291 if test -n "$GENERATE_RELRO_SCRIPT" ; then
293 echo '  ; else if (bfd_link_pie (&link_info)'          >> e${EMULATION_NAME}.c
294 echo '             && link_info.separate_code'         >> e${EMULATION_NAME}.c
295 echo '             && link_info.one_rosegment'         >> e${EMULATION_NAME}.c
296 echo '             && link_info.relro) return'         >> e${EMULATION_NAME}.c
297 sed $sc ldscripts/${EMULATION_NAME}.xdeor              >> e${EMULATION_NAME}.c
299 echo '  ; else if (bfd_link_pie (&link_info)'          >> e${EMULATION_NAME}.c
300 echo '             && link_info.separate_code'         >> e${EMULATION_NAME}.c
301 echo '             && link_info.relro) return'         >> e${EMULATION_NAME}.c
302 sed $sc ldscripts/${EMULATION_NAME}.xdeo               >> e${EMULATION_NAME}.c
308 echo '  ; else if (bfd_link_pie (&link_info)'           >> e${EMULATION_NAME}.c
309 echo '             && link_info.one_rosegment'          >> e${EMULATION_NAME}.c
310 echo '             && link_info.separate_code) return'  >> e${EMULATION_NAME}.c
311 sed $sc ldscripts/${EMULATION_NAME}.xder                >> e${EMULATION_NAME}.c
313 echo '  ; else if (bfd_link_pie (&link_info)'           >> e${EMULATION_NAME}.c
314 echo '             && link_info.separate_code) return'  >> e${EMULATION_NAME}.c
315 sed $sc ldscripts/${EMULATION_NAME}.xde                 >> e${EMULATION_NAME}.c
317 if test -n "$GENERATE_RELRO_SCRIPT" ; then
319 echo '  ; else if (bfd_link_pie (&link_info)'          >> e${EMULATION_NAME}.c
320 echo '             && link_info.relro) return'         >> e${EMULATION_NAME}.c
321 sed $sc ldscripts/${EMULATION_NAME}.xdo                >> e${EMULATION_NAME}.c
325 echo '  ; else if (bfd_link_pie (&link_info)) return'   >> e${EMULATION_NAME}.c
326 sed $sc ldscripts/${EMULATION_NAME}.xd                  >> e${EMULATION_NAME}.c
329 if test -n "$GENERATE_SHLIB_SCRIPT" ; then
330 if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
332 echo '  ; else if (bfd_link_dll (&link_info)'           >> e${EMULATION_NAME}.c
333 echo '             && link_info.combreloc'              >> e${EMULATION_NAME}.c
334 echo '             && link_info.separate_code'          >> e${EMULATION_NAME}.c
335 echo '             && link_info.one_rosegment'          >> e${EMULATION_NAME}.c
336 echo '             && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c
337 sed $sc ldscripts/${EMULATION_NAME}.xswer               >> e${EMULATION_NAME}.c
339 echo '  ; else if (bfd_link_dll (&link_info)'           >> e${EMULATION_NAME}.c
340 echo '             && link_info.combreloc'              >> e${EMULATION_NAME}.c
341 echo '             && link_info.separate_code'          >> e${EMULATION_NAME}.c
342 echo '             && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c
343 sed $sc ldscripts/${EMULATION_NAME}.xswe                >> e${EMULATION_NAME}.c
345 echo '  ; else if (bfd_link_dll (&link_info)'           >> e${EMULATION_NAME}.c
346 echo '             && link_info.combreloc'              >> e${EMULATION_NAME}.c
347 echo '             && link_info.relro'                  >> e${EMULATION_NAME}.c
348 echo '             && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c
349 sed $sc ldscripts/${EMULATION_NAME}.xsw                 >> e${EMULATION_NAME}.c
351 if test -n "$GENERATE_RELRO_SCRIPT" ; then
353 echo '  ; else if (bfd_link_dll (&link_info)'          >> e${EMULATION_NAME}.c
354 echo '             && link_info.combreloc'             >> e${EMULATION_NAME}.c
355 echo '             && link_info.separate_code'         >> e${EMULATION_NAME}.c
356 echo '             && link_info.one_rosegment'         >> e${EMULATION_NAME}.c
357 echo '             && link_info.relro) return'         >> e${EMULATION_NAME}.c
358 sed $sc ldscripts/${EMULATION_NAME}.xsceor             >> e${EMULATION_NAME}.c
360 echo '  ; else if (bfd_link_dll (&link_info)'          >> e${EMULATION_NAME}.c
361 echo '             && link_info.combreloc'             >> e${EMULATION_NAME}.c
362 echo '             && link_info.separate_code'         >> e${EMULATION_NAME}.c
363 echo '             && link_info.relro) return'         >> e${EMULATION_NAME}.c
364 sed $sc ldscripts/${EMULATION_NAME}.xsceo              >> e${EMULATION_NAME}.c
368 echo '  ; else if (bfd_link_dll (&link_info)'           >> e${EMULATION_NAME}.c
369 echo '             && link_info.combreloc'              >> e${EMULATION_NAME}.c
370 echo '             && link_info.one_rosegment'          >> e${EMULATION_NAME}.c
371 echo '             && link_info.separate_code) return'  >> e${EMULATION_NAME}.c
372 sed $sc ldscripts/${EMULATION_NAME}.xscer               >> e${EMULATION_NAME}.c
374 echo '  ; else if (bfd_link_dll (&link_info)'           >> e${EMULATION_NAME}.c
375 echo '             && link_info.combreloc'              >> e${EMULATION_NAME}.c
376 echo '             && link_info.separate_code) return'  >> e${EMULATION_NAME}.c
377 sed $sc ldscripts/${EMULATION_NAME}.xsce                        >> e${EMULATION_NAME}.c
379 if test -n "$GENERATE_RELRO_SCRIPT" ; then
381 echo '  ; else if (bfd_link_dll (&link_info)'          >> e${EMULATION_NAME}.c
382 echo '             && link_info.combreloc'             >> e${EMULATION_NAME}.c
383 echo '             && link_info.relro) return'         >> e${EMULATION_NAME}.c
384 sed $sc ldscripts/${EMULATION_NAME}.xsco               >> e${EMULATION_NAME}.c
388 echo '  ; else if (bfd_link_dll (&link_info)'           >> e${EMULATION_NAME}.c
389 echo '             && link_info.combreloc) return'      >> e${EMULATION_NAME}.c
390 sed $sc ldscripts/${EMULATION_NAME}.xsc                 >> e${EMULATION_NAME}.c
392 if test -n "$GENERATE_RELRO_SCRIPT" ; then
394 echo '  ; else if (bfd_link_dll (&link_info)'          >> e${EMULATION_NAME}.c
395 echo '             && link_info.separate_code'         >> e${EMULATION_NAME}.c
396 echo '             && link_info.one_rosegment'         >> e${EMULATION_NAME}.c
397 echo '             && link_info.relro) return'         >> e${EMULATION_NAME}.c
398 sed $sc ldscripts/${EMULATION_NAME}.xseor              >> e${EMULATION_NAME}.c
400 echo '  ; else if (bfd_link_dll (&link_info)'          >> e${EMULATION_NAME}.c
401 echo '             && link_info.separate_code'         >> e${EMULATION_NAME}.c
402 echo '             && link_info.relro) return'         >> e${EMULATION_NAME}.c
403 sed $sc ldscripts/${EMULATION_NAME}.xseo               >> e${EMULATION_NAME}.c
409 echo '  ; else if (bfd_link_dll (&link_info)'           >> e${EMULATION_NAME}.c
410 echo '             && link_info.one_rosegment'          >> e${EMULATION_NAME}.c
411 echo '             && link_info.separate_code) return'  >> e${EMULATION_NAME}.c
412 sed $sc ldscripts/${EMULATION_NAME}.xser                >> e${EMULATION_NAME}.c
414 echo '  ; else if (bfd_link_dll (&link_info)'           >> e${EMULATION_NAME}.c
415 echo '             && link_info.separate_code) return'  >> e${EMULATION_NAME}.c
416 sed $sc ldscripts/${EMULATION_NAME}.xse                 >> e${EMULATION_NAME}.c
418 if test -n "$GENERATE_RELRO_SCRIPT" ; then
420 echo '  ; else if (bfd_link_dll (&link_info)'          >> e${EMULATION_NAME}.c
421 echo '             && link_info.relro) return'         >> e${EMULATION_NAME}.c
422 sed $sc ldscripts/${EMULATION_NAME}.xso               >> e${EMULATION_NAME}.c
426 echo '  ; else if (bfd_link_dll (&link_info)) return'   >> e${EMULATION_NAME}.c
427 sed $sc ldscripts/${EMULATION_NAME}.xs                  >> e${EMULATION_NAME}.c
431 if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
433 echo '  ; else if (link_info.combreloc'                 >> e${EMULATION_NAME}.c
434 echo '             && link_info.separate_code'          >> e${EMULATION_NAME}.c
435 echo '             && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c
436 sed $sc ldscripts/${EMULATION_NAME}.xwe                 >> e${EMULATION_NAME}.c
438 echo '  ; else if (link_info.combreloc'                 >> e${EMULATION_NAME}.c
439 echo '             && link_info.separate_code'          >> e${EMULATION_NAME}.c
440 echo '             && link_info.one_rosegment'          >> e${EMULATION_NAME}.c
441 echo '             && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c
442 sed $sc ldscripts/${EMULATION_NAME}.xwer                >> e${EMULATION_NAME}.c
444 echo '  ; else if (link_info.combreloc'                 >> e${EMULATION_NAME}.c
445 echo '             && link_info.relro'                  >> e${EMULATION_NAME}.c
446 echo '             && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c
447 sed $sc ldscripts/${EMULATION_NAME}.xw                  >> e${EMULATION_NAME}.c
449 if test -n "$GENERATE_RELRO_SCRIPT" ; then
451 echo '  ; else if (link_info.combreloc'                 >> e${EMULATION_NAME}.c
452 echo '             && link_info.separate_code'          >> e${EMULATION_NAME}.c
453 echo '             && link_info.one_rosegment'          >> e${EMULATION_NAME}.c
454 echo '             && link_info.relro) return'          >> e${EMULATION_NAME}.c
455 sed $sc ldscripts/${EMULATION_NAME}.xceor               >> e${EMULATION_NAME}.c
457 echo '  ; else if (link_info.combreloc'                 >> e${EMULATION_NAME}.c
458 echo '             && link_info.separate_code'          >> e${EMULATION_NAME}.c
459 echo '             && link_info.relro) return'          >> e${EMULATION_NAME}.c
460 sed $sc ldscripts/${EMULATION_NAME}.xceo                >> e${EMULATION_NAME}.c
464 echo '  ; else if (link_info.combreloc'                 >> e${EMULATION_NAME}.c
465 echo '             && link_info.one_rosegment'          >> e${EMULATION_NAME}.c
466 echo '             && link_info.separate_code) return'  >> e${EMULATION_NAME}.c
467 sed $sc ldscripts/${EMULATION_NAME}.xcer                >> e${EMULATION_NAME}.c
469 echo '  ; else if (link_info.combreloc'                 >> e${EMULATION_NAME}.c
470 echo '             && link_info.separate_code) return'  >> e${EMULATION_NAME}.c
471 sed $sc ldscripts/${EMULATION_NAME}.xce                 >> e${EMULATION_NAME}.c
473 if test -n "$GENERATE_RELRO_SCRIPT" ; then
475 echo '  ; else if (link_info.combreloc'                 >> e${EMULATION_NAME}.c
476 echo '             && link_info.relro) return'          >> e${EMULATION_NAME}.c
477 sed $sc ldscripts/${EMULATION_NAME}.xco                 >> e${EMULATION_NAME}.c
481 echo '  ; else if (link_info.combreloc) return'         >> e${EMULATION_NAME}.c
482 sed $sc ldscripts/${EMULATION_NAME}.xc                  >> e${EMULATION_NAME}.c
486 if test -n "$GENERATE_RELRO_SCRIPT" ; then
488 echo '  ; else if (link_info.separate_code'             >> e${EMULATION_NAME}.c
489 echo '             && link_info.one_rosegment'          >> e${EMULATION_NAME}.c
490 echo '             && link_info.relro) return'          >> e${EMULATION_NAME}.c
491 sed $sc ldscripts/${EMULATION_NAME}.xeor                >> e${EMULATION_NAME}.c
493 echo '  ; else if (link_info.separate_code'             >> e${EMULATION_NAME}.c
494 echo '             && link_info.relro) return'          >> e${EMULATION_NAME}.c
495 sed $sc ldscripts/${EMULATION_NAME}.xeo                 >> e${EMULATION_NAME}.c
499 echo '  ; else if (link_info.separate_code'             >> e${EMULATION_NAME}.c
500 echo '             && link_info.one_rosegment) return'  >> e${EMULATION_NAME}.c
501 sed $sc ldscripts/${EMULATION_NAME}.xer                 >> e${EMULATION_NAME}.c
503 echo '  ; else if (link_info.separate_code) return'     >> e${EMULATION_NAME}.c
504 sed $sc ldscripts/${EMULATION_NAME}.xe                  >> e${EMULATION_NAME}.c
506 if test -n "$GENERATE_RELRO_SCRIPT" ; then
508 echo '  ; else if (link_info.relro) return'             >> e${EMULATION_NAME}.c
509 sed $sc ldscripts/${EMULATION_NAME}.xo                  >> e${EMULATION_NAME}.c
513 echo '  ; else return'                                  >> e${EMULATION_NAME}.c
514 sed $sc ldscripts/${EMULATION_NAME}.x                   >> e${EMULATION_NAME}.c
515 echo '; }'                                              >> e${EMULATION_NAME}.c
517 else
518 # Scripts read from the filesystem.
520 fragment <<EOF
522   *isfile = 1;
524   if (bfd_link_relocatable (&link_info) && config.build_constructors)
525     return "ldscripts/${EMULATION_NAME}.xu";
526   else if (bfd_link_relocatable (&link_info))
527     return "ldscripts/${EMULATION_NAME}.xr";
528   else if (!config.text_read_only)
529     return "ldscripts/${EMULATION_NAME}.xbn";
531 if cmp -s ldscripts/${EMULATION_NAME}.x ldscripts/${EMULATION_NAME}.xn; then :
532 else
533 fragment <<EOF
534   else if (!config.magic_demand_paged)
535     return "ldscripts/${EMULATION_NAME}.xn";
538 if test -n "$GENERATE_PIE_SCRIPT" ; then
539 if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
540 fragment <<EOF
541   else if (bfd_link_pie (&link_info)
542            && link_info.combreloc
543            && link_info.relro
544            && (link_info.flags & DF_BIND_NOW))
545     {
546       if (link_info.separate_code)
547         {
548           if (link_info.one_rosegment)
549             return "ldscripts/${EMULATION_NAME}.xdwer";
550           else
551             return "ldscripts/${EMULATION_NAME}.xdwe";
552         }
553       else
554         return "ldscripts/${EMULATION_NAME}.xdw";
555     }
557 if test -n "$GENERATE_RELRO_SCRIPT" ; then
558 fragment <<EOF
559   else if (bfd_link_pie (&link_info)
560            && link_info.combreloc
561            && link_info.relro)
562     {
563       if (link_info.separate_code)
564         {
565           if (link_info.one_rosegment)
566             return "ldscripts/${EMULATION_NAME}.xdceor";
567           else
568             return "ldscripts/${EMULATION_NAME}.xdceo";
569         }
570       else
571         return "ldscripts/${EMULATION_NAME}.xdco";
572     }
575 fragment <<EOF
576   else if (bfd_link_pie (&link_info)
577            && link_info.combreloc)
578     {
579       if (link_info.separate_code)
580         {
581           if (link_info.one_rosegment)
582             return "ldscripts/${EMULATION_NAME}.xdcer";
583           else
584             return "ldscripts/${EMULATION_NAME}.xdce";
585         }
586       else
587         return "ldscripts/${EMULATION_NAME}.xdc";
588     }
591 if test -n "$GENERATE_RELRO_SCRIPT" ; then
592 fragment <<EOF
593   else if (bfd_link_pie (&link_info)
594            && link_info.relro)
595     {
596       if (link_info.separate_code)
597         {
598           if (link_info.one_rosegment)
599             return "ldscripts/${EMULATION_NAME}.xdeor";
600           else
601             return "ldscripts/${EMULATION_NAME}.xdeo";
602         }
603       else
604         return "ldscripts/${EMULATION_NAME}.xdo";
605     }
608 fragment <<EOF
609   else if (bfd_link_pie (&link_info))
610     {
611       if (link_info.separate_code)
612         {
613           if (link_info.one_rosegment)
614             return "ldscripts/${EMULATION_NAME}.xder";
615           else
616             return "ldscripts/${EMULATION_NAME}.xde";
617         }
618       else
619         return "ldscripts/${EMULATION_NAME}.xd";
620     }
623 if test -n "$GENERATE_SHLIB_SCRIPT" ; then
624 if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
625 fragment <<EOF
626   else if (bfd_link_dll (&link_info) && link_info.combreloc
627            && link_info.relro && (link_info.flags & DF_BIND_NOW))
628     {
629       if (link_info.separate_code)
630         {
631           if (link_info.one_rosegment)
632             return "ldscripts/${EMULATION_NAME}.xswer";
633           else
634             return "ldscripts/${EMULATION_NAME}.xswe";
635         }
636       else
637         return "ldscripts/${EMULATION_NAME}.xsw";
638     }
640 if test -n "$GENERATE_RELRO_SCRIPT" ; then
641 fragment <<EOF
642   else if (bfd_link_dll (&link_info)
643            && link_info.combreloc
644            && link_info.relro)
645     {
646       if (link_info.separate_code)
647         {
648           if (link_info.one_rosegment)
649             return "ldscripts/${EMULATION_NAME}.xsceor";
650           else
651             return "ldscripts/${EMULATION_NAME}.xsceo";
652         }
653       else
654         return "ldscripts/${EMULATION_NAME}.xsco";
655     }
658 fragment <<EOF
659   else if (bfd_link_dll (&link_info) && link_info.combreloc)
660     {
661       if (link_info.separate_code)
662         {
663           if (link_info.one_rosegment)
664             return "ldscripts/${EMULATION_NAME}.xscer";
665           else
666             return "ldscripts/${EMULATION_NAME}.xsce";
667         }
668       else
669         return "ldscripts/${EMULATION_NAME}.xsc";
670     }
673 if test -n "$GENERATE_RELRO_SCRIPT" ; then
674 fragment <<EOF
675   else if (bfd_link_dll (&link_info)
676            && link_info.relro)
677     {
678       if (link_info.separate_code)
679         {
680           if (link_info.one_rosegment)
681             return "ldscripts/${EMULATION_NAME}.xseor";
682           else
683             return "ldscripts/${EMULATION_NAME}.xseo";
684         }
685       else
686         return "ldscripts/${EMULATION_NAME}.xso";
687     }
690 fragment <<EOF
691   else if (bfd_link_dll (&link_info))
692     {
693       if (link_info.separate_code)
694         {
695           if (link_info.one_rosegment)
696             return "ldscripts/${EMULATION_NAME}.xser";
697           else
698             return "ldscripts/${EMULATION_NAME}.xse";
699         }
700       else
701         return "ldscripts/${EMULATION_NAME}.xs";
702     }
705 if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
706 fragment <<EOF
707   else if (link_info.combreloc && link_info.relro
708            && (link_info.flags & DF_BIND_NOW))
709     {
710       if (link_info.separate_code)
711         {
712           if (link_info.one_rosegment)
713             return "ldscripts/${EMULATION_NAME}.xwer";
714           else
715             return "ldscripts/${EMULATION_NAME}.xwe";
716         }
717       else
718         return "ldscripts/${EMULATION_NAME}.xw";
719     }
721 if test -n "$GENERATE_RELRO_SCRIPT" ; then
722 fragment <<EOF
723   else if (link_info.combreloc
724            && link_info.relro)
725     {
726       if (link_info.separate_code)
727         {
728           if (link_info.one_rosegment)
729             return "ldscripts/${EMULATION_NAME}.xceor";
730           else
731             return "ldscripts/${EMULATION_NAME}.xceo";
732         }
733       else
734         return "ldscripts/${EMULATION_NAME}.xco";
735     }
738 fragment <<EOF
739   else if (link_info.combreloc)
740     {
741       if (link_info.separate_code)
742         {
743           if (link_info.one_rosegment)
744             return "ldscripts/${EMULATION_NAME}.xcer";
745           else
746             return "ldscripts/${EMULATION_NAME}.xce";
747         }
748       else
749         return "ldscripts/${EMULATION_NAME}.xc";
750     }
753 if test -n "$GENERATE_RELRO_SCRIPT" ; then
754 fragment <<EOF
755   else if (link_info.relro)
756     {
757       if (link_info.separate_code)
758         {
759           if (link_info.one_rosegment)
760             return "ldscripts/${EMULATION_NAME}.xeor";
761           else
762             return "ldscripts/${EMULATION_NAME}.xeo";
763         }
764       else
765         return "ldscripts/${EMULATION_NAME}.xo";
766     }
769 fragment <<EOF
770   else
771     {
772       if (link_info.separate_code)
773         {
774           if (link_info.one_rosegment)
775             return "ldscripts/${EMULATION_NAME}.xer";
776           else
777             return "ldscripts/${EMULATION_NAME}.xe";
778         }
779       else
780         return "ldscripts/${EMULATION_NAME}.x";
781     }
788 fragment <<EOF
790 static void
791 gld${EMULATION_NAME}_add_options
792   (int ns, char **shortopts, int nl, struct option **longopts,
793    int nrl ATTRIBUTE_UNUSED, struct option **really_longopts ATTRIBUTE_UNUSED)
796 if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
797 fragment <<EOF
798   static const char xtra_short[] = "${PARSE_AND_LIST_SHORTOPTS}z:P:";
800 else
801 fragment <<EOF
802   static const char xtra_short[] = "${PARSE_AND_LIST_SHORTOPTS}z:";
805 fragment <<EOF
806   static const struct option xtra_long[] = {
808 if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
809 fragment <<EOF
810     {"audit", required_argument, NULL, OPTION_AUDIT},
811     {"Bgroup", no_argument, NULL, OPTION_GROUP},
814 fragment <<EOF
815     {"build-id", optional_argument, NULL, OPTION_BUILD_ID},
816     {"package-metadata", optional_argument, NULL, OPTION_PACKAGE_METADATA},
817     {"compress-debug-sections", required_argument, NULL, OPTION_COMPRESS_DEBUG},
818     {"rosegment", no_argument, NULL, OPTION_ROSEGMENT},
819     {"no-rosegment", no_argument, NULL, OPTION_NO_ROSEGMENT},
821 if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
822 fragment <<EOF
823     {"depaudit", required_argument, NULL, 'P'},
824     {"disable-new-dtags", no_argument, NULL, OPTION_DISABLE_NEW_DTAGS},
825     {"enable-new-dtags", no_argument, NULL, OPTION_ENABLE_NEW_DTAGS},
826     {"eh-frame-hdr", no_argument, NULL, OPTION_EH_FRAME_HDR},
827     {"no-eh-frame-hdr", no_argument, NULL, OPTION_NO_EH_FRAME_HDR},
828     {"exclude-libs", required_argument, NULL, OPTION_EXCLUDE_LIBS},
829     {"hash-style", required_argument, NULL, OPTION_HASH_STYLE},
832 if test -n "$PARSE_AND_LIST_LONGOPTS" ; then
833 fragment <<EOF
834     $PARSE_AND_LIST_LONGOPTS
837 fragment <<EOF
838     {NULL, no_argument, NULL, 0}
839   };
841   *shortopts = (char *) xrealloc (*shortopts, ns + sizeof (xtra_short));
842   memcpy (*shortopts + ns, &xtra_short, sizeof (xtra_short));
843   *longopts = (struct option *)
844     xrealloc (*longopts, nl * sizeof (struct option) + sizeof (xtra_long));
845   memcpy (*longopts + nl, &xtra_long, sizeof (xtra_long));
848 #define DEFAULT_BUILD_ID_STYLE  "sha1"
850 static bool
851 gld${EMULATION_NAME}_handle_option (int optc)
853   switch (optc)
854     {
855     default:
856       return false;
858     case OPTION_BUILD_ID:
859       free ((char *) ldelf_emit_note_gnu_build_id);
860       ldelf_emit_note_gnu_build_id = NULL;
861       if (optarg == NULL)
862         optarg = DEFAULT_BUILD_ID_STYLE;
863       if (strcmp (optarg, "none"))
864         ldelf_emit_note_gnu_build_id = xstrdup (optarg);
865       break;
867     case OPTION_PACKAGE_METADATA:
868       free ((char *) ldelf_emit_note_fdo_package_metadata);
869       ldelf_emit_note_fdo_package_metadata = NULL;
870       if (optarg != NULL)
871         {
872           size_t len = strlen (optarg);
873           if (len > 0)
874             {
875               char *package_metadata = xmalloc (len + 1);
876               percent_decode (optarg, package_metadata);
877               ldelf_emit_note_fdo_package_metadata = package_metadata;
878             }
879         }
880       break;
882     case OPTION_COMPRESS_DEBUG:
883       config.compress_debug = bfd_get_compression_algorithm (optarg);
884       if (strcasecmp (optarg, "zstd") == 0)
885         {
886 #ifndef HAVE_ZSTD
887           if (config.compress_debug == COMPRESS_DEBUG_ZSTD)
888             einfo (_ ("%F%P: --compress-debug-sections=zstd: ld is not built "
889                   "with zstd support\n"));
890 #endif
891         }
892       if (config.compress_debug == COMPRESS_UNKNOWN)
893         einfo (_("%F%P: invalid --compress-debug-sections option: \`%s'\n"),
894                optarg);
895       break;
897     case OPTION_ROSEGMENT:
898       link_info.one_rosegment = true;
899       break;
900     case OPTION_NO_ROSEGMENT:
901       link_info.one_rosegment = false;
902       break;      
905 if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
906 fragment <<EOF
907     case OPTION_AUDIT:
908         ldelf_append_to_separated_string (&audit, optarg);
909         break;
911     case 'P':
912         ldelf_append_to_separated_string (&depaudit, optarg);
913         break;
915     case OPTION_DISABLE_NEW_DTAGS:
916       link_info.new_dtags = false;
917       break;
919     case OPTION_ENABLE_NEW_DTAGS:
920       link_info.new_dtags = true;
921       break;
923     case OPTION_EH_FRAME_HDR:
924       link_info.eh_frame_hdr_type = DWARF2_EH_HDR;
925       break;
927     case OPTION_NO_EH_FRAME_HDR:
928       link_info.eh_frame_hdr_type = 0;
929       break;
931     case OPTION_GROUP:
932       link_info.flags_1 |= (bfd_vma) DF_1_GROUP;
933       /* Groups must be self-contained.  */
934       link_info.unresolved_syms_in_objects = RM_DIAGNOSE;
935       link_info.unresolved_syms_in_shared_libs = RM_DIAGNOSE;
936       break;
938     case OPTION_EXCLUDE_LIBS:
939       add_excluded_libs (optarg);
940       break;
942     case OPTION_HASH_STYLE:
943       link_info.emit_hash = false;
944       link_info.emit_gnu_hash = false;
945       if (strcmp (optarg, "sysv") == 0)
946         link_info.emit_hash = true;
947       else if (strcmp (optarg, "gnu") == 0)
948         link_info.emit_gnu_hash = true;
949       else if (strcmp (optarg, "both") == 0)
950         {
951           link_info.emit_hash = true;
952           link_info.emit_gnu_hash = true;
953         }
954       else
955         einfo (_("%F%P: invalid hash style \`%s'\n"), optarg);
956       break;
960 fragment <<EOF
961     case 'z':
962       if (strcmp (optarg, "defs") == 0)
963         link_info.unresolved_syms_in_objects = RM_DIAGNOSE;
964       else if (strcmp (optarg, "undefs") == 0)
965         link_info.unresolved_syms_in_objects = RM_IGNORE;
966       else if (strcmp (optarg, "muldefs") == 0)
967         link_info.allow_multiple_definition = true;
968       else if (startswith (optarg, "max-page-size="))
969         {
970           char *end;
972           link_info.maxpagesize = strtoul (optarg + 14, &end, 0);
973           if (*end
974               || (link_info.maxpagesize & (link_info.maxpagesize - 1)) != 0)
975             einfo (_("%F%P: invalid maximum page size \`%s'\n"),
976                    optarg + 14);
977           link_info.maxpagesize_is_set = true;
978         }
979       else if (startswith (optarg, "common-page-size="))
980         {
981           char *end;
982           link_info.commonpagesize = strtoul (optarg + 17, &end, 0);
983           if (*end
984               || (link_info.commonpagesize & (link_info.commonpagesize - 1)) != 0)
985             einfo (_("%F%P: invalid common page size \`%s'\n"),
986                    optarg + 17);
987           link_info.commonpagesize_is_set = true;
988         }
989       else if (startswith (optarg, "stack-size="))
990         {
991           char *end;
992           link_info.stacksize = strtoul (optarg + 11, &end, 0);
993           if (*end || link_info.stacksize < 0)
994             einfo (_("%F%P: invalid stack size \`%s'\n"), optarg + 11);
995           if (!link_info.stacksize)
996             /* Use -1 for explicit no-stack, because zero means
997                'default'.   */
998             link_info.stacksize = -1;
999         }
1000       else if (strcmp (optarg, "execstack") == 0)
1001         {
1002           link_info.execstack = true;
1003           link_info.noexecstack = false;
1004         }
1005       else if (strcmp (optarg, "noexecstack") == 0)
1006         {
1007           link_info.noexecstack = true;
1008           link_info.execstack = false;
1009         }
1010       else if (strcmp (optarg, "unique-symbol") == 0)
1011         link_info.unique_symbol = true;
1012       else if (strcmp (optarg, "nounique-symbol") == 0)
1013         link_info.unique_symbol = false;
1014       else if (strcmp (optarg, "globalaudit") == 0)
1015         {
1016           link_info.flags_1 |= DF_1_GLOBAUDIT;
1017         }
1018       else if (startswith (optarg, "start-stop-gc"))
1019         link_info.start_stop_gc = true;
1020       else if (startswith (optarg, "nostart-stop-gc"))
1021         link_info.start_stop_gc = false;
1022       else if (startswith (optarg, "start-stop-visibility="))
1023         {
1024           if (strcmp (optarg, "start-stop-visibility=default") == 0)
1025             link_info.start_stop_visibility = STV_DEFAULT;
1026           else if (strcmp (optarg, "start-stop-visibility=internal") == 0)
1027             link_info.start_stop_visibility = STV_INTERNAL;
1028           else if (strcmp (optarg, "start-stop-visibility=hidden") == 0)
1029             link_info.start_stop_visibility = STV_HIDDEN;
1030           else if (strcmp (optarg, "start-stop-visibility=protected") == 0)
1031             link_info.start_stop_visibility = STV_PROTECTED;
1032           else
1033             einfo (_("%F%P: invalid visibility in \`-z %s'; "
1034                      "must be default, internal, hidden, or protected"),
1035                    optarg);
1036         }
1037       else if (strcmp (optarg, "sectionheader") == 0)
1038         config.no_section_header = false;
1039       else if (strcmp (optarg, "nosectionheader") == 0)
1040         config.no_section_header = true;
1043 if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
1044 fragment <<EOF
1045       else if (strcmp (optarg, "global") == 0)
1046         link_info.flags_1 |= (bfd_vma) DF_1_GLOBAL;
1047       else if (strcmp (optarg, "initfirst") == 0)
1048         link_info.flags_1 |= (bfd_vma) DF_1_INITFIRST;
1049       else if (strcmp (optarg, "interpose") == 0)
1050         link_info.flags_1 |= (bfd_vma) DF_1_INTERPOSE;
1051       else if (strcmp (optarg, "loadfltr") == 0)
1052         link_info.flags_1 |= (bfd_vma) DF_1_LOADFLTR;
1053       else if (strcmp (optarg, "nodefaultlib") == 0)
1054         link_info.flags_1 |= (bfd_vma) DF_1_NODEFLIB;
1055       else if (strcmp (optarg, "nodelete") == 0)
1056         link_info.flags_1 |= (bfd_vma) DF_1_NODELETE;
1057       else if (strcmp (optarg, "nodlopen") == 0)
1058         link_info.flags_1 |= (bfd_vma) DF_1_NOOPEN;
1059       else if (strcmp (optarg, "nodump") == 0)
1060         link_info.flags_1 |= (bfd_vma) DF_1_NODUMP;
1061       else if (strcmp (optarg, "now") == 0)
1062         {
1063           link_info.flags |= (bfd_vma) DF_BIND_NOW;
1064           link_info.flags_1 |= (bfd_vma) DF_1_NOW;
1065         }
1066       else if (strcmp (optarg, "lazy") == 0)
1067         {
1068           link_info.flags &= ~(bfd_vma) DF_BIND_NOW;
1069           link_info.flags_1 &= ~(bfd_vma) DF_1_NOW;
1070         }
1071       else if (strcmp (optarg, "origin") == 0)
1072         {
1073           link_info.flags |= (bfd_vma) DF_ORIGIN;
1074           link_info.flags_1 |= (bfd_vma) DF_1_ORIGIN;
1075         }
1076       else if (strcmp (optarg, "unique") == 0)
1077         link_info.gnu_flags_1 |= (bfd_vma) DF_GNU_1_UNIQUE;
1078       else if (strcmp (optarg, "nounique") == 0)
1079         link_info.gnu_flags_1 &= ~(bfd_vma) DF_GNU_1_UNIQUE;
1080       else if (strcmp (optarg, "combreloc") == 0)
1081         link_info.combreloc = true;
1082       else if (strcmp (optarg, "nocombreloc") == 0)
1083         link_info.combreloc = false;
1084       else if (strcmp (optarg, "nocopyreloc") == 0)
1085         link_info.nocopyreloc = true;
1087 if test -n "$COMMONPAGESIZE"; then
1088 fragment <<EOF
1089       else if (strcmp (optarg, "relro") == 0)
1090         link_info.relro = true;
1091       else if (strcmp (optarg, "norelro") == 0)
1092         link_info.relro = false;
1096 fragment <<EOF
1097       else if (strcmp (optarg, "separate-code") == 0)
1098         link_info.separate_code = true;
1099       else if (strcmp (optarg, "noseparate-code") == 0)
1100         link_info.separate_code = false;
1101       else if (strcmp (optarg, "common") == 0)
1102         link_info.elf_stt_common = elf_stt_common;
1103       else if (strcmp (optarg, "nocommon") == 0)
1104         link_info.elf_stt_common = no_elf_stt_common;
1105       else if (strcmp (optarg, "text") == 0)
1106         link_info.textrel_check = textrel_check_error;
1107       else if (strcmp (optarg, "notext") == 0)
1108         link_info.textrel_check = textrel_check_none;
1109       else if (strcmp (optarg, "textoff") == 0)
1110         link_info.textrel_check = textrel_check_none;
1113 if test -n "$PARSE_AND_LIST_ARGS_CASE_Z" ; then
1114 fragment <<EOF
1115  $PARSE_AND_LIST_ARGS_CASE_Z
1119 fragment <<EOF
1120       else
1121         queue_unknown_cmdline_warning ("-z %s", optarg);
1122       break;
1125 if test -n "$PARSE_AND_LIST_ARGS_CASES" ; then
1126 fragment <<EOF
1127  $PARSE_AND_LIST_ARGS_CASES
1131 fragment <<EOF
1132     }
1134   return true;
1139 if test x"$LDEMUL_LIST_OPTIONS" != xgld"$EMULATION_NAME"_list_options; then
1140 gld_list_options="gld${EMULATION_NAME}_list_options"
1141 if test -n "$PARSE_AND_LIST_OPTIONS"; then
1142 fragment <<EOF
1144 static void
1145 gld${EMULATION_NAME}_list_options (FILE * file)
1149 if test -n "$PARSE_AND_LIST_OPTIONS" ; then
1150 fragment <<EOF
1151  $PARSE_AND_LIST_OPTIONS
1155 fragment <<EOF
1158 else
1159   gld_list_options="NULL"
1162 if test -n "$PARSE_AND_LIST_EPILOGUE" ; then
1163 fragment <<EOF
1164  $PARSE_AND_LIST_EPILOGUE
1169 LDEMUL_AFTER_PARSE=${LDEMUL_AFTER_PARSE-ldelf_after_parse}
1170 LDEMUL_BEFORE_PLUGIN_ALL_SYMBOLS_READ=${LDEMUL_BEFORE_PLUGIN_ALL_SYMBOLS_READ-gld${EMULATION_NAME}_before_plugin_all_symbols_read}
1171 LDEMUL_AFTER_OPEN=${LDEMUL_AFTER_OPEN-gld${EMULATION_NAME}_after_open}
1172 LDEMUL_BEFORE_PLACE_ORPHANS=${LDEMUL_BEFORE_PLACE_ORPHANS-ldelf_before_place_orphans}
1173 LDEMUL_AFTER_ALLOCATION=${LDEMUL_AFTER_ALLOCATION-gld${EMULATION_NAME}_after_allocation}
1174 LDEMUL_SET_OUTPUT_ARCH=${LDEMUL_SET_OUTPUT_ARCH-ldelf_set_output_arch}
1175 LDEMUL_BEFORE_ALLOCATION=${LDEMUL_BEFORE_ALLOCATION-gld${EMULATION_NAME}_before_allocation}
1176 LDEMUL_OPEN_DYNAMIC_ARCHIVE=${LDEMUL_OPEN_DYNAMIC_ARCHIVE-ldelf_open_dynamic_archive}
1177 LDEMUL_PLACE_ORPHAN=${LDEMUL_PLACE_ORPHAN-ldelf_place_orphan}
1178 LDEMUL_ADD_OPTIONS=gld${EMULATION_NAME}_add_options
1179 LDEMUL_HANDLE_OPTION=gld${EMULATION_NAME}_handle_option
1180 LDEMUL_LIST_OPTIONS=${LDEMUL_LIST_OPTIONS-${gld_list_options}}
1181 LDEMUL_RECOGNIZED_FILE=${LDEMUL_RECOGNIZED_FILE-ldelf_load_symbols}
1183 source_em ${srcdir}/emultempl/emulation.em