Attachment 'binutils-2.21-bf.patch'

Download

   1 diff --git a/bfd/config.bfd b/bfd/config.bfd
   2 index 9b719d8..39d5f21 100644
   3 --- a/bfd/config.bfd
   4 +++ b/bfd/config.bfd
   5 @@ -600,6 +600,10 @@ case "${targ}" in
   6      targ_selvecs="i386linux_vec i386pei_vec"
   7      targ64_selvecs="bfd_elf64_x86_64_vec bfd_elf64_l1om_vec"
   8      ;;
   9 +  i[3-7]86-*-barrelfish*)
  10 +    targ_defvec=bfd_elf32_i386_vec
  11 +    targ_selvecs=bfd_elf32_i386_vec
  12 +    ;;
  13  #ifdef BFD64
  14    x86_64-*-darwin*)
  15      targ_defvec=mach_o_x86_64_vec
  16 @@ -632,6 +636,11 @@ case "${targ}" in
  17      targ_selvecs="bfd_elf32_i386_vec i386linux_vec i386pei_vec x86_64pei_vec bfd_elf64_l1om_vec"
  18      want64=true
  19      ;;
  20 +  x86_64-*-barrelfish*)
  21 +    targ_defvec=bfd_elf64_x86_64_vec
  22 +    targ_selvecs=bfd_elf64_x86_64_vec
  23 +    want64=true
  24 +    ;;
  25    x86_64-*-mingw*)
  26      targ_defvec=x86_64pe_vec
  27      targ_selvecs="x86_64pe_vec x86_64pei_vec bfd_elf64_x86_64_vec bfd_elf64_l1om_vec i386pe_vec i386pei_vec bfd_elf32_i386_vec"
  28 diff --git a/config.sub b/config.sub
  29 index 204218c..c882591 100755
  30 --- a/config.sub
  31 +++ b/config.sub
  32 @@ -1298,6 +1298,7 @@ case $os in
  33  	      | -sym* | -kopensolaris* \
  34  	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
  35  	      | -aos* | -aros* \
  36 +              | -barrelfish* \
  37  	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
  38  	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
  39  	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
  40 diff --git a/gas/configure.tgt b/gas/configure.tgt
  41 index c05a64a..7031c9e 100644
  42 --- a/gas/configure.tgt
  43 +++ b/gas/configure.tgt
  44 @@ -233,6 +233,7 @@ case ${generic_target} in
  45    i386-*-chaos)				fmt=elf ;;
  46    i386-*-rdos*)				fmt=elf ;;
  47    i386-*-darwin*)			fmt=macho ;;
  48 +  i386-*-barrelfish*)                   fmt=elf ;;
  49  
  50    i860-*-*)				fmt=elf endian=little ;;
  51  
  52 diff --git a/ld/Makefile.am b/ld/Makefile.am
  53 index b4364be..e8e3756 100644
  54 --- a/ld/Makefile.am
  55 +++ b/ld/Makefile.am
  56 @@ -234,6 +234,7 @@ ALL_EMULATION_SOURCES = \
  57  	eelf32xstormy16.c \
  58  	eelf32xtensa.c \
  59  	eelf_i386.c \
  60 +	ebarrelfish_i386.c \
  61  	eelf_i386_be.c \
  62  	eelf_i386_chaos.c \
  63  	eelf_i386_fbsd.c \
  64 @@ -1163,6 +1164,12 @@ eelf64ltsmip.c: $(srcdir)/emulparams/elf64ltsmip.sh \
  65  eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
  66    $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
  67  	${GENSCRIPTS} elf_i386 "$(tdir_elf_i386)"
  68 +ebarrelfish_i386.c: $(srcdir)/emulparams/barrelfish_i386.sh \
  69 +  $(ELF_DEPS) $(srcdir)/scripttempl/elf-bf.sc ${GEN_DEPENDS}
  70 +	${GENSCRIPTS} barrelfish_i386 "$(tdir_barrelfish_i386)"
  71 +ebarrelfish_x86_64.c: $(srcdir)/emulparams/barrelfish_x86_64.sh \
  72 +  $(ELF_DEPS) $(srcdir)/scripttempl/elf-bf.sc ${GEN_DEPENDS}
  73 +	${GENSCRIPTS} barrelfish_x86_64 "$(tdir_barrelfish_x86_64)"
  74  eelf_x86_64.c: $(srcdir)/emulparams/elf_x86_64.sh \
  75    $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
  76  	${GENSCRIPTS} elf_x86_64 "$(tdir_elf_x86_64)"
  77 diff --git a/ld/Makefile.in b/ld/Makefile.in
  78 index dac81b3..7b8ced2 100644
  79 --- a/ld/Makefile.in
  80 +++ b/ld/Makefile.in
  81 @@ -534,6 +534,7 @@ ALL_EMULATION_SOURCES = \
  82  	eelf32xstormy16.c \
  83  	eelf32xtensa.c \
  84  	eelf_i386.c \
  85 +	ebarrelfish_i386.c \
  86  	eelf_i386_be.c \
  87  	eelf_i386_chaos.c \
  88  	eelf_i386_fbsd.c \
  89 @@ -741,6 +742,7 @@ ALL_64_EMULATION_SOURCES = \
  90  	eshelf64_nbsd.c \
  91  	eshlelf64_nbsd.c \
  92  	eelf_x86_64.c \
  93 +	ebarrelfish_x86_64.c \
  94  	eelf_x86_64_fbsd.c \
  95  	eelf_x86_64_sol2.c \
  96  	eelf_l1om.c \
  97 @@ -2586,6 +2588,12 @@ eelf64ltsmip.c: $(srcdir)/emulparams/elf64ltsmip.sh \
  98  eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
  99    $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 100  	${GENSCRIPTS} elf_i386 "$(tdir_elf_i386)"
 101 +ebarrelfish_i386.c: $(srcdir)/emulparams/barrelfish_i386.sh \
 102 +  $(ELF_DEPS) $(srcdir)/scripttempl/elf-bf.sc ${GEN_DEPENDS}
 103 +	${GENSCRIPTS} barrelfish_i386 "$(tdir_barrelfish_i386)"
 104 +ebarrelfish_x86_64.c: $(srcdir)/emulparams/barrelfish_x86_64.sh \
 105 +  $(ELF_DEPS) $(srcdir)/scripttempl/elf-bf.sc ${GEN_DEPENDS}
 106 +	${GENSCRIPTS} barrelfish_x86_64 "$(tdir_barrelfish_x86_64)"
 107  eelf_x86_64.c: $(srcdir)/emulparams/elf_x86_64.sh \
 108    $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 109  	${GENSCRIPTS} elf_x86_64 "$(tdir_elf_x86_64)"
 110 diff --git a/ld/configure.tgt b/ld/configure.tgt
 111 index 4e90739..754e33a 100644
 112 --- a/ld/configure.tgt
 113 +++ b/ld/configure.tgt
 114 @@ -193,6 +193,7 @@ i[3-7]86-*-bsd)		targ_emul=i386bsd ;;
 115  i[3-7]86-*-bsd386)	targ_emul=i386bsd ;;
 116  i[3-7]86-*-bsdi*)	targ_emul=i386bsd ;;
 117  i[3-7]86-*-aout)	targ_emul=i386aout ;;
 118 +i[3-7]86-*-barrelfish*) targ_emul=barrelfish_i386 ;;
 119  i[3-7]86-*-linux*aout*)	targ_emul=i386linux
 120  			targ_extra_emuls=elf_i386
 121  			tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'` ;;
 122 @@ -207,6 +208,7 @@ x86_64-*-linux-*)	targ_emul=elf_x86_64
 123  			targ_extra_libpath=elf_i386
 124  			tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
 125  			tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'` ;;
 126 +x86_64-*-barrelfish*)	targ_emul=barrelfish_x86_64 ;;
 127  i[3-7]86-*-sysv[45]*)	targ_emul=elf_i386 ;;
 128  i[3-7]86-*-solaris2*)	targ_emul=elf_i386_sol2
 129                          targ_extra_emuls="elf_i386_ldso elf_i386 elf_x86_64_sol2 elf_x86_64 elf_l1om"
 130 diff --git a/ld/emulparams/barrelfish_i386.sh b/ld/emulparams/barrelfish_i386.sh
 131 new file mode 100644
 132 index 0000000..2d70ee9
 133 --- /dev/null
 134 +++ b/ld/emulparams/barrelfish_i386.sh
 135 @@ -0,0 +1,15 @@
 136 +SCRIPT_NAME=elf-bf
 137 +OUTPUT_FORMAT="elf32-i386"
 138 +NO_RELA_RELOCS=yes
 139 +TEXT_START_ADDR=0x400000
 140 +DATA_START_ADDR=0x800000
 141 +MAXPAGESIZE=0x1000
 142 +COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
 143 +ARCH=i386
 144 +MACHINE=
 145 +NOP=0x90909090
 146 +TEMPLATE_NAME=elf32
 147 +GENERATE_SHLIB_SCRIPT=no
 148 +GENERATE_PIE_SCRIPT=yes
 149 +NO_SMALL_DATA=yes
 150 +SEPARATE_GOTPLT=12
 151 diff --git a/ld/emulparams/barrelfish_x86_64.sh b/ld/emulparams/barrelfish_x86_64.sh
 152 new file mode 100644
 153 index 0000000..ebd1f8e
 154 --- /dev/null
 155 +++ b/ld/emulparams/barrelfish_x86_64.sh
 156 @@ -0,0 +1,17 @@
 157 +SCRIPT_NAME=elf-bf
 158 +ELFSIZE=64
 159 +OUTPUT_FORMAT="elf64-x86-64"
 160 +NO_RELA_RELOCS=yes
 161 +TEXT_START_ADDR=0x400000
 162 +DATARELRO_START_ADDR=0x800000
 163 +MAXPAGESIZE=0x1000
 164 +COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
 165 +ARCH="i386:x86-64"
 166 +MACHINE=
 167 +NOP=0x90909090
 168 +TEMPLATE_NAME=elf32
 169 +GENERATE_SHLIB_SCRIPT=no
 170 +GENERATE_PIE_SCRIPT=yes
 171 +NO_SMALL_DATA=yes
 172 +LARGE_SECTIONS=yes
 173 +SEPARATE_GOTPLT=24
 174 diff --git a/ld/scripttempl/elf-bf.sc b/ld/scripttempl/elf-bf.sc
 175 new file mode 100644
 176 index 0000000..8de234f
 177 --- /dev/null
 178 +++ b/ld/scripttempl/elf-bf.sc
 179 @@ -0,0 +1,623 @@
 180 +#
 181 +# Unusual variables checked by this code:
 182 +#	NOP - four byte opcode for no-op (defaults to 0)
 183 +#	NO_SMALL_DATA - no .sbss/.sbss2/.sdata/.sdata2 sections if not
 184 +#		empty.
 185 +#	SMALL_DATA_CTOR - .ctors contains small data.
 186 +#	SMALL_DATA_DTOR - .dtors contains small data.
 187 +#	DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
 188 +#	INITIAL_READONLY_SECTIONS - at start of text segment
 189 +#	OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
 190 +#		(e.g., .PARISC.milli)
 191 +#	OTHER_TEXT_SECTIONS - these get put in .text when relocating
 192 +#	OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
 193 +#		(e.g., .PARISC.global)
 194 +#	OTHER_RELRO_SECTIONS - other than .data.rel.ro ...
 195 +#		(e.g. PPC32 .fixup, .got[12])
 196 +#	OTHER_BSS_SECTIONS - other than .bss .sbss ...
 197 +#	ATTRS_SECTIONS - at the end
 198 +#	OTHER_SECTIONS - at the end
 199 +#	EXECUTABLE_SYMBOLS - symbols that must be defined for an
 200 +#		executable (e.g., _DYNAMIC_LINK)
 201 +#       TEXT_START_ADDR - the first byte of the text segment, after any
 202 +#               headers.
 203 +#       TEXT_BASE_ADDRESS - the first byte of the text segment.
 204 +#	TEXT_START_SYMBOLS - symbols that appear at the start of the
 205 +#		.text section.
 206 +#	DATA_START_SYMBOLS - symbols that appear at the start of the
 207 +#		.data section.
 208 +#	DATA_END_SYMBOLS - symbols that appear at the end of the
 209 +#		writeable data sections.
 210 +#	OTHER_GOT_SYMBOLS - symbols defined just before .got.
 211 +#	OTHER_GOT_SECTIONS - sections just after .got.
 212 +#	OTHER_SDATA_SECTIONS - sections just after .sdata.
 213 +#	OTHER_BSS_SYMBOLS - symbols that appear at the start of the
 214 +#		.bss section besides __bss_start.
 215 +#	DATA_PLT - .plt should be in data segment, not text segment.
 216 +#	PLT_BEFORE_GOT - .plt just before .got when .plt is in data segement.
 217 +#	BSS_PLT - .plt should be in bss segment
 218 +#	NO_REL_RELOCS - Don't include .rel.* sections in script
 219 +#	NO_RELA_RELOCS - Don't include .rela.* sections in script
 220 +#	NON_ALLOC_DYN - Place dynamic sections after data segment.
 221 +#	TEXT_DYNAMIC - .dynamic in text segment, not data segment.
 222 +#	EMBEDDED - whether this is for an embedded system. 
 223 +#	SHLIB_TEXT_START_ADDR - if set, add to SIZEOF_HEADERS to set
 224 +#		start address of shared library.
 225 +#	INPUT_FILES - INPUT command of files to always include
 226 +#	WRITABLE_RODATA - if set, the .rodata section should be writable
 227 +#	INIT_START, INIT_END -  statements just before and just after
 228 +# 	combination of .init sections.
 229 +#	FINI_START, FINI_END - statements just before and just after
 230 +# 	combination of .fini sections.
 231 +#	STACK_ADDR - start of a .stack section.
 232 +#	OTHER_SYMBOLS - symbols to place right at the end of the script.
 233 +#	ETEXT_NAME - name of a symbol for the end of the text section,
 234 +#		normally etext.
 235 +#	SEPARATE_GOTPLT - if set, .got.plt should be separate output section,
 236 +#		so that .got can be in the RELRO area.  It should be set to
 237 +#		the number of bytes in the beginning of .got.plt which can be
 238 +#		in the RELRO area as well.
 239 +#	USER_LABEL_PREFIX - prefix to add to user-visible symbols.
 240 +#	RODATA_NAME, SDATA_NAME, SBSS_NAME, BSS_NAME - base parts of names
 241 +#		for standard sections, without initial "." or suffixes.
 242 +#
 243 +# When adding sections, do note that the names of some sections are used
 244 +# when specifying the start address of the next.
 245 +#
 246 +
 247 +#  Many sections come in three flavours.  There is the 'real' section,
 248 +#  like ".data".  Then there are the per-procedure or per-variable
 249 +#  sections, generated by -ffunction-sections and -fdata-sections in GCC,
 250 +#  and useful for --gc-sections, which for a variable "foo" might be
 251 +#  ".data.foo".  Then there are the linkonce sections, for which the linker
 252 +#  eliminates duplicates, which are named like ".gnu.linkonce.d.foo".
 253 +#  The exact correspondences are:
 254 +#
 255 +#  Section	Linkonce section
 256 +#  .text	.gnu.linkonce.t.foo
 257 +#  .rodata	.gnu.linkonce.r.foo
 258 +#  .data	.gnu.linkonce.d.foo
 259 +#  .bss		.gnu.linkonce.b.foo
 260 +#  .sdata	.gnu.linkonce.s.foo
 261 +#  .sbss	.gnu.linkonce.sb.foo
 262 +#  .sdata2	.gnu.linkonce.s2.foo
 263 +#  .sbss2	.gnu.linkonce.sb2.foo
 264 +#  .debug_info	.gnu.linkonce.wi.foo
 265 +#  .tdata	.gnu.linkonce.td.foo
 266 +#  .tbss	.gnu.linkonce.tb.foo
 267 +#  .lrodata	.gnu.linkonce.lr.foo
 268 +#  .ldata	.gnu.linkonce.l.foo
 269 +#  .lbss	.gnu.linkonce.lb.foo
 270 +#
 271 +#  Each of these can also have corresponding .rel.* and .rela.* sections.
 272 +
 273 +test -z "$RODATA_NAME" && RODATA_NAME=rodata
 274 +test -z "$SDATA_NAME" && SDATA_NAME=sdata
 275 +test -z "$SBSS_NAME" && SBSS_NAME=sbss
 276 +test -z "$BSS_NAME" && BSS_NAME=bss
 277 +test -z "$ENTRY" && ENTRY=${USER_LABEL_PREFIX}_start
 278 +test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
 279 +test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
 280 +if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
 281 +test -z "${ELFSIZE}" && ELFSIZE=32
 282 +test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8"
 283 +test "$LD_FLAG" = "N" && DATA_ADDR=.
 284 +test -z "${ETEXT_NAME}" && ETEXT_NAME=${USER_LABEL_PREFIX}etext
 285 +test -n "$CREATE_SHLIB$CREATE_PIE" && test -n "$SHLIB_DATA_ADDR" && COMMONPAGESIZE=""
 286 +test -z "$CREATE_SHLIB$CREATE_PIE" && test -n "$DATA_ADDR" && COMMONPAGESIZE=""
 287 +test -n "$RELRO_NOW" && unset SEPARATE_GOTPLT
 288 +test -z "$ATTRS_SECTIONS" && ATTRS_SECTIONS=".gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }"
 289 +DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))"
 290 +DATA_SEGMENT_RELRO_END=""
 291 +DATA_SEGMENT_END=""
 292 +if test -n "${COMMONPAGESIZE}"; then
 293 +  DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}) - ((${MAXPAGESIZE} - .) & (${MAXPAGESIZE} - 1)); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})"
 294 +  DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);"
 295 +  DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
 296 +fi
 297 +if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then
 298 +  INITIAL_READONLY_SECTIONS=".interp       ${RELOCATING-0} : { *(.interp) }"
 299 +fi
 300 +if test -z "$PLT"; then
 301 +  IPLT=".iplt         ${RELOCATING-0} : { *(.iplt) }"
 302 +  PLT=".plt          ${RELOCATING-0} : { *(.plt)${IREL_IN_PLT+ *(.iplt)} }
 303 +  ${IREL_IN_PLT-$IPLT}"
 304 +fi
 305 +test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT=yes
 306 +if test -z "$GOT"; then
 307 +  if test -z "$SEPARATE_GOTPLT"; then
 308 +    GOT=".got          ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }"
 309 +  else
 310 +    GOT=".got          ${RELOCATING-0} : { *(.got) *(.igot) }"
 311 +    GOTPLT=".got.plt      ${RELOCATING-0} : { *(.got.plt)  *(.igot.plt) }"
 312 +  fi
 313 +fi
 314 +REL_IFUNC=".rel.ifunc    ${RELOCATING-0} : { *(.rel.ifunc) }"
 315 +RELA_IFUNC=".rela.ifunc   ${RELOCATING-0} : { *(.rela.ifunc) }"
 316 +REL_IPLT=".rel.iplt     ${RELOCATING-0} :
 317 +    {
 318 +      ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_start = .);}}
 319 +      *(.rel.iplt)
 320 +      ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_end = .);}}
 321 +    }"
 322 +RELA_IPLT=".rela.iplt    ${RELOCATING-0} :
 323 +    {
 324 +      ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_start = .);}}
 325 +      *(.rela.iplt)
 326 +      ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_end = .);}}
 327 +    }"
 328 +DYNAMIC=".dynamic      ${RELOCATING-0} : { *(.dynamic) }"
 329 +RODATA=".${RODATA_NAME}       ${RELOCATING-0} : { *(.${RODATA_NAME}${RELOCATING+ .${RODATA_NAME}.* .gnu.linkonce.r.*}) }"
 330 +DATARELRO=".data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }"
 331 +DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }"
 332 +if test -z "${NO_SMALL_DATA}"; then
 333 +  SBSS=".${SBSS_NAME}         ${RELOCATING-0} :
 334 +  {
 335 +    ${RELOCATING+${SBSS_START_SYMBOLS}}
 336 +    ${CREATE_SHLIB+*(.${SBSS_NAME}2 .${SBSS_NAME}2.* .gnu.linkonce.sb2.*)}
 337 +    *(.dyn${SBSS_NAME})
 338 +    *(.${SBSS_NAME}${RELOCATING+ .${SBSS_NAME}.* .gnu.linkonce.sb.*})
 339 +    *(.scommon)
 340 +    ${RELOCATING+${SBSS_END_SYMBOLS}}
 341 +  }"
 342 +  SBSS2=".${SBSS_NAME}2        ${RELOCATING-0} : { *(.${SBSS_NAME}2${RELOCATING+ .${SBSS_NAME}2.* .gnu.linkonce.sb2.*}) }"
 343 +  SDATA="/* We want the small data sections together, so single-instruction offsets
 344 +     can access them all, and initialized data all before uninitialized, so
 345 +     we can shorten the on-disk segment size.  */
 346 +  .${SDATA_NAME}        ${RELOCATING-0} : 
 347 +  {
 348 +    ${RELOCATING+${SDATA_START_SYMBOLS}}
 349 +    ${CREATE_SHLIB+*(.${SDATA_NAME}2 .${SDATA_NAME}2.* .gnu.linkonce.s2.*)}
 350 +    *(.${SDATA_NAME}${RELOCATING+ .${SDATA_NAME}.* .gnu.linkonce.s.*})
 351 +  }"
 352 +  SDATA2=".${SDATA_NAME}2       ${RELOCATING-0} :
 353 +  {
 354 +    ${RELOCATING+${SDATA2_START_SYMBOLS}}
 355 +    *(.${SDATA_NAME}2${RELOCATING+ .${SDATA_NAME}2.* .gnu.linkonce.s2.*})
 356 +  }"
 357 +  REL_SDATA=".rel.${SDATA_NAME}    ${RELOCATING-0} : { *(.rel.${SDATA_NAME}${RELOCATING+ .rel.${SDATA_NAME}.* .rel.gnu.linkonce.s.*}) }
 358 +  .rela.${SDATA_NAME}   ${RELOCATING-0} : { *(.rela.${SDATA_NAME}${RELOCATING+ .rela.${SDATA_NAME}.* .rela.gnu.linkonce.s.*}) }"
 359 +  REL_SBSS=".rel.${SBSS_NAME}     ${RELOCATING-0} : { *(.rel.${SBSS_NAME}${RELOCATING+ .rel.${SBSS_NAME}.* .rel.gnu.linkonce.sb.*}) }
 360 +  .rela.${SBSS_NAME}    ${RELOCATING-0} : { *(.rela.${SBSS_NAME}${RELOCATING+ .rela.${SBSS_NAME}.* .rela.gnu.linkonce.sb.*}) }"
 361 +  REL_SDATA2=".rel.${SDATA_NAME}2   ${RELOCATING-0} : { *(.rel.${SDATA_NAME}2${RELOCATING+ .rel.${SDATA_NAME}2.* .rel.gnu.linkonce.s2.*}) }
 362 +  .rela.${SDATA_NAME}2  ${RELOCATING-0} : { *(.rela.${SDATA_NAME}2${RELOCATING+ .rela.${SDATA_NAME}2.* .rela.gnu.linkonce.s2.*}) }"
 363 +  REL_SBSS2=".rel.${SBSS_NAME}2    ${RELOCATING-0} : { *(.rel.${SBSS_NAME}2${RELOCATING+ .rel.${SBSS_NAME}2.* .rel.gnu.linkonce.sb2.*}) }
 364 +  .rela.${SBSS_NAME}2   ${RELOCATING-0} : { *(.rela.${SBSS_NAME}2${RELOCATING+ .rela.${SBSS_NAME}2.* .rela.gnu.linkonce.sb2.*}) }"
 365 +else
 366 +  NO_SMALL_DATA=" "
 367 +fi
 368 +if test -z "${DATA_GOT}"; then
 369 +  if test -n "${NO_SMALL_DATA}"; then
 370 +    DATA_GOT=" "
 371 +  fi
 372 +fi
 373 +if test -z "${SDATA_GOT}"; then
 374 +  if test -z "${NO_SMALL_DATA}"; then
 375 +    SDATA_GOT=" "
 376 +  fi
 377 +fi
 378 +test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" "
 379 +test "${LARGE_SECTIONS}" = "yes" && REL_LARGE="
 380 +  .rel.ldata    ${RELOCATING-0} : { *(.rel.ldata${RELOCATING+ .rel.ldata.* .rel.gnu.linkonce.l.*}) }
 381 +  .rela.ldata   ${RELOCATING-0} : { *(.rela.ldata${RELOCATING+ .rela.ldata.* .rela.gnu.linkonce.l.*}) }
 382 +  .rel.lbss     ${RELOCATING-0} : { *(.rel.lbss${RELOCATING+ .rel.lbss.* .rel.gnu.linkonce.lb.*}) }
 383 +  .rela.lbss    ${RELOCATING-0} : { *(.rela.lbss${RELOCATING+ .rela.lbss.* .rela.gnu.linkonce.lb.*}) }
 384 +  .rel.lrodata  ${RELOCATING-0} : { *(.rel.lrodata${RELOCATING+ .rel.lrodata.* .rel.gnu.linkonce.lr.*}) }
 385 +  .rela.lrodata ${RELOCATING-0} : { *(.rela.lrodata${RELOCATING+ .rela.lrodata.* .rela.gnu.linkonce.lr.*}) }"
 386 +test "${LARGE_SECTIONS}" = "yes" && OTHER_BSS_SECTIONS="
 387 +  ${OTHER_BSS_SECTIONS}
 388 +  .lbss ${RELOCATING-0} :
 389 +  {
 390 +    *(.dynlbss)
 391 +    *(.lbss${RELOCATING+ .lbss.* .gnu.linkonce.lb.*})
 392 +    *(LARGE_COMMON)
 393 +  }"
 394 +test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS="
 395 +  .lrodata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
 396 +  {
 397 +    *(.lrodata${RELOCATING+ .lrodata.* .gnu.linkonce.lr.*})
 398 +  }
 399 +  .ldata ${RELOCATING-0} ${RELOCATING+ALIGN(${MAXPAGESIZE}) + (. & (${MAXPAGESIZE} - 1))} :
 400 +  {
 401 +    *(.ldata${RELOCATING+ .ldata.* .gnu.linkonce.l.*})
 402 +    ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
 403 +  }"
 404 +INIT_ARRAY=".init_array   ${RELOCATING-0} :
 405 +  {
 406 +    ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_start = .);}}
 407 +    KEEP (*(SORT(.init_array.*)))
 408 +    KEEP (*(.init_array))
 409 +    ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__init_array_end = .);}}
 410 +  }"
 411 +FINI_ARRAY=".fini_array   ${RELOCATING-0} :
 412 +  {
 413 +    ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_start = .);}}
 414 +    KEEP (*(SORT(.fini_array.*)))
 415 +    KEEP (*(.fini_array))
 416 +    ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_end = .);}}
 417 +  }"
 418 +CTOR=".ctors        ${CONSTRUCTING-0} : 
 419 +  {
 420 +    ${CONSTRUCTING+${CTOR_START}}
 421 +    /* gcc uses crtbegin.o to find the start of
 422 +       the constructors, so we make sure it is
 423 +       first.  Because this is a wildcard, it
 424 +       doesn't matter if the user does not
 425 +       actually link against crtbegin.o; the
 426 +       linker won't look for a file to match a
 427 +       wildcard.  The wildcard also means that it
 428 +       doesn't matter which directory crtbegin.o
 429 +       is in.  */
 430 +
 431 +    KEEP (*crtbegin.o(.ctors))
 432 +    KEEP (*crtbegin?.o(.ctors))
 433 +
 434 +    /* We don't want to include the .ctor section from
 435 +       the crtend.o file until after the sorted ctors.
 436 +       The .ctor section from the crtend file contains the
 437 +       end of ctors marker and it must be last */
 438 +
 439 +    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors))
 440 +    KEEP (*(SORT(.ctors.*)))
 441 +    KEEP (*(.ctors))
 442 +    ${CONSTRUCTING+${CTOR_END}}
 443 +  }"
 444 +DTOR=".dtors        ${CONSTRUCTING-0} :
 445 +  {
 446 +    ${CONSTRUCTING+${DTOR_START}}
 447 +    KEEP (*crtbegin.o(.dtors))
 448 +    KEEP (*crtbegin?.o(.dtors))
 449 +    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors))
 450 +    KEEP (*(SORT(.dtors.*)))
 451 +    KEEP (*(.dtors))
 452 +    ${CONSTRUCTING+${DTOR_END}}
 453 +  }"
 454 +STACK="  .stack        ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} :
 455 +  {
 456 +    ${RELOCATING+${USER_LABEL_PREFIX}_stack = .;}
 457 +    *(.stack)
 458 +  }"
 459 +
 460 +TEXT_START_ADDR="SEGMENT_START(\"text-segment\", ${TEXT_START_ADDR})"
 461 +SHLIB_TEXT_START_ADDR="SEGMENT_START(\"text-segment\", ${SHLIB_TEXT_START_ADDR:-0})"
 462 +
 463 +# if this is for an embedded system, don't add SIZEOF_HEADERS.
 464 +if [ -z "$EMBEDDED" ]; then
 465 +   test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR} + SIZEOF_HEADERS"
 466 +else
 467 +   test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR}"
 468 +fi
 469 +
 470 +if [ -n "$DATARELRO_START_ADDR" ]; then
 471 +  DATARELRO_START=". = ${DATARELRO_START_ADDR};"
 472 +fi
 473 +
 474 +if [ -n "$DATA_START_ADDR" ]; then
 475 +  DATA_START=". = ${DATA_START_ADDR};"
 476 +fi
 477 +
 478 +cat <<EOF
 479 +OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
 480 +	      "${LITTLE_OUTPUT_FORMAT}")
 481 +OUTPUT_ARCH(${OUTPUT_ARCH})
 482 +${RELOCATING+ENTRY(${ENTRY})}
 483 +
 484 +${RELOCATING+${LIB_SEARCH_DIRS}}
 485 +${RELOCATING+${EXECUTABLE_SYMBOLS}}
 486 +${RELOCATING+${INPUT_FILES}}
 487 +${RELOCATING- /* For some reason, the Solaris linker makes bad executables
 488 +  if gld -r is used and the intermediate file has sections starting
 489 +  at non-zero addresses.  Could be a Solaris ld bug, could be a GNU ld
 490 +  bug.  But for now assigning the zero vmas works.  */}
 491 +
 492 +SECTIONS
 493 +{
 494 +  /* Read-only sections, merged into text segment: */
 495 +  ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR}); . = ${TEXT_BASE_ADDRESS};}}}
 496 +  ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR} + SIZEOF_HEADERS;}}
 497 +  ${CREATE_PIE+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR} + SIZEOF_HEADERS;}}
 498 +  ${INITIAL_READONLY_SECTIONS}
 499 +  .note.gnu.build-id : { *(.note.gnu.build-id) }
 500 +EOF
 501 +
 502 +test -n "${RELOCATING+0}" || unset NON_ALLOC_DYN
 503 +test -z "${NON_ALLOC_DYN}" || TEXT_DYNAMIC=
 504 +cat > ldscripts/dyntmp.$$ <<EOF
 505 +  ${TEXT_DYNAMIC+${DYNAMIC}}
 506 +  .hash         ${RELOCATING-0} : { *(.hash) }
 507 +  .gnu.hash     ${RELOCATING-0} : { *(.gnu.hash) }
 508 +  .dynsym       ${RELOCATING-0} : { *(.dynsym) }
 509 +  .dynstr       ${RELOCATING-0} : { *(.dynstr) }
 510 +  .gnu.version  ${RELOCATING-0} : { *(.gnu.version) }
 511 +  .gnu.version_d ${RELOCATING-0}: { *(.gnu.version_d) }
 512 +  .gnu.version_r ${RELOCATING-0}: { *(.gnu.version_r) }
 513 +EOF
 514 +
 515 +if [ "x$COMBRELOC" = x ]; then
 516 +  COMBRELOCCAT="cat >> ldscripts/dyntmp.$$"
 517 +else
 518 +  COMBRELOCCAT="cat > $COMBRELOC"
 519 +fi
 520 +eval $COMBRELOCCAT <<EOF
 521 +  ${INITIAL_RELOC_SECTIONS}
 522 +  .rel.init     ${RELOCATING-0} : { *(.rel.init) }
 523 +  .rela.init    ${RELOCATING-0} : { *(.rela.init) }
 524 +  .rel.text     ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) }
 525 +  .rela.text    ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) }
 526 +  .rel.fini     ${RELOCATING-0} : { *(.rel.fini) }
 527 +  .rela.fini    ${RELOCATING-0} : { *(.rela.fini) }
 528 +  .rel.${RODATA_NAME}   ${RELOCATING-0} : { *(.rel.${RODATA_NAME}${RELOCATING+ .rel.${RODATA_NAME}.* .rel.gnu.linkonce.r.*}) }
 529 +  .rela.${RODATA_NAME}  ${RELOCATING-0} : { *(.rela.${RODATA_NAME}${RELOCATING+ .rela.${RODATA_NAME}.* .rela.gnu.linkonce.r.*}) }
 530 +  ${OTHER_READONLY_RELOC_SECTIONS}
 531 +  .rel.data.rel.ro ${RELOCATING-0} : { *(.rel.data.rel.ro${RELOCATING+* .rel.gnu.linkonce.d.rel.ro.*}) }
 532 +  .rela.data.rel.ro ${RELOCATING-0} : { *(.rela.data.rel.ro${RELOCATING+* .rela.gnu.linkonce.d.rel.ro.*}) }
 533 +  .rel.data     ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) }
 534 +  .rela.data    ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
 535 +  ${OTHER_READWRITE_RELOC_SECTIONS}
 536 +  .rel.tdata	${RELOCATING-0} : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) }
 537 +  .rela.tdata	${RELOCATING-0} : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) }
 538 +  .rel.tbss	${RELOCATING-0} : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) }
 539 +  .rela.tbss	${RELOCATING-0} : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) }
 540 +  .rel.ctors    ${RELOCATING-0} : { *(.rel.ctors) }
 541 +  .rela.ctors   ${RELOCATING-0} : { *(.rela.ctors) }
 542 +  .rel.dtors    ${RELOCATING-0} : { *(.rel.dtors) }
 543 +  .rela.dtors   ${RELOCATING-0} : { *(.rela.dtors) }
 544 +  .rel.got      ${RELOCATING-0} : { *(.rel.got) }
 545 +  .rela.got     ${RELOCATING-0} : { *(.rela.got) }
 546 +  ${OTHER_GOT_RELOC_SECTIONS}
 547 +  ${REL_SDATA}
 548 +  ${REL_SBSS}
 549 +  ${REL_SDATA2}
 550 +  ${REL_SBSS2}
 551 +  .rel.${BSS_NAME}      ${RELOCATING-0} : { *(.rel.${BSS_NAME}${RELOCATING+ .rel.${BSS_NAME}.* .rel.gnu.linkonce.b.*}) }
 552 +  .rela.${BSS_NAME}     ${RELOCATING-0} : { *(.rela.${BSS_NAME}${RELOCATING+ .rela.${BSS_NAME}.* .rela.gnu.linkonce.b.*}) }
 553 +  ${REL_LARGE}
 554 +  ${IREL_IN_PLT+$REL_IFUNC}
 555 +  ${IREL_IN_PLT+$RELA_IFUNC}
 556 +  ${IREL_IN_PLT-$REL_IPLT}
 557 +  ${IREL_IN_PLT-$RELA_IPLT}
 558 +EOF
 559 +
 560 +if [ -n "$COMBRELOC" ]; then
 561 +cat >> ldscripts/dyntmp.$$ <<EOF
 562 +  .rel.dyn      ${RELOCATING-0} :
 563 +    {
 564 +EOF
 565 +sed -e '/^[ 	]*[{}][ 	]*$/d;/:[ 	]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/      \1/' $COMBRELOC >> ldscripts/dyntmp.$$
 566 +cat >> ldscripts/dyntmp.$$ <<EOF
 567 +    }
 568 +  .rela.dyn     ${RELOCATING-0} :
 569 +    {
 570 +EOF
 571 +sed -e '/^[ 	]*[{}][ 	]*$/d;/:[ 	]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/      \1/' $COMBRELOC >> ldscripts/dyntmp.$$
 572 +cat >> ldscripts/dyntmp.$$ <<EOF
 573 +    }
 574 +EOF
 575 +fi
 576 +
 577 +cat >> ldscripts/dyntmp.$$ <<EOF
 578 +  .rel.plt      ${RELOCATING-0} :
 579 +    {
 580 +      *(.rel.plt)
 581 +      ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_start = .);}}}
 582 +      ${IREL_IN_PLT+${RELOCATING+*(.rel.iplt)}}
 583 +      ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rel_iplt_end = .);}}}
 584 +    }
 585 +  .rela.plt     ${RELOCATING-0} :
 586 +    {
 587 +      *(.rela.plt)
 588 +      ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_start = .);}}}
 589 +      ${IREL_IN_PLT+${RELOCATING+*(.rela.iplt)}}
 590 +      ${IREL_IN_PLT+${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__rela_iplt_end = .);}}}
 591 +    }
 592 +  ${OTHER_PLT_RELOC_SECTIONS}
 593 +EOF
 594 +
 595 +if test -z "${NON_ALLOC_DYN}"; then
 596 +  if test -z "${NO_REL_RELOCS}${NO_RELA_RELOCS}"; then
 597 +    cat ldscripts/dyntmp.$$
 598 +  else
 599 +    if test -z "${NO_REL_RELOCS}"; then
 600 +      sed -e '/^[ 	]*\.rela\.[^}]*$/,/}/d' -e '/^[ 	]*\.rela\./d' ldscripts/dyntmp.$$
 601 +    fi
 602 +    if test -z "${NO_RELA_RELOCS}"; then
 603 +      sed -e '/^[ 	]*\.rel\.[^}]*$/,/}/d' -e '/^[ 	]*\.rel\./d' ldscripts/dyntmp.$$
 604 +    fi
 605 +  fi
 606 +  rm -f ldscripts/dyntmp.$$
 607 +fi
 608 +
 609 +cat <<EOF
 610 +  .init         ${RELOCATING-0} : 
 611 +  { 
 612 +    ${RELOCATING+${INIT_START}}
 613 +    KEEP (*(.init))
 614 +    ${RELOCATING+${INIT_END}}
 615 +  } =${NOP-0}
 616 +
 617 +  ${TEXT_PLT+${PLT}}
 618 +  ${TINY_READONLY_SECTION}
 619 +  .text         ${RELOCATING-0} :
 620 +  {
 621 +    ${RELOCATING+${TEXT_START_SYMBOLS}}
 622 +    ${RELOCATING+*(.text.unlikely .text.*_unlikely)}
 623 +    ${RELOCATING+*(.text.exit .text.exit.*)}
 624 +    ${RELOCATING+*(.text.startup .text.startup.*)}
 625 +    ${RELOCATING+*(.text.hot .text.hot.*)}
 626 +    *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
 627 +    /* .gnu.warning sections are handled specially by elf32.em.  */
 628 +    *(.gnu.warning)
 629 +    ${RELOCATING+${OTHER_TEXT_SECTIONS}}
 630 +  } =${NOP-0}
 631 +  .fini         ${RELOCATING-0} :
 632 +  {
 633 +    ${RELOCATING+${FINI_START}}
 634 +    KEEP (*(.fini))
 635 +    ${RELOCATING+${FINI_END}}
 636 +  } =${NOP-0}
 637 +  ${RELOCATING+PROVIDE (__${ETEXT_NAME} = .);}
 638 +  ${RELOCATING+PROVIDE (_${ETEXT_NAME} = .);}
 639 +  ${RELOCATING+PROVIDE (${ETEXT_NAME} = .);}
 640 +  ${WRITABLE_RODATA-${RODATA}}
 641 +  .${RODATA_NAME}1      ${RELOCATING-0} : { *(.${RODATA_NAME}1) }
 642 +  ${CREATE_SHLIB-${SDATA2}}
 643 +  ${CREATE_SHLIB-${SBSS2}}
 644 +  ${OTHER_READONLY_SECTIONS}
 645 +  .eh_frame_hdr : { *(.eh_frame_hdr) }
 646 +  .eh_frame     ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
 647 +  .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
 648 +
 649 +  /* Adjust the address for the data segment.  We want to adjust up to
 650 +     the same address within the page on the next page up.  */
 651 +  ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}}
 652 +  ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
 653 +  ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
 654 +
 655 +  /* Exception handling  */
 656 +  .eh_frame     ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
 657 +  .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
 658 +
 659 +  /* Thread Local Storage sections  */
 660 +  .tdata	${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
 661 +  .tbss		${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
 662 +
 663 +  .preinit_array   ${RELOCATING-0} :
 664 +  {
 665 +    ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_start = .);}}
 666 +    KEEP (*(.preinit_array))
 667 +    ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__preinit_array_end = .);}}
 668 +  }
 669 +  ${RELOCATING+${INIT_ARRAY}}
 670 +  ${RELOCATING+${FINI_ARRAY}}
 671 +  ${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}
 672 +  ${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}}
 673 +  .jcr          ${RELOCATING-0} : { KEEP (*(.jcr)) }
 674 +
 675 +  ${DATARELRO_START}
 676 +  ${RELOCATING+${DATARELRO}}
 677 +  ${OTHER_RELRO_SECTIONS}
 678 +  ${TEXT_DYNAMIC-${DYNAMIC}}
 679 +  ${DATA_GOT+${RELRO_NOW+${GOT}}}
 680 +  ${DATA_GOT+${RELRO_NOW+${GOTPLT}}}
 681 +  ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT+${GOT}}}}
 682 +  ${RELOCATING+${DATA_SEGMENT_RELRO_END}}
 683 +  ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT-${GOT}}}}
 684 +  ${DATA_GOT+${RELRO_NOW-${GOTPLT}}}
 685 +
 686 +  ${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}}
 687 +
 688 +  ${DATA_START}
 689 +  .data         ${RELOCATING-0} :
 690 +  {
 691 +    ${RELOCATING+${DATA_START_SYMBOLS}}
 692 +    *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
 693 +    ${CONSTRUCTING+SORT(CONSTRUCTORS)}
 694 +  }
 695 +  .data1        ${RELOCATING-0} : { *(.data1) }
 696 +  ${WRITABLE_RODATA+${RODATA}}
 697 +  ${OTHER_READWRITE_SECTIONS}
 698 +  ${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}}
 699 +  ${SMALL_DATA_DTOR+${RELOCATING+${DTOR}}}
 700 +  ${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}}
 701 +  ${SDATA_GOT+${RELOCATING+${OTHER_GOT_SYMBOLS}}}
 702 +  ${SDATA_GOT+${GOT}}
 703 +  ${SDATA_GOT+${OTHER_GOT_SECTIONS}}
 704 +  ${SDATA}
 705 +  ${OTHER_SDATA_SECTIONS}
 706 +  ${RELOCATING+${DATA_END_SYMBOLS-${USER_LABEL_PREFIX}_edata = .; PROVIDE (${USER_LABEL_PREFIX}edata = .);}}
 707 +  ${RELOCATING+${USER_LABEL_PREFIX}__bss_start = .;}
 708 +  ${RELOCATING+${OTHER_BSS_SYMBOLS}}
 709 +  ${SBSS}
 710 +  ${BSS_PLT+${PLT}}
 711 +  .${BSS_NAME}          ${RELOCATING-0} :
 712 +  {
 713 +   *(.dyn${BSS_NAME})
 714 +   *(.${BSS_NAME}${RELOCATING+ .${BSS_NAME}.* .gnu.linkonce.b.*})
 715 +   *(COMMON)
 716 +   /* Align here to ensure that the .bss section occupies space up to
 717 +      _end.  Align after .bss to ensure correct alignment even if the
 718 +      .bss section disappears because there are no input sections.
 719 +      FIXME: Why do we need it? When there is no .bss section, we don't
 720 +      pad the .data section.  */
 721 +   ${RELOCATING+. = ALIGN(. != 0 ? ${ALIGNMENT} : 1);}
 722 +  }
 723 +  ${OTHER_BSS_SECTIONS}
 724 +  ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
 725 +  ${RELOCATING+. = ALIGN(${ALIGNMENT});}
 726 +  ${LARGE_SECTIONS}
 727 +  ${RELOCATING+. = ALIGN(${ALIGNMENT});}
 728 +  ${RELOCATING+${OTHER_END_SYMBOLS}}
 729 +  ${RELOCATING+${END_SYMBOLS-${USER_LABEL_PREFIX}_end = .; PROVIDE (${USER_LABEL_PREFIX}end = .);}}
 730 +  ${RELOCATING+${DATA_SEGMENT_END}}
 731 +EOF
 732 +
 733 +if test -n "${NON_ALLOC_DYN}"; then
 734 +  if test -z "${NO_REL_RELOCS}${NO_RELA_RELOCS}"; then
 735 +    cat ldscripts/dyntmp.$$
 736 +  else
 737 +    if test -z "${NO_REL_RELOCS}"; then
 738 +      sed -e '/^[ 	]*\.rela\.[^}]*$/,/}/d' -e '/^[ 	]*\.rela\./d' ldscripts/dyntmp.$$
 739 +    fi
 740 +    if test -z "${NO_RELA_RELOCS}"; then
 741 +      sed -e '/^[ 	]*\.rel\.[^}]*$/,/}/d' -e '/^[ 	]*\.rel\./d' ldscripts/dyntmp.$$
 742 +    fi
 743 +  fi
 744 +  rm -f ldscripts/dyntmp.$$
 745 +fi
 746 +
 747 +cat <<EOF
 748 +  /* Stabs debugging sections.  */
 749 +  .stab          0 : { *(.stab) }
 750 +  .stabstr       0 : { *(.stabstr) }
 751 +  .stab.excl     0 : { *(.stab.excl) }
 752 +  .stab.exclstr  0 : { *(.stab.exclstr) }
 753 +  .stab.index    0 : { *(.stab.index) }
 754 +  .stab.indexstr 0 : { *(.stab.indexstr) }
 755 +
 756 +  .comment       0 : { *(.comment) }
 757 +
 758 +  /* DWARF debug sections.
 759 +     Symbols in the DWARF debugging sections are relative to the beginning
 760 +     of the section so we begin them at 0.  */
 761 +
 762 +  /* DWARF 1 */
 763 +  .debug          0 : { *(.debug) }
 764 +  .line           0 : { *(.line) }
 765 +
 766 +  /* GNU DWARF 1 extensions */
 767 +  .debug_srcinfo  0 : { *(.debug_srcinfo .zdebug_srcinfo) }
 768 +  .debug_sfnames  0 : { *(.debug_sfnames .zdebug_sfnames) }
 769 +
 770 +  /* DWARF 1.1 and DWARF 2 */
 771 +  .debug_aranges  0 : { *(.debug_aranges .zdebug_aranges) }
 772 +  .debug_pubnames 0 : { *(.debug_pubnames .zdebug_pubnames) }
 773 +
 774 +  /* DWARF 2 */
 775 +  .debug_info     0 : { *(.debug_info${RELOCATING+ .gnu.linkonce.wi.*} .zdebug_info) }
 776 +  .debug_abbrev   0 : { *(.debug_abbrev .zdebug_abbrev) }
 777 +  .debug_line     0 : { *(.debug_line .zdebug_line) }
 778 +  .debug_frame    0 : { *(.debug_frame .zdebug_frame) }
 779 +  .debug_str      0 : { *(.debug_str .zdebug_str) }
 780 +  .debug_loc      0 : { *(.debug_loc .zdebug_loc) }
 781 +  .debug_macinfo  0 : { *(.debug_macinfo .zdebug_macinfo) }
 782 +
 783 +  /* SGI/MIPS DWARF 2 extensions */
 784 +  .debug_weaknames 0 : { *(.debug_weaknames .zdebug_weaknames) }
 785 +  .debug_funcnames 0 : { *(.debug_funcnames .zdebug_funcnames) }
 786 +  .debug_typenames 0 : { *(.debug_typenames .zdebug_typenames) }
 787 +  .debug_varnames  0 : { *(.debug_varnames .zdebug_varnames) }
 788 +
 789 +  /* DWARF 3 */
 790 +  .debug_pubtypes 0 : { *(.debug_pubtypes .zdebug_pubtypes) }
 791 +  .debug_ranges   0 : { *(.debug_ranges .zdebug_ranges) }
 792 +
 793 +  ${TINY_DATA_SECTION}
 794 +  ${TINY_BSS_SECTION}
 795 +
 796 +  ${STACK_ADDR+${STACK}}
 797 +  ${ATTRS_SECTIONS}
 798 +  ${OTHER_SECTIONS}
 799 +  ${RELOCATING+${OTHER_SYMBOLS}}
 800 +  ${RELOCATING+${DISCARDED}}
 801 +}
 802 +EOF
 803 

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2012-11-28 11:45:27, 32.4 KB) [[attachment:binutils-2.21-bf.patch]]
  • [get | view] (2013-03-30 20:30:57, 34.5 KB) [[attachment:binutils-2.23.2-barrelfish.patch]]
  • [get | view] (2014-01-13 15:01:01, 34.6 KB) [[attachment:binutils-2.24-barrelfish.patch]]
  • [get | view] (2014-12-04 23:29:28, 4.0 KB) [[attachment:build-toolchain.sh]]
  • [get | view] (2012-11-28 11:46:01, 161.1 KB) [[attachment:gcc-4.5.2-bf.patch]]
  • [get | view] (2013-04-24 15:01:56, 164.8 KB) [[attachment:gcc-4.7.3-barrelfish.patch]]
  • [get | view] (2014-12-04 23:29:37, 168.6 KB) [[attachment:gcc-4.8.3-barrelfish.patch]]
  • [get | view] (2014-12-04 23:29:45, 168.7 KB) [[attachment:gcc-4.9.2-barrelfish.patch]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.