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: gold patch committed (Was: Re: Help needed to track down bug: linking Linux kernel with gold creates unbootable kernel)


2010/4/23 Török Edwin <edwintorok@gmail.com>:
> On 04/23/2010 07:49 AM, Ian Lance Taylor wrote:
>> John Reiser <jreiser@bitwagon.com> writes:
>>
>>>> Linux kernel linker scripts needs to align .rodata section to 2MB:
>>>>
>>>> . = ALIGN((1<< ?21));
>>>>
>>>> Since gold can only align to 4K, gold can't be used on Linux
>>>> kernel.
>>>
>>> The linker script statement ". = ALIGN((1<< ?21));" requires alignment
>>> to 2 MiB. ?If gold "can only align to 4 KiB", then gold must emit an
>>> error message upon processing input that requires a larger alignment.
>>> It is a bug that current gold does not emit such a message for this case.
>>
>> The problem is that the alignment requested by the linker script is
>> not reflected in the linker output. ?That actually appears to be true
>> of the GNU linker as well. ?Logically, an alignment requested in the
>> linker script should be reflected in the program segments.
>>
>> I committed this patch to make an alignment requested in the linker
>> script be reflected in the p_align field of the generated program
>> headers. ?I don't know if this actually fixes the problem, but it
>> seems like the right thing to do.
>
> With latest CVS gold I get this error:
> objcopy ?-R .comment -S vmlinux arch/x86/boot/compressed/vmlinux.bin
> objcopy:arch/x86/boot/compressed/vmlinux.bin[.text]: File truncated
> objcopy:arch/x86/boot/compressed/vmlinux.bin: File truncated
>
> Looks like objcopy doesn't like something about vmlinux.
>
> $ ls -l vmlinux
> -rwxr-xr-x 1 edwin edwin 10879216 Apr 23 16:58 vmlinux
>

>
> Program Headers:
> ?Type ? ? ? ? ? Offset ? VirtAddr ? ? ? ? ? PhysAddr ? ? ? ? ? FileSiz
> ?MemSiz ? Flg Align
> ?LOAD ? ? ? ? ? 0x001000 0xffffffff81000000 0x0000000001000000 0x5f2000
> 0x5f2000 R E 0x7fff3a5e9140
> ?LOAD ? ? ? ? ? 0x5f3000 0xffffffff81600000 0x0000000001600000 0x183220
> 0x183220 RWE 0x7fff3a5e9140
> ?LOAD ? ? ? ? ? 0x777000 0xffffffffff600000 0x0000000001784000 0x000888
> 0x000888 R E 0x7fff3a5e9140
> ?LOAD ? ? ? ? ? 0x778000 0x0000000000000000 0x0000000001785000 0x014628
> 0x014628 RW ?0x7fff3a5e9140
> ?LOAD ? ? ? ? ? 0x78d000 0xffffffff8179a000 0x000000000179a000 0x071000
> 0x456d000 RWE 0x7fff3a5e9140
> ?NOTE ? ? ? ? ? 0x3d2c18 0xffffffff813d1c18 0x00000000013d1c18 0x000024
> 0x000024 ? ? 0x4
>

If it is generated by gold, its p_align fields are bogus.


-- 
H.J.


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