Re: [ECOS] raw output to serial port and dataflash + legacy API questions

Andrew Lunn <[email protected]>
Newsgroups gmane.os.ecos.devel
Message-ID <20090511175743.GA4940__27790.5656992973$1242064705$gmane$org@lunn.ch>
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.