xref: /freebsd-14.2/sys/conf/ldscript.powerpc (revision bb5f7016)
1c585bae1SBenno Rice
266c80959SBaptiste DaroussinOUTPUT_FORMAT("elf32-powerpc-freebsd", "elf32-powerpc-freebsd",
366c80959SBaptiste Daroussin	      "elf32-powerpc-freebsd")
4c585bae1SBenno RiceOUTPUT_ARCH(powerpc)
528c31322SDoug RabsonENTRY(__start)
6d0e12656SPeter WemmSEARCH_DIR(/usr/lib);
7c585bae1SBenno RicePROVIDE (__stack = 0);
89411e24dSBrandon BergrenPHDRS
99411e24dSBrandon Bergren{
109411e24dSBrandon Bergren	kernel PT_LOAD;
119411e24dSBrandon Bergren	dynamic PT_DYNAMIC;
129411e24dSBrandon Bergren}
1328c31322SDoug RabsonSECTIONS
1428c31322SDoug Rabson{
1528c31322SDoug Rabson  /* Read-only sections, merged into text segment: */
168678a430SMarcel Moolenaar
178678a430SMarcel Moolenaar  . = kernbase + SIZEOF_HEADERS;
18bb808254SNathan Whitehorn  PROVIDE (begin = . - SIZEOF_HEADERS);
198678a430SMarcel Moolenaar
208678a430SMarcel Moolenaar  .text      :
218678a430SMarcel Moolenaar  {
226d515b0cSBrandon Bergren    *(.glink)
238678a430SMarcel Moolenaar    *(.text)
248678a430SMarcel Moolenaar    *(.stub)
258678a430SMarcel Moolenaar    /* .gnu.warning sections are handled specially by elf32.em.  */
268678a430SMarcel Moolenaar    *(.gnu.warning)
278678a430SMarcel Moolenaar    *(.gnu.linkonce.t*)
289411e24dSBrandon Bergren  } :kernel =0
298678a430SMarcel Moolenaar  _etext = .;
308678a430SMarcel Moolenaar  PROVIDE (etext = .);
318678a430SMarcel Moolenaar
3228c31322SDoug Rabson  .interp     : { *(.interp) 	}
3328c31322SDoug Rabson  .hash          : { *(.hash)		}
3428c31322SDoug Rabson  .dynsym        : { *(.dynsym)		}
3528c31322SDoug Rabson  .dynstr        : { *(.dynstr)		}
3628c31322SDoug Rabson  .gnu.version   : { *(.gnu.version)	}
3728c31322SDoug Rabson  .gnu.version_d   : { *(.gnu.version_d)	}
3828c31322SDoug Rabson  .gnu.version_r   : { *(.gnu.version_r)	}
3928c31322SDoug Rabson  .rela.text     :
4028c31322SDoug Rabson    { *(.rela.text) *(.rela.gnu.linkonce.t*) }
4128c31322SDoug Rabson  .rela.data     :
4228c31322SDoug Rabson    { *(.rela.data) *(.rela.gnu.linkonce.d*) }
4328c31322SDoug Rabson  .rela.rodata   :
4428c31322SDoug Rabson    { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
4528c31322SDoug Rabson  .rela.got      : { *(.rela.got)		}
46c585bae1SBenno Rice  .rela.got1     : { *(.rela.got1)		}
47c585bae1SBenno Rice  .rela.got2     : { *(.rela.got2)		}
4828c31322SDoug Rabson  .rela.ctors    : { *(.rela.ctors)	}
4928c31322SDoug Rabson  .rela.dtors    : { *(.rela.dtors)	}
5028c31322SDoug Rabson  .rela.init     : { *(.rela.init)	}
5128c31322SDoug Rabson  .rela.fini     : { *(.rela.fini)	}
5228c31322SDoug Rabson  .rela.bss      : { *(.rela.bss)		}
5328c31322SDoug Rabson  .rela.plt      : { *(.rela.plt)		}
54c585bae1SBenno Rice  .rela.sdata    : { *(.rela.sdata)		}
55c585bae1SBenno Rice  .rela.sbss     : { *(.rela.sbss)		}
56c585bae1SBenno Rice  .rela.sdata2   : { *(.rela.sdata2)		}
57c585bae1SBenno Rice  .rela.sbss2    : { *(.rela.sbss2)		}
588678a430SMarcel Moolenaar
59c585bae1SBenno Rice  .init      : { *(.init)    } =0
60c585bae1SBenno Rice  .fini      : { *(.fini)    } =0
6128c31322SDoug Rabson  .rodata    : { *(.rodata) *(.gnu.linkonce.r*) }
6228c31322SDoug Rabson  .rodata1   : { *(.rodata1) }
6374cd06b4SEd Maste  .note.gnu.build-id : {
6474cd06b4SEd Maste    PROVIDE (__build_id_start = .);
6574cd06b4SEd Maste    *(.note.gnu.build-id)
6674cd06b4SEd Maste    PROVIDE (__build_id_end = .);
6774cd06b4SEd Maste  }
68c585bae1SBenno Rice  .sdata2    : { *(.sdata2)  }
69c585bae1SBenno Rice  .sbss2     : { *(.sbss2)   }
70f379be7aSMark Peek  /* Adjust the address for the data segment to the next page up. */
71f379be7aSMark Peek  . = ((. + 0x1000) & ~(0x1000 - 1));
7228c31322SDoug Rabson  .data    :
7328c31322SDoug Rabson  {
7428c31322SDoug Rabson    *(.data)
7528c31322SDoug Rabson    *(.gnu.linkonce.d*)
7628c31322SDoug Rabson  }
7728c31322SDoug Rabson  .data1   : { *(.data1) }
78c585bae1SBenno Rice  .got1           : { *(.got1) }
796d515b0cSBrandon Bergren  . = ALIGN(4096);
806d515b0cSBrandon Bergren  .got            : { *(.got) }
816d515b0cSBrandon Bergren  .got.plt        : { *(.got.plt) }
82*bb5f7016SZhenlei Huang  .init_array     :
83*bb5f7016SZhenlei Huang  {
84*bb5f7016SZhenlei Huang    PROVIDE_HIDDEN (__init_array_start = .);
85*bb5f7016SZhenlei Huang    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)))
86*bb5f7016SZhenlei Huang    KEEP (*(.init_array))
87*bb5f7016SZhenlei Huang    PROVIDE_HIDDEN (__init_array_end = .);
88*bb5f7016SZhenlei Huang  }
89*bb5f7016SZhenlei Huang  .fini_array     :
90*bb5f7016SZhenlei Huang  {
91*bb5f7016SZhenlei Huang    PROVIDE_HIDDEN (__fini_array_start = .);
92*bb5f7016SZhenlei Huang    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)))
93*bb5f7016SZhenlei Huang    KEEP (*(.fini_array))
94*bb5f7016SZhenlei Huang    PROVIDE_HIDDEN (__fini_array_end = .);
95*bb5f7016SZhenlei Huang  }
969411e24dSBrandon Bergren  .dynamic        : { *(.dynamic) } :kernel :dynamic
97c585bae1SBenno Rice  /* Put .ctors and .dtors next to the .got2 section, so that the pointers
98c585bae1SBenno Rice     get relocated with -mrelocatable. Also put in the .fixup pointers.
99c585bae1SBenno Rice     The current compiler no longer needs this, but keep it around for 2.7.2  */
100c585bae1SBenno Rice                PROVIDE (_GOT2_START_ = .);
101c585bae1SBenno Rice  .got2           :  { *(.got2) }
102c585bae1SBenno Rice                PROVIDE (__CTOR_LIST__ = .);
103c585bae1SBenno Rice  .ctors          : { *(.ctors) }
104c585bae1SBenno Rice                PROVIDE (__CTOR_END__ = .);
105c585bae1SBenno Rice                PROVIDE (__DTOR_LIST__ = .);
106c585bae1SBenno Rice  .dtors          : { *(.dtors) }
107c585bae1SBenno Rice                PROVIDE (__DTOR_END__ = .);
108c585bae1SBenno Rice                PROVIDE (_FIXUP_START_ = .);
109c585bae1SBenno Rice  .fixup          : { *(.fixup) }
110c585bae1SBenno Rice                PROVIDE (_FIXUP_END_ = .);
111c585bae1SBenno Rice                PROVIDE (_GOT2_END_ = .);
11228c31322SDoug Rabson  /* We want the small data sections together, so single-instruction offsets
11328c31322SDoug Rabson     can access them all, and initialized data all before uninitialized, so
11428c31322SDoug Rabson     we can shorten the on-disk segment size.  */
1159411e24dSBrandon Bergren  .sdata     : { *(.sdata) } :kernel
11628c31322SDoug Rabson  _edata  =  .;
11728c31322SDoug Rabson  PROVIDE (edata = .);
118c585bae1SBenno Rice  .sbss      :
119c585bae1SBenno Rice  {
120c585bae1SBenno Rice    PROVIDE (__sbss_start = .);
121c585bae1SBenno Rice    *(.sbss)
122c585bae1SBenno Rice    *(.scommon)
123c585bae1SBenno Rice    *(.dynsbss)
124c585bae1SBenno Rice    PROVIDE (__sbss_end = .);
125c585bae1SBenno Rice  }
126c585bae1SBenno Rice  .plt   : { *(.plt) }
12728c31322SDoug Rabson  .bss       :
12828c31322SDoug Rabson  {
129c585bae1SBenno Rice   PROVIDE (__bss_start = .);
13028c31322SDoug Rabson   *(.dynbss)
13128c31322SDoug Rabson   *(.bss)
13228c31322SDoug Rabson   *(COMMON)
13328c31322SDoug Rabson  }
13428c31322SDoug Rabson  _end = . ;
13528c31322SDoug Rabson  PROVIDE (end = .);
13628c31322SDoug Rabson  /* Stabs debugging sections.  */
13728c31322SDoug Rabson  .stab 0 : { *(.stab) }
13828c31322SDoug Rabson  .stabstr 0 : { *(.stabstr) }
13928c31322SDoug Rabson  /* DWARF debug sections.
14028c31322SDoug Rabson     Symbols in the DWARF debugging sections are relative to the beginning
14128c31322SDoug Rabson     of the section so we begin them at 0.  */
14228c31322SDoug Rabson  /* DWARF 1 */
14328c31322SDoug Rabson  .debug          0 : { *(.debug) }
14428c31322SDoug Rabson  .line           0 : { *(.line) }
14528c31322SDoug Rabson  /* GNU DWARF 1 extensions */
14628c31322SDoug Rabson  .debug_srcinfo  0 : { *(.debug_srcinfo) }
14728c31322SDoug Rabson  .debug_sfnames  0 : { *(.debug_sfnames) }
14828c31322SDoug Rabson  /* DWARF 1.1 and DWARF 2 */
14928c31322SDoug Rabson  .debug_aranges  0 : { *(.debug_aranges) }
15028c31322SDoug Rabson  .debug_pubnames 0 : { *(.debug_pubnames) }
15128c31322SDoug Rabson  /* DWARF 2 */
15228c31322SDoug Rabson  .debug_info     0 : { *(.debug_info) }
15328c31322SDoug Rabson  .debug_abbrev   0 : { *(.debug_abbrev) }
15428c31322SDoug Rabson  .debug_line     0 : { *(.debug_line) }
15528c31322SDoug Rabson  .debug_frame    0 : { *(.debug_frame) }
15628c31322SDoug Rabson  .debug_str      0 : { *(.debug_str) }
15728c31322SDoug Rabson  .debug_loc      0 : { *(.debug_loc) }
15828c31322SDoug Rabson  .debug_macinfo  0 : { *(.debug_macinfo) }
15928c31322SDoug Rabson  /* SGI/MIPS DWARF 2 extensions */
16028c31322SDoug Rabson  .debug_weaknames 0 : { *(.debug_weaknames) }
16128c31322SDoug Rabson  .debug_funcnames 0 : { *(.debug_funcnames) }
16228c31322SDoug Rabson  .debug_typenames 0 : { *(.debug_typenames) }
16328c31322SDoug Rabson  .debug_varnames  0 : { *(.debug_varnames) }
16428c31322SDoug Rabson  /* These must appear regardless of  .  */
16528c31322SDoug Rabson}
16628c31322SDoug Rabson
167