bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/16788] New: Gold produces unbootable Linux kernel


From: markus at trippelsdorf dot de
Subject: [Bug gold/16788] New: Gold produces unbootable Linux kernel
Date: Tue, 01 Apr 2014 13:28:12 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=16788

            Bug ID: 16788
           Summary: Gold produces unbootable Linux kernel
           Product: binutils
           Version: 2.25 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gold
          Assignee: ian at airs dot com
          Reporter: markus at trippelsdorf dot de
                CC: ccoutant at google dot com

Building the Linux kernel (current git) with gold causes the 
kernel to hang very early during boot.

It is the following command that makes the difference:

ld -m elf_x86_64 --build-id -o vmlinux -T
/usr/src/linux/arch/x86/kernel/vmlinux.lds arch/x86/kernel/head_64.o
arch/x86/kernel/head64.o arch/x86/kernel/head.o init/built-in.o --start-group
usr/built-in.o arch/x86/built-in.o kernel/built-in.o mm/built-in.o
fs/built-in.o ipc/built-in.o security/built-in.o crypto/built-in.o
block/built-in.o lib/lib.a arch/x86/lib/lib.a lib/built-in.o
arch/x86/lib/built-in.o drivers/built-in.o sound/built-in.o firmware/built-in.o
arch/x86/pci/built-in.o arch/x86/power/built-in.o arch/x86/video/built-in.o
net/built-in.o --end-group .tmp_kallsyms2.o

With gold I get:

There are 31 section headers, starting at offset 0xb3e2d0:

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 56526f 00  AX 
0   0 4096
  [ 2] .notes            NOTE            ffffffff81565270 566270 000040 00   A 
0   0  4
  [ 3] __ex_table        PROGBITS        ffffffff815652b0 5662b0 000ee0 00   A 
0   0  8
  [ 4] .rodata           PROGBITS        ffffffff81600000 601000 1c4448 00   A 
0   0 64
  [ 5] __bug_table       PROGBITS        ffffffff817c4448 7c5448 005580 00   A 
0   0  1
  [ 6] .pci_fixup        PROGBITS        ffffffff817c99c8 7ca9c8 002988 00   A 
0   0  8
  [ 7] .builtin_fw       PROGBITS        ffffffff817cc350 7cd350 0002b8 00   A 
0   0  8
  [ 8] __param           PROGBITS        ffffffff817cc608 7cd608 002180 00   A 
0   0  8
  [ 9] __modver          PROGBITS        ffffffff817ce788 7cf788 000878 00   A 
0   0  8
  [10] .data             PROGBITS        ffffffff81800000 7d0000 06f000 00  WA 
0   0 4096
  [11] __tracepoint_str  PROGBITS        ffffffff8186f000 83f000 000010 00  WA 
0   0  8
  [12] .vvar             PROGBITS        ffffffff81870000 840000 0000f0 00  WA 
0   0 16
  [13] .data..percpu     PROGBITS        0000000000000000 841000 012540 00  WA 
0   0 4096
  [14] .init.text        PROGBITS        ffffffff81884000 854000 02b7dc 00  AX 
0   0 16
  [15] .init.data        PROGBITS        ffffffff818b0000 880000 06e448 00  WA 
0   0 4096
  [16] .x86_cpu_dev.init PROGBITS        ffffffff8191e448 8ee448 000008 00   A 
0   0  8
  [17] .altinstructions  PROGBITS        ffffffff8191e450 8ee450 000f9c 00   A 
0   0  1
  [18] .altinstr_replacement PROGBITS        ffffffff8191f3ec 8ef3ec 00055a 00 
AX  0   0  1
  [19] .iommu_table      PROGBITS        ffffffff8191f948 8ef948 000050 00   A 
0   0  8
  [20] .apicdrivers      PROGBITS        ffffffff8191f998 8ef998 000010 00  WA 
0   0  8
  [21] .exit.text        PROGBITS        ffffffff8191f9a8 8ef9a8 00157e 00  AX 
0   0  1
  [22] .smp_locks        PROGBITS        ffffffff81921000 8f1000 005000 00   A 
0   0  4
  [23] .data_nosave      PROGBITS        ffffffff81926000 8f6000 000000 00   A 
0   0  0
  [24] .bss              NOBITS          ffffffff81926000 8f6000 096000 00  WA 
0   0 4096
  [25] .brk              NOBITS          ffffffff819bc000 98c000 026000 00  WA 
0   0  1
  [26] .comment          PROGBITS        0000000000000000 9b2000 00002a 01  MS 
0   0  1
  [27] .debug_frame      PROGBITS        0000000000000000 9b2030 001b90 00     
0   0  8
  [28] .symtab           SYMTAB          0000000000000000 9b3bc0 0dfef0 18    
29 23572  8
  [29] .strtab           STRTAB          0000000000000000 a93ab0 0aa6e6 00     
0   0  1
  [30] .shstrtab         STRTAB          0000000000000000 b3e196 00013a 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 5 program headers, starting at offset 64

Program Headers:
  Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz
  Flg Align
  LOAD           0x001000 0xffffffff81000000 0x0000000001000000 0x7cf000
0x7cf000 R E 0x200000
  LOAD           0x7d0000 0xffffffff81800000 0x0000000001800000 0x0700f0
0x0700f0 RW  0x200000
  LOAD           0x841000 0x0000000000000000 0x0000000001871000 0x012540
0x012540 RW  0x200000
  LOAD           0x854000 0xffffffff81884000 0x0000000001884000 0x15e000
0x15e000 RWE 0x200000
  NOTE           0x566270 0xffffffff81565270 0x0000000001565270 0x000040
0x000040     0x4

 Section to Segment mapping:
  Segment Sections...
   00     .text .notes __ex_table .rodata __bug_table .pci_fixup .builtin_fw
__param __modver 
   01     .data __tracepoint_str .vvar 
   02     .data..percpu 
   03     .init.text .init.data .x86_cpu_dev.init .altinstructions
.altinstr_replacement .iommu_table .apicdrivers .exit.text .smp_locks
.data_nosave .bss .brk 
   04     .notes 


With ld.bfd I get:

There are 31 section headers, starting at offset 0xd27d00:

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 200000 56526f 00  AX 
0   0 4096
  [ 2] .notes            NOTE            ffffffff81565270 765270 000024 00  AX 
0   0  4
  [ 3] __ex_table        PROGBITS        ffffffff815652a0 7652a0 000ee0 00   A 
0   0  8
  [ 4] .rodata           PROGBITS        ffffffff81600000 800000 1c2590 00   A 
0   0 64
  [ 5] __bug_table       PROGBITS        ffffffff817c2590 9c2590 005580 00   A 
0   0  1
  [ 6] .pci_fixup        PROGBITS        ffffffff817c7b10 9c7b10 002988 00   A 
0   0  8
  [ 7] .builtin_fw       PROGBITS        ffffffff817ca498 9ca498 0002b8 00   A 
0   0  8
  [ 8] __param           PROGBITS        ffffffff817ca750 9ca750 002180 00   A 
0   0  8
  [ 9] __modver          PROGBITS        ffffffff817cc8d0 9cc8d0 000730 00   A 
0   0  8
  [10] .data             PROGBITS        ffffffff81800000 a00000 06f000 00  WA 
0   0 4096
  [11] __tracepoint_str  PROGBITS        ffffffff8186f000 a6f000 000010 00  WA 
0   0  8
  [12] .vvar             PROGBITS        ffffffff81870000 a70000 0000f0 00  WA 
0   0 16
  [13] .data..percpu     PROGBITS        0000000000000000 c00000 012540 00  WA 
0   0 4096
  [14] .init.text        PROGBITS        ffffffff81884000 c84000 02b7dc 00  AX 
0   0 16
  [15] .init.data        PROGBITS        ffffffff818b0000 cb0000 06e448 00  WA 
0   0 4096
  [16] .x86_cpu_dev.init PROGBITS        ffffffff8191e448 d1e448 000008 00   A 
0   0  8
  [17] .altinstructions  PROGBITS        ffffffff8191e450 d1e450 000f9c 00   A 
0   0  1
  [18] .altinstr_replacement PROGBITS        ffffffff8191f3ec d1f3ec 00055a 00 
AX  0   0  1
  [19] .iommu_table      PROGBITS        ffffffff8191f948 d1f948 000050 00   A 
0   0  8
  [20] .apicdrivers      PROGBITS        ffffffff8191f998 d1f998 000010 00  WA 
0   0  8
  [21] .exit.text        PROGBITS        ffffffff8191f9a8 d1f9a8 00157e 00  AX 
0   0  1
  [22] .smp_locks        PROGBITS        ffffffff81921000 d21000 005000 00   A 
0   0  4
  [23] .data_nosave      PROGBITS        ffffffff81926000 d26000 000000 00   W 
0   0  1
  [24] .bss              NOBITS          ffffffff81926000 d26000 096000 00  WA 
0   0 4096
  [25] .brk              NOBITS          ffffffff819bc000 d26000 026000 00  WA 
0   0  1
  [26] .comment          PROGBITS        0000000000000000 d26000 000029 01  MS 
0   0  1
  [27] .debug_frame      PROGBITS        0000000000000000 d26030 001b90 00     
0   0  8
  [28] .shstrtab         STRTAB          0000000000000000 d27bc0 00013a 00     
0   0  1
  [29] .symtab           SYMTAB          0000000000000000 d284c0 0dd4d8 18    
30 23123  8
  [30] .strtab           STRTAB          0000000000000000 e05998 0aa5b7 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 5 program headers, starting at offset 64

Program Headers:
  Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz
  Flg Align
  LOAD           0x200000 0xffffffff81000000 0x0000000001000000 0x7cd000
0x7cd000 R E 0x200000
  LOAD           0xa00000 0xffffffff81800000 0x0000000001800000 0x0700f0
0x0700f0 RW  0x200000
  LOAD           0xc00000 0x0000000000000000 0x0000000001871000 0x012540
0x012540 RW  0x200000
  LOAD           0xc84000 0xffffffff81884000 0x0000000001884000 0x0a2000
0x15e000 RWE 0x200000
  NOTE           0x765270 0xffffffff81565270 0x0000000001565270 0x000024
0x000024     0x4

 Section to Segment mapping:
  Segment Sections...
   00     .text .notes __ex_table .rodata __bug_table .pci_fixup .builtin_fw
__param __modver 
   01     .data __tracepoint_str .vvar 
   02     .data..percpu 
   03     .init.text .init.data .x86_cpu_dev.init .altinstructions
.altinstr_replacement .iommu_table .apicdrivers .exit.text .smp_locks .bss .brk 
   04     .notes 

So the .text section is at the wrong offset with gold (0x001000 vs. 0x200000).

The linker script is attached.

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]