[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] [RFC] Patch adding support for atmega2560-2561
From: |
Björn Haase |
Subject: |
Re: [avr-libc-dev] [RFC] Patch adding support for atmega2560-2561 |
Date: |
Mon, 19 Sep 2005 15:14:52 +0200 |
User-agent: |
KMail/1.7.1 |
David Brown wrote on Montag, 19. September 2005 09:53 :
> An alternative idea might be to use individual sections such as
> ".text1_foo" for the stub for function foo(), and make use of the
> "--gc-sections" option in the linker to remove any such section that is not
> used. I'm thinking of the same idea as the "-ffunction-sections" switch in
> gcc which can be used with "--gc-sections" to avoid linking in functions
> that are not used. I haven't tried the "-ffunction-sections" switch, and
> don't even know if it is implemented for the avr port, but perhaps the same
> idea can be used.
Your idea indeed works! However, one will to have to change the binutil's
default linker scripts and avr-libc's crt file a bit, such that the
--gc-sections switch actually works: One will probably have to replace the
sections .init1 up to .init9 by .init 1 up to .init 9 (note the white space
between the numbers). Otherwise, e.g. .init2 will be considered to be an
unused section and would be thrown away. If it's subsection 2 of the .init
section that does not happen. Also one would have to add
-Wl,--entry=__vectors to the linker options such that the reset vector is
taken as a starting point.
Positive side-effect would also be that with -ffunction-sections unused
functions that are not declared static could be removed by the linker.
Yours,
Bjoern
- [avr-libc-dev] [task #3693] Add new devices: mega 640-1280-1281-2560-2561, Anatoly Sokolov, 2005/09/05
- RE: [avr-libc-dev] [task #3693][task #4102] Add new devices: mega640-1280-1281-2560-2561, Darcy Watkins, 2005/09/06
- [avr-libc-dev] [task #3693] Add new devices: mega 640-1280-1281-2560-2561, Anatoly Sokolov, 2005/09/07
- [avr-libc-dev] [task #3693] Add new devices: mega 640-1280-1281-2560-2561, Uwe Fechner, 2005/09/16
- RE: [avr-libc-dev] [task #3693] Add new devices: mega640-1280-1281-2560-2561, Darcy Watkins, 2005/09/16
- Re: [avr-libc-dev] [task #3693] Add new devices: mega640-1280-1281-2560-2561, Björn Haase, 2005/09/18
- [avr-libc-dev] [RFC] Patch adding support for atmega2560-2561, Björn Haase, 2005/09/18
- Re: [avr-libc-dev] [RFC] Patch adding support for atmega2560-2561, David Brown, 2005/09/19
- Re: [avr-libc-dev] [RFC] Patch adding support for atmega2560-2561, Björn Haase, 2005/09/19
- Re: [avr-libc-dev] [RFC] Patch adding support for atmega2560-2561,
Björn Haase <=
- Re: [avr-libc-dev] [RFC] Patch adding support for atmega2560-2561, Bernd Trog, 2005/09/19
- [avr-libc-dev] [RFC] Suggestion on how to rapidly implement support for atmega2560-2561, Björn Haase, 2005/09/19
- Re: [avr-libc-dev] [RFC] Suggestion on how to rapidly implement supportfor atmega2560-2561, Anatoly Sokolov, 2005/09/23
- [avr-libc-dev] Re: [RFC] Patch adding support for atmega2560-2561, Denis Chertykov, 2005/09/22