From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6447 invoked by alias); 12 Aug 2009 01:00:11 -0000 Received: (qmail 6372 invoked by uid 22791); 12 Aug 2009 01:00:05 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-pz0-f202.google.com (HELO mail-pz0-f202.google.com) (209.85.222.202) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 Aug 2009 00:59:57 +0000 Received: by pzk40 with SMTP id 40so3785199pzk.14 for ; Tue, 11 Aug 2009 17:59:55 -0700 (PDT) Received: by 10.114.38.9 with SMTP id l9mr9014159wal.176.1250038795085; Tue, 11 Aug 2009 17:59:55 -0700 (PDT) Received: from Paullaptop (203-206-7-21.dyn.iinet.net.au [203.206.7.21]) by mx.google.com with ESMTPS id l30sm11654927waf.35.2009.08.11.17.59.51 (version=SSLv3 cipher=RC4-MD5); Tue, 11 Aug 2009 17:59:52 -0700 (PDT) Message-ID: From: "Paul Edwards" To: "Ulrich Weigand" Cc: References: <200908111348.n7BDmooM002811@d12av02.megacenter.de.ibm.com> In-Reply-To: <200908111348.n7BDmooM002811@d12av02.megacenter.de.ibm.com> Subject: Re: i370 port Date: Wed, 12 Aug 2009 11:52:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-08/txt/msg00188.txt.bz2 > That depends a bit on the compiler version and optimization level, > but (in particular in the 3.x time frame) GCC may output assembler > code on a function-by-function basis, without necessarily reading > in the whole source file first. Ok, actually it doesn't matter if it doesn't work all the time. I'll always be compiling with -Os anyway, so it sounds like I'm in with a chance of the whole file being read first? If so, where is my first opportunity, in 3.2.3, to see if there's a "main" function in this file? >> > As crt0.o can be (and usually is) completely >> > written in assembler, you can arrange for everything to be in the >> > sequence >> > that is required. (On the linker command line, crt0.o would be placed >> > first, so if the entry point is the first thing in crt0.o it will then >> > also be the first thing in the executable.) >> >> Yes, I can do that, but that means I need to have a linker command >> line! The way the MVS linker works, I can link my main program, >> (which obviously doesn't have crt0 in it), and, thanks to the "END" >> statement, I can specify an entry point. This means no complaint >> from the linker about a default (and wrong) entry point, and no >> need for any linker statements. It all automatically resolves. > > I don't know exactly how your port handles this on MVS, but usually > GCC itself will invoke the linker, and will itself prepare an > appropriate command linker for the linker. GCC on MVS *only* outputs assembler. ie you always have to use the "-S" option. By doing so, it turns GCC into a pure text-processing application, which will thus work in any C90 environment. > In current GCC, every insn contains "location" information pointing > back to source code line (and column) numbers. However, in GCC 3.x > I think this wasn't yet present, but you had to rely on line number > notes interspersed with the insn stream. > > In any case, if you build with -g and use in addition the "debug > assembler output" flag -dA the assembler output should contain > human-readable comments containing line number information. The GCC assembler is never invoked. After getting the assembler output from the -S option, this is fed into IFOX00/IEV90/ASMA90. Regardless, if line number notes are interspersed in the stream, maybe whenever I write out an assembler instruction I will have access to those notes and can print out a comment. Thanks. Paul.