ld warning, allocated section not in segment

Vivek Goyal vgoyal@in.ibm.com
Sun Oct 8 17:08:00 GMT 2006


I am compiling the latest kernel and run into following warning message.

ld: .tmp_vmlinux1: warning: allocated section `.smp_altinstr_replacement' not in segment

Following is the definition of section .smp_altinstr_replacement in linker
script file.

  .smp_altinstr_replacement : AT(ADDR(.smp_altinstr_replacement) - LOAD_OFFSET) {
        . = ALIGN(4096);
        __smp_alt_end = .;

Why is it happening? What does it mean? From the message it looks like as if
linker has not mapped smp_altinstr_replacement section into a segment. But
readelf output shows that above section has been mapped to the segment 01.

 Section to Segment mapping:
  Segment Sections...
   00     .text __ex_table .rodata .pci_fixup __ksymtab __ksymtab_gpl __ksymtab_unused __kcrctab __kcrctab_gpl __kcrctab_unused __ksymtab_strings __param
   01     .data .data_nosave .data.page_aligned .data.cacheline_aligned .data.read_mostly .data.init_task .smp_locks .smp_altinstr_replacement .init.text .init.data .init.setup .initcall.init .con_initcall.init .altinstructions .altinstr_replacement .exit.text .init.ramfs .data.percpu .bss

In my case it looks like there is no input .smp_altinstr_replacement section
present and due to ALIGN option linker is forced to create an allocatable 
output section.

  [25] .smp_altinstructi PROGBITS        c050c000 458604 000000 00   W  0   0  1
  [26] .smp_locks        PROGBITS        c050c000 40d000 0032fc 00   A  0   0  4
  [27] .smp_altinstr_rep NOBITS          c050f2fc 4592fc 000d04 00  WA  0   0  1
  [28] .init.text        PROGBITS        c0510000 411000 021972 00  AX  0   0 16

Even if that is the case, why is linker emitting above warning? How can I get
rid of it?

I am using ld version GNU ld version 20040927
This is also reproducible by linker version 2.16.1


More information about the Binutils mailing list