xref: /freebsd/sys/conf/ldscript.powerpc (revision 3e76d05231b0aa77d922bdbc9abf62d9747a91ab)
166c80959SBaptiste DaroussinOUTPUT_FORMAT("elf32-powerpc-freebsd", "elf32-powerpc-freebsd",
266c80959SBaptiste Daroussin	      "elf32-powerpc-freebsd")
3c585bae1SBenno RiceOUTPUT_ARCH(powerpc)
428c31322SDoug RabsonENTRY(__start)
5d0e12656SPeter WemmSEARCH_DIR(/usr/lib);
6c585bae1SBenno RicePROVIDE (__stack = 0);
79411e24dSBrandon BergrenPHDRS
89411e24dSBrandon Bergren{
99411e24dSBrandon Bergren	kernel PT_LOAD;
109411e24dSBrandon Bergren	dynamic PT_DYNAMIC;
119411e24dSBrandon Bergren}
1228c31322SDoug RabsonSECTIONS
1328c31322SDoug Rabson{
1428c31322SDoug Rabson  /* Read-only sections, merged into text segment: */
158678a430SMarcel Moolenaar
168678a430SMarcel Moolenaar  . = kernbase + SIZEOF_HEADERS;
17bb808254SNathan Whitehorn  PROVIDE (begin = . - SIZEOF_HEADERS);
188678a430SMarcel Moolenaar
198678a430SMarcel Moolenaar  .text      :
208678a430SMarcel Moolenaar  {
216d515b0cSBrandon Bergren    *(.glink)
228678a430SMarcel Moolenaar    *(.text)
238678a430SMarcel Moolenaar    *(.stub)
248678a430SMarcel Moolenaar    /* .gnu.warning sections are handled specially by elf32.em.  */
258678a430SMarcel Moolenaar    *(.gnu.warning)
268678a430SMarcel Moolenaar    *(.gnu.linkonce.t*)
279411e24dSBrandon Bergren  } :kernel =0
288678a430SMarcel Moolenaar  _etext = .;
298678a430SMarcel Moolenaar  PROVIDE (etext = .);
308678a430SMarcel Moolenaar
3128c31322SDoug Rabson  .interp     : { *(.interp) 	}
3228c31322SDoug Rabson  .hash          : { *(.hash)		}
3328c31322SDoug Rabson  .dynsym        : { *(.dynsym)		}
3428c31322SDoug Rabson  .dynstr        : { *(.dynstr)		}
3528c31322SDoug Rabson  .gnu.version   : { *(.gnu.version)	}
3628c31322SDoug Rabson  .gnu.version_d   : { *(.gnu.version_d)	}
3728c31322SDoug Rabson  .gnu.version_r   : { *(.gnu.version_r)	}
3828c31322SDoug Rabson  .rela.text     :
3928c31322SDoug Rabson    { *(.rela.text) *(.rela.gnu.linkonce.t*) }
4028c31322SDoug Rabson  .rela.data     :
4128c31322SDoug Rabson    { *(.rela.data) *(.rela.gnu.linkonce.d*) }
4228c31322SDoug Rabson  .rela.rodata   :
4328c31322SDoug Rabson    { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
4428c31322SDoug Rabson  .rela.got      : { *(.rela.got)		}
45c585bae1SBenno Rice  .rela.got1     : { *(.rela.got1)		}
46c585bae1SBenno Rice  .rela.got2     : { *(.rela.got2)		}
4728c31322SDoug Rabson  .rela.ctors    : { *(.rela.ctors)	}
4828c31322SDoug Rabson  .rela.dtors    : { *(.rela.dtors)	}
4928c31322SDoug Rabson  .rela.init     : { *(.rela.init)	}
5028c31322SDoug Rabson  .rela.fini     : { *(.rela.fini)	}
5128c31322SDoug Rabson  .rela.bss      : { *(.rela.bss)		}
5228c31322SDoug Rabson  .rela.plt      : { *(.rela.plt)		}
53c585bae1SBenno Rice  .rela.sdata    : { *(.rela.sdata)		}
54c585bae1SBenno Rice  .rela.sbss     : { *(.rela.sbss)		}
55c585bae1SBenno Rice  .rela.sdata2   : { *(.rela.sdata2)		}
56c585bae1SBenno Rice  .rela.sbss2    : { *(.rela.sbss2)		}
578678a430SMarcel Moolenaar
58c585bae1SBenno Rice  .init      : { *(.init)    } =0
59c585bae1SBenno Rice  .fini      : { *(.fini)    } =0
6028c31322SDoug Rabson  .rodata    : { *(.rodata) *(.gnu.linkonce.r*) }
6128c31322SDoug Rabson  .rodata1   : { *(.rodata1) }
6274cd06b4SEd Maste  .note.gnu.build-id : {
6374cd06b4SEd Maste    PROVIDE (__build_id_start = .);
6474cd06b4SEd Maste    *(.note.gnu.build-id)
6574cd06b4SEd Maste    PROVIDE (__build_id_end = .);
6674cd06b4SEd Maste  }
67c585bae1SBenno Rice  .sdata2    : { *(.sdata2)  }
68c585bae1SBenno Rice  .sbss2     : { *(.sbss2)   }
69f379be7aSMark Peek  /* Adjust the address for the data segment to the next page up. */
70f379be7aSMark Peek  . = ((. + 0x1000) & ~(0x1000 - 1));
7128c31322SDoug Rabson  .data    :
7228c31322SDoug Rabson  {
7328c31322SDoug Rabson    *(.data)
7428c31322SDoug Rabson    *(.gnu.linkonce.d*)
7528c31322SDoug Rabson  }
7628c31322SDoug Rabson  .data1   : { *(.data1) }
77c585bae1SBenno Rice  .got1           : { *(.got1) }
786d515b0cSBrandon Bergren  . = ALIGN(4096);
796d515b0cSBrandon Bergren  .got            : { *(.got) }
806d515b0cSBrandon Bergren  .got.plt        : { *(.got.plt) }
81*3e76d052SZhenlei Huang  .init_array     :
82*3e76d052SZhenlei Huang  {
83*3e76d052SZhenlei Huang    PROVIDE_HIDDEN (__init_array_start = .);
84*3e76d052SZhenlei Huang    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)))
85*3e76d052SZhenlei Huang    KEEP (*(.init_array))
86*3e76d052SZhenlei Huang    PROVIDE_HIDDEN (__init_array_end = .);
87*3e76d052SZhenlei Huang  }
88*3e76d052SZhenlei Huang  .fini_array     :
89*3e76d052SZhenlei Huang  {
90*3e76d052SZhenlei Huang    PROVIDE_HIDDEN (__fini_array_start = .);
91*3e76d052SZhenlei Huang    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)))
92*3e76d052SZhenlei Huang    KEEP (*(.fini_array))
93*3e76d052SZhenlei Huang    PROVIDE_HIDDEN (__fini_array_end = .);
94*3e76d052SZhenlei Huang  }
959411e24dSBrandon Bergren  .dynamic        : { *(.dynamic) } :kernel :dynamic
96c585bae1SBenno Rice  /* Put .ctors and .dtors next to the .got2 section, so that the pointers
97c585bae1SBenno Rice     get relocated with -mrelocatable. Also put in the .fixup pointers.
98c585bae1SBenno Rice     The current compiler no longer needs this, but keep it around for 2.7.2  */
99c585bae1SBenno Rice                PROVIDE (_GOT2_START_ = .);
1003896a6ccSJessica Clarke  .got2           :  { *(.got2) } :kernel
101c585bae1SBenno Rice                PROVIDE (__CTOR_LIST__ = .);
102c585bae1SBenno Rice  .ctors          : { *(.ctors) }
103c585bae1SBenno Rice                PROVIDE (__CTOR_END__ = .);
104c585bae1SBenno Rice                PROVIDE (__DTOR_LIST__ = .);
105c585bae1SBenno Rice  .dtors          : { *(.dtors) }
106c585bae1SBenno Rice                PROVIDE (__DTOR_END__ = .);
107c585bae1SBenno Rice                PROVIDE (_FIXUP_START_ = .);
108c585bae1SBenno Rice  .fixup          : { *(.fixup) }
109c585bae1SBenno Rice                PROVIDE (_FIXUP_END_ = .);
110c585bae1SBenno Rice                PROVIDE (_GOT2_END_ = .);
11128c31322SDoug Rabson  /* We want the small data sections together, so single-instruction offsets
11228c31322SDoug Rabson     can access them all, and initialized data all before uninitialized, so
11328c31322SDoug Rabson     we can shorten the on-disk segment size.  */
1143896a6ccSJessica Clarke  .sdata     : { *(.sdata) }
11528c31322SDoug Rabson  _edata  =  .;
11628c31322SDoug Rabson  PROVIDE (edata = .);
117c585bae1SBenno Rice  .sbss      :
118c585bae1SBenno Rice  {
119c585bae1SBenno Rice    PROVIDE (__sbss_start = .);
120c585bae1SBenno Rice    *(.sbss)
121c585bae1SBenno Rice    *(.scommon)
122c585bae1SBenno Rice    *(.dynsbss)
123c585bae1SBenno Rice    PROVIDE (__sbss_end = .);
124c585bae1SBenno Rice  }
125c585bae1SBenno Rice  .plt   : { *(.plt) }
12628c31322SDoug Rabson  .bss       :
12728c31322SDoug Rabson  {
128c585bae1SBenno Rice   PROVIDE (__bss_start = .);
12928c31322SDoug Rabson   *(.dynbss)
13028c31322SDoug Rabson   *(.bss)
13128c31322SDoug Rabson   *(COMMON)
13228c31322SDoug Rabson  }
13328c31322SDoug Rabson  _end = . ;
13428c31322SDoug Rabson  PROVIDE (end = .);
13537d6d682SWarner Losh
13637d6d682SWarner Losh  /* Debug */
13737d6d682SWarner Losh  INCLUDE debuginfo.ldscript
13828c31322SDoug Rabson
13923dff4fdSWarner Losh  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
14023dff4fdSWarner Losh  /DISCARD/ : { *(.note.GNU-stack) }
14123dff4fdSWarner Losh}
142