[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Missing Section
From: |
Erik Christiansen |
Subject: |
Re: [avr-gcc-list] Missing Section |
Date: |
Mon, 8 Oct 2007 11:24:22 +1000 |
User-agent: |
Mutt/1.5.9i |
On Fri, Oct 05, 2007 at 09:48:10AM -0700, Gre7g Luterman wrote:
> $ avr-objdump.exe -h RIO-15C/RIO-15C.elf | head -n 15
>
> RIO-15C/RIO-15C.elf: file format elf32-avr
>
> Sections:
> Idx Name Size VMA LMA File
> off Algn
> 0 .update 000001ba 00001e40 00001e40
> 00001f24 2**0
> CONTENTS, READONLY
> 1 .text 00001e02 00000000 00000000
> 000000b4 2**1
> CONTENTS, ALLOC, LOAD, READONLY,
> CODE
> 2 .data 00000004 00800060 00001e02
> 00001eb6 2**0
> CONTENTS, ALLOC, LOAD, DATA
> 3 .bss 0000019b 00800064 00800064
> 00001eba 2**0
> ALLOC
> 4 .eeprom 0000006a 00810000 00810000
> 00001eba 2**0
> CONTENTS, ALLOC, LOAD, DATA
The .update section lacks both the ALLOC and LOAD attributes, so there's
nothing to tell the tools to allocate memory or load the contents. However,
your linker script is not causing that by using NOLOAD, so the problem
lies elsewhere.
You wrote earlier:
> Were the sections created with just a .S file? Custom sections work
> fine for me also... as long as there is one or more .c files in that
> section.
So it's an assembler .section statement, not a C __attribute__((...))),
which is putting stuff into .update, in the problem case.
Can you please post your assembler .section statement?
We particularly need to see the quoted flags on the line, especially
since "info as" says:
If no flags are specified, the default flags depend upon the section
name. If the section name is not recognized, the default will be for
the section to be loaded and writable.
That does not appear to be compatible with the problem code (harmlessly)
defaulting the section attributes, does it?
> I tried to duplicate what you're doing in your Makefile, but I'm not
> having any luck. I've been using avr-gcc.exe instead of avr-as.exe &
> avr-ld.exe, ...
That is more convenient. Using avr-gcc, rather than invoking avr-as and
avr-ld directly, has the advantage of allowing re-use of the C header
files.
There are different ways to do things. A common way to make them work is
to collect data on what is problematic, until a gap to wriggle through
appears.
Your .section line, putting stuff into .update, is the next needed clue,
I suspect.
Erik