Re: [Patch, avr] Shrink interrupt vector table down to last used entry

Georg-Johann Lay <[email protected]>
Newsgroups gmane.comp.hardware.avr.gcc
Message-ID <[email protected]>
Senthil Kumar Selvaraj wrote:

>> Granted, the (saved memory) reward for the effort is small, but if the
>> user would specify the number of the highest used vector, then gas
>> conditional assembly, in a "bad vector" macro does handle the task:
> 
> Ah, but right now, the vector table is defined in avr-libc
> (crt1/gcrt1.S) and gets built into crtxxx.o at avr-libc build time. It
> is then linked into the final executable automatically by the gcc
> driver. I guess that rules out conditional assembly?

It is reasonable that gcrt1.S is contained in a distribution so that users can
assemble an use it directly.  There's already an issue for this: #38125.

http://savannah.nongnu.org/bugs/?38125

With that, it's straight forward to accomplish a small vector table:

Just -nostartfiles, add gcrt1.S to the project and define _VECTORS_SIZE.

That way it is flexible and freely adjustable without binutils hacks.

Johann
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.