From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2753 invoked by alias); 30 Sep 2002 12:39:13 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 2733 invoked by uid 61); 30 Sep 2002 12:39:13 -0000 Date: Mon, 30 Sep 2002 05:39:00 -0000 Message-ID: <20020930123913.2732.qmail@sources.redhat.com> To: betoes@igbt.sel.eesc.sc.usp.br, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, pzn@igbt.sel.eesc.sc.usp.br From: rearnsha@gcc.gnu.org Reply-To: rearnsha@gcc.gnu.org, betoes@igbt.sel.eesc.sc.usp.br, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, pzn@igbt.sel.eesc.sc.usp.br, gcc-gnats@gcc.gnu.org Subject: Re: other/7249: -Wl, and -Xlinker options to arm-aout-gcc X-SW-Source: 2002-09/txt/msg00852.txt.bz2 List-Id: Synopsis: -Wl, and -Xlinker options to arm-aout-gcc State-Changed-From-To: open->feedback State-Changed-By: rearnsha State-Changed-When: Mon Sep 30 05:39:11 2002 State-Changed-Why: I don't think there is anything here that is specific to the ARM, it think it's due to the way the driver programs for gcc have been changed. Gcc uses a program called collect2 as part of its link process. Collect2 (to a simple approximation) does the link in three steps: it first links all the objects specified together; then it scans the image for certain symbols, such as C++ constructors, destructors or exception tables, etc; and finally it links in some extra code to ensure that the above information is correctly initialized at the start of execution. The problem, I think, is that collect2 doesn't understand the -oformat option. However, even if we taught collect2 about it, I'm not sure it would help much. collect2 needs to be able to run tools such as nm on the partially linked image, and it can't do that if its been written out in ihex format. So I really think you need to split your link step into two commands. In the first produce an executable a.out image using the linker, and in the second use objcopy to translate your final image into ihex format. Ie, arm-aout-gcc -nostdlib -o foo.aout foo.c arm-aout-objcopy -O ihex -o foo foo.aout This gives you all the flexibility of using gcc to link your image but you still end up with an ihex format file. Are you happy if I close this PR? http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7249