diff options
Diffstat (limited to 'ld/emultempl/vxworks.em')
-rw-r--r-- | ld/emultempl/vxworks.em | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/ld/emultempl/vxworks.em b/ld/emultempl/vxworks.em index 349fa54..b03419f 100644 --- a/ld/emultempl/vxworks.em +++ b/ld/emultempl/vxworks.em @@ -7,6 +7,13 @@ cat >>e${EMULATION_NAME}.c <<EOF static int force_dynamic; static void +vxworks_before_parse (void) +{ + ${LDEMUL_BEFORE_PARSE-gld${EMULATION_NAME}_before_parse} (); + config.rpath_separator = ';'; +} + +static void vxworks_after_open (void) { ${LDEMUL_AFTER_OPEN-gld${EMULATION_NAME}_after_open} (); @@ -48,4 +55,27 @@ PARSE_AND_LIST_ARGS_CASES=$PARSE_AND_LIST_ARGS_CASES' break; ' -LDEMUL_AFTER_OPEN=vxworks_after_open +# Hook in our routines above. There are three possibilities: +# +# (1) VXWORKS_BASE_EM_FILE did not set the hook's LDEMUL_FOO variable. +# We want to define LDEMUL_FOO to vxworks_foo in that case, +# +# (2) VXWORKS_BASE_EM_FILE set the hook's LDEMUL_FOO variable to +# gld${EMULATION_NAME}_foo. This means that the file has +# replaced elf32.em's default definition, so we simply #define +# the current value of LDEMUL_FOO to vxworks_foo. +# +# (3) VXWORKS_BASE_EM_FILE set the hook's LDEMUL_FOO variable to +# something other than gld${EMULATION_NAME}_foo. We handle +# this case in the same way as (1). +for override in before_parse after_open; do + var="LDEMUL_`echo ${override} | tr a-z A-Z`" + eval value=\$${var} + if test "${value}" = "gld${EMULATION_NAME}_${override}"; then + cat >>e${EMULATION_NAME}.c <<EOF +#define ${value} vxworks_${override} +EOF + else + eval $var=vxworks_${override} + fi +done |