Re: [cc65] rodata alignment independent from ld.cfg

From: Gábor Lénárt <lgb1lgb.hu>
Date: 2011-01-14 20:03:48
On Fri, Jan 14, 2011 at 06:57:04PM +0100, Ullrich von Bassewitz wrote:
> 
> On Fri, Jan 14, 2011 at 05:51:05PM +0100, Gábor Lénárt wrote:
> > It's quite
> > impossible to create new segments for this, since it would mean to use
> > hundreds of segments if I want to optimize my code well.  However even if I
> > know the theory behind the reason (why ca65/ld65 work this way) I have no
> > idea how to solve these kind of problems too much.  Currently I've given up
> > my ideas to optimize my code for DTV this way because of these problems.  Do
> > you have any idea what can I do instead of just giving up?  :)
> 
> You don't have to create hundreds of segments. Just create one segment that is
> aligned and place all the code that must be aligned into this segment.

You haven't got my point, I think. For sure, I can do that. But I also want to
align "randomly" throughout the code to insert eg as many NOPs as it needs
to have the next opcode 4 byte alignmented.  Or to have some given code
aligned even if I insert/delete opcodes before that part.  For sure, you are
right, it can be done easily as you suggested, but it's _very_ hard to track
the alignment throughout a code which is longer than any trivial code.  Also
if I insert something to somewhere, I should recalculate the alignment
throught the whole code ...  If you have a perfect code, which is not need
any modification other than the optimizing, it's fine what you've suggested. 
But in practice, even if optimization should be the "last step" after having
"perfect" code, the reality is very often quite different.  At least imho :)
And on DTV I want almost all my code optimized this way, it would be a quite
big work to align just the segment and then take care about the rest
"manually" inside the segment. I have a stupid script which inspects the
generated vice label (it was easier for me currently) file and then modifies
the source itself, which can be recompiled again to have what I want (with
some marks in the source by me), but it's a very ugly solution, I think :)
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Jan 14 20:04:05 2011

This archive was generated by hypermail 2.1.8 : 2011-01-14 20:04:08 CET