Subject: Re: Revision K strongarms ...
To: Ian Molton <mh120608@cr10m.staffs.ac.uk>
From: Philip Blundell <pb@nexus.co.uk>
List: port-arm32
Date: 05/07/1998 12:46:05
In message <27a7d15mh120608@staffs.ac.uk>, Ian Molton writes:
>On 07 May, Philip Blundell <pb@nexus.co.uk> wrote:
>> The problem is that gcc doesn't _know_ where the code is going to end
>> up.  The  linker doesn't necessarily page-align all object files. 
>
>Why not modify the linker ?

It could be done.  A smarter linker would enable you to do some optimisations 
that you can't do in the compiler alone.  But I think it might be quite a bit 
of work.

If you mean `modify the linker so it _does_ page align everything', that would 
cause tremendous code bloat.  For example, the GNU C library contains 1076 
object files.  Assuming that, on average, you'd waste half a page per object 
by aligning them, that would cost you a total of over 2MB.  In fact it's even 
worse than that because a significant number of them are much smaller than a 
single page - they only contain a few hundred bytes of code.  So again, it's 
possible, but you have to weigh up whether it's actually worth the cost.  If 
you _did_ do this, you would either have to maintain two versions of 
everything, or foist this wastage of space onto everybody who uses NetBSD, the 
majority of whom probably don't have CPUs with this problem.

p.