avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] [Patch, avr] Shrink interrupt vector table down to la


From: Weddington, Eric
Subject: Re: [avr-gcc-list] [Patch, avr] Shrink interrupt vector table down to last used entry
Date: Mon, 4 Mar 2013 17:42:41 +0000

> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On
> Behalf Of Senthil Kumar Selvaraj
> Sent: Friday, March 01, 2013 10:59 PM
> To: Georg-Johann Lay
> Cc: address@hidden
> Subject: Re: [avr-gcc-list] [Patch, avr] Shrink interrupt vector table
> down to last used entry
> 
> > With that, it's straight forward to accomplish a small vector table:
> >
> > Just -nostartfiles, add gcrt1.S to the project and define
> _VECTORS_SIZE.
> 
> Well, if the user is willing to do that, he might as well customize it
> and delete the extra entries in the table himself. He can actually do
> better than just shrinking the tail - he can use "holes" for some
> custom
> assembly (see
> http://blog.schicks.net/wp-content/uploads/2009/09/bootloader_faq.pdf).
> And of course, a custom linker script can do the job as well.
> 
> The intent behind the original patch was to shrink the table
> automatically with minimal or no user input for a standard setup. I
> guess Eric's response seals the fate of the patch then :)

Please realize that just because a user *can* do that, doesn't mean that they 
ought to do that, or do it easily. All it takes is to accidentally use the 
wrong register, or wrong bit mask and now an interrupt is enabled when it 
shouldn't be. If other code is now in the vector table, whether at the tail, or 
in "holes", it could wreak havoc with a system, and all for what gain? Of a few 
bytes of code size? This is not the kind of optimizations we should be pursuing.

There are plenty of opportunities to reduce the generated code size by working 
on the AVR back end than by automating the truncation of the IVT. The costs 
outweigh the benefits.



reply via email to

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