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] problem building linux kernel


On 2010.11.16 at 16:39 -0800, Doug Kwan (éæå) wrote:
> On Tue, Nov 16, 2010 at 7:59 AM, Markus Trippelsdorf
> <markus@trippelsdorf.de> wrote:
> > On 2010.11.16 at 07:52 -0800, Ian Lance Taylor wrote:
> >> Markus Trippelsdorf <markus@trippelsdorf.de> writes:
> >>
> >> > Gold produces a malformed vmlinux file with this command:
> >>
> >> In what way is the vmlinux file malformed?
> >
> > Insofar as the this command normaly succeeds, but fails with the vmlinux
> > linked with gold:
> >
> > (good)
> > % objcopy -v -R .comment -S vmlinux arch/x86/boot/compressed/vmlinux.bin
> > copy from `vmlinux' [elf64-x86-64] to `arch/x86/boot/compressed/vmlinux.bin' [elf64-x86-64]
> >
> > (bad)
> > % objcopy Â-R .comment -S vmlinux arch/x86/boot/compressed/vmlinux.bin
> > BFD: arch/x86/boot/compressed/vmlinux.bin: warning: allocated section `.data..percpu' not in segment
> > objcopy:arch/x86/boot/compressed/vmlinux.bin[.text]: File truncated
> > objcopy:arch/x86/boot/compressed/vmlinux.bin: File truncated
>
> I cannot reproduce the problem with top of trunk gold and top of linux
> kernel.  Can you do a
> 
> readelf -lSW vmlinux

There are 35 section headers, starting at offset 0x816340:

Section Headers:
  [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            0000000000000000 000000 000000 00      0   0  0
  [ 1] .text             PROGBITS        ffffffff81000000 001000 45316a 00  AX  0   0 4096
  [ 2] .notes            NOTE            ffffffff8145316c 45416c 000040 00   A  0   0  4
  [ 3] __ex_table        PROGBITS        ffffffff814531b0 4541b0 001820 00   A  0   0  8
  [ 4] .rodata           PROGBITS        ffffffff81455000 456000 1452eb 00   A  0   0 64
  [ 5] __bug_table       PROGBITS        ffffffff8159a2f0 59b2f0 004884 00   A  0   0  1
  [ 6] __jump_table      PROGBITS        ffffffff8159eb78 59fb78 0000a8 00   A  0   0  1
  [ 7] .pci_fixup        PROGBITS        ffffffff8159ec20 59fc20 001790 00   A  0   0 16
  [ 8] .builtin_fw       PROGBITS        ffffffff815a03b0 5a13b0 0002a0 00   A  0   0  8
  [ 9] __init_rodata     PROGBITS        ffffffff815a0660 5a1660 002aa0 00   A  0   0 32
  [10] __param           PROGBITS        ffffffff815a3100 5a4100 001f00 00   A  0   0  8
  [11] .data             PROGBITS        ffffffff815a5000 5a6000 064628 00  WA  0   0 4096
  [12] .vsyscall_0       PROGBITS        ffffffffff600000 60b000 00010c 00  AX  0   0 16
  [13] .vsyscall_fn      PROGBITS        ffffffffff600140 60b140 00003a 00  AX  0   0 16
  [14] .vsyscall_gtod_data PROGBITS        ffffffffff600180 60b180 000060 00  WA  0   0 16
  [15] .vsyscall_1       PROGBITS        ffffffffff600400 60b400 00004e 00  AX  0   0 16
  [16] .vsyscall_2       PROGBITS        ffffffffff600800 60b800 000065 00  AX  0   0 16
  [17] .vgetcpu_mode     PROGBITS        ffffffffff600870 60b870 000004 00  WA  0   0 16
  [18] .jiffies          PROGBITS        ffffffffff600880 60b880 000008 00  WA  0   0 16
  [19] .data..percpu     PROGBITS        0000000000000000 60c000 011f80 00  WA  0   0 4096
  [20] .init.text        PROGBITS        ffffffff8161d000 61e000 02e88f 00  AX  0   0 16
  [21] .init.data        PROGBITS        ffffffff8164b8a0 64c8a0 025308 00  WA  0   0 32
  [22] .x86_cpu_dev.init PROGBITS        ffffffff81670ba8 671ba8 000008 00   A  0   0  8
  [23] .altinstructions  PROGBITS        ffffffff81670bb0 671bb0 001484 00   A  0   0  8
  [24] .altinstr_replacement PROGBITS        ffffffff81672034 673034 000430 00  AX  0   0  1
  [25] .iommu_table      PROGBITS        ffffffff81672468 673468 000050 00   A  0   0  8
  [26] .exit.text        PROGBITS        ffffffff816724b8 6734b8 001a53 00  AX  0   0  1
  [27] .smp_locks        PROGBITS        ffffffff81674000 675000 004000 00   A  0   0  4
  [28] .bss              NOBITS          ffffffff81678000 679000 0488fc 00  WA  0   0 4096
  [29] .brk              NOBITS          ffffffff816c1000 6c2000 020000 00  WA  0   0  1
  [30] .comment          PROGBITS        0000000000000000 6e2000 000012 01  MS  0   0  1
  [31] .debug_frame      PROGBITS        0000000000000000 6e2018 001b68 00      0   0  8
  [32] .symtab           SYMTAB          0000000000000000 6e3b80 0ae468 18     33 18329  8
  [33] .strtab           STRTAB          0000000000000000 791fe8 0841df 00      0   0  1
  [34] .shstrtab         STRTAB          0000000000000000 8161c7 000177 00      0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), l (large)
  I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
  O (extra OS processing required) o (OS specific), p (processor specific)

Elf file type is EXEC (Executable file)
Entry point 0x1000000
There are 6 program headers, starting at offset 64

Program Headers:
  Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   Flg Align
  LOAD           0x001000 0xffffffff81000000 0x0000000001000000 0x5a5000 0x5a5000 R E 0xffffffff816c1000
  LOAD           0x5a6000 0xffffffff815a5000 0x00000000015a5000 0x064628 0x064628 RWE 0xffffffff816c1000
  LOAD           0x60b000 0xffffffffff600000 0x000000000160a000 0x000888 0x000888 R E 0xffffffff816c1000
  LOAD           0x60c000 0x0000000000000000 0x000000000160b000 0x011f80 0x011f80 RW  0xffffffff816c1000
  LOAD           0x61e000 0xffffffff8161d000 0x000000000161d000 0x0c4000 0x0c4000 RWE 0xffffffff816c1000
  NOTE           0x45416c 0xffffffff8145316c 0x000000000145316c 0x000040 0x000040     0x4

 Section to Segment mapping:
  Segment Sections...
   00     .text .notes __ex_table .rodata __bug_table __jump_table .pci_fixup .builtin_fw __init_rodata __param
   01     .data
   02     .vsyscall_0 .vsyscall_fn .vsyscall_gtod_data .vsyscall_1 .vsyscall_2 .vgetcpu_mode .jiffies
   03     .data..percpu
   04     .init.text .init.data .x86_cpu_dev.init .altinstructions .altinstr_replacement .iommu_table .exit.text .smp_locks .bss .brk
   05     .notes

If you want to reproduce it locally it might be easier if you simply use
my attached kernel config file. (Just copy it to .config in the kernel
top directory and then run "make V=1").
-- 
Markus

Attachment: config
Description: Text document


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