[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Memory section different of .text section

From: Ned Konz
Subject: Re: [avr-gcc-list] Memory section different of .text section
Date: Tue, 23 Nov 2004 10:59:57 -0800
User-agent: KMail/1.7.1

On Tuesday 23 November 2004 10:24 am, Yannick PODGORSKI wrote:
> Hi,
> I saw it in gcc 3.4.2 manual, there is an example.
> I use --section-start=.function=0x1D000 and the section is well create.
> I use __attribute__ ((section(".function"))) in front of functions and it
> works :
>     uint16_t section_fct(void); __attribute__ ((section(".function")))
> The function is well put in memory at 0x1D000
> I try with variables but it doesn't work :
> uint16_t var_section __attribute__ ((section(".function"))) = 0;
> The linker doesn't link :-). The error is about "section type conflict".

What happens if you make a section in RAM for the variable? I wouldn't think 
that you'd be able to put a variable into flash at 0x1d000 (because then it 
wouldn't be "variable", right?).

Also, I'd think it would be easier to maintain using a custom linker file 
rather than using command-line settings of section addresses.

Have you tried moving the .data section using something like the command line 


(that, according to the avr-libc docs would move the .data section to 0x1100).
You have to add 0x800000 to the actual RAM address.

Ned Konz

reply via email to

[Prev in Thread] Current Thread [Next in Thread]