diff mbox

binutils 2.19 issue with kernel link

Message ID 20090709163900.GA6549@farnsworth.org (mailing list archive)
State Not Applicable
Delegated to: Kumar Gala
Headers show

Commit Message

Dale Farnsworth July 9, 2009, 4:39 p.m. UTC
On Wed, Jul 08, 2009 at 05:41:39PM -0500, Kumar Gala wrote:
> We are seeing an issue w/ld and kernel linking of 32-bit kernels.
>
> The ld from fedora 11 (2.19.51.0.2-17.fc11 20090204) ends not providing 
> the proper address for _end.
>
> Building stock v2.6.30 w/the mpc85xx_defconfig we get:
>
> 00001000 A _end
>
> Using 2.18.50.20080215 we get:
>
> c0680000 A _end
>
> If we modify the linker script:
>
>       _end2 = .;
>       _end3 = ALIGN(4096);
>       _end4 = ALIGN(PAGE_SIZE);
>       . = ALIGN(PAGE_SIZE);
>       _end = . ;
>       PROVIDE32 (end = .);
>
> and the result is:
>
> 00001000 A _end
> c067f678 A _end2
> c0680000 A _end3
> c0680000 A _end4
>
> I used an old version of linker (2.18.50.20080215) and re-linked:
>
> c067f678 A _end2
> c0680000 A _end
> c0680000 A _end3
> c0680000 A _end4
>
> Any ideas?

We have found the following workaround to be useful.
Thanks to Andrew Jenner at Code Sourcery.

-Dale

Dale Farnsworth
MontaVista Software

Comments

Kumar Gala July 9, 2009, 6:14 p.m. UTC | #1
On Jul 9, 2009, at 11:39 AM, Dale Farnsworth wrote:

> On Wed, Jul 08, 2009 at 05:41:39PM -0500, Kumar Gala wrote:
>> We are seeing an issue w/ld and kernel linking of 32-bit kernels.
>>
>> The ld from fedora 11 (2.19.51.0.2-17.fc11 20090204) ends not  
>> providing
>> the proper address for _end.
>>
>> Building stock v2.6.30 w/the mpc85xx_defconfig we get:
>>
>> 00001000 A _end
>>
>> Using 2.18.50.20080215 we get:
>>
>> c0680000 A _end
>>
>> If we modify the linker script:
>>
>>      _end2 = .;
>>      _end3 = ALIGN(4096);
>>      _end4 = ALIGN(PAGE_SIZE);
>>      . = ALIGN(PAGE_SIZE);
>>      _end = . ;
>>      PROVIDE32 (end = .);
>>
>> and the result is:
>>
>> 00001000 A _end
>> c067f678 A _end2
>> c0680000 A _end3
>> c0680000 A _end4
>>
>> I used an old version of linker (2.18.50.20080215) and re-linked:
>>
>> c067f678 A _end2
>> c0680000 A _end
>> c0680000 A _end3
>> c0680000 A _end4
>>
>> Any ideas?
>
> We have found the following workaround to be useful.
> Thanks to Andrew Jenner at Code Sourcery.
>
> -Dale
>
> Dale Farnsworth
> MontaVista Software
>
> diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/ 
> vmlinux.lds.S
> index acf237f..34b0181 100644
> --- a/arch/powerpc/kernel/vmlinux.lds.S
> +++ b/arch/powerpc/kernel/vmlinux.lds.S
> @@ -282,4 +282,7 @@ SECTIONS
> 	. = ALIGN(PAGE_SIZE);
> 	_end = . ;
> 	PROVIDE32 (end = .);
> +
> +#undef PPC
> +	.PPC.EMB.apuinfo 0 : { *(.PPC.EMB.apuinfo) }
> }

Is there any plans to fix binutils or is this viewed as not a binutils  
regression?

- k
Dale Farnsworth July 9, 2009, 7:06 p.m. UTC | #2
On Thu, Jul 09, 2009 at 01:14:28PM -0500, Kumar Gala wrote:
> On Jul 9, 2009, at 11:39 AM, Dale Farnsworth wrote:
>> We have found the following workaround to be useful.
>> Thanks to Andrew Jenner at Code Sourcery.
>>
>> -Dale
>>
>> Dale Farnsworth
>> MontaVista Software
>>
>> diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/ 
>> vmlinux.lds.S
>> index acf237f..34b0181 100644
>> --- a/arch/powerpc/kernel/vmlinux.lds.S
>> +++ b/arch/powerpc/kernel/vmlinux.lds.S
>> @@ -282,4 +282,7 @@ SECTIONS
>> 	. = ALIGN(PAGE_SIZE);
>> 	_end = . ;
>> 	PROVIDE32 (end = .);
>> +
>> +#undef PPC
>> +	.PPC.EMB.apuinfo 0 : { *(.PPC.EMB.apuinfo) }
>> }
>
> Is there any plans to fix binutils or is this viewed as not a binutils  
> regression?

It sure looks like a regression to me, but I don't have details on
a potential fix.

-Dale
diff mbox

Patch

diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index acf237f..34b0181 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -282,4 +282,7 @@  SECTIONS
 	. = ALIGN(PAGE_SIZE);
 	_end = . ;
 	PROVIDE32 (end = .);
+
+#undef PPC
+	.PPC.EMB.apuinfo 0 : { *(.PPC.EMB.apuinfo) }
 }