dyn.lds.S 4.9 KB
Newer Older
L
Linus Torvalds 已提交
1
#include <asm-generic/vmlinux.lds.h>
2
#include <asm/page.h>
L
Linus Torvalds 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15

OUTPUT_FORMAT(ELF_FORMAT)
OUTPUT_ARCH(ELF_ARCH)
ENTRY(_start)
jiffies = jiffies_64;

SECTIONS
{
  PROVIDE (__executable_start = START);
  . = START + SIZEOF_HEADERS;
  .interp         : { *(.interp) }
  __binary_start = .;
  . = ALIGN(4096);		/* Init code and data */
16
  _text = .;
L
Linus Torvalds 已提交
17 18
  _stext = .;
  __init_begin = .;
19
  INIT_TEXT_SECTION(PAGE_SIZE)
L
Linus Torvalds 已提交
20

21
  . = ALIGN(PAGE_SIZE);
L
Linus Torvalds 已提交
22 23 24

  /* Read-only sections, merged into text segment: */
  .hash           : { *(.hash) }
R
Roland McGrath 已提交
25
  .gnu.hash       : { *(.gnu.hash) }
L
Linus Torvalds 已提交
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
  .dynsym         : { *(.dynsym) }
  .dynstr         : { *(.dynstr) }
  .gnu.version    : { *(.gnu.version) }
  .gnu.version_d  : { *(.gnu.version_d) }
  .gnu.version_r  : { *(.gnu.version_r) }
  .rel.init       : { *(.rel.init) }
  .rela.init      : { *(.rela.init) }
  .rel.text       : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
  .rela.text      : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
  .rel.fini       : { *(.rel.fini) }
  .rela.fini      : { *(.rela.fini) }
  .rel.rodata     : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
  .rela.rodata    : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
  .rel.data       : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
  .rela.data      : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
  .rel.tdata	  : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
  .rela.tdata	  : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
  .rel.tbss	  : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
  .rela.tbss	  : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
  .rel.ctors      : { *(.rel.ctors) }
  .rela.ctors     : { *(.rela.ctors) }
  .rel.dtors      : { *(.rel.dtors) }
  .rela.dtors     : { *(.rela.dtors) }
  .rel.got        : { *(.rel.got) }
  .rela.got       : { *(.rela.got) }
  .rel.bss        : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
  .rela.bss       : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
  .rel.plt        : { *(.rel.plt) }
  .rela.plt       : { *(.rela.plt) }
  .init           : {
    KEEP (*(.init))
  } =0x90909090
  .plt            : { *(.plt) }
  .text           : {
60
    TEXT_TEXT
L
Linus Torvalds 已提交
61 62 63 64 65 66
    SCHED_TEXT
    LOCK_TEXT
    *(.fixup)
    *(.stub .text.* .gnu.linkonce.t.*)
    /* .gnu.warning sections are handled specially by elf32.em.  */
    *(.gnu.warning)
67

68
    . = ALIGN(PAGE_SIZE);
L
Linus Torvalds 已提交
69
  } =0x90909090
70
  . = ALIGN(PAGE_SIZE);
71 72 73 74 75
  .syscall_stub : {
	__syscall_stub_start = .;
	*(.__syscall_stub*)
	__syscall_stub_end = .;
  }
L
Linus Torvalds 已提交
76 77 78 79 80 81 82 83
  .fini           : {
    KEEP (*(.fini))
  } =0x90909090

  .kstrtab : { *(.kstrtab) }

  #include "asm/common.lds.S"

84
  init.data : { INIT_DATA }
L
Linus Torvalds 已提交
85 86 87 88 89 90 91 92 93 94

  /* Ensure the __preinit_array_start label is properly aligned.  We
     could instead move the label definition inside the section, but
     the linker would then create the section even if it turns out to
     be empty, which isn't pretty.  */
  . = ALIGN(32 / 8);
  .preinit_array     : { *(.preinit_array) }
  .init_array     : { *(.init_array) }
  .fini_array     : { *(.fini_array) }
  .data           : {
95
    INIT_TASK_DATA(KERNEL_STACK_SIZE)
J
Jeff Dike 已提交
96
    . = ALIGN(KERNEL_STACK_SIZE);
97
    *(.data..init_irqstack)
98 99
    DATA_DATA
    *(.data.* .gnu.linkonce.d.*)
L
Linus Torvalds 已提交
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
    SORT(CONSTRUCTORS)
  }
  .data1          : { *(.data1) }
  .tdata	  : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  .tbss		  : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  .eh_frame       : { KEEP (*(.eh_frame)) }
  .gcc_except_table   : { *(.gcc_except_table) }
  .dynamic        : { *(.dynamic) }
  .ctors          : {
    /* gcc uses crtbegin.o to find the start of
       the constructors, so we make sure it is
       first.  Because this is a wildcard, it
       doesn't matter if the user does not
       actually link against crtbegin.o; the
       linker won't look for a file to match a
       wildcard.  The wildcard also means that it
       doesn't matter which directory crtbegin.o
       is in.  */
    KEEP (*crtbegin.o(.ctors))
    /* We don't want to include the .ctor section from
       from the crtend.o file until after the sorted ctors.
       The .ctor section from the crtend file contains the
       end of ctors marker and it must be last */
    KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
    KEEP (*(SORT(.ctors.*)))
    KEEP (*(.ctors))
  }
  .dtors          : {
    KEEP (*crtbegin.o(.dtors))
    KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
    KEEP (*(SORT(.dtors.*)))
    KEEP (*(.dtors))
  }
  .jcr            : { KEEP (*(.jcr)) }
  .got            : { *(.got.plt) *(.got) }
  _edata = .;
  PROVIDE (edata = .);
  .bss            : {
138
   __bss_start = .;
L
Linus Torvalds 已提交
139 140 141 142 143 144 145 146 147 148 149
   *(.dynbss)
   *(.bss .bss.* .gnu.linkonce.b.*)
   *(COMMON)
   /* Align here to ensure that the .bss section occupies space up to
      _end.  Align after .bss to ensure correct alignment even if the
      .bss section disappears because there are no input sections.  */
   . = ALIGN(32 / 8);
  . = ALIGN(32 / 8);
  }
  _end = .;
  PROVIDE (end = .);
150 151 152 153

  STABS_DEBUG

  DWARF_DEBUG
154

155
  DISCARDS
L
Linus Torvalds 已提交
156
}