[fpc-pascal] Variable alignment in arm-embedded

Koenraad Lelong fpascal at brouwerij.homelinux.net
Tue Jun 12 09:50:49 CEST 2012

On 08-06-12 14:37, Jeppe Græsdal Johansen wrote:
> Den 08-06-2012 14:28, Ludo Brands skrev:
>>> Thanks Ludo,
>>> I'll take that as a starting point. I hope I will not need the "lost"
>>> 256 bytes in the future.
>> I could be wrong but AFAIK if the compiler would do the alignment, the
>> loss
>> can also be up to 255 bytes. Here you lose 256 bytes in all cases.
> Yes, but this would allow the linker to place other stuff there which
> fits in less than 255 bytes.
> Wasting 255 bytes is a lot on systems that only has a few kilobytes of
> RAM. I wonder if the restriction of 32 bytes on the align directive
> could just be removed, or will we need some sort of linker script changes?


I'm still struggling to get interrupts (or even inputs) work but I 
wanted to comment on the size of the table. Reading the manuals I found 
it's actually on a 512 byte boundery. The VTOR (Vector Table Offset 
Register) masks off the last 9 bits (8..0).
If I need that space I will modify the start of RAM location and use the 
first bytes of RAM for the vector-table.
It would be nice to have "external" linker scripts. That way you could 
more easily add processors, or use custom bootloaders.


Koenraad Lelong.

More information about the fpc-pascal mailing list