This is the mail archive of the 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: current binutils trunk fails to build bootable kernel image for some configurations

On Wed, Jul 22, 2009 at 01:04:57PM -0400, Matthias Klose wrote:
> this was reported as, I currently don't 
> have much more information, besides that one of the Debian kernel 
> maintainers did identify
> 2009-07-11  Alan Modra  <>
>         * ldlang.c (insert_os_after): Don't tie assignments to non-alloc
>         output sections.
> this patch as the one causing the wrongly built kernel. However I don't 
> see this checkin mentioned on the ML.

The discussion happened on bug-binutils.

> Bastian Blank did check that the 
> problem goes away with a binutils build from trunk and this patch 
> reverted. Some more analysis in

The biggest problem is that the kernel linker script doesn't mention
all sections, which means ld must choose a place for the unmentioned
sections (orphans).  Sometimes ld's placement isn't how a naive
programmer would expect.

In this case:

  .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {

ld stuck an orphan section between the two statements.  Which meant
that the start of .data_nosave is not aligned (and since the end is
aligned by following statements, it means that .data_nosave also has
padding inserted).  It would be more robust to write:

  .data_nosave ALIGN(PAGE_SIZE) : AT(ADDR(.data_nosave) - LOAD_OFFSET) {

Alan Modra
Australia Development Lab, IBM

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