This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: The current linker failed to generate working Linux kernel


On Fri, Aug 18, 2006 at 02:42:35PM +0930, Alan Modra wrote:
> On Thu, Aug 17, 2006 at 09:44:53AM -0700, H. J. Lu wrote:
> > On Thu, Aug 17, 2006 at 10:50:39AM +0930, Alan Modra wrote:
> > > Not OK.  The main reason I added this code was to make using overlays
> > > simpler.  See http://sourceware.org/ml/binutils/2006-07/msg00314.html
> > > Your patch means that all loaded sections after an overlay would again
> > > need to have their lma specified, which is a pain.
> > 
> > I don't see why I have to specify lma after overlay:
> 
> My goal is to be able to insert an OVERLAY stanza into one of the
> existing linker scripts *without* having to mess around with dot as you
> are doing in your testcases, and have ld generate a nicely packed
> object file.  I would expect ld -N to not generate any extra segments
> apart from those for the overlay sections, ie. at most one segment
> before the overlays, one segment for each overlay section, and at most
> one after the overlays, and for p_paddr of each segment to follow on
> from the previous segment's ending p_paddr modulo alignment constraints.
> This translates to minimum wasted ROM (or whatever the backing store is
> for the overlays).  You'll find that if you try to do this with an old
> linker, you'll need to specify lma for all sections following the
> overlay.
> 

It is a nice new feature to have. But it shouldn't break the existing
linker scripts. When

.data : { *(.data) }

is used, I expect its lma == vma unless AT is used, as specified by
the linker manual. I will prefer a new linker option or a linker
script command to change the behavior. I checked in 2 testcases.
One of them fails due to the changed linker behavior.


H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]