From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26079 invoked by alias); 11 May 2009 17:57:55 -0000 Received: (qmail 26060 invoked by uid 22791); 11 May 2009 17:57:54 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 May 2009 17:57:48 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1M3Zl1-0005zy-00; Mon, 11 May 2009 19:57:43 +0200 Date: Mon, 11 May 2009 17:57:00 -0000 From: Andrew Lunn To: Evgeniy Dushistov Cc: Dave Milter , ecos-discuss@ecos.sourceware.org, ecos-devel@ecos.sourceware.org Subject: Re: [ECOS] raw output to serial port and dataflash + legacy API questions Message-ID: <20090511175743.GA4940@lunn.ch> Mail-Followup-To: Evgeniy Dushistov , Dave Milter , ecos-discuss@ecos.sourceware.org, ecos-devel@ecos.sourceware.org References: <2a382c6e0905070357u76683dacqfe8bd885c9260671@mail.gmail.com> <20090511172638.GA27330@rain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090511172638.GA27330@rain> User-Agent: Mutt/1.5.18 (2008-05-17) X-IsSubscribed: yes Mailing-List: contact ecos-devel-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-devel-owner@ecos.sourceware.org X-SW-Source: 2009-05/txt/msg00005.txt.bz2 > For example, you write this code in some ".c" file: > > __externC cyg_spi_at91_device_t spi_dataflash_dev0; > > CYG_DATAFLASH_FLASH_DRIVER( cyg_eb55_dataflash, > &spi_dataflash_dev0, > 0x08000000, > 0, > 16 ); > > this file contains only definitions of variables, > no code. For some reasons linker will remove > such kind of object file in the resulting binary, and also all the stuff like dataflash module, because > without this file there are no links to dataflash module functions. > > I suppose, this is bug either in build system of ecos, or in arm-eabi toolchain. > > The workaround for this issue, that I used, is simple. I add after > CYG_DATAFLASH_FLASH_DRIVER the dummy function: > > CYG_DATAFLASH_FLASH_DRIVER( cyg_eb55_dataflash, > 0, > 16 ); > > +void cyg_eb55_dataflash_func(int p) > +{ > +} > + If something is not referenced, the linker will throw it away. It is unwanted bloat. To stop this, you need to let the build system know. eg for a serial driver in the CDL: compile -library=libextras.a at91_serial.c Andrew