X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=ld%2Femultempl%2Fvxworks.em;h=f6ad0b657d5272e42e1bbeb45dc109534165a34b;hb=92b93329b58c744ea269b50f6278ed99416941a9;hp=eafbb58d8ef08a34dcc87076612fc4d8bbf41461;hpb=01f0fe5e0450edf168c1f612feb93cf588e4e7ea;p=deliverable%2Fbinutils-gdb.git diff --git a/ld/emultempl/vxworks.em b/ld/emultempl/vxworks.em index eafbb58d8e..f6ad0b657d 100644 --- a/ld/emultempl/vxworks.em +++ b/ld/emultempl/vxworks.em @@ -1,11 +1,39 @@ +# This shell script emits a C file. -*- C -*- +# Copyright 2007 Free Software Foundation, Inc. +# +# This file is part of the GNU Binutils. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. +# + if test -n "$VXWORKS_BASE_EM_FILE" ; then -. "${srcdir}/emultempl/${VXWORKS_BASE_EM_FILE}.em" + source_em "${srcdir}/emultempl/${VXWORKS_BASE_EM_FILE}.em" fi -cat >>e${EMULATION_NAME}.c <xvec->flavour == bfd_target_elf_flavour && !_bfd_elf_link_create_dynamic_sections (link_info.input_bfds, &link_info)) einfo ("%X%P: Cannot create dynamic sections %E\n"); if (!force_dynamic && !link_info.shared + && output_bfd->xvec->flavour == bfd_target_elf_flavour && elf_hash_table (&link_info)->dynamic_sections_created) einfo ("%X%P: Dynamic sections created in non-dynamic link\n"); } @@ -46,4 +76,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 + fragment <