1 if test -n "$VXWORKS_BASE_EM_FILE" ; then
2 . "${srcdir}/emultempl/${VXWORKS_BASE_EM_FILE}.em"
5 cat >>e${EMULATION_NAME}.c <<EOF
7 static int force_dynamic;
10 vxworks_before_parse (void)
12 ${LDEMUL_BEFORE_PARSE-gld${EMULATION_NAME}_before_parse} ();
13 config.rpath_separator = ';';
17 vxworks_after_open (void)
19 ${LDEMUL_AFTER_OPEN-gld${EMULATION_NAME}_after_open} ();
22 && link_info.input_bfds
23 && output_bfd->xvec->flavour == bfd_target_elf_flavour
24 && !_bfd_elf_link_create_dynamic_sections (link_info.input_bfds,
26 einfo ("%X%P: Cannot create dynamic sections %E\n");
30 && output_bfd->xvec->flavour == bfd_target_elf_flavour
31 && elf_hash_table (&link_info)->dynamic_sections_created)
32 einfo ("%X%P: Dynamic sections created in non-dynamic link\n");
37 PARSE_AND_LIST_PROLOGUE=$PARSE_AND_LIST_PROLOGUE'
39 OPTION_FORCE_DYNAMIC = 501
43 PARSE_AND_LIST_LONGOPTS=$PARSE_AND_LIST_LONGOPTS'
44 {"force-dynamic", no_argument, NULL, OPTION_FORCE_DYNAMIC},
47 PARSE_AND_LIST_OPTIONS=$PARSE_AND_LIST_OPTIONS'
49 --force-dynamic Always create dynamic sections\n"));
52 PARSE_AND_LIST_ARGS_CASES=$PARSE_AND_LIST_ARGS_CASES'
53 case OPTION_FORCE_DYNAMIC:
58 # Hook in our routines above. There are three possibilities:
60 # (1) VXWORKS_BASE_EM_FILE did not set the hook's LDEMUL_FOO variable.
61 # We want to define LDEMUL_FOO to vxworks_foo in that case,
63 # (2) VXWORKS_BASE_EM_FILE set the hook's LDEMUL_FOO variable to
64 # gld${EMULATION_NAME}_foo. This means that the file has
65 # replaced elf32.em's default definition, so we simply #define
66 # the current value of LDEMUL_FOO to vxworks_foo.
68 # (3) VXWORKS_BASE_EM_FILE set the hook's LDEMUL_FOO variable to
69 # something other than gld${EMULATION_NAME}_foo. We handle
70 # this case in the same way as (1).
71 for override in before_parse after_open; do
72 var="LDEMUL_`echo ${override} | tr a-z A-Z`"
74 if test "${value}" = "gld${EMULATION_NAME}_${override}"; then
75 cat >>e${EMULATION_NAME}.c <<EOF
76 #define ${value} vxworks_${override}
79 eval $var=vxworks_${override}