The best thing to do is just to rewrite startup procedures and redefine
vectors table.
I think you've got no global vars and/or do not care about globals initial
values.So, you're probably do not need a startups at all.
Then put 'main' as a reset vector in vectors table and pass --endup=main to
gcc. You'll save about 90 bytes total then.
The procedure is explained in docs.
~d
On Wednesday 30 April 2003 13:56, Bob Paddock wrote:
> Is there some way that I can have better control over the order the
> compiler puts things in memory?
>
> For example:
>
> Disassembly of section .text:
>
> 0000fc00 <_reset_vector__>:
> fc00: b2 40 80 5a mov #23168, &0x0120 ;#0x5a80
> ...
> fc36: 30 40 40 fc br #0xfc40 ;
>
> 0000fc3a <vector_ffe0>:
> fc3a: 30 40 3e fc br #0xfc3e ;
>
> 0000fc3e <_unexpected_>:
> fc3e: 00 13 reti
>
> 0000fc40 <main>:
>
> How do I move <vector_ffe0> and <_unexpected_>, so that
> I can get rid of the br 0xfc40 jump that jumps around them?
> I'm looking for a automated solution, not some thing I have to
> hand tweak each build.
>
> I'd move the <sections> to right before the vector table, or the start
> of flash so that they stay out of the way in the future.
>
> I'm trying to fit the code in a 1K part, and I'm over by 8 bytes,
> so every byte counts.
--
/********************************************************************
("`-''-/").___..--''"`-._ (\ Dimmy the Wild UA1ACZ
`6_ 6 ) `-. ( ).`-.__.`) Enterprise Information Sys
(_Y_.)' ._ ) `._ `. ``-..-' Nevsky prospekt, 20 / 44
_..`--'_..-_/ /--'_.' ,' Saint Petersburg, Russia
(il),-'' (li),' ((!.-' +7 (812) 3468202, 5585314
********************************************************************/