From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5613 invoked by alias); 27 Sep 2012 07:28:15 -0000 Received: (qmail 5603 invoked by uid 22791); 27 Sep 2012 07:28:12 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from tetra.codeconfidence.com (HELO tetra.codeconfidence.com) (94.229.66.225) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 27 Sep 2012 07:27:58 +0000 Received: from cog.dallaway.org.uk (cpc1-cmbg10-0-0-cust34.5-4.cable.virginmedia.com [81.102.132.35]) by tetra.codeconfidence.com (Postfix) with ESMTP id AAA44234C443; Thu, 27 Sep 2012 08:27:56 +0100 (BST) Received: from cog.dallaway.org.uk (cog.dallaway.org.uk [127.0.0.1]) by cog.dallaway.org.uk (8.13.8/8.13.8) with ESMTP id q8R7RuHR031366; Thu, 27 Sep 2012 08:27:56 +0100 Message-ID: <5063FFFC.2020405@dallaway.org.uk> Date: Thu, 27 Sep 2012 07:28:00 -0000 From: John Dallaway User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.5) Gecko/20120606 Thunderbird/10.0.5 MIME-Version: 1.0 To: Ken Yee CC: eCos Discussion References: <20120926234606.868@web002.roc2.bluetie.com> In-Reply-To: <20120926234606.868@web002.roc2.bluetie.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: [ECOS] Re: possible bug in configtool or whatever is generating "target.ld" file X-SW-Source: 2012-09/txt/msg00034.txt.bz2 Hi Ken On 27/09/12 04:46, Ken Yee wrote: > When you link your app, the symptom is you see this when you link your application: > > /home/ecos/gnutools/arm-eabi/bin/../lib/gcc/arm-eabi/4.6.2/../../../../arm-eabi/bin/ld:target.ld:17: syntax error > collect2: ld returned 1 exit status > > It's a bit of a cryptic error because target.ld is not in the path indicated. > It's actually in your your ecos_install/lib directory. > If you open the target.ld file, you'll see this: > > ============== > ... > SECTIONS > { > .debug_aranges 0 : { *(.debug_aranges) } .debug_pubnames 0 : { *(.debug_pubnames) } .debug_info 0 : { *(.debug_info) } .debug_abbrev 0 : { *(.debug_abbrev) } .debug_line 0 : { *(.debug_line) } .debug_frame 0 : { *(.debug_frame) } .debug_str 0 : { *(.debug_str) } .debug_loc 0 : { *(.debug_loc) } .debug_macinfo 0 : { *(.debug_macinfo) } .note.arm.ident 0 : { KEEP (*(.note.arm.ident)) } /DISCARD/ 0 : { *(.fini_array*) } > .fixed_vectors 0x20 : { . = .; KEEP (*(.fixed_vectors)) } > sram > SECTION_sram_code (sram, ALIGN (0x4), ) > .rom_vectors 0x02008000 : { __rom_vectors_vma = ABSOLUTE(.); . = .; KEEP (*(.vectors)) } > ram __rom_vectors_lma = LOADADDR(.rom_vectors); > ... > ================ > > The offending line 17 is the one that starts with SECTION_sram_code; delete this > line to fix the link error. > That looks like the syntax for the .ldi file instead of the target.ld file. The eCos build system runs the C preprocessor over a target-specific .ldi file to generate the final linker script file (target.ld). The macros such as SECTION_data and SECTION_bss are defined in an architecture-specific .ld file located in the relevant architecture HAL package. For example, the Cortex-M architectural HAL package provides the file src/cortexm.ld containing these definitions. The various .ldi files provided by the platform HAL packages should use only those macros defined in the relevant architecture-specific .ld file. The fact that "SECTION_sram_code" appears in your target.ld output suggests that this macro is used in the target-specific .ldi file but is not defined in the architecture-specific .ld file and is therefore not being replaced by the C preprocessor. I hope this helps... John Dallaway eCos maintainer http://www.dallaway.org.uk/john -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss