On Mon, Mar 29, 2010 at 06:19:51AM +0200, Joerg Wunsch wrote:
> Erik Christiansen <dva...@internode.on.net> wrote:
> 
> > Since the discussion has proceeded this far, you've presumably not had
> > satisfaction from choosing for yourself where a function lives?:
> > 
> > void foo(void) __attribute__ ((section (".bootloader")));
> 
> That doesn't really help to also place functions from libgcc.a into
> a separate section.

Ah, that is a rather special case. It is possible to edit the function
prototypes in the gcc source, and build a custom compiler for this
special task, but is the section attribute preserved in an archive?  

It may be more convenient and reliable to use -nodefaultlibs, instead of
modifying gcc, and supply a copy of the the functions ourselves, with
modified function prototypes. Alternatively, simple linker scripting
provides full control of placement, with unmodified code.

That seems a small effort, especially if the result is highly desirable.

Note: I am just guessing that a simple:

     mysection : { libgcc.a(.*) }

     in the linker script won't be honoured during the process of
     satisfying missing externals from an archive. I haven't checked
     whether that could be all that is needed to do the job.

Erik

-- 
If at first you don't succeed, destroy all evidence that you tried.
                           - Ralf Hildebrandt, on postfix-users.



_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to