avrdude-dev
[Top][All Lists]
Advanced

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

RE: [avrdude-dev] avrdude elf implimentation


From: Eric Weddington
Subject: RE: [avrdude-dev] avrdude elf implimentation
Date: Thu, 15 Mar 2007 06:03:24 -0600

 

> -----Original Message-----
> From: 
> address@hidden 
> [mailto:address@hidden
> rg] On Behalf Of Colin O'Flynn
> Sent: Wednesday, March 14, 2007 5:59 PM
> To: address@hidden
> Subject: [avrdude-dev] avrdude elf implimentation
> 
> Hello,
> 
> I decided to start a new thread for technical discussions of 
> the new avrdude 
> feature where it can read ELF files, from the "[avr-gcc-list] Re: 
> [avrdude-dev] [RFC] avrdude Feature  RequestandCall for Volunteers".
> 
> One thing I noticed is this:
> 
> If we add new sections to the ELF file, won't it break old 
> makefiles? Mostly 
> the copy of ELF files to HEX. This part of the Makefile does the copy:
> 
> %.hex: %.elf
>       @echo
>       @echo $(MSG_FLASH) $@
>       $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
> 
> This copies everything EXCEPT for the .eeprom section. So 
> when more sections 
> are added, we either have to change the Makefile to remove 
> those sections 
> too, or change how the copy is done....
> 
> Any ideas?

Hi Colin,

IIRC, the copy is also based on the "attributes" of the sections. You can
see these attributes when you look at the .map file, or in various output
from binutils programs, or in the default linker script that is used. 

My guess is that the objcopy command to convert to hex, will copy all
sections that have the read attribute ('r'), and then it explicity disallows
the .eeprom section. If I'm wrong, please somebody correct me.

Changing the default Makefile, to change the copy command, has its problems
when the distros (mainly WinAVR) is released. It takes time for users to use
the new Makefile, or use the new MFile, and ultimately AVR Studio would also
have to be changed to generate a new internal Makefile. So this ties a
specific version of WinAVR with a specific version of AVR Studio. And I've
seen the effects of this recently. ;-)

What might be better, is to change the linker scripts
(<install>/avr/lib/ldscripts). Perhaps there is a way to set the attributes
of default fuse sections, such that it won't get pulled in to the objcopy
command to create the application hex file. If the linker scripts are
changed to include fuse sections, then we can set the default names for the
fuse sections and they become somewhat "official".

(Speaking of that, perhaps something like this ought to be done for the
.bootloader section.... But that's a different discussion. ;-)

Joerg, Anatoly, any thoughts?

Eric





reply via email to

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