From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18429 invoked by alias); 9 Apr 2010 09:35:07 -0000 Received: (qmail 18416 invoked by uid 22791); 9 Apr 2010 09:35:06 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Apr 2010 09:35:00 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 2F15ACB02E9 for ; Fri, 9 Apr 2010 11:34:58 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TeEXWv1SUFRm for ; Fri, 9 Apr 2010 11:34:58 +0200 (CEST) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) by mel.act-europe.fr (Postfix) with ESMTP id 1AC1ACB02E7 for ; Fri, 9 Apr 2010 11:34:58 +0200 (CEST) Received: by ulanbator.act-europe.fr (Postfix, from userid 501) id AFCE71519FEA; Fri, 9 Apr 2010 11:34:59 +0200 (CEST) Date: Fri, 09 Apr 2010 09:35:00 -0000 From: Tristan Gingold To: binutils@sourceware.org Subject: [Patch 3/4]: Rewrite of the alpha-vms bfd back-end (ld) Message-ID: <20100409093459.GA85611@ulanbator.act-europe.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2010-04/txt/msg00097.txt.bz2 This adds support for alpha-vms to ld. Tristan. ld/ 2010-04-09 Tristan Gingold * emulparams/alphavms.sh: New file. * emultempl/vms.em: New file. * scripttempl/alphavms.sc: New file. * configure.tgt (alpha*-*-*vms*): Added. * Makefile.am (ALL_EMULATIONS): Add ealphavms.o (ealphavms.c): New target. * Makefile.in: Regenerate. --- ld/Makefile.am | 5 ++ ld/configure.tgt | 3 +- ld/emulparams/alphavms.sh | 7 +++ ld/emultempl/vms.em | 123 ++++++++++++++++++++++++++++++++++++++++++++ ld/scripttempl/alphavms.sc | 34 ++++++++++++ 5 files changed, 171 insertions(+), 1 deletions(-) create mode 100644 ld/emulparams/alphavms.sh create mode 100644 ld/emultempl/vms.em create mode 100644 ld/scripttempl/alphavms.sc diff --git a/ld/Makefile.am b/ld/Makefile.am index 010fb55..54e9309 100644 --- a/ld/Makefile.am +++ b/ld/Makefile.am @@ -118,6 +118,7 @@ ALL_EMULATIONS = \ eaixppc.o \ eaixrs6.o \ ealpha.o \ + ealphavms.o \ earcelf.o \ earm_epoc_pe.o \ earm_wince_pe.o \ @@ -611,6 +612,10 @@ eaixrs6.c: $(srcdir)/emulparams/aixrs6.sh \ ealpha.c: $(srcdir)/emulparams/alpha.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/alpha.sc ${GEN_DEPENDS} ${GENSCRIPTS} alpha "$(tdir_alpha)" +ealphavms.c: $(srcdir)/emulparams/alphavms.sh \ + $(srcdir)/emultempl/vms.em $(srcdir)/scripttempl/alphavms.sc \ + ${GEN_DEPENDS} + ${GENSCRIPTS} alphavms "$(tdir_alphavms)" earcelf.c: $(srcdir)/emulparams/arcelf.sh \ $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} arcelf "$(tdir_arcelf)" diff --git a/ld/configure.tgt b/ld/configure.tgt index c519ba7..def0287 100644 --- a/ld/configure.tgt +++ b/ld/configure.tgt @@ -39,7 +39,8 @@ alpha*-*-osf*) targ_emul=alpha ;; alpha*-*-gnu*) targ_emul=elf64alpha ;; alpha*-*-netware*) targ_emul=alpha ;; alpha*-*-netbsd*) targ_emul=elf64alpha_nbsd ;; -alpha*-*-openbsd*) targ_emul=elf64alpha +alpha*-*-openbsd*) targ_emul=elf64alpha ;; +alpha*-*-*vms*) targ_emul=alphavms ;; arc-*-elf*) targ_emul=arcelf ;; diff --git a/ld/emulparams/alphavms.sh b/ld/emulparams/alphavms.sh new file mode 100644 index 0000000..ac9b3a2 --- /dev/null +++ b/ld/emulparams/alphavms.sh @@ -0,0 +1,7 @@ +SCRIPT_NAME=alphavms + +OUTPUT_FORMAT="vms-alpha" +ARCH=alpha + +COMPILE_IN=yes +EXTRA_EM_FILE=vms \ No newline at end of file diff --git a/ld/emultempl/vms.em b/ld/emultempl/vms.em new file mode 100644 index 0000000..ec52de7 --- /dev/null +++ b/ld/emultempl/vms.em @@ -0,0 +1,123 @@ +# This shell script emits a C file. -*- C -*- +# Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# 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. +# + +# This file is sourced from generic.em. + +fragment <is_archive) + return FALSE; + + string = (char *) xmalloc (strlen (search->name) + + strlen (entry->filename) + + sizeof "/.exe"); + + sprintf (string, "%s/%s.exe", search->name, entry->filename); + + if (! ldfile_try_open_bfd (string, entry)) + { + free (string); + return FALSE; + } + + entry->filename = string; + + return TRUE; +} + +static int +gld${EMULATION_NAME}_find_potential_libraries + (char *name, lang_input_statement_type *entry) +{ + return ldfile_open_file_search (name, entry, "", ".olb"); +} + +/* Place an orphan section. We use this to put random OVR sections. + Much borrowed from elf32.em. */ + +static lang_output_section_statement_type * +vms_place_orphan (asection *s, + const char *secname ATTRIBUTE_UNUSED, + int constraint ATTRIBUTE_UNUSED) +{ + static struct orphan_save hold_data = + { + "\$DATA\$", + SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_DATA, + 0, 0, 0, 0 + }; + + /* We have nothing to say for anything other than a final link. */ + if (link_info.relocatable + || (s->flags & (SEC_EXCLUDE | SEC_LOAD)) != SEC_LOAD) + return NULL; + + /* Only handle data sections. */ + if ((s->flags & SEC_DATA) == 0) + return NULL; + + if (hold_data.os == NULL) + hold_data.os = lang_output_section_find (hold_data.name); + + if (hold_data.os != NULL) + { + lang_add_section (&hold_data.os->children, s, hold_data.os); + return hold_data.os; + } + else + return NULL; +} +EOF + +LDEMUL_PLACE_ORPHAN=vms_place_orphan +LDEMUL_BEFORE_PARSE=gld"$EMULATION_NAME"_before_parse +LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=gld"$EMULATION_NAME"_create_output_section_statements +LDEMUL_FIND_POTENTIAL_LIBRARIES=gld"$EMULATION_NAME"_find_potential_libraries +LDEMUL_OPEN_DYNAMIC_ARCHIVE=gld"$EMULATION_NAME"_open_dynamic_archive diff --git a/ld/scripttempl/alphavms.sc b/ld/scripttempl/alphavms.sc new file mode 100644 index 0000000..ed4ec68 --- /dev/null +++ b/ld/scripttempl/alphavms.sc @@ -0,0 +1,34 @@ +# Linker script for Alpha VMS systems. +# Tristan Gingold . + +PAGESIZE=0x10000 + +cat <