[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avr-gcc-list] Strings in ROM
From: |
Weddington, Eric |
Subject: |
RE: [avr-gcc-list] Strings in ROM |
Date: |
Fri, 13 Mar 2009 16:37:08 -0600 |
> -----Original Message-----
> From:
> address@hidden
> [mailto:address@hidden
> org] On Behalf Of Robert von Knobloch
> Sent: Friday, March 13, 2009 6:51 AM
> To: address@hidden
> Subject: [avr-gcc-list] Strings in ROM
>
> #define SECTION TEST1_SECTION
>
> SECTION prog_char press_button[] = ">> Press UUT button <<";
> SECTION prog_char button_timeout[] = "*** Error - Timeout! ***";
>
> where the linker sees:
> LDFLAGS = -Wl,-Map,$(PRG).map \
> -Wl,--section-start=.test0=0x2600 \
> -Wl,--section-start=.testparms0=0x2e80 \
> -Wl,--section-start=.test1=0x2f00 \
> -Wl,--section-start=.testparms1=0x3780
>
> 'make' results in:
>
> avr-gcc -g -Wall -Os -mmcu=atmega644 -DF_CPU=20000000 -c
> -o main.o
> main.c
> In file included from main.c:25:
> tests.c:138: error: section of 'press_button' conflicts with previous
> declaration
> tests.c:139: error: section of 'button_timeout' conflicts
> with previous
> declaration
>
> I cannot find where 'prog_char is defined and would like to know how I
> can force the compiler to put these strings in my 'test1' section.
prog_char is defined in <avr/pgmspace.h>.
Take a look at the GCC user manual, under Function Attributes, look at the
"section" attribute:
<http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/Function-Attributes.html#Function-Attributes>