Re: [cc65] Best way to get aligned memory...

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2003-01-15 18:52:17


Hi!

On Wed, Jan 15, 2003 at 01:22:07AM +0100, Groepaz wrote:
> > Because .ALIGN needs the segment to be aligned to that boundary, but BSS
> > has an alignment of 1. At least this is how it is currently implemented.
> > Groepaz already complained about it (loudly:-), so it may get changed, but
> > it's very low priority.
>
> there's a quite easy fix which i am using atm.... just put some padding-bytes
> into crt0, so that the "startup" segment ends at an even adress... that way
> atleast alignment to even adresses works (with more padding == waste more
> memory you can have working page-aligment aswell....etc).

The sections (= parts of a segment) inside an object file are already marked
in the header of the object file with the required alignment. Since the linker
cannot add bytes within a section (this would change the size of the data and
would therefore interfere with address calculations done by the assembler),
an easier solution would be to pad the start of the section to the required
alignment.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz_at_musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-01-15 18:52:22 CET