From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20838 invoked by alias); 14 May 2005 19:02:39 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 20822 invoked from network); 14 May 2005 19:02:34 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 14 May 2005 19:02:34 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j4EJ2Y2j023237 for ; Sat, 14 May 2005 15:02:34 -0400 Received: from pobox.surrey.redhat.com (pobox.surrey.redhat.com [172.16.10.17]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j4EJ2XO26759; Sat, 14 May 2005 15:02:33 -0400 Received: from [172.31.0.98] (vpnuser9.surrey.redhat.com [172.16.9.9]) by pobox.surrey.redhat.com (8.12.8/8.12.8) with ESMTP id j4EJ2WMO011328; Sat, 14 May 2005 20:02:32 +0100 Message-ID: <42864B67.7010005@redhat.com> Date: Sat, 14 May 2005 20:46:00 -0000 From: Nick Clifton User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) MIME-Version: 1.0 To: Ravi Ramaseshan CC: binutils@sources.redhat.com Subject: Re: Including files through command line options References: <22080b0a0505131425254624f9@mail.gmail.com> In-Reply-To: <22080b0a0505131425254624f9@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2005-05/txt/msg00475.txt.bz2 Hi Ravi, > Based on a command line option, I want to make GAS include certain > assembly source files (let's assume that I know where the file is for > now). > > I've tried setting a flag in md_parse_option, reading that flag in > md_begin and then based on that flag called read_a_source_file on the > file which I wanted to include. > > Could anyone advise me if this is the acceptable way of achieving my > objective or if there is a cleaner way of doing this. It is an acceptable way of achieving your goal. Presumably you are only modifying files specific to the target you are working on, so there is no chance that if there was a bug in your code it would affect other targets. As for cleaner ways of achieving your objective I would definitely recommend that you consider using the "gcc" program instead. Gcc is quite capable of taking assembler source files which include C preprocessor commands, including the #include directive, processing it and then passing it on to GAS. ie GCC and C preprocessor can already do exactly what you want, so why bother reinventing the wheel ? Cheers Nick