binutils-gdb/ld/genscripts.sh

636 lines
21 KiB
Bash
Raw Normal View History

1999-05-03 09:29:11 +02:00
#!/bin/sh
# genscripts.sh - generate the ld-emulation-target specific files
# Copyright (C) 2004-2020 Free Software Foundation, Inc.
2007-07-06 16:09:45 +02:00
#
# This file is part of the Gnu Linker.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GLD; see the file COPYING. If not, write to the Free
# Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
1999-05-03 09:29:11 +02:00
#
# Usage: genscripts_extra.sh \
# srcdir \
# libdir \
# prefix \
# exec_prefix \
# host \
# target \
# target_alias \
# default_emulation \
# native_lib_dirs \
# use_sysroot \
# enable_initfini_array \
# this_emulation \
# optional:
# tool_dir
1999-05-03 09:29:11 +02:00
#
# Sample usage:
#
# genscripts_extra.sh \
# /sources/ld \
# /usr/local/lib \
# /usr/local \
# /usr/local \
# sparc-sun-sunos4.1.3 \
# sparc-sun-sunos4.1.3 \
# sparc-sun-sunos4.1.3 \
# sun4 \
# "" \
# no \
# sun3 \
# sparc-sun-sunos4.1.3 \
# sparc.sh
#
# produces the linker scripts:
#
# sun3.x [default linker script]
# sun3.xbn [used when the linker is invoked with "-N"]
# sun3.xn [used when the linker is invoked with "-n"]
# sun3.xr [used when the linker is invoked with "-r"]
# sun3.xu [used when the linker is invoked with "-Ur"]
#
# depending on platform specific settings linker scripts with the
# following suffixes might be generated as well:
#
# xdwe: -pie -z combreloc -z separate-code -z relro -z now
# xdw: -pie -z combreloc -z relro -z now
# xdceo: -pie -z combreloc -z separate-code -z relro
# xdce: -pie -z combreloc -z separate-code
# xdco: -pie -z combreloc -z relro
# xdc: -pie -z combreloc
# xdeo: -pie -z separate-code -z relro
# xde: -pie -z separate-code
# xdo: -pie -z relro
# xd: -pie
#
# xswe: -shared -z combreloc -z separate-code -z relro -z now
# xsw: -shared -z combreloc -z relro -z now
# xsceo: -shared -z combreloc -z separate-code -z relro
# xsce: -shared -z combreloc -z separate-code
# xsco: -shared -z combreloc -z relro
# xsc: -shared -z combreloc
# xseo: -shared -z separate-code -z relro
# xse: -shared -z separate-code
# xso: -shared -z relro
# xs: -shared
#
# xwe: -z combreloc -z separate-code -z relro -z now
# xw: -z combreloc -z relro -z now
# xceo: -z combreloc -z separate-code -z relro
# xce: -z combreloc -z separate-code
# xco: -z combreloc -z relro
# xc: -z combreloc
# xeo: -z separate-code -z relro
# xe: -z separate-code
# xo: -z relro
#
#
# It also produced the C source file:
#
# em_sun3.c
#
# which is then compiled into the linker.
#
# The linker scripts are created by running the shell script
# /sources/ld/emulparams/sparc.sh to set the value of ${SCRIPT_NAME}
# (and any other variables it wants to). ${SCRIPT_NAME} is then
# invoked with a variable called ${LD_FLAG} to tell it which version
# of the linker script to create.
1999-05-03 09:29:11 +02:00
srcdir=$1
libdir=$2
prefix=$3
exec_prefix=$4
host=$5
target=$6
target_alias=$7
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
DEPDIR=$8
shift 8
LIB_PATH=$1
EMULATION_LIBPATH=$2
NATIVE_LIB_DIRS=$3
use_sysroot=$4
ENABLE_INITFINI_ARRAY=$5
shift 5
EMULATION_NAME=$1
TOOL_LIB=$2
source_sh()
{
if test -n "${DEPDIR}"; then
echo $1 >> ${DEPDIR}/e${EMULATION_NAME}.Tc
fi
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
. $1
}
if test -n "${DEPDIR}"; then
rm -f ${DEPDIR}/e${EMULATION_NAME}.Tc
fi
1999-05-03 09:29:11 +02:00
# Include the emulation-specific parameters:
CUSTOMIZER_SCRIPT="${srcdir}/emulparams/${EMULATION_NAME}.sh"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
1999-05-03 09:29:11 +02:00
if test -d ldscripts; then
true
else
mkdir ldscripts
fi
* Makefile.am (eelf32iq10.c): Fix tab/whitespace mixup. * Makefile.am (ldmain.o): Add @TARGET_SYSTEM_ROOT_DEFINE@. (GENSCRIPTS): Add @use_sysroot@. * Makefile.in: Regenerated. * configure.host: Move setting of NATIVE_LIB_DIRS to... * configure.tgt: ... here. Use ${target} instead of ${host} for NATIVE_LIB_DIRS. * configure.in: Add --with-sysroot. * configure: Regenerated. * genscripts.sh: Accept use_sysroot option. Set new variables NATIVE and USE_LIBPATH. Prepend "=" to directory names if $use_sysroot. Don't search $tool_lib if $use_sysroot. * ldfile.c (ldfile_add_library_path): Handle leading '='. * ldmain.c (TARGET_SYSTEM_ROOT): Define if not defined. (ld_sysroot): New variable. (main): Initialize ld_sysroot. * ldmain.h (ld_sysroot): New extern. * emultempl/elf32.em: Use NATIVE and USE_LIBPATH instead of searching $EMULATION_LIBPATH. (gld${EMULATION_NAME}_add_sysroot): New function. (gld${EMULATION_NAME}_check_ld_so_conf): Use it. Honor ld_sysroot. (gld${EMULATION_NAME}_after_open): Likewise. Only search environment variables if $NATIVE. * ld.texinfo (Options): Mention "=" prefix in the description of -L. * NEWS: Mention --with-sysroot. * emulparams/elf32bmipn32-defs.sh: Set NATIVE and LIBPATH_SUFFIX instead of setting LIB_PATH. * emulparams/elf32ppc.sh: Likewise. * emulparams/elf64_s390.sh: Likewise. * emulparams/elf64_sparc.sh: Likewise. * emulparams/elf64ppc.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/elf64_aix.sh: Add "=" prefixes to LIB_PATH. * emulparams/elf64hppa.sh: Add "=" prefixes to LIB_PATH.
2003-01-06 17:14:01 +01:00
# Set some flags for the emultempl scripts. USE_LIBPATH will
# be set for any libpath-using emulation; NATIVE will be set for a
# libpath-using emulation where ${host} = ${target}. NATIVE
# may already have been set by the emulparams file, but that's OK
# (it'll just get set to "yes" twice).
case " $EMULATION_LIBPATH " in
*" ${EMULATION_NAME} "*)
if [ "x${host}" = "x${target}" ] ; then
NATIVE=yes
USE_LIBPATH=yes
elif [ "x${use_sysroot}" = "xyes" ] ; then
USE_LIBPATH=yes
fi
;;
esac
# If the emulparams file sets NATIVE, make sure USE_LIBPATH is set also.
if test "x$NATIVE" = "xyes" ; then
USE_LIBPATH=yes
fi
1999-05-03 09:29:11 +02:00
# Set the library search path, for libraries named by -lfoo.
# If LIB_PATH is defined (e.g., by Makefile) and non-empty, it is used.
# Otherwise, the default is set here.
#
# The format is the usual list of colon-separated directories.
# To force a logically empty LIB_PATH, do LIBPATH=":".
* Makefile.am (eelf32iq10.c): Fix tab/whitespace mixup. * Makefile.am (ldmain.o): Add @TARGET_SYSTEM_ROOT_DEFINE@. (GENSCRIPTS): Add @use_sysroot@. * Makefile.in: Regenerated. * configure.host: Move setting of NATIVE_LIB_DIRS to... * configure.tgt: ... here. Use ${target} instead of ${host} for NATIVE_LIB_DIRS. * configure.in: Add --with-sysroot. * configure: Regenerated. * genscripts.sh: Accept use_sysroot option. Set new variables NATIVE and USE_LIBPATH. Prepend "=" to directory names if $use_sysroot. Don't search $tool_lib if $use_sysroot. * ldfile.c (ldfile_add_library_path): Handle leading '='. * ldmain.c (TARGET_SYSTEM_ROOT): Define if not defined. (ld_sysroot): New variable. (main): Initialize ld_sysroot. * ldmain.h (ld_sysroot): New extern. * emultempl/elf32.em: Use NATIVE and USE_LIBPATH instead of searching $EMULATION_LIBPATH. (gld${EMULATION_NAME}_add_sysroot): New function. (gld${EMULATION_NAME}_check_ld_so_conf): Use it. Honor ld_sysroot. (gld${EMULATION_NAME}_after_open): Likewise. Only search environment variables if $NATIVE. * ld.texinfo (Options): Mention "=" prefix in the description of -L. * NEWS: Mention --with-sysroot. * emulparams/elf32bmipn32-defs.sh: Set NATIVE and LIBPATH_SUFFIX instead of setting LIB_PATH. * emulparams/elf32ppc.sh: Likewise. * emulparams/elf64_s390.sh: Likewise. * emulparams/elf64_sparc.sh: Likewise. * emulparams/elf64ppc.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/elf64_aix.sh: Add "=" prefixes to LIB_PATH. * emulparams/elf64hppa.sh: Add "=" prefixes to LIB_PATH.
2003-01-06 17:14:01 +01:00
#
# If we are using a sysroot, prefix library paths with "=" to indicate this.
#
# If the emulparams file set LIBPATH_SUFFIX, prepend an extra copy of
# the library path with the suffix applied.
1999-05-03 09:29:11 +02:00
# Paths with LIBPATH_SUFFIX
lib_path1=
# Paths without LIBPATH_SUFFIX
lib_path2=
if [ "${LIB_PATH}" != ":" ] ; then
lib_path2=${LIB_PATH}
fi
# Add args to lib_path1 and lib_path2, discarding any duplicates
append_to_lib_path()
{
if [ $# != 0 ]; then
for lib in "$@"; do
# The "=" is harmless if we aren't using a sysroot, but also needless.
if [ "x${use_sysroot}" = "xyes" ] ; then
lib="=${lib}"
fi
skip_lib=no
for libpath_suffix in ${LIBPATH_SUFFIX}; do
case "${lib}" in
*${libpath_suffix})
case :${lib_path1}: in
*:${lib}:*) ;;
::) lib_path1=${lib} ;;
*) lib_path1=${lib_path1}:${lib} ;;
esac ;;
*)
if test -n "${LIBPATH_SUFFIX_SKIP}"; then
case "${lib}" in
*${LIBPATH_SUFFIX_SKIP}) skip_lib=yes ;;
esac
fi
if test "${skip_lib}" = "no"; then
case :${lib_path1}: in
*:${lib}${libpath_suffix}:*) ;;
::) lib_path1=${lib}${libpath_suffix} ;;
*) lib_path1=${lib_path1}:${lib}${libpath_suffix} ;;
esac
fi ;;
esac
done
if test "${skip_lib}" = "no"; then
case :${lib_path1}:${lib_path2}: in
*:${lib}:*) ;;
*::) lib_path2=${lib} ;;
*) lib_path2=${lib_path2}:${lib} ;;
esac
fi
done
fi
}
# Always search $(tooldir)/lib, aka /usr/local/TARGET/lib when native
# except when LIBPATH=":".
if [ "${LIB_PATH}" != ":" ] ; then
libs=
if [ "x${TOOL_LIB}" = "x" ] ; then
if [ "x${NATIVE}" = "xyes" ] ; then
libs="${exec_prefix}/${target_alias}/lib"
fi
else
# For multilib'ed targets, ensure both ${target_alias}/lib${LIBPATH_SUFFIX}
# and ${TOOL_LIB}/lib${LIBPATH_SUFFIX} are in the default search path,
# because 64bit libraries may be in both places, depending on
# cross-development setup method (e.g.: /usr/s390x-linux/lib64
# vs. /usr/s390-linux/lib64)
for libpath_suffix in ${LIBPATH_SUFFIX}; do
case "${NATIVE}:${libpath_suffix}:${TOOL_LIB}" in
:* | *::* | *:*:*${libpath_suffix}) ;;
*) libs="${exec_prefix}/${target_alias}/lib${libpath_suffix}" ;;
esac
done
libs="${exec_prefix}/${TOOL_LIB}/lib ${libs}"
fi
append_to_lib_path ${libs}
1999-05-03 09:29:11 +02:00
fi
if [ "x${LIB_PATH}" = "x" ] && [ "x${USE_LIBPATH}" = xyes ] ; then
libs=${NATIVE_LIB_DIRS}
if [ "x${NATIVE}" = "xyes" ] ; then
case " ${libs} " in
*" ${libdir} "*) ;;
*) libs="${libdir} ${libs}" ;;
esac
fi
append_to_lib_path ${libs}
* Makefile.am (eelf32iq10.c): Fix tab/whitespace mixup. * Makefile.am (ldmain.o): Add @TARGET_SYSTEM_ROOT_DEFINE@. (GENSCRIPTS): Add @use_sysroot@. * Makefile.in: Regenerated. * configure.host: Move setting of NATIVE_LIB_DIRS to... * configure.tgt: ... here. Use ${target} instead of ${host} for NATIVE_LIB_DIRS. * configure.in: Add --with-sysroot. * configure: Regenerated. * genscripts.sh: Accept use_sysroot option. Set new variables NATIVE and USE_LIBPATH. Prepend "=" to directory names if $use_sysroot. Don't search $tool_lib if $use_sysroot. * ldfile.c (ldfile_add_library_path): Handle leading '='. * ldmain.c (TARGET_SYSTEM_ROOT): Define if not defined. (ld_sysroot): New variable. (main): Initialize ld_sysroot. * ldmain.h (ld_sysroot): New extern. * emultempl/elf32.em: Use NATIVE and USE_LIBPATH instead of searching $EMULATION_LIBPATH. (gld${EMULATION_NAME}_add_sysroot): New function. (gld${EMULATION_NAME}_check_ld_so_conf): Use it. Honor ld_sysroot. (gld${EMULATION_NAME}_after_open): Likewise. Only search environment variables if $NATIVE. * ld.texinfo (Options): Mention "=" prefix in the description of -L. * NEWS: Mention --with-sysroot. * emulparams/elf32bmipn32-defs.sh: Set NATIVE and LIBPATH_SUFFIX instead of setting LIB_PATH. * emulparams/elf32ppc.sh: Likewise. * emulparams/elf64_s390.sh: Likewise. * emulparams/elf64_sparc.sh: Likewise. * emulparams/elf64ppc.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/elf64_aix.sh: Add "=" prefixes to LIB_PATH. * emulparams/elf64hppa.sh: Add "=" prefixes to LIB_PATH.
2003-01-06 17:14:01 +01:00
fi
1999-05-03 09:29:11 +02:00
case :${lib_path1}:${lib_path2}: in
*:: | ::*) LIB_PATH=${lib_path1}${lib_path2} ;;
*) LIB_PATH=${lib_path1}:${lib_path2} ;;
esac
LIB_SEARCH_DIRS=`echo ${LIB_PATH} | sed -e 's/:/ /g' -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\\"\1\\");/g'`
1999-05-03 09:29:11 +02:00
# We need it for testsuite.
set $EMULATION_LIBPATH
if [ "x$1" = "x$EMULATION_NAME" ]; then
test -d tmpdir || mkdir tmpdir
rm -f tmpdir/libpath.exp
echo "set libpath \"${LIB_PATH}\"" | sed -e 's/:/ /g' > tmpdir/libpath.exp
fi
* elf-bfd.h (enum elf_reloc_type_class): New. (struct elf_backend_data): Add elf_backend_reloc_type_class. (_bfd_elf_reloc_type_class): New. * elfxx-target.h (elf_backend_reloc_type_class): Define. (elfNN_bed): Add elf_backend_reloc_type_class. * elf.c (_bfd_elf_reloc_type_class): New. * elf32-i386.c (elf_i386_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (elf_i386_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (elf_i386_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elf32-sparc.c (elf32_sparc_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (elf32_sparc_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (elf32_sparc_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elf64-sparc.c (sparc64_elf_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (sparc64_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (sparc64_elf_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add reltext field. (elfNN_ia64_hash_table_create): Clear ia64_info. (get_reloc_section): Set DF_TEXTREL if the reloc is against read-only section. (elfNN_ia64_size_dynamic_sections): Use ia64_info->reltext flag instead of looking up section names for DT_TEXTREL. (elfNN_ia64_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elflink.h (size_dynamic_sections): Add spare DT_NULL tags. (struct elf_link_sort_rela): New. (elf_link_sort_cmp1, elf_link_sort_cmp2, elf_link_sort_relocs): New. (elf_bfd_final_link): Call elf_link_sort_relocs. Convert one spare DT_NULL into DT_RELCOUNT resp. DT_RELACOUNT if necessary. * bfdlink.h (struct bfd_link_info): Add combreloc and spare_dynamic_tags fields. * emultempl/elf32.em (place_orphan): Place orphan .rel* sections into .rel.dyn resp. .rela.dyn if combreloc. (get_script): If .x linker script is equal to .xn, only put it once into the binary. Add .xc and .xsc scripts. (parse_args): Handle -z combreloc and -z nocombreloc. * scripttempl/elf.sc (.rela.sbss): Fix a typo. For .xc and .xsc scripts put all .rel* or .rela* input sections but .rel*.plt and PLT-like sections into .rel.dyn resp. .rela.dyn. * genscripts.sh (GENERATE_COMBRELOC_SCRIPT): Set if SCRIPT_NAME is elf. Strip trailing whitespace from script. Generate .xc and .xsc scripts if requested. * ldmain.c (main): Initialize link_info.combreloc and link_info.spare_dynamic_tags. * lexsup.c (OPTION_SPARE_DYNAMIC_TAGS): Define. (ld_options): Add --spare-dynamic-tags option. (parse_args): Likewise. * ld.texinfo: Document -z combreloc and -z nocombreloc. * ldint.texinfo: Document .xc and .xsc linker scripts. * NEWS: Add notes about -z combreloc and SHF_MERGE.
2001-08-23 17:14:18 +02:00
if [ "x$SCRIPT_NAME" = "xelf" ]; then
GENERATE_COMBRELOC_SCRIPT=yes
fi
1999-05-03 09:29:11 +02:00
SEGMENT_SIZE=${SEGMENT_SIZE-${MAXPAGESIZE-${TARGET_PAGE_SIZE}}}
1999-05-03 09:29:11 +02:00
# Determine DATA_ALIGNMENT for the 5 variants, using
# values specified in the emulparams/<script_to_run>.sh file or default.
1999-05-03 09:29:11 +02:00
DATA_ALIGNMENT_="${DATA_ALIGNMENT_-${DATA_ALIGNMENT-ALIGN(${SEGMENT_SIZE})}}"
DATA_ALIGNMENT_n="${DATA_ALIGNMENT_n-${DATA_ALIGNMENT_}}"
DATA_ALIGNMENT_N="${DATA_ALIGNMENT_N-${DATA_ALIGNMENT-.}}"
DATA_ALIGNMENT_r="${DATA_ALIGNMENT_r-${DATA_ALIGNMENT-}}"
DATA_ALIGNMENT_u="${DATA_ALIGNMENT_u-${DATA_ALIGNMENT_r}}"
LD_FLAG=r
DATA_ALIGNMENT=${DATA_ALIGNMENT_r}
DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})"
( echo "/* Script for -r */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
ld whitespace fixes * pe-dll.c: Formatting, whitespace fixes. * NEWS: Whitespace fixes. * configure.ac: Likewise. * configure.tgt: Likewise. * deffilep.y: Likewise. * genscripts.sh: Likewise. * ld.texinfo: Likewise. * ldgram.y: Likewise. * ldlang.c: Likewise. * ldlex.l: Likewise. * lexsup.c: Likewise. * plugin.c: Likewise. * emulparams/arc-endianness.sh: Likewise. * emulparams/elf32_x86_64.sh: Likewise. * emulparams/elf64mmix.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/h8300elf.sh: Likewise. * emulparams/h8300elf_linux.sh: Likewise. * emulparams/vxworks.sh: Likewise. * emultempl/aarch64elf.em: Likewise. * emultempl/aix.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/metagelf.em: Likewise. * emultempl/msp430.em: Likewise. * emultempl/nds32elf.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spu_ovl.S: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/tic6xdsbt.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vms.em: Likewise. * po/Make-in: Likewise. * scripttempl/DWARF.sc: Likewise. * scripttempl/aix.sc: Likewise. * scripttempl/alpha.sc: Likewise. * scripttempl/alphavms.sc: Likewise. * scripttempl/aout.sc: Likewise. * scripttempl/arclinux.sc: Likewise. * scripttempl/armaout.sc: Likewise. * scripttempl/armbpabi.sc: Likewise. * scripttempl/armcoff.sc: Likewise. * scripttempl/avr.sc: Likewise. * scripttempl/crisaout.sc: Likewise. * scripttempl/delta68.sc: Likewise. * scripttempl/dlx.sc: Likewise. * scripttempl/elf.sc: Likewise. * scripttempl/elf32cr16.sc: Likewise. * scripttempl/elf32cr16c.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/elf32msp430.sc: Likewise. * scripttempl/elf32msp430_3.sc: Likewise. * scripttempl/elf32sh-symbian.sc: Likewise. * scripttempl/elf32xc16x.sc: Likewise. * scripttempl/elf32xc16xl.sc: Likewise. * scripttempl/elf32xc16xs.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/elfarc.sc: Likewise. * scripttempl/elfarcv2.sc: Likewise. * scripttempl/elfd10v.sc: Likewise. * scripttempl/elfd30v.sc: Likewise. * scripttempl/elfi370.sc: Likewise. * scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. * scripttempl/elfmicroblaze.sc: Likewise. * scripttempl/elfxgate.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/epiphany_4x4.sc: Likewise. * scripttempl/epocpe.sc: Likewise. * scripttempl/h8300.sc: Likewise. * scripttempl/h8300h.sc: Likewise. * scripttempl/h8300hn.sc: Likewise. * scripttempl/h8300s.sc: Likewise. * scripttempl/h8300sn.sc: Likewise. * scripttempl/h8300sx.sc: Likewise. * scripttempl/h8300sxn.sc: Likewise. * scripttempl/h8500.sc: Likewise. * scripttempl/h8500b.sc: Likewise. * scripttempl/h8500c.sc: Likewise. * scripttempl/h8500m.sc: Likewise. * scripttempl/h8500s.sc: Likewise. * scripttempl/hppaelf.sc: Likewise. * scripttempl/i386beos.sc: Likewise. * scripttempl/i386coff.sc: Likewise. * scripttempl/i386go32.sc: Likewise. * scripttempl/i386msdos.sc: Likewise. * scripttempl/i860coff.sc: Likewise. * scripttempl/i960.sc: Likewise. * scripttempl/ia64vms.sc: Likewise. * scripttempl/ip2k.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/m68kaux.sc: Likewise. * scripttempl/m68kcoff.sc: Likewise. * scripttempl/m88kbcs.sc: Likewise. * scripttempl/mcorepe.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/mips.sc: Likewise. * scripttempl/mipsbsd.sc: Likewise. * scripttempl/mmo.sc: Likewise. * scripttempl/moxie.sc: Likewise. * scripttempl/nds32elf.sc: Likewise. * scripttempl/nw.sc: Likewise. * scripttempl/pe.sc: Likewise. * scripttempl/pep.sc: Likewise. * scripttempl/pj.sc: Likewise. * scripttempl/ppcpe.sc: Likewise. * scripttempl/psos.sc: Likewise. * scripttempl/riscix.sc: Likewise. * scripttempl/sh.sc: Likewise. * scripttempl/sparccoff.sc: Likewise. * scripttempl/st2000.sc: Likewise. * scripttempl/tic30aout.sc: Likewise. * scripttempl/tic30coff.sc: Likewise. * scripttempl/tic4xcoff.sc: Likewise. * scripttempl/tic54xcoff.sc: Likewise. * scripttempl/tic80coff.sc: Likewise. * scripttempl/v850.sc: Likewise. * scripttempl/v850_rh850.sc: Likewise. * scripttempl/vanilla.sc: Likewise. * scripttempl/visium.sc: Likewise. * scripttempl/w65.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. * scripttempl/z80.sc: Likewise. * scripttempl/z8000.sc: Likewise. * configure: Regenerate.
2017-10-12 12:58:30 +02:00
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xr
1999-05-03 09:29:11 +02:00
LD_FLAG=u
DATA_ALIGNMENT=${DATA_ALIGNMENT_u}
CONSTRUCTING=" "
( echo "/* Script for -Ur */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
ld whitespace fixes * pe-dll.c: Formatting, whitespace fixes. * NEWS: Whitespace fixes. * configure.ac: Likewise. * configure.tgt: Likewise. * deffilep.y: Likewise. * genscripts.sh: Likewise. * ld.texinfo: Likewise. * ldgram.y: Likewise. * ldlang.c: Likewise. * ldlex.l: Likewise. * lexsup.c: Likewise. * plugin.c: Likewise. * emulparams/arc-endianness.sh: Likewise. * emulparams/elf32_x86_64.sh: Likewise. * emulparams/elf64mmix.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/h8300elf.sh: Likewise. * emulparams/h8300elf_linux.sh: Likewise. * emulparams/vxworks.sh: Likewise. * emultempl/aarch64elf.em: Likewise. * emultempl/aix.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/metagelf.em: Likewise. * emultempl/msp430.em: Likewise. * emultempl/nds32elf.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spu_ovl.S: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/tic6xdsbt.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vms.em: Likewise. * po/Make-in: Likewise. * scripttempl/DWARF.sc: Likewise. * scripttempl/aix.sc: Likewise. * scripttempl/alpha.sc: Likewise. * scripttempl/alphavms.sc: Likewise. * scripttempl/aout.sc: Likewise. * scripttempl/arclinux.sc: Likewise. * scripttempl/armaout.sc: Likewise. * scripttempl/armbpabi.sc: Likewise. * scripttempl/armcoff.sc: Likewise. * scripttempl/avr.sc: Likewise. * scripttempl/crisaout.sc: Likewise. * scripttempl/delta68.sc: Likewise. * scripttempl/dlx.sc: Likewise. * scripttempl/elf.sc: Likewise. * scripttempl/elf32cr16.sc: Likewise. * scripttempl/elf32cr16c.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/elf32msp430.sc: Likewise. * scripttempl/elf32msp430_3.sc: Likewise. * scripttempl/elf32sh-symbian.sc: Likewise. * scripttempl/elf32xc16x.sc: Likewise. * scripttempl/elf32xc16xl.sc: Likewise. * scripttempl/elf32xc16xs.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/elfarc.sc: Likewise. * scripttempl/elfarcv2.sc: Likewise. * scripttempl/elfd10v.sc: Likewise. * scripttempl/elfd30v.sc: Likewise. * scripttempl/elfi370.sc: Likewise. * scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. * scripttempl/elfmicroblaze.sc: Likewise. * scripttempl/elfxgate.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/epiphany_4x4.sc: Likewise. * scripttempl/epocpe.sc: Likewise. * scripttempl/h8300.sc: Likewise. * scripttempl/h8300h.sc: Likewise. * scripttempl/h8300hn.sc: Likewise. * scripttempl/h8300s.sc: Likewise. * scripttempl/h8300sn.sc: Likewise. * scripttempl/h8300sx.sc: Likewise. * scripttempl/h8300sxn.sc: Likewise. * scripttempl/h8500.sc: Likewise. * scripttempl/h8500b.sc: Likewise. * scripttempl/h8500c.sc: Likewise. * scripttempl/h8500m.sc: Likewise. * scripttempl/h8500s.sc: Likewise. * scripttempl/hppaelf.sc: Likewise. * scripttempl/i386beos.sc: Likewise. * scripttempl/i386coff.sc: Likewise. * scripttempl/i386go32.sc: Likewise. * scripttempl/i386msdos.sc: Likewise. * scripttempl/i860coff.sc: Likewise. * scripttempl/i960.sc: Likewise. * scripttempl/ia64vms.sc: Likewise. * scripttempl/ip2k.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/m68kaux.sc: Likewise. * scripttempl/m68kcoff.sc: Likewise. * scripttempl/m88kbcs.sc: Likewise. * scripttempl/mcorepe.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/mips.sc: Likewise. * scripttempl/mipsbsd.sc: Likewise. * scripttempl/mmo.sc: Likewise. * scripttempl/moxie.sc: Likewise. * scripttempl/nds32elf.sc: Likewise. * scripttempl/nw.sc: Likewise. * scripttempl/pe.sc: Likewise. * scripttempl/pep.sc: Likewise. * scripttempl/pj.sc: Likewise. * scripttempl/ppcpe.sc: Likewise. * scripttempl/psos.sc: Likewise. * scripttempl/riscix.sc: Likewise. * scripttempl/sh.sc: Likewise. * scripttempl/sparccoff.sc: Likewise. * scripttempl/st2000.sc: Likewise. * scripttempl/tic30aout.sc: Likewise. * scripttempl/tic30coff.sc: Likewise. * scripttempl/tic4xcoff.sc: Likewise. * scripttempl/tic54xcoff.sc: Likewise. * scripttempl/tic80coff.sc: Likewise. * scripttempl/v850.sc: Likewise. * scripttempl/v850_rh850.sc: Likewise. * scripttempl/vanilla.sc: Likewise. * scripttempl/visium.sc: Likewise. * scripttempl/w65.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. * scripttempl/z80.sc: Likewise. * scripttempl/z8000.sc: Likewise. * configure: Regenerate.
2017-10-12 12:58:30 +02:00
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xu
1999-05-03 09:29:11 +02:00
DATA_ALIGNMENT=${DATA_ALIGNMENT_}
RELOCATING=" "
LD_FLAG=
( echo "/* Default linker script, for normal executables */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
ld whitespace fixes * pe-dll.c: Formatting, whitespace fixes. * NEWS: Whitespace fixes. * configure.ac: Likewise. * configure.tgt: Likewise. * deffilep.y: Likewise. * genscripts.sh: Likewise. * ld.texinfo: Likewise. * ldgram.y: Likewise. * ldlang.c: Likewise. * ldlex.l: Likewise. * lexsup.c: Likewise. * plugin.c: Likewise. * emulparams/arc-endianness.sh: Likewise. * emulparams/elf32_x86_64.sh: Likewise. * emulparams/elf64mmix.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/h8300elf.sh: Likewise. * emulparams/h8300elf_linux.sh: Likewise. * emulparams/vxworks.sh: Likewise. * emultempl/aarch64elf.em: Likewise. * emultempl/aix.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/metagelf.em: Likewise. * emultempl/msp430.em: Likewise. * emultempl/nds32elf.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spu_ovl.S: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/tic6xdsbt.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vms.em: Likewise. * po/Make-in: Likewise. * scripttempl/DWARF.sc: Likewise. * scripttempl/aix.sc: Likewise. * scripttempl/alpha.sc: Likewise. * scripttempl/alphavms.sc: Likewise. * scripttempl/aout.sc: Likewise. * scripttempl/arclinux.sc: Likewise. * scripttempl/armaout.sc: Likewise. * scripttempl/armbpabi.sc: Likewise. * scripttempl/armcoff.sc: Likewise. * scripttempl/avr.sc: Likewise. * scripttempl/crisaout.sc: Likewise. * scripttempl/delta68.sc: Likewise. * scripttempl/dlx.sc: Likewise. * scripttempl/elf.sc: Likewise. * scripttempl/elf32cr16.sc: Likewise. * scripttempl/elf32cr16c.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/elf32msp430.sc: Likewise. * scripttempl/elf32msp430_3.sc: Likewise. * scripttempl/elf32sh-symbian.sc: Likewise. * scripttempl/elf32xc16x.sc: Likewise. * scripttempl/elf32xc16xl.sc: Likewise. * scripttempl/elf32xc16xs.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/elfarc.sc: Likewise. * scripttempl/elfarcv2.sc: Likewise. * scripttempl/elfd10v.sc: Likewise. * scripttempl/elfd30v.sc: Likewise. * scripttempl/elfi370.sc: Likewise. * scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. * scripttempl/elfmicroblaze.sc: Likewise. * scripttempl/elfxgate.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/epiphany_4x4.sc: Likewise. * scripttempl/epocpe.sc: Likewise. * scripttempl/h8300.sc: Likewise. * scripttempl/h8300h.sc: Likewise. * scripttempl/h8300hn.sc: Likewise. * scripttempl/h8300s.sc: Likewise. * scripttempl/h8300sn.sc: Likewise. * scripttempl/h8300sx.sc: Likewise. * scripttempl/h8300sxn.sc: Likewise. * scripttempl/h8500.sc: Likewise. * scripttempl/h8500b.sc: Likewise. * scripttempl/h8500c.sc: Likewise. * scripttempl/h8500m.sc: Likewise. * scripttempl/h8500s.sc: Likewise. * scripttempl/hppaelf.sc: Likewise. * scripttempl/i386beos.sc: Likewise. * scripttempl/i386coff.sc: Likewise. * scripttempl/i386go32.sc: Likewise. * scripttempl/i386msdos.sc: Likewise. * scripttempl/i860coff.sc: Likewise. * scripttempl/i960.sc: Likewise. * scripttempl/ia64vms.sc: Likewise. * scripttempl/ip2k.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/m68kaux.sc: Likewise. * scripttempl/m68kcoff.sc: Likewise. * scripttempl/m88kbcs.sc: Likewise. * scripttempl/mcorepe.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/mips.sc: Likewise. * scripttempl/mipsbsd.sc: Likewise. * scripttempl/mmo.sc: Likewise. * scripttempl/moxie.sc: Likewise. * scripttempl/nds32elf.sc: Likewise. * scripttempl/nw.sc: Likewise. * scripttempl/pe.sc: Likewise. * scripttempl/pep.sc: Likewise. * scripttempl/pj.sc: Likewise. * scripttempl/ppcpe.sc: Likewise. * scripttempl/psos.sc: Likewise. * scripttempl/riscix.sc: Likewise. * scripttempl/sh.sc: Likewise. * scripttempl/sparccoff.sc: Likewise. * scripttempl/st2000.sc: Likewise. * scripttempl/tic30aout.sc: Likewise. * scripttempl/tic30coff.sc: Likewise. * scripttempl/tic4xcoff.sc: Likewise. * scripttempl/tic54xcoff.sc: Likewise. * scripttempl/tic80coff.sc: Likewise. * scripttempl/v850.sc: Likewise. * scripttempl/v850_rh850.sc: Likewise. * scripttempl/vanilla.sc: Likewise. * scripttempl/visium.sc: Likewise. * scripttempl/w65.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. * scripttempl/z80.sc: Likewise. * scripttempl/z8000.sc: Likewise. * configure: Regenerate.
2017-10-12 12:58:30 +02:00
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.x
1999-05-03 09:29:11 +02:00
LD_FLAG=textonly
( echo "/* Script for -z separate-code */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xe
if test -n "$GENERATE_RELRO_SCRIPT"; then
LD_FLAG=
RELRO=" "
( echo "/* Script for -z relro */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xo
LD_FLAG=textonly
( echo "/* Script for -z separate-code -z relro */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xeo
unset RELRO
fi
1999-05-03 09:29:11 +02:00
LD_FLAG=n
DATA_ALIGNMENT=${DATA_ALIGNMENT_n}
( echo "/* Script for -n */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
ld whitespace fixes * pe-dll.c: Formatting, whitespace fixes. * NEWS: Whitespace fixes. * configure.ac: Likewise. * configure.tgt: Likewise. * deffilep.y: Likewise. * genscripts.sh: Likewise. * ld.texinfo: Likewise. * ldgram.y: Likewise. * ldlang.c: Likewise. * ldlex.l: Likewise. * lexsup.c: Likewise. * plugin.c: Likewise. * emulparams/arc-endianness.sh: Likewise. * emulparams/elf32_x86_64.sh: Likewise. * emulparams/elf64mmix.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/h8300elf.sh: Likewise. * emulparams/h8300elf_linux.sh: Likewise. * emulparams/vxworks.sh: Likewise. * emultempl/aarch64elf.em: Likewise. * emultempl/aix.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/metagelf.em: Likewise. * emultempl/msp430.em: Likewise. * emultempl/nds32elf.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spu_ovl.S: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/tic6xdsbt.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vms.em: Likewise. * po/Make-in: Likewise. * scripttempl/DWARF.sc: Likewise. * scripttempl/aix.sc: Likewise. * scripttempl/alpha.sc: Likewise. * scripttempl/alphavms.sc: Likewise. * scripttempl/aout.sc: Likewise. * scripttempl/arclinux.sc: Likewise. * scripttempl/armaout.sc: Likewise. * scripttempl/armbpabi.sc: Likewise. * scripttempl/armcoff.sc: Likewise. * scripttempl/avr.sc: Likewise. * scripttempl/crisaout.sc: Likewise. * scripttempl/delta68.sc: Likewise. * scripttempl/dlx.sc: Likewise. * scripttempl/elf.sc: Likewise. * scripttempl/elf32cr16.sc: Likewise. * scripttempl/elf32cr16c.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/elf32msp430.sc: Likewise. * scripttempl/elf32msp430_3.sc: Likewise. * scripttempl/elf32sh-symbian.sc: Likewise. * scripttempl/elf32xc16x.sc: Likewise. * scripttempl/elf32xc16xl.sc: Likewise. * scripttempl/elf32xc16xs.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/elfarc.sc: Likewise. * scripttempl/elfarcv2.sc: Likewise. * scripttempl/elfd10v.sc: Likewise. * scripttempl/elfd30v.sc: Likewise. * scripttempl/elfi370.sc: Likewise. * scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. * scripttempl/elfmicroblaze.sc: Likewise. * scripttempl/elfxgate.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/epiphany_4x4.sc: Likewise. * scripttempl/epocpe.sc: Likewise. * scripttempl/h8300.sc: Likewise. * scripttempl/h8300h.sc: Likewise. * scripttempl/h8300hn.sc: Likewise. * scripttempl/h8300s.sc: Likewise. * scripttempl/h8300sn.sc: Likewise. * scripttempl/h8300sx.sc: Likewise. * scripttempl/h8300sxn.sc: Likewise. * scripttempl/h8500.sc: Likewise. * scripttempl/h8500b.sc: Likewise. * scripttempl/h8500c.sc: Likewise. * scripttempl/h8500m.sc: Likewise. * scripttempl/h8500s.sc: Likewise. * scripttempl/hppaelf.sc: Likewise. * scripttempl/i386beos.sc: Likewise. * scripttempl/i386coff.sc: Likewise. * scripttempl/i386go32.sc: Likewise. * scripttempl/i386msdos.sc: Likewise. * scripttempl/i860coff.sc: Likewise. * scripttempl/i960.sc: Likewise. * scripttempl/ia64vms.sc: Likewise. * scripttempl/ip2k.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/m68kaux.sc: Likewise. * scripttempl/m68kcoff.sc: Likewise. * scripttempl/m88kbcs.sc: Likewise. * scripttempl/mcorepe.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/mips.sc: Likewise. * scripttempl/mipsbsd.sc: Likewise. * scripttempl/mmo.sc: Likewise. * scripttempl/moxie.sc: Likewise. * scripttempl/nds32elf.sc: Likewise. * scripttempl/nw.sc: Likewise. * scripttempl/pe.sc: Likewise. * scripttempl/pep.sc: Likewise. * scripttempl/pj.sc: Likewise. * scripttempl/ppcpe.sc: Likewise. * scripttempl/psos.sc: Likewise. * scripttempl/riscix.sc: Likewise. * scripttempl/sh.sc: Likewise. * scripttempl/sparccoff.sc: Likewise. * scripttempl/st2000.sc: Likewise. * scripttempl/tic30aout.sc: Likewise. * scripttempl/tic30coff.sc: Likewise. * scripttempl/tic4xcoff.sc: Likewise. * scripttempl/tic54xcoff.sc: Likewise. * scripttempl/tic80coff.sc: Likewise. * scripttempl/v850.sc: Likewise. * scripttempl/v850_rh850.sc: Likewise. * scripttempl/vanilla.sc: Likewise. * scripttempl/visium.sc: Likewise. * scripttempl/w65.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. * scripttempl/z80.sc: Likewise. * scripttempl/z8000.sc: Likewise. * configure: Regenerate.
2017-10-12 12:58:30 +02:00
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xn
1999-05-03 09:29:11 +02:00
LD_FLAG=N
DATA_ALIGNMENT=${DATA_ALIGNMENT_N}
( echo "/* Script for -N */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
ld whitespace fixes * pe-dll.c: Formatting, whitespace fixes. * NEWS: Whitespace fixes. * configure.ac: Likewise. * configure.tgt: Likewise. * deffilep.y: Likewise. * genscripts.sh: Likewise. * ld.texinfo: Likewise. * ldgram.y: Likewise. * ldlang.c: Likewise. * ldlex.l: Likewise. * lexsup.c: Likewise. * plugin.c: Likewise. * emulparams/arc-endianness.sh: Likewise. * emulparams/elf32_x86_64.sh: Likewise. * emulparams/elf64mmix.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/h8300elf.sh: Likewise. * emulparams/h8300elf_linux.sh: Likewise. * emulparams/vxworks.sh: Likewise. * emultempl/aarch64elf.em: Likewise. * emultempl/aix.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/metagelf.em: Likewise. * emultempl/msp430.em: Likewise. * emultempl/nds32elf.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spu_ovl.S: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/tic6xdsbt.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vms.em: Likewise. * po/Make-in: Likewise. * scripttempl/DWARF.sc: Likewise. * scripttempl/aix.sc: Likewise. * scripttempl/alpha.sc: Likewise. * scripttempl/alphavms.sc: Likewise. * scripttempl/aout.sc: Likewise. * scripttempl/arclinux.sc: Likewise. * scripttempl/armaout.sc: Likewise. * scripttempl/armbpabi.sc: Likewise. * scripttempl/armcoff.sc: Likewise. * scripttempl/avr.sc: Likewise. * scripttempl/crisaout.sc: Likewise. * scripttempl/delta68.sc: Likewise. * scripttempl/dlx.sc: Likewise. * scripttempl/elf.sc: Likewise. * scripttempl/elf32cr16.sc: Likewise. * scripttempl/elf32cr16c.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/elf32msp430.sc: Likewise. * scripttempl/elf32msp430_3.sc: Likewise. * scripttempl/elf32sh-symbian.sc: Likewise. * scripttempl/elf32xc16x.sc: Likewise. * scripttempl/elf32xc16xl.sc: Likewise. * scripttempl/elf32xc16xs.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/elfarc.sc: Likewise. * scripttempl/elfarcv2.sc: Likewise. * scripttempl/elfd10v.sc: Likewise. * scripttempl/elfd30v.sc: Likewise. * scripttempl/elfi370.sc: Likewise. * scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. * scripttempl/elfmicroblaze.sc: Likewise. * scripttempl/elfxgate.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/epiphany_4x4.sc: Likewise. * scripttempl/epocpe.sc: Likewise. * scripttempl/h8300.sc: Likewise. * scripttempl/h8300h.sc: Likewise. * scripttempl/h8300hn.sc: Likewise. * scripttempl/h8300s.sc: Likewise. * scripttempl/h8300sn.sc: Likewise. * scripttempl/h8300sx.sc: Likewise. * scripttempl/h8300sxn.sc: Likewise. * scripttempl/h8500.sc: Likewise. * scripttempl/h8500b.sc: Likewise. * scripttempl/h8500c.sc: Likewise. * scripttempl/h8500m.sc: Likewise. * scripttempl/h8500s.sc: Likewise. * scripttempl/hppaelf.sc: Likewise. * scripttempl/i386beos.sc: Likewise. * scripttempl/i386coff.sc: Likewise. * scripttempl/i386go32.sc: Likewise. * scripttempl/i386msdos.sc: Likewise. * scripttempl/i860coff.sc: Likewise. * scripttempl/i960.sc: Likewise. * scripttempl/ia64vms.sc: Likewise. * scripttempl/ip2k.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/m68kaux.sc: Likewise. * scripttempl/m68kcoff.sc: Likewise. * scripttempl/m88kbcs.sc: Likewise. * scripttempl/mcorepe.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/mips.sc: Likewise. * scripttempl/mipsbsd.sc: Likewise. * scripttempl/mmo.sc: Likewise. * scripttempl/moxie.sc: Likewise. * scripttempl/nds32elf.sc: Likewise. * scripttempl/nw.sc: Likewise. * scripttempl/pe.sc: Likewise. * scripttempl/pep.sc: Likewise. * scripttempl/pj.sc: Likewise. * scripttempl/ppcpe.sc: Likewise. * scripttempl/psos.sc: Likewise. * scripttempl/riscix.sc: Likewise. * scripttempl/sh.sc: Likewise. * scripttempl/sparccoff.sc: Likewise. * scripttempl/st2000.sc: Likewise. * scripttempl/tic30aout.sc: Likewise. * scripttempl/tic30coff.sc: Likewise. * scripttempl/tic4xcoff.sc: Likewise. * scripttempl/tic54xcoff.sc: Likewise. * scripttempl/tic80coff.sc: Likewise. * scripttempl/v850.sc: Likewise. * scripttempl/v850_rh850.sc: Likewise. * scripttempl/vanilla.sc: Likewise. * scripttempl/visium.sc: Likewise. * scripttempl/w65.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. * scripttempl/z80.sc: Likewise. * scripttempl/z8000.sc: Likewise. * configure: Regenerate.
2017-10-12 12:58:30 +02:00
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xbn
* elf-bfd.h (enum elf_reloc_type_class): New. (struct elf_backend_data): Add elf_backend_reloc_type_class. (_bfd_elf_reloc_type_class): New. * elfxx-target.h (elf_backend_reloc_type_class): Define. (elfNN_bed): Add elf_backend_reloc_type_class. * elf.c (_bfd_elf_reloc_type_class): New. * elf32-i386.c (elf_i386_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (elf_i386_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (elf_i386_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elf32-sparc.c (elf32_sparc_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (elf32_sparc_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (elf32_sparc_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elf64-sparc.c (sparc64_elf_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (sparc64_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (sparc64_elf_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add reltext field. (elfNN_ia64_hash_table_create): Clear ia64_info. (get_reloc_section): Set DF_TEXTREL if the reloc is against read-only section. (elfNN_ia64_size_dynamic_sections): Use ia64_info->reltext flag instead of looking up section names for DT_TEXTREL. (elfNN_ia64_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elflink.h (size_dynamic_sections): Add spare DT_NULL tags. (struct elf_link_sort_rela): New. (elf_link_sort_cmp1, elf_link_sort_cmp2, elf_link_sort_relocs): New. (elf_bfd_final_link): Call elf_link_sort_relocs. Convert one spare DT_NULL into DT_RELCOUNT resp. DT_RELACOUNT if necessary. * bfdlink.h (struct bfd_link_info): Add combreloc and spare_dynamic_tags fields. * emultempl/elf32.em (place_orphan): Place orphan .rel* sections into .rel.dyn resp. .rela.dyn if combreloc. (get_script): If .x linker script is equal to .xn, only put it once into the binary. Add .xc and .xsc scripts. (parse_args): Handle -z combreloc and -z nocombreloc. * scripttempl/elf.sc (.rela.sbss): Fix a typo. For .xc and .xsc scripts put all .rel* or .rela* input sections but .rel*.plt and PLT-like sections into .rel.dyn resp. .rela.dyn. * genscripts.sh (GENERATE_COMBRELOC_SCRIPT): Set if SCRIPT_NAME is elf. Strip trailing whitespace from script. Generate .xc and .xsc scripts if requested. * ldmain.c (main): Initialize link_info.combreloc and link_info.spare_dynamic_tags. * lexsup.c (OPTION_SPARE_DYNAMIC_TAGS): Define. (ld_options): Add --spare-dynamic-tags option. (parse_args): Likewise. * ld.texinfo: Document -z combreloc and -z nocombreloc. * ldint.texinfo: Document .xc and .xsc linker scripts. * NEWS: Add notes about -z combreloc and SHF_MERGE.
2001-08-23 17:14:18 +02:00
if test -n "$GENERATE_COMBRELOC_SCRIPT"; then
DATA_ALIGNMENT=${DATA_ALIGNMENT_c-${DATA_ALIGNMENT_}}
LD_FLAG=c
COMBRELOC=ldscripts/${EMULATION_NAME}.xc.tmp
( echo "/* Script for -z combreloc */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
ld whitespace fixes * pe-dll.c: Formatting, whitespace fixes. * NEWS: Whitespace fixes. * configure.ac: Likewise. * configure.tgt: Likewise. * deffilep.y: Likewise. * genscripts.sh: Likewise. * ld.texinfo: Likewise. * ldgram.y: Likewise. * ldlang.c: Likewise. * ldlex.l: Likewise. * lexsup.c: Likewise. * plugin.c: Likewise. * emulparams/arc-endianness.sh: Likewise. * emulparams/elf32_x86_64.sh: Likewise. * emulparams/elf64mmix.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/h8300elf.sh: Likewise. * emulparams/h8300elf_linux.sh: Likewise. * emulparams/vxworks.sh: Likewise. * emultempl/aarch64elf.em: Likewise. * emultempl/aix.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/metagelf.em: Likewise. * emultempl/msp430.em: Likewise. * emultempl/nds32elf.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spu_ovl.S: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/tic6xdsbt.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vms.em: Likewise. * po/Make-in: Likewise. * scripttempl/DWARF.sc: Likewise. * scripttempl/aix.sc: Likewise. * scripttempl/alpha.sc: Likewise. * scripttempl/alphavms.sc: Likewise. * scripttempl/aout.sc: Likewise. * scripttempl/arclinux.sc: Likewise. * scripttempl/armaout.sc: Likewise. * scripttempl/armbpabi.sc: Likewise. * scripttempl/armcoff.sc: Likewise. * scripttempl/avr.sc: Likewise. * scripttempl/crisaout.sc: Likewise. * scripttempl/delta68.sc: Likewise. * scripttempl/dlx.sc: Likewise. * scripttempl/elf.sc: Likewise. * scripttempl/elf32cr16.sc: Likewise. * scripttempl/elf32cr16c.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/elf32msp430.sc: Likewise. * scripttempl/elf32msp430_3.sc: Likewise. * scripttempl/elf32sh-symbian.sc: Likewise. * scripttempl/elf32xc16x.sc: Likewise. * scripttempl/elf32xc16xl.sc: Likewise. * scripttempl/elf32xc16xs.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/elfarc.sc: Likewise. * scripttempl/elfarcv2.sc: Likewise. * scripttempl/elfd10v.sc: Likewise. * scripttempl/elfd30v.sc: Likewise. * scripttempl/elfi370.sc: Likewise. * scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. * scripttempl/elfmicroblaze.sc: Likewise. * scripttempl/elfxgate.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/epiphany_4x4.sc: Likewise. * scripttempl/epocpe.sc: Likewise. * scripttempl/h8300.sc: Likewise. * scripttempl/h8300h.sc: Likewise. * scripttempl/h8300hn.sc: Likewise. * scripttempl/h8300s.sc: Likewise. * scripttempl/h8300sn.sc: Likewise. * scripttempl/h8300sx.sc: Likewise. * scripttempl/h8300sxn.sc: Likewise. * scripttempl/h8500.sc: Likewise. * scripttempl/h8500b.sc: Likewise. * scripttempl/h8500c.sc: Likewise. * scripttempl/h8500m.sc: Likewise. * scripttempl/h8500s.sc: Likewise. * scripttempl/hppaelf.sc: Likewise. * scripttempl/i386beos.sc: Likewise. * scripttempl/i386coff.sc: Likewise. * scripttempl/i386go32.sc: Likewise. * scripttempl/i386msdos.sc: Likewise. * scripttempl/i860coff.sc: Likewise. * scripttempl/i960.sc: Likewise. * scripttempl/ia64vms.sc: Likewise. * scripttempl/ip2k.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/m68kaux.sc: Likewise. * scripttempl/m68kcoff.sc: Likewise. * scripttempl/m88kbcs.sc: Likewise. * scripttempl/mcorepe.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/mips.sc: Likewise. * scripttempl/mipsbsd.sc: Likewise. * scripttempl/mmo.sc: Likewise. * scripttempl/moxie.sc: Likewise. * scripttempl/nds32elf.sc: Likewise. * scripttempl/nw.sc: Likewise. * scripttempl/pe.sc: Likewise. * scripttempl/pep.sc: Likewise. * scripttempl/pj.sc: Likewise. * scripttempl/ppcpe.sc: Likewise. * scripttempl/psos.sc: Likewise. * scripttempl/riscix.sc: Likewise. * scripttempl/sh.sc: Likewise. * scripttempl/sparccoff.sc: Likewise. * scripttempl/st2000.sc: Likewise. * scripttempl/tic30aout.sc: Likewise. * scripttempl/tic30coff.sc: Likewise. * scripttempl/tic4xcoff.sc: Likewise. * scripttempl/tic54xcoff.sc: Likewise. * scripttempl/tic80coff.sc: Likewise. * scripttempl/v850.sc: Likewise. * scripttempl/v850_rh850.sc: Likewise. * scripttempl/vanilla.sc: Likewise. * scripttempl/visium.sc: Likewise. * scripttempl/w65.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. * scripttempl/z80.sc: Likewise. * scripttempl/z8000.sc: Likewise. * configure: Regenerate.
2017-10-12 12:58:30 +02:00
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xc
* elf-bfd.h (enum elf_reloc_type_class): New. (struct elf_backend_data): Add elf_backend_reloc_type_class. (_bfd_elf_reloc_type_class): New. * elfxx-target.h (elf_backend_reloc_type_class): Define. (elfNN_bed): Add elf_backend_reloc_type_class. * elf.c (_bfd_elf_reloc_type_class): New. * elf32-i386.c (elf_i386_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (elf_i386_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (elf_i386_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elf32-sparc.c (elf32_sparc_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (elf32_sparc_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (elf32_sparc_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elf64-sparc.c (sparc64_elf_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (sparc64_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (sparc64_elf_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add reltext field. (elfNN_ia64_hash_table_create): Clear ia64_info. (get_reloc_section): Set DF_TEXTREL if the reloc is against read-only section. (elfNN_ia64_size_dynamic_sections): Use ia64_info->reltext flag instead of looking up section names for DT_TEXTREL. (elfNN_ia64_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elflink.h (size_dynamic_sections): Add spare DT_NULL tags. (struct elf_link_sort_rela): New. (elf_link_sort_cmp1, elf_link_sort_cmp2, elf_link_sort_relocs): New. (elf_bfd_final_link): Call elf_link_sort_relocs. Convert one spare DT_NULL into DT_RELCOUNT resp. DT_RELACOUNT if necessary. * bfdlink.h (struct bfd_link_info): Add combreloc and spare_dynamic_tags fields. * emultempl/elf32.em (place_orphan): Place orphan .rel* sections into .rel.dyn resp. .rela.dyn if combreloc. (get_script): If .x linker script is equal to .xn, only put it once into the binary. Add .xc and .xsc scripts. (parse_args): Handle -z combreloc and -z nocombreloc. * scripttempl/elf.sc (.rela.sbss): Fix a typo. For .xc and .xsc scripts put all .rel* or .rela* input sections but .rel*.plt and PLT-like sections into .rel.dyn resp. .rela.dyn. * genscripts.sh (GENERATE_COMBRELOC_SCRIPT): Set if SCRIPT_NAME is elf. Strip trailing whitespace from script. Generate .xc and .xsc scripts if requested. * ldmain.c (main): Initialize link_info.combreloc and link_info.spare_dynamic_tags. * lexsup.c (OPTION_SPARE_DYNAMIC_TAGS): Define. (ld_options): Add --spare-dynamic-tags option. (parse_args): Likewise. * ld.texinfo: Document -z combreloc and -z nocombreloc. * ldint.texinfo: Document .xc and .xsc linker scripts. * NEWS: Add notes about -z combreloc and SHF_MERGE.
2001-08-23 17:14:18 +02:00
rm -f ${COMBRELOC}
LD_FLAG=ctextonly
COMBRELOC=ldscripts/${EMULATION_NAME}.xce.tmp
( echo "/* Script for -z combreloc -z separate-code */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xce
rm -f ${COMBRELOC}
bfd/ * elflink.c (elf_bfd_final_link): Don't output STT_SECTION symbol into .dynsym if elf_section_data (sec)->dynindx <= 0. Adjust counting of last_local. (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt created by the linker nor !SHF_ALLOC. * elf32-i386.c (elf_i386_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. Set sh_entsize for .got section in addition to .got.plt. (elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. (elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. Set sh_entsize for .got section in addition to .got.plt. * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO. (bfd_section_from_phdr): Likewise. (map_sections_to_segments): Likewise. (assign_file_positions_for_segments): Likewise. (get_program_header_size): Likewise. * elflink.c (bfd_elf_size_dynamic_sections): Set elf_tdata (output_bfd)->relro from info->relro. * elf-bfd.h (struct elf_obj_tdata): Add relro field. include/ * bfdlink.h (struct bfd_link_info): Add relro, relro_start and relro_end fields. * elf/common.h (PT_GNU_EH_FRAME, PT_GNU_STACK): Add comments. (PT_GNU_RELRO): Define. binutils/ * readelf.c (get_segment_type): Handle PT_GNU_RELRO. ld/ * genscripts.sh: Generate -z combreloc -z now -z relro scripts for binaries, -shared and -pie. * emulparams/elf_i386.sh (SEPARATE_GOTPLT): Set. * emulparams/elf_x86_64.sh (SEPARATE_GOTPLT): Set. * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Rename to... (OTHER_RELRO_SECTIONS): ... this. * ldlex.l (DATA_SEGMENT_RELRO_END): Add. * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Handle -z relro and -z norelro. (gld${EMULATION_NAME}_list_options): Add it to usage. (gld${EMULATION_NAME}_get_script): Return -z combreloc -z now -z relro scripts when appropriate. * scripttempl/elf.sc: Unset SEPARATE_GOTPLT if RELRO_NOW is set. Create separate .got.plt section if SEPARATE_GOTPLT. Move sections which are only written during relocation handling to the beginning of RW segment. If NO_SMALL_DATA, move .got before .data. Add DATA_SEGMENT_RELRO_END directive. Include OTHER_RELRO_SECTIONS. * ldgram.y (DATA_SEGMENT_RELRO_END): Add. * ldexp.c (exp_print_token): Handle DATA_SEGMENT_RELRO_END. (fold_unary): Likewise. (fold_binary): Handle -z relro. * ldexp.h (struct exp_data_seg): Add exp_dataseg_relro_seen and exp_dataseg_relro_adjust phases. Add relro_end field. * ldmain.c (main): Initialize link_info.relro to FALSE. * ldlang.c (lang_size_sections): Handle -z relro. ld/testsuite/ * ld-i386/tlspic.rd: Adjust for section reordering changes and removal of unneeded STT_SECTION symbols from .dynsym. * ld-i386/tlspic.dd: Likewise. * ld-i386/tlspic.sd: Likewise. * ld-i386/tlsbin.rd: Likewise. * ld-i386/tlsbinpic.s: Likewise. * ld-i386/tlsbin.dd: Likewise. * ld-i386/tlsbin.sd: Likewise. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlsnopic1.s: Likewise. * ld-i386/combreloc.d: Likewise. * ld-i386/tlsnopic.dd: Likewise. * ld-i386/tlsnopic.sd: Likewise. * ld-x86-64/tlspic.rd: Likewise. * ld-x86-64/tlspic.dd: Likewise. * ld-x86-64/tlsbin.dd: Likewise. * ld-x86-64/tlspic.sd: Likewise. * ld-x86-64/tlsbin.sd: Likewise. * ld-x86-64/tlspic.td: Likewise. * ld-x86-64/tlsbin.td: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-s390/tlspic1.s: Likewise. * ld-s390/tlsbinpic.s: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlspic.dd: Likewise. * ld-s390/tlsbin.dd: Likewise. * ld-s390/tlsbin.sd: Likewise. * ld-s390/tlsbin.td: Likewise. * ld-s390/tlspic.sd: Likewise. * ld-s390/tlspic.td: Likewise. * ld-s390/tlspic1_64.s: Likewise. * ld-s390/tlsbinpic_64.s: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic_64.dd: Likewise. * ld-s390/tlsbin_64.dd: Likewise. * ld-s390/tlspic_64.sd: Likewise. * ld-s390/tlspic_64.td: Likewise. * ld-s390/tlsbin_64.td: Likewise. * ld-s390/tlsbin_64.sd: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.g: Likewise. * ld-powerpc/tlsso32.t: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-ia64/tlspic.rd: Likewise. * ld-ia64/tlspic.dd: Likewise. * ld-ia64/tlspic.sd: Likewise. * ld-ia64/tlspic.td: Likewise. * ld-ia64/tlsbin.rd: Likewise. * ld-ia64/tlsbin.sd: Likewise. * ld-ia64/tlsbin.td: Likewise. * ld-elfvsb/elfvsb.exp: XFAIL non-PIC load offset tests on s390x. * ld-shared/shared.exp: Likewise.
2004-05-11 19:08:38 +02:00
RELRO_NOW=" "
LD_FLAG=w
bfd/ * elflink.c (elf_bfd_final_link): Don't output STT_SECTION symbol into .dynsym if elf_section_data (sec)->dynindx <= 0. Adjust counting of last_local. (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt created by the linker nor !SHF_ALLOC. * elf32-i386.c (elf_i386_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. Set sh_entsize for .got section in addition to .got.plt. (elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. (elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. Set sh_entsize for .got section in addition to .got.plt. * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO. (bfd_section_from_phdr): Likewise. (map_sections_to_segments): Likewise. (assign_file_positions_for_segments): Likewise. (get_program_header_size): Likewise. * elflink.c (bfd_elf_size_dynamic_sections): Set elf_tdata (output_bfd)->relro from info->relro. * elf-bfd.h (struct elf_obj_tdata): Add relro field. include/ * bfdlink.h (struct bfd_link_info): Add relro, relro_start and relro_end fields. * elf/common.h (PT_GNU_EH_FRAME, PT_GNU_STACK): Add comments. (PT_GNU_RELRO): Define. binutils/ * readelf.c (get_segment_type): Handle PT_GNU_RELRO. ld/ * genscripts.sh: Generate -z combreloc -z now -z relro scripts for binaries, -shared and -pie. * emulparams/elf_i386.sh (SEPARATE_GOTPLT): Set. * emulparams/elf_x86_64.sh (SEPARATE_GOTPLT): Set. * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Rename to... (OTHER_RELRO_SECTIONS): ... this. * ldlex.l (DATA_SEGMENT_RELRO_END): Add. * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Handle -z relro and -z norelro. (gld${EMULATION_NAME}_list_options): Add it to usage. (gld${EMULATION_NAME}_get_script): Return -z combreloc -z now -z relro scripts when appropriate. * scripttempl/elf.sc: Unset SEPARATE_GOTPLT if RELRO_NOW is set. Create separate .got.plt section if SEPARATE_GOTPLT. Move sections which are only written during relocation handling to the beginning of RW segment. If NO_SMALL_DATA, move .got before .data. Add DATA_SEGMENT_RELRO_END directive. Include OTHER_RELRO_SECTIONS. * ldgram.y (DATA_SEGMENT_RELRO_END): Add. * ldexp.c (exp_print_token): Handle DATA_SEGMENT_RELRO_END. (fold_unary): Likewise. (fold_binary): Handle -z relro. * ldexp.h (struct exp_data_seg): Add exp_dataseg_relro_seen and exp_dataseg_relro_adjust phases. Add relro_end field. * ldmain.c (main): Initialize link_info.relro to FALSE. * ldlang.c (lang_size_sections): Handle -z relro. ld/testsuite/ * ld-i386/tlspic.rd: Adjust for section reordering changes and removal of unneeded STT_SECTION symbols from .dynsym. * ld-i386/tlspic.dd: Likewise. * ld-i386/tlspic.sd: Likewise. * ld-i386/tlsbin.rd: Likewise. * ld-i386/tlsbinpic.s: Likewise. * ld-i386/tlsbin.dd: Likewise. * ld-i386/tlsbin.sd: Likewise. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlsnopic1.s: Likewise. * ld-i386/combreloc.d: Likewise. * ld-i386/tlsnopic.dd: Likewise. * ld-i386/tlsnopic.sd: Likewise. * ld-x86-64/tlspic.rd: Likewise. * ld-x86-64/tlspic.dd: Likewise. * ld-x86-64/tlsbin.dd: Likewise. * ld-x86-64/tlspic.sd: Likewise. * ld-x86-64/tlsbin.sd: Likewise. * ld-x86-64/tlspic.td: Likewise. * ld-x86-64/tlsbin.td: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-s390/tlspic1.s: Likewise. * ld-s390/tlsbinpic.s: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlspic.dd: Likewise. * ld-s390/tlsbin.dd: Likewise. * ld-s390/tlsbin.sd: Likewise. * ld-s390/tlsbin.td: Likewise. * ld-s390/tlspic.sd: Likewise. * ld-s390/tlspic.td: Likewise. * ld-s390/tlspic1_64.s: Likewise. * ld-s390/tlsbinpic_64.s: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic_64.dd: Likewise. * ld-s390/tlsbin_64.dd: Likewise. * ld-s390/tlspic_64.sd: Likewise. * ld-s390/tlspic_64.td: Likewise. * ld-s390/tlsbin_64.td: Likewise. * ld-s390/tlsbin_64.sd: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.g: Likewise. * ld-powerpc/tlsso32.t: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-ia64/tlspic.rd: Likewise. * ld-ia64/tlspic.dd: Likewise. * ld-ia64/tlspic.sd: Likewise. * ld-ia64/tlspic.td: Likewise. * ld-ia64/tlsbin.rd: Likewise. * ld-ia64/tlsbin.sd: Likewise. * ld-ia64/tlsbin.td: Likewise. * ld-elfvsb/elfvsb.exp: XFAIL non-PIC load offset tests on s390x. * ld-shared/shared.exp: Likewise.
2004-05-11 19:08:38 +02:00
COMBRELOC=ldscripts/${EMULATION_NAME}.xw.tmp
( echo "/* Script for -z combreloc -z relro -z now */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
ld whitespace fixes * pe-dll.c: Formatting, whitespace fixes. * NEWS: Whitespace fixes. * configure.ac: Likewise. * configure.tgt: Likewise. * deffilep.y: Likewise. * genscripts.sh: Likewise. * ld.texinfo: Likewise. * ldgram.y: Likewise. * ldlang.c: Likewise. * ldlex.l: Likewise. * lexsup.c: Likewise. * plugin.c: Likewise. * emulparams/arc-endianness.sh: Likewise. * emulparams/elf32_x86_64.sh: Likewise. * emulparams/elf64mmix.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/h8300elf.sh: Likewise. * emulparams/h8300elf_linux.sh: Likewise. * emulparams/vxworks.sh: Likewise. * emultempl/aarch64elf.em: Likewise. * emultempl/aix.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/metagelf.em: Likewise. * emultempl/msp430.em: Likewise. * emultempl/nds32elf.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spu_ovl.S: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/tic6xdsbt.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vms.em: Likewise. * po/Make-in: Likewise. * scripttempl/DWARF.sc: Likewise. * scripttempl/aix.sc: Likewise. * scripttempl/alpha.sc: Likewise. * scripttempl/alphavms.sc: Likewise. * scripttempl/aout.sc: Likewise. * scripttempl/arclinux.sc: Likewise. * scripttempl/armaout.sc: Likewise. * scripttempl/armbpabi.sc: Likewise. * scripttempl/armcoff.sc: Likewise. * scripttempl/avr.sc: Likewise. * scripttempl/crisaout.sc: Likewise. * scripttempl/delta68.sc: Likewise. * scripttempl/dlx.sc: Likewise. * scripttempl/elf.sc: Likewise. * scripttempl/elf32cr16.sc: Likewise. * scripttempl/elf32cr16c.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/elf32msp430.sc: Likewise. * scripttempl/elf32msp430_3.sc: Likewise. * scripttempl/elf32sh-symbian.sc: Likewise. * scripttempl/elf32xc16x.sc: Likewise. * scripttempl/elf32xc16xl.sc: Likewise. * scripttempl/elf32xc16xs.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/elfarc.sc: Likewise. * scripttempl/elfarcv2.sc: Likewise. * scripttempl/elfd10v.sc: Likewise. * scripttempl/elfd30v.sc: Likewise. * scripttempl/elfi370.sc: Likewise. * scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. * scripttempl/elfmicroblaze.sc: Likewise. * scripttempl/elfxgate.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/epiphany_4x4.sc: Likewise. * scripttempl/epocpe.sc: Likewise. * scripttempl/h8300.sc: Likewise. * scripttempl/h8300h.sc: Likewise. * scripttempl/h8300hn.sc: Likewise. * scripttempl/h8300s.sc: Likewise. * scripttempl/h8300sn.sc: Likewise. * scripttempl/h8300sx.sc: Likewise. * scripttempl/h8300sxn.sc: Likewise. * scripttempl/h8500.sc: Likewise. * scripttempl/h8500b.sc: Likewise. * scripttempl/h8500c.sc: Likewise. * scripttempl/h8500m.sc: Likewise. * scripttempl/h8500s.sc: Likewise. * scripttempl/hppaelf.sc: Likewise. * scripttempl/i386beos.sc: Likewise. * scripttempl/i386coff.sc: Likewise. * scripttempl/i386go32.sc: Likewise. * scripttempl/i386msdos.sc: Likewise. * scripttempl/i860coff.sc: Likewise. * scripttempl/i960.sc: Likewise. * scripttempl/ia64vms.sc: Likewise. * scripttempl/ip2k.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/m68kaux.sc: Likewise. * scripttempl/m68kcoff.sc: Likewise. * scripttempl/m88kbcs.sc: Likewise. * scripttempl/mcorepe.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/mips.sc: Likewise. * scripttempl/mipsbsd.sc: Likewise. * scripttempl/mmo.sc: Likewise. * scripttempl/moxie.sc: Likewise. * scripttempl/nds32elf.sc: Likewise. * scripttempl/nw.sc: Likewise. * scripttempl/pe.sc: Likewise. * scripttempl/pep.sc: Likewise. * scripttempl/pj.sc: Likewise. * scripttempl/ppcpe.sc: Likewise. * scripttempl/psos.sc: Likewise. * scripttempl/riscix.sc: Likewise. * scripttempl/sh.sc: Likewise. * scripttempl/sparccoff.sc: Likewise. * scripttempl/st2000.sc: Likewise. * scripttempl/tic30aout.sc: Likewise. * scripttempl/tic30coff.sc: Likewise. * scripttempl/tic4xcoff.sc: Likewise. * scripttempl/tic54xcoff.sc: Likewise. * scripttempl/tic80coff.sc: Likewise. * scripttempl/v850.sc: Likewise. * scripttempl/v850_rh850.sc: Likewise. * scripttempl/vanilla.sc: Likewise. * scripttempl/visium.sc: Likewise. * scripttempl/w65.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. * scripttempl/z80.sc: Likewise. * scripttempl/z8000.sc: Likewise. * configure: Regenerate.
2017-10-12 12:58:30 +02:00
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xw
bfd/ * elflink.c (elf_bfd_final_link): Don't output STT_SECTION symbol into .dynsym if elf_section_data (sec)->dynindx <= 0. Adjust counting of last_local. (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt created by the linker nor !SHF_ALLOC. * elf32-i386.c (elf_i386_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. Set sh_entsize for .got section in addition to .got.plt. (elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. (elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. Set sh_entsize for .got section in addition to .got.plt. * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO. (bfd_section_from_phdr): Likewise. (map_sections_to_segments): Likewise. (assign_file_positions_for_segments): Likewise. (get_program_header_size): Likewise. * elflink.c (bfd_elf_size_dynamic_sections): Set elf_tdata (output_bfd)->relro from info->relro. * elf-bfd.h (struct elf_obj_tdata): Add relro field. include/ * bfdlink.h (struct bfd_link_info): Add relro, relro_start and relro_end fields. * elf/common.h (PT_GNU_EH_FRAME, PT_GNU_STACK): Add comments. (PT_GNU_RELRO): Define. binutils/ * readelf.c (get_segment_type): Handle PT_GNU_RELRO. ld/ * genscripts.sh: Generate -z combreloc -z now -z relro scripts for binaries, -shared and -pie. * emulparams/elf_i386.sh (SEPARATE_GOTPLT): Set. * emulparams/elf_x86_64.sh (SEPARATE_GOTPLT): Set. * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Rename to... (OTHER_RELRO_SECTIONS): ... this. * ldlex.l (DATA_SEGMENT_RELRO_END): Add. * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Handle -z relro and -z norelro. (gld${EMULATION_NAME}_list_options): Add it to usage. (gld${EMULATION_NAME}_get_script): Return -z combreloc -z now -z relro scripts when appropriate. * scripttempl/elf.sc: Unset SEPARATE_GOTPLT if RELRO_NOW is set. Create separate .got.plt section if SEPARATE_GOTPLT. Move sections which are only written during relocation handling to the beginning of RW segment. If NO_SMALL_DATA, move .got before .data. Add DATA_SEGMENT_RELRO_END directive. Include OTHER_RELRO_SECTIONS. * ldgram.y (DATA_SEGMENT_RELRO_END): Add. * ldexp.c (exp_print_token): Handle DATA_SEGMENT_RELRO_END. (fold_unary): Likewise. (fold_binary): Handle -z relro. * ldexp.h (struct exp_data_seg): Add exp_dataseg_relro_seen and exp_dataseg_relro_adjust phases. Add relro_end field. * ldmain.c (main): Initialize link_info.relro to FALSE. * ldlang.c (lang_size_sections): Handle -z relro. ld/testsuite/ * ld-i386/tlspic.rd: Adjust for section reordering changes and removal of unneeded STT_SECTION symbols from .dynsym. * ld-i386/tlspic.dd: Likewise. * ld-i386/tlspic.sd: Likewise. * ld-i386/tlsbin.rd: Likewise. * ld-i386/tlsbinpic.s: Likewise. * ld-i386/tlsbin.dd: Likewise. * ld-i386/tlsbin.sd: Likewise. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlsnopic1.s: Likewise. * ld-i386/combreloc.d: Likewise. * ld-i386/tlsnopic.dd: Likewise. * ld-i386/tlsnopic.sd: Likewise. * ld-x86-64/tlspic.rd: Likewise. * ld-x86-64/tlspic.dd: Likewise. * ld-x86-64/tlsbin.dd: Likewise. * ld-x86-64/tlspic.sd: Likewise. * ld-x86-64/tlsbin.sd: Likewise. * ld-x86-64/tlspic.td: Likewise. * ld-x86-64/tlsbin.td: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-s390/tlspic1.s: Likewise. * ld-s390/tlsbinpic.s: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlspic.dd: Likewise. * ld-s390/tlsbin.dd: Likewise. * ld-s390/tlsbin.sd: Likewise. * ld-s390/tlsbin.td: Likewise. * ld-s390/tlspic.sd: Likewise. * ld-s390/tlspic.td: Likewise. * ld-s390/tlspic1_64.s: Likewise. * ld-s390/tlsbinpic_64.s: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic_64.dd: Likewise. * ld-s390/tlsbin_64.dd: Likewise. * ld-s390/tlspic_64.sd: Likewise. * ld-s390/tlspic_64.td: Likewise. * ld-s390/tlsbin_64.td: Likewise. * ld-s390/tlsbin_64.sd: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.g: Likewise. * ld-powerpc/tlsso32.t: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-ia64/tlspic.rd: Likewise. * ld-ia64/tlspic.dd: Likewise. * ld-ia64/tlspic.sd: Likewise. * ld-ia64/tlspic.td: Likewise. * ld-ia64/tlsbin.rd: Likewise. * ld-ia64/tlsbin.sd: Likewise. * ld-ia64/tlsbin.td: Likewise. * ld-elfvsb/elfvsb.exp: XFAIL non-PIC load offset tests on s390x. * ld-shared/shared.exp: Likewise.
2004-05-11 19:08:38 +02:00
rm -f ${COMBRELOC}
LD_FLAG=wtextonly
COMBRELOC=ldscripts/${EMULATION_NAME}.xwe.tmp
( echo "/* Script for -z combreloc -z separate-code -z relro -z now */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xwe
rm -f ${COMBRELOC}
* elf-bfd.h (enum elf_reloc_type_class): New. (struct elf_backend_data): Add elf_backend_reloc_type_class. (_bfd_elf_reloc_type_class): New. * elfxx-target.h (elf_backend_reloc_type_class): Define. (elfNN_bed): Add elf_backend_reloc_type_class. * elf.c (_bfd_elf_reloc_type_class): New. * elf32-i386.c (elf_i386_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (elf_i386_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (elf_i386_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elf32-sparc.c (elf32_sparc_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (elf32_sparc_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (elf32_sparc_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elf64-sparc.c (sparc64_elf_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (sparc64_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (sparc64_elf_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add reltext field. (elfNN_ia64_hash_table_create): Clear ia64_info. (get_reloc_section): Set DF_TEXTREL if the reloc is against read-only section. (elfNN_ia64_size_dynamic_sections): Use ia64_info->reltext flag instead of looking up section names for DT_TEXTREL. (elfNN_ia64_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elflink.h (size_dynamic_sections): Add spare DT_NULL tags. (struct elf_link_sort_rela): New. (elf_link_sort_cmp1, elf_link_sort_cmp2, elf_link_sort_relocs): New. (elf_bfd_final_link): Call elf_link_sort_relocs. Convert one spare DT_NULL into DT_RELCOUNT resp. DT_RELACOUNT if necessary. * bfdlink.h (struct bfd_link_info): Add combreloc and spare_dynamic_tags fields. * emultempl/elf32.em (place_orphan): Place orphan .rel* sections into .rel.dyn resp. .rela.dyn if combreloc. (get_script): If .x linker script is equal to .xn, only put it once into the binary. Add .xc and .xsc scripts. (parse_args): Handle -z combreloc and -z nocombreloc. * scripttempl/elf.sc (.rela.sbss): Fix a typo. For .xc and .xsc scripts put all .rel* or .rela* input sections but .rel*.plt and PLT-like sections into .rel.dyn resp. .rela.dyn. * genscripts.sh (GENERATE_COMBRELOC_SCRIPT): Set if SCRIPT_NAME is elf. Strip trailing whitespace from script. Generate .xc and .xsc scripts if requested. * ldmain.c (main): Initialize link_info.combreloc and link_info.spare_dynamic_tags. * lexsup.c (OPTION_SPARE_DYNAMIC_TAGS): Define. (ld_options): Add --spare-dynamic-tags option. (parse_args): Likewise. * ld.texinfo: Document -z combreloc and -z nocombreloc. * ldint.texinfo: Document .xc and .xsc linker scripts. * NEWS: Add notes about -z combreloc and SHF_MERGE.
2001-08-23 17:14:18 +02:00
COMBRELOC=
bfd/ * elflink.c (elf_bfd_final_link): Don't output STT_SECTION symbol into .dynsym if elf_section_data (sec)->dynindx <= 0. Adjust counting of last_local. (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt created by the linker nor !SHF_ALLOC. * elf32-i386.c (elf_i386_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. Set sh_entsize for .got section in addition to .got.plt. (elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. (elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. Set sh_entsize for .got section in addition to .got.plt. * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO. (bfd_section_from_phdr): Likewise. (map_sections_to_segments): Likewise. (assign_file_positions_for_segments): Likewise. (get_program_header_size): Likewise. * elflink.c (bfd_elf_size_dynamic_sections): Set elf_tdata (output_bfd)->relro from info->relro. * elf-bfd.h (struct elf_obj_tdata): Add relro field. include/ * bfdlink.h (struct bfd_link_info): Add relro, relro_start and relro_end fields. * elf/common.h (PT_GNU_EH_FRAME, PT_GNU_STACK): Add comments. (PT_GNU_RELRO): Define. binutils/ * readelf.c (get_segment_type): Handle PT_GNU_RELRO. ld/ * genscripts.sh: Generate -z combreloc -z now -z relro scripts for binaries, -shared and -pie. * emulparams/elf_i386.sh (SEPARATE_GOTPLT): Set. * emulparams/elf_x86_64.sh (SEPARATE_GOTPLT): Set. * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Rename to... (OTHER_RELRO_SECTIONS): ... this. * ldlex.l (DATA_SEGMENT_RELRO_END): Add. * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Handle -z relro and -z norelro. (gld${EMULATION_NAME}_list_options): Add it to usage. (gld${EMULATION_NAME}_get_script): Return -z combreloc -z now -z relro scripts when appropriate. * scripttempl/elf.sc: Unset SEPARATE_GOTPLT if RELRO_NOW is set. Create separate .got.plt section if SEPARATE_GOTPLT. Move sections which are only written during relocation handling to the beginning of RW segment. If NO_SMALL_DATA, move .got before .data. Add DATA_SEGMENT_RELRO_END directive. Include OTHER_RELRO_SECTIONS. * ldgram.y (DATA_SEGMENT_RELRO_END): Add. * ldexp.c (exp_print_token): Handle DATA_SEGMENT_RELRO_END. (fold_unary): Likewise. (fold_binary): Handle -z relro. * ldexp.h (struct exp_data_seg): Add exp_dataseg_relro_seen and exp_dataseg_relro_adjust phases. Add relro_end field. * ldmain.c (main): Initialize link_info.relro to FALSE. * ldlang.c (lang_size_sections): Handle -z relro. ld/testsuite/ * ld-i386/tlspic.rd: Adjust for section reordering changes and removal of unneeded STT_SECTION symbols from .dynsym. * ld-i386/tlspic.dd: Likewise. * ld-i386/tlspic.sd: Likewise. * ld-i386/tlsbin.rd: Likewise. * ld-i386/tlsbinpic.s: Likewise. * ld-i386/tlsbin.dd: Likewise. * ld-i386/tlsbin.sd: Likewise. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlsnopic1.s: Likewise. * ld-i386/combreloc.d: Likewise. * ld-i386/tlsnopic.dd: Likewise. * ld-i386/tlsnopic.sd: Likewise. * ld-x86-64/tlspic.rd: Likewise. * ld-x86-64/tlspic.dd: Likewise. * ld-x86-64/tlsbin.dd: Likewise. * ld-x86-64/tlspic.sd: Likewise. * ld-x86-64/tlsbin.sd: Likewise. * ld-x86-64/tlspic.td: Likewise. * ld-x86-64/tlsbin.td: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-s390/tlspic1.s: Likewise. * ld-s390/tlsbinpic.s: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlspic.dd: Likewise. * ld-s390/tlsbin.dd: Likewise. * ld-s390/tlsbin.sd: Likewise. * ld-s390/tlsbin.td: Likewise. * ld-s390/tlspic.sd: Likewise. * ld-s390/tlspic.td: Likewise. * ld-s390/tlspic1_64.s: Likewise. * ld-s390/tlsbinpic_64.s: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic_64.dd: Likewise. * ld-s390/tlsbin_64.dd: Likewise. * ld-s390/tlspic_64.sd: Likewise. * ld-s390/tlspic_64.td: Likewise. * ld-s390/tlsbin_64.td: Likewise. * ld-s390/tlsbin_64.sd: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.g: Likewise. * ld-powerpc/tlsso32.t: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-ia64/tlspic.rd: Likewise. * ld-ia64/tlspic.dd: Likewise. * ld-ia64/tlspic.sd: Likewise. * ld-ia64/tlspic.td: Likewise. * ld-ia64/tlsbin.rd: Likewise. * ld-ia64/tlsbin.sd: Likewise. * ld-ia64/tlsbin.td: Likewise. * ld-elfvsb/elfvsb.exp: XFAIL non-PIC load offset tests on s390x. * ld-shared/shared.exp: Likewise.
2004-05-11 19:08:38 +02:00
unset RELRO_NOW
if test -n "$GENERATE_RELRO_SCRIPT"; then
LD_FLAG=c
RELRO=" "
COMBRELOC=ldscripts/${EMULATION_NAME}.xco.tmp
( echo "/* Script for -z combreloc -z relro */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xco
rm -f ${COMBRELOC}
LD_FLAG=ctextonly
COMBRELOC=ldscripts/${EMULATION_NAME}.xceo.tmp
( echo "/* Script for -z combreloc -z separate-code -z relro */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xceo
rm -f ${COMBRELOC}
COMBRELOC=
unset RELRO
fi
* elf-bfd.h (enum elf_reloc_type_class): New. (struct elf_backend_data): Add elf_backend_reloc_type_class. (_bfd_elf_reloc_type_class): New. * elfxx-target.h (elf_backend_reloc_type_class): Define. (elfNN_bed): Add elf_backend_reloc_type_class. * elf.c (_bfd_elf_reloc_type_class): New. * elf32-i386.c (elf_i386_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (elf_i386_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (elf_i386_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elf32-sparc.c (elf32_sparc_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (elf32_sparc_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (elf32_sparc_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elf64-sparc.c (sparc64_elf_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (sparc64_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (sparc64_elf_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add reltext field. (elfNN_ia64_hash_table_create): Clear ia64_info. (get_reloc_section): Set DF_TEXTREL if the reloc is against read-only section. (elfNN_ia64_size_dynamic_sections): Use ia64_info->reltext flag instead of looking up section names for DT_TEXTREL. (elfNN_ia64_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elflink.h (size_dynamic_sections): Add spare DT_NULL tags. (struct elf_link_sort_rela): New. (elf_link_sort_cmp1, elf_link_sort_cmp2, elf_link_sort_relocs): New. (elf_bfd_final_link): Call elf_link_sort_relocs. Convert one spare DT_NULL into DT_RELCOUNT resp. DT_RELACOUNT if necessary. * bfdlink.h (struct bfd_link_info): Add combreloc and spare_dynamic_tags fields. * emultempl/elf32.em (place_orphan): Place orphan .rel* sections into .rel.dyn resp. .rela.dyn if combreloc. (get_script): If .x linker script is equal to .xn, only put it once into the binary. Add .xc and .xsc scripts. (parse_args): Handle -z combreloc and -z nocombreloc. * scripttempl/elf.sc (.rela.sbss): Fix a typo. For .xc and .xsc scripts put all .rel* or .rela* input sections but .rel*.plt and PLT-like sections into .rel.dyn resp. .rela.dyn. * genscripts.sh (GENERATE_COMBRELOC_SCRIPT): Set if SCRIPT_NAME is elf. Strip trailing whitespace from script. Generate .xc and .xsc scripts if requested. * ldmain.c (main): Initialize link_info.combreloc and link_info.spare_dynamic_tags. * lexsup.c (OPTION_SPARE_DYNAMIC_TAGS): Define. (ld_options): Add --spare-dynamic-tags option. (parse_args): Likewise. * ld.texinfo: Document -z combreloc and -z nocombreloc. * ldint.texinfo: Document .xc and .xsc linker scripts. * NEWS: Add notes about -z combreloc and SHF_MERGE.
2001-08-23 17:14:18 +02:00
fi
1999-05-03 09:29:11 +02:00
if test -n "$GENERATE_SHLIB_SCRIPT"; then
DATA_ALIGNMENT=${DATA_ALIGNMENT_s-${DATA_ALIGNMENT_}}
CREATE_SHLIB=" "
LD_FLAG=shared
( echo "/* Script for -shared */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
ld whitespace fixes * pe-dll.c: Formatting, whitespace fixes. * NEWS: Whitespace fixes. * configure.ac: Likewise. * configure.tgt: Likewise. * deffilep.y: Likewise. * genscripts.sh: Likewise. * ld.texinfo: Likewise. * ldgram.y: Likewise. * ldlang.c: Likewise. * ldlex.l: Likewise. * lexsup.c: Likewise. * plugin.c: Likewise. * emulparams/arc-endianness.sh: Likewise. * emulparams/elf32_x86_64.sh: Likewise. * emulparams/elf64mmix.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/h8300elf.sh: Likewise. * emulparams/h8300elf_linux.sh: Likewise. * emulparams/vxworks.sh: Likewise. * emultempl/aarch64elf.em: Likewise. * emultempl/aix.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/metagelf.em: Likewise. * emultempl/msp430.em: Likewise. * emultempl/nds32elf.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spu_ovl.S: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/tic6xdsbt.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vms.em: Likewise. * po/Make-in: Likewise. * scripttempl/DWARF.sc: Likewise. * scripttempl/aix.sc: Likewise. * scripttempl/alpha.sc: Likewise. * scripttempl/alphavms.sc: Likewise. * scripttempl/aout.sc: Likewise. * scripttempl/arclinux.sc: Likewise. * scripttempl/armaout.sc: Likewise. * scripttempl/armbpabi.sc: Likewise. * scripttempl/armcoff.sc: Likewise. * scripttempl/avr.sc: Likewise. * scripttempl/crisaout.sc: Likewise. * scripttempl/delta68.sc: Likewise. * scripttempl/dlx.sc: Likewise. * scripttempl/elf.sc: Likewise. * scripttempl/elf32cr16.sc: Likewise. * scripttempl/elf32cr16c.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/elf32msp430.sc: Likewise. * scripttempl/elf32msp430_3.sc: Likewise. * scripttempl/elf32sh-symbian.sc: Likewise. * scripttempl/elf32xc16x.sc: Likewise. * scripttempl/elf32xc16xl.sc: Likewise. * scripttempl/elf32xc16xs.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/elfarc.sc: Likewise. * scripttempl/elfarcv2.sc: Likewise. * scripttempl/elfd10v.sc: Likewise. * scripttempl/elfd30v.sc: Likewise. * scripttempl/elfi370.sc: Likewise. * scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. * scripttempl/elfmicroblaze.sc: Likewise. * scripttempl/elfxgate.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/epiphany_4x4.sc: Likewise. * scripttempl/epocpe.sc: Likewise. * scripttempl/h8300.sc: Likewise. * scripttempl/h8300h.sc: Likewise. * scripttempl/h8300hn.sc: Likewise. * scripttempl/h8300s.sc: Likewise. * scripttempl/h8300sn.sc: Likewise. * scripttempl/h8300sx.sc: Likewise. * scripttempl/h8300sxn.sc: Likewise. * scripttempl/h8500.sc: Likewise. * scripttempl/h8500b.sc: Likewise. * scripttempl/h8500c.sc: Likewise. * scripttempl/h8500m.sc: Likewise. * scripttempl/h8500s.sc: Likewise. * scripttempl/hppaelf.sc: Likewise. * scripttempl/i386beos.sc: Likewise. * scripttempl/i386coff.sc: Likewise. * scripttempl/i386go32.sc: Likewise. * scripttempl/i386msdos.sc: Likewise. * scripttempl/i860coff.sc: Likewise. * scripttempl/i960.sc: Likewise. * scripttempl/ia64vms.sc: Likewise. * scripttempl/ip2k.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/m68kaux.sc: Likewise. * scripttempl/m68kcoff.sc: Likewise. * scripttempl/m88kbcs.sc: Likewise. * scripttempl/mcorepe.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/mips.sc: Likewise. * scripttempl/mipsbsd.sc: Likewise. * scripttempl/mmo.sc: Likewise. * scripttempl/moxie.sc: Likewise. * scripttempl/nds32elf.sc: Likewise. * scripttempl/nw.sc: Likewise. * scripttempl/pe.sc: Likewise. * scripttempl/pep.sc: Likewise. * scripttempl/pj.sc: Likewise. * scripttempl/ppcpe.sc: Likewise. * scripttempl/psos.sc: Likewise. * scripttempl/riscix.sc: Likewise. * scripttempl/sh.sc: Likewise. * scripttempl/sparccoff.sc: Likewise. * scripttempl/st2000.sc: Likewise. * scripttempl/tic30aout.sc: Likewise. * scripttempl/tic30coff.sc: Likewise. * scripttempl/tic4xcoff.sc: Likewise. * scripttempl/tic54xcoff.sc: Likewise. * scripttempl/tic80coff.sc: Likewise. * scripttempl/v850.sc: Likewise. * scripttempl/v850_rh850.sc: Likewise. * scripttempl/vanilla.sc: Likewise. * scripttempl/visium.sc: Likewise. * scripttempl/w65.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. * scripttempl/z80.sc: Likewise. * scripttempl/z8000.sc: Likewise. * configure: Regenerate.
2017-10-12 12:58:30 +02:00
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xs
LD_FLAG=sharedtextonly
( echo "/* Script for -shared -z separate-code */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xse
if test -n "$GENERATE_RELRO_SCRIPT"; then
RELRO=" "
LD_FLAG=shared
( echo "/* Script for -shared -z relro */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xso
LD_FLAG=sharedtextonly
( echo "/* Script for -shared -z separate-code -z relro */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xseo
unset RELRO
fi
* elf-bfd.h (enum elf_reloc_type_class): New. (struct elf_backend_data): Add elf_backend_reloc_type_class. (_bfd_elf_reloc_type_class): New. * elfxx-target.h (elf_backend_reloc_type_class): Define. (elfNN_bed): Add elf_backend_reloc_type_class. * elf.c (_bfd_elf_reloc_type_class): New. * elf32-i386.c (elf_i386_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (elf_i386_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (elf_i386_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elf32-sparc.c (elf32_sparc_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (elf32_sparc_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (elf32_sparc_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elf64-sparc.c (sparc64_elf_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (sparc64_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (sparc64_elf_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add reltext field. (elfNN_ia64_hash_table_create): Clear ia64_info. (get_reloc_section): Set DF_TEXTREL if the reloc is against read-only section. (elfNN_ia64_size_dynamic_sections): Use ia64_info->reltext flag instead of looking up section names for DT_TEXTREL. (elfNN_ia64_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elflink.h (size_dynamic_sections): Add spare DT_NULL tags. (struct elf_link_sort_rela): New. (elf_link_sort_cmp1, elf_link_sort_cmp2, elf_link_sort_relocs): New. (elf_bfd_final_link): Call elf_link_sort_relocs. Convert one spare DT_NULL into DT_RELCOUNT resp. DT_RELACOUNT if necessary. * bfdlink.h (struct bfd_link_info): Add combreloc and spare_dynamic_tags fields. * emultempl/elf32.em (place_orphan): Place orphan .rel* sections into .rel.dyn resp. .rela.dyn if combreloc. (get_script): If .x linker script is equal to .xn, only put it once into the binary. Add .xc and .xsc scripts. (parse_args): Handle -z combreloc and -z nocombreloc. * scripttempl/elf.sc (.rela.sbss): Fix a typo. For .xc and .xsc scripts put all .rel* or .rela* input sections but .rel*.plt and PLT-like sections into .rel.dyn resp. .rela.dyn. * genscripts.sh (GENERATE_COMBRELOC_SCRIPT): Set if SCRIPT_NAME is elf. Strip trailing whitespace from script. Generate .xc and .xsc scripts if requested. * ldmain.c (main): Initialize link_info.combreloc and link_info.spare_dynamic_tags. * lexsup.c (OPTION_SPARE_DYNAMIC_TAGS): Define. (ld_options): Add --spare-dynamic-tags option. (parse_args): Likewise. * ld.texinfo: Document -z combreloc and -z nocombreloc. * ldint.texinfo: Document .xc and .xsc linker scripts. * NEWS: Add notes about -z combreloc and SHF_MERGE.
2001-08-23 17:14:18 +02:00
if test -n "$GENERATE_COMBRELOC_SCRIPT"; then
DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}}
LD_FLAG=cshared
bfd/ * elflink.c (elf_bfd_final_link): Don't output STT_SECTION symbol into .dynsym if elf_section_data (sec)->dynindx <= 0. Adjust counting of last_local. (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt created by the linker nor !SHF_ALLOC. * elf32-i386.c (elf_i386_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. Set sh_entsize for .got section in addition to .got.plt. (elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. (elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. Set sh_entsize for .got section in addition to .got.plt. * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO. (bfd_section_from_phdr): Likewise. (map_sections_to_segments): Likewise. (assign_file_positions_for_segments): Likewise. (get_program_header_size): Likewise. * elflink.c (bfd_elf_size_dynamic_sections): Set elf_tdata (output_bfd)->relro from info->relro. * elf-bfd.h (struct elf_obj_tdata): Add relro field. include/ * bfdlink.h (struct bfd_link_info): Add relro, relro_start and relro_end fields. * elf/common.h (PT_GNU_EH_FRAME, PT_GNU_STACK): Add comments. (PT_GNU_RELRO): Define. binutils/ * readelf.c (get_segment_type): Handle PT_GNU_RELRO. ld/ * genscripts.sh: Generate -z combreloc -z now -z relro scripts for binaries, -shared and -pie. * emulparams/elf_i386.sh (SEPARATE_GOTPLT): Set. * emulparams/elf_x86_64.sh (SEPARATE_GOTPLT): Set. * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Rename to... (OTHER_RELRO_SECTIONS): ... this. * ldlex.l (DATA_SEGMENT_RELRO_END): Add. * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Handle -z relro and -z norelro. (gld${EMULATION_NAME}_list_options): Add it to usage. (gld${EMULATION_NAME}_get_script): Return -z combreloc -z now -z relro scripts when appropriate. * scripttempl/elf.sc: Unset SEPARATE_GOTPLT if RELRO_NOW is set. Create separate .got.plt section if SEPARATE_GOTPLT. Move sections which are only written during relocation handling to the beginning of RW segment. If NO_SMALL_DATA, move .got before .data. Add DATA_SEGMENT_RELRO_END directive. Include OTHER_RELRO_SECTIONS. * ldgram.y (DATA_SEGMENT_RELRO_END): Add. * ldexp.c (exp_print_token): Handle DATA_SEGMENT_RELRO_END. (fold_unary): Likewise. (fold_binary): Handle -z relro. * ldexp.h (struct exp_data_seg): Add exp_dataseg_relro_seen and exp_dataseg_relro_adjust phases. Add relro_end field. * ldmain.c (main): Initialize link_info.relro to FALSE. * ldlang.c (lang_size_sections): Handle -z relro. ld/testsuite/ * ld-i386/tlspic.rd: Adjust for section reordering changes and removal of unneeded STT_SECTION symbols from .dynsym. * ld-i386/tlspic.dd: Likewise. * ld-i386/tlspic.sd: Likewise. * ld-i386/tlsbin.rd: Likewise. * ld-i386/tlsbinpic.s: Likewise. * ld-i386/tlsbin.dd: Likewise. * ld-i386/tlsbin.sd: Likewise. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlsnopic1.s: Likewise. * ld-i386/combreloc.d: Likewise. * ld-i386/tlsnopic.dd: Likewise. * ld-i386/tlsnopic.sd: Likewise. * ld-x86-64/tlspic.rd: Likewise. * ld-x86-64/tlspic.dd: Likewise. * ld-x86-64/tlsbin.dd: Likewise. * ld-x86-64/tlspic.sd: Likewise. * ld-x86-64/tlsbin.sd: Likewise. * ld-x86-64/tlspic.td: Likewise. * ld-x86-64/tlsbin.td: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-s390/tlspic1.s: Likewise. * ld-s390/tlsbinpic.s: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlspic.dd: Likewise. * ld-s390/tlsbin.dd: Likewise. * ld-s390/tlsbin.sd: Likewise. * ld-s390/tlsbin.td: Likewise. * ld-s390/tlspic.sd: Likewise. * ld-s390/tlspic.td: Likewise. * ld-s390/tlspic1_64.s: Likewise. * ld-s390/tlsbinpic_64.s: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic_64.dd: Likewise. * ld-s390/tlsbin_64.dd: Likewise. * ld-s390/tlspic_64.sd: Likewise. * ld-s390/tlspic_64.td: Likewise. * ld-s390/tlsbin_64.td: Likewise. * ld-s390/tlsbin_64.sd: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.g: Likewise. * ld-powerpc/tlsso32.t: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-ia64/tlspic.rd: Likewise. * ld-ia64/tlspic.dd: Likewise. * ld-ia64/tlspic.sd: Likewise. * ld-ia64/tlspic.td: Likewise. * ld-ia64/tlsbin.rd: Likewise. * ld-ia64/tlsbin.sd: Likewise. * ld-ia64/tlsbin.td: Likewise. * ld-elfvsb/elfvsb.exp: XFAIL non-PIC load offset tests on s390x. * ld-shared/shared.exp: Likewise.
2004-05-11 19:08:38 +02:00
COMBRELOC=ldscripts/${EMULATION_NAME}.xsc.tmp
( echo "/* Script for -shared -z combreloc */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
ld whitespace fixes * pe-dll.c: Formatting, whitespace fixes. * NEWS: Whitespace fixes. * configure.ac: Likewise. * configure.tgt: Likewise. * deffilep.y: Likewise. * genscripts.sh: Likewise. * ld.texinfo: Likewise. * ldgram.y: Likewise. * ldlang.c: Likewise. * ldlex.l: Likewise. * lexsup.c: Likewise. * plugin.c: Likewise. * emulparams/arc-endianness.sh: Likewise. * emulparams/elf32_x86_64.sh: Likewise. * emulparams/elf64mmix.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/h8300elf.sh: Likewise. * emulparams/h8300elf_linux.sh: Likewise. * emulparams/vxworks.sh: Likewise. * emultempl/aarch64elf.em: Likewise. * emultempl/aix.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/metagelf.em: Likewise. * emultempl/msp430.em: Likewise. * emultempl/nds32elf.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spu_ovl.S: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/tic6xdsbt.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vms.em: Likewise. * po/Make-in: Likewise. * scripttempl/DWARF.sc: Likewise. * scripttempl/aix.sc: Likewise. * scripttempl/alpha.sc: Likewise. * scripttempl/alphavms.sc: Likewise. * scripttempl/aout.sc: Likewise. * scripttempl/arclinux.sc: Likewise. * scripttempl/armaout.sc: Likewise. * scripttempl/armbpabi.sc: Likewise. * scripttempl/armcoff.sc: Likewise. * scripttempl/avr.sc: Likewise. * scripttempl/crisaout.sc: Likewise. * scripttempl/delta68.sc: Likewise. * scripttempl/dlx.sc: Likewise. * scripttempl/elf.sc: Likewise. * scripttempl/elf32cr16.sc: Likewise. * scripttempl/elf32cr16c.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/elf32msp430.sc: Likewise. * scripttempl/elf32msp430_3.sc: Likewise. * scripttempl/elf32sh-symbian.sc: Likewise. * scripttempl/elf32xc16x.sc: Likewise. * scripttempl/elf32xc16xl.sc: Likewise. * scripttempl/elf32xc16xs.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/elfarc.sc: Likewise. * scripttempl/elfarcv2.sc: Likewise. * scripttempl/elfd10v.sc: Likewise. * scripttempl/elfd30v.sc: Likewise. * scripttempl/elfi370.sc: Likewise. * scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. * scripttempl/elfmicroblaze.sc: Likewise. * scripttempl/elfxgate.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/epiphany_4x4.sc: Likewise. * scripttempl/epocpe.sc: Likewise. * scripttempl/h8300.sc: Likewise. * scripttempl/h8300h.sc: Likewise. * scripttempl/h8300hn.sc: Likewise. * scripttempl/h8300s.sc: Likewise. * scripttempl/h8300sn.sc: Likewise. * scripttempl/h8300sx.sc: Likewise. * scripttempl/h8300sxn.sc: Likewise. * scripttempl/h8500.sc: Likewise. * scripttempl/h8500b.sc: Likewise. * scripttempl/h8500c.sc: Likewise. * scripttempl/h8500m.sc: Likewise. * scripttempl/h8500s.sc: Likewise. * scripttempl/hppaelf.sc: Likewise. * scripttempl/i386beos.sc: Likewise. * scripttempl/i386coff.sc: Likewise. * scripttempl/i386go32.sc: Likewise. * scripttempl/i386msdos.sc: Likewise. * scripttempl/i860coff.sc: Likewise. * scripttempl/i960.sc: Likewise. * scripttempl/ia64vms.sc: Likewise. * scripttempl/ip2k.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/m68kaux.sc: Likewise. * scripttempl/m68kcoff.sc: Likewise. * scripttempl/m88kbcs.sc: Likewise. * scripttempl/mcorepe.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/mips.sc: Likewise. * scripttempl/mipsbsd.sc: Likewise. * scripttempl/mmo.sc: Likewise. * scripttempl/moxie.sc: Likewise. * scripttempl/nds32elf.sc: Likewise. * scripttempl/nw.sc: Likewise. * scripttempl/pe.sc: Likewise. * scripttempl/pep.sc: Likewise. * scripttempl/pj.sc: Likewise. * scripttempl/ppcpe.sc: Likewise. * scripttempl/psos.sc: Likewise. * scripttempl/riscix.sc: Likewise. * scripttempl/sh.sc: Likewise. * scripttempl/sparccoff.sc: Likewise. * scripttempl/st2000.sc: Likewise. * scripttempl/tic30aout.sc: Likewise. * scripttempl/tic30coff.sc: Likewise. * scripttempl/tic4xcoff.sc: Likewise. * scripttempl/tic54xcoff.sc: Likewise. * scripttempl/tic80coff.sc: Likewise. * scripttempl/v850.sc: Likewise. * scripttempl/v850_rh850.sc: Likewise. * scripttempl/vanilla.sc: Likewise. * scripttempl/visium.sc: Likewise. * scripttempl/w65.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. * scripttempl/z80.sc: Likewise. * scripttempl/z8000.sc: Likewise. * configure: Regenerate.
2017-10-12 12:58:30 +02:00
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsc
* elf-bfd.h (enum elf_reloc_type_class): New. (struct elf_backend_data): Add elf_backend_reloc_type_class. (_bfd_elf_reloc_type_class): New. * elfxx-target.h (elf_backend_reloc_type_class): Define. (elfNN_bed): Add elf_backend_reloc_type_class. * elf.c (_bfd_elf_reloc_type_class): New. * elf32-i386.c (elf_i386_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (elf_i386_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (elf_i386_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elf32-sparc.c (elf32_sparc_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (elf32_sparc_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (elf32_sparc_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elf64-sparc.c (sparc64_elf_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (sparc64_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (sparc64_elf_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add reltext field. (elfNN_ia64_hash_table_create): Clear ia64_info. (get_reloc_section): Set DF_TEXTREL if the reloc is against read-only section. (elfNN_ia64_size_dynamic_sections): Use ia64_info->reltext flag instead of looking up section names for DT_TEXTREL. (elfNN_ia64_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elflink.h (size_dynamic_sections): Add spare DT_NULL tags. (struct elf_link_sort_rela): New. (elf_link_sort_cmp1, elf_link_sort_cmp2, elf_link_sort_relocs): New. (elf_bfd_final_link): Call elf_link_sort_relocs. Convert one spare DT_NULL into DT_RELCOUNT resp. DT_RELACOUNT if necessary. * bfdlink.h (struct bfd_link_info): Add combreloc and spare_dynamic_tags fields. * emultempl/elf32.em (place_orphan): Place orphan .rel* sections into .rel.dyn resp. .rela.dyn if combreloc. (get_script): If .x linker script is equal to .xn, only put it once into the binary. Add .xc and .xsc scripts. (parse_args): Handle -z combreloc and -z nocombreloc. * scripttempl/elf.sc (.rela.sbss): Fix a typo. For .xc and .xsc scripts put all .rel* or .rela* input sections but .rel*.plt and PLT-like sections into .rel.dyn resp. .rela.dyn. * genscripts.sh (GENERATE_COMBRELOC_SCRIPT): Set if SCRIPT_NAME is elf. Strip trailing whitespace from script. Generate .xc and .xsc scripts if requested. * ldmain.c (main): Initialize link_info.combreloc and link_info.spare_dynamic_tags. * lexsup.c (OPTION_SPARE_DYNAMIC_TAGS): Define. (ld_options): Add --spare-dynamic-tags option. (parse_args): Likewise. * ld.texinfo: Document -z combreloc and -z nocombreloc. * ldint.texinfo: Document .xc and .xsc linker scripts. * NEWS: Add notes about -z combreloc and SHF_MERGE.
2001-08-23 17:14:18 +02:00
rm -f ${COMBRELOC}
LD_FLAG=csharedtextonly
COMBRELOC=ldscripts/${EMULATION_NAME}.xsce.tmp
( echo "/* Script for -shared -z combreloc -z separate-code */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsce
rm -f ${COMBRELOC}
bfd/ * elflink.c (elf_bfd_final_link): Don't output STT_SECTION symbol into .dynsym if elf_section_data (sec)->dynindx <= 0. Adjust counting of last_local. (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt created by the linker nor !SHF_ALLOC. * elf32-i386.c (elf_i386_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. Set sh_entsize for .got section in addition to .got.plt. (elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. (elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. Set sh_entsize for .got section in addition to .got.plt. * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO. (bfd_section_from_phdr): Likewise. (map_sections_to_segments): Likewise. (assign_file_positions_for_segments): Likewise. (get_program_header_size): Likewise. * elflink.c (bfd_elf_size_dynamic_sections): Set elf_tdata (output_bfd)->relro from info->relro. * elf-bfd.h (struct elf_obj_tdata): Add relro field. include/ * bfdlink.h (struct bfd_link_info): Add relro, relro_start and relro_end fields. * elf/common.h (PT_GNU_EH_FRAME, PT_GNU_STACK): Add comments. (PT_GNU_RELRO): Define. binutils/ * readelf.c (get_segment_type): Handle PT_GNU_RELRO. ld/ * genscripts.sh: Generate -z combreloc -z now -z relro scripts for binaries, -shared and -pie. * emulparams/elf_i386.sh (SEPARATE_GOTPLT): Set. * emulparams/elf_x86_64.sh (SEPARATE_GOTPLT): Set. * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Rename to... (OTHER_RELRO_SECTIONS): ... this. * ldlex.l (DATA_SEGMENT_RELRO_END): Add. * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Handle -z relro and -z norelro. (gld${EMULATION_NAME}_list_options): Add it to usage. (gld${EMULATION_NAME}_get_script): Return -z combreloc -z now -z relro scripts when appropriate. * scripttempl/elf.sc: Unset SEPARATE_GOTPLT if RELRO_NOW is set. Create separate .got.plt section if SEPARATE_GOTPLT. Move sections which are only written during relocation handling to the beginning of RW segment. If NO_SMALL_DATA, move .got before .data. Add DATA_SEGMENT_RELRO_END directive. Include OTHER_RELRO_SECTIONS. * ldgram.y (DATA_SEGMENT_RELRO_END): Add. * ldexp.c (exp_print_token): Handle DATA_SEGMENT_RELRO_END. (fold_unary): Likewise. (fold_binary): Handle -z relro. * ldexp.h (struct exp_data_seg): Add exp_dataseg_relro_seen and exp_dataseg_relro_adjust phases. Add relro_end field. * ldmain.c (main): Initialize link_info.relro to FALSE. * ldlang.c (lang_size_sections): Handle -z relro. ld/testsuite/ * ld-i386/tlspic.rd: Adjust for section reordering changes and removal of unneeded STT_SECTION symbols from .dynsym. * ld-i386/tlspic.dd: Likewise. * ld-i386/tlspic.sd: Likewise. * ld-i386/tlsbin.rd: Likewise. * ld-i386/tlsbinpic.s: Likewise. * ld-i386/tlsbin.dd: Likewise. * ld-i386/tlsbin.sd: Likewise. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlsnopic1.s: Likewise. * ld-i386/combreloc.d: Likewise. * ld-i386/tlsnopic.dd: Likewise. * ld-i386/tlsnopic.sd: Likewise. * ld-x86-64/tlspic.rd: Likewise. * ld-x86-64/tlspic.dd: Likewise. * ld-x86-64/tlsbin.dd: Likewise. * ld-x86-64/tlspic.sd: Likewise. * ld-x86-64/tlsbin.sd: Likewise. * ld-x86-64/tlspic.td: Likewise. * ld-x86-64/tlsbin.td: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-s390/tlspic1.s: Likewise. * ld-s390/tlsbinpic.s: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlspic.dd: Likewise. * ld-s390/tlsbin.dd: Likewise. * ld-s390/tlsbin.sd: Likewise. * ld-s390/tlsbin.td: Likewise. * ld-s390/tlspic.sd: Likewise. * ld-s390/tlspic.td: Likewise. * ld-s390/tlspic1_64.s: Likewise. * ld-s390/tlsbinpic_64.s: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic_64.dd: Likewise. * ld-s390/tlsbin_64.dd: Likewise. * ld-s390/tlspic_64.sd: Likewise. * ld-s390/tlspic_64.td: Likewise. * ld-s390/tlsbin_64.td: Likewise. * ld-s390/tlsbin_64.sd: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.g: Likewise. * ld-powerpc/tlsso32.t: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-ia64/tlspic.rd: Likewise. * ld-ia64/tlspic.dd: Likewise. * ld-ia64/tlspic.sd: Likewise. * ld-ia64/tlspic.td: Likewise. * ld-ia64/tlsbin.rd: Likewise. * ld-ia64/tlsbin.sd: Likewise. * ld-ia64/tlsbin.td: Likewise. * ld-elfvsb/elfvsb.exp: XFAIL non-PIC load offset tests on s390x. * ld-shared/shared.exp: Likewise.
2004-05-11 19:08:38 +02:00
RELRO_NOW=" "
LD_FLAG=wshared
bfd/ * elflink.c (elf_bfd_final_link): Don't output STT_SECTION symbol into .dynsym if elf_section_data (sec)->dynindx <= 0. Adjust counting of last_local. (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt created by the linker nor !SHF_ALLOC. * elf32-i386.c (elf_i386_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. Set sh_entsize for .got section in addition to .got.plt. (elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. (elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. Set sh_entsize for .got section in addition to .got.plt. * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO. (bfd_section_from_phdr): Likewise. (map_sections_to_segments): Likewise. (assign_file_positions_for_segments): Likewise. (get_program_header_size): Likewise. * elflink.c (bfd_elf_size_dynamic_sections): Set elf_tdata (output_bfd)->relro from info->relro. * elf-bfd.h (struct elf_obj_tdata): Add relro field. include/ * bfdlink.h (struct bfd_link_info): Add relro, relro_start and relro_end fields. * elf/common.h (PT_GNU_EH_FRAME, PT_GNU_STACK): Add comments. (PT_GNU_RELRO): Define. binutils/ * readelf.c (get_segment_type): Handle PT_GNU_RELRO. ld/ * genscripts.sh: Generate -z combreloc -z now -z relro scripts for binaries, -shared and -pie. * emulparams/elf_i386.sh (SEPARATE_GOTPLT): Set. * emulparams/elf_x86_64.sh (SEPARATE_GOTPLT): Set. * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Rename to... (OTHER_RELRO_SECTIONS): ... this. * ldlex.l (DATA_SEGMENT_RELRO_END): Add. * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Handle -z relro and -z norelro. (gld${EMULATION_NAME}_list_options): Add it to usage. (gld${EMULATION_NAME}_get_script): Return -z combreloc -z now -z relro scripts when appropriate. * scripttempl/elf.sc: Unset SEPARATE_GOTPLT if RELRO_NOW is set. Create separate .got.plt section if SEPARATE_GOTPLT. Move sections which are only written during relocation handling to the beginning of RW segment. If NO_SMALL_DATA, move .got before .data. Add DATA_SEGMENT_RELRO_END directive. Include OTHER_RELRO_SECTIONS. * ldgram.y (DATA_SEGMENT_RELRO_END): Add. * ldexp.c (exp_print_token): Handle DATA_SEGMENT_RELRO_END. (fold_unary): Likewise. (fold_binary): Handle -z relro. * ldexp.h (struct exp_data_seg): Add exp_dataseg_relro_seen and exp_dataseg_relro_adjust phases. Add relro_end field. * ldmain.c (main): Initialize link_info.relro to FALSE. * ldlang.c (lang_size_sections): Handle -z relro. ld/testsuite/ * ld-i386/tlspic.rd: Adjust for section reordering changes and removal of unneeded STT_SECTION symbols from .dynsym. * ld-i386/tlspic.dd: Likewise. * ld-i386/tlspic.sd: Likewise. * ld-i386/tlsbin.rd: Likewise. * ld-i386/tlsbinpic.s: Likewise. * ld-i386/tlsbin.dd: Likewise. * ld-i386/tlsbin.sd: Likewise. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlsnopic1.s: Likewise. * ld-i386/combreloc.d: Likewise. * ld-i386/tlsnopic.dd: Likewise. * ld-i386/tlsnopic.sd: Likewise. * ld-x86-64/tlspic.rd: Likewise. * ld-x86-64/tlspic.dd: Likewise. * ld-x86-64/tlsbin.dd: Likewise. * ld-x86-64/tlspic.sd: Likewise. * ld-x86-64/tlsbin.sd: Likewise. * ld-x86-64/tlspic.td: Likewise. * ld-x86-64/tlsbin.td: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-s390/tlspic1.s: Likewise. * ld-s390/tlsbinpic.s: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlspic.dd: Likewise. * ld-s390/tlsbin.dd: Likewise. * ld-s390/tlsbin.sd: Likewise. * ld-s390/tlsbin.td: Likewise. * ld-s390/tlspic.sd: Likewise. * ld-s390/tlspic.td: Likewise. * ld-s390/tlspic1_64.s: Likewise. * ld-s390/tlsbinpic_64.s: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic_64.dd: Likewise. * ld-s390/tlsbin_64.dd: Likewise. * ld-s390/tlspic_64.sd: Likewise. * ld-s390/tlspic_64.td: Likewise. * ld-s390/tlsbin_64.td: Likewise. * ld-s390/tlsbin_64.sd: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.g: Likewise. * ld-powerpc/tlsso32.t: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-ia64/tlspic.rd: Likewise. * ld-ia64/tlspic.dd: Likewise. * ld-ia64/tlspic.sd: Likewise. * ld-ia64/tlspic.td: Likewise. * ld-ia64/tlsbin.rd: Likewise. * ld-ia64/tlsbin.sd: Likewise. * ld-ia64/tlsbin.td: Likewise. * ld-elfvsb/elfvsb.exp: XFAIL non-PIC load offset tests on s390x. * ld-shared/shared.exp: Likewise.
2004-05-11 19:08:38 +02:00
COMBRELOC=ldscripts/${EMULATION_NAME}.xsw.tmp
( echo "/* Script for -shared -z combreloc -z relro -z now */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
ld whitespace fixes * pe-dll.c: Formatting, whitespace fixes. * NEWS: Whitespace fixes. * configure.ac: Likewise. * configure.tgt: Likewise. * deffilep.y: Likewise. * genscripts.sh: Likewise. * ld.texinfo: Likewise. * ldgram.y: Likewise. * ldlang.c: Likewise. * ldlex.l: Likewise. * lexsup.c: Likewise. * plugin.c: Likewise. * emulparams/arc-endianness.sh: Likewise. * emulparams/elf32_x86_64.sh: Likewise. * emulparams/elf64mmix.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/h8300elf.sh: Likewise. * emulparams/h8300elf_linux.sh: Likewise. * emulparams/vxworks.sh: Likewise. * emultempl/aarch64elf.em: Likewise. * emultempl/aix.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/metagelf.em: Likewise. * emultempl/msp430.em: Likewise. * emultempl/nds32elf.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spu_ovl.S: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/tic6xdsbt.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vms.em: Likewise. * po/Make-in: Likewise. * scripttempl/DWARF.sc: Likewise. * scripttempl/aix.sc: Likewise. * scripttempl/alpha.sc: Likewise. * scripttempl/alphavms.sc: Likewise. * scripttempl/aout.sc: Likewise. * scripttempl/arclinux.sc: Likewise. * scripttempl/armaout.sc: Likewise. * scripttempl/armbpabi.sc: Likewise. * scripttempl/armcoff.sc: Likewise. * scripttempl/avr.sc: Likewise. * scripttempl/crisaout.sc: Likewise. * scripttempl/delta68.sc: Likewise. * scripttempl/dlx.sc: Likewise. * scripttempl/elf.sc: Likewise. * scripttempl/elf32cr16.sc: Likewise. * scripttempl/elf32cr16c.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/elf32msp430.sc: Likewise. * scripttempl/elf32msp430_3.sc: Likewise. * scripttempl/elf32sh-symbian.sc: Likewise. * scripttempl/elf32xc16x.sc: Likewise. * scripttempl/elf32xc16xl.sc: Likewise. * scripttempl/elf32xc16xs.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/elfarc.sc: Likewise. * scripttempl/elfarcv2.sc: Likewise. * scripttempl/elfd10v.sc: Likewise. * scripttempl/elfd30v.sc: Likewise. * scripttempl/elfi370.sc: Likewise. * scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. * scripttempl/elfmicroblaze.sc: Likewise. * scripttempl/elfxgate.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/epiphany_4x4.sc: Likewise. * scripttempl/epocpe.sc: Likewise. * scripttempl/h8300.sc: Likewise. * scripttempl/h8300h.sc: Likewise. * scripttempl/h8300hn.sc: Likewise. * scripttempl/h8300s.sc: Likewise. * scripttempl/h8300sn.sc: Likewise. * scripttempl/h8300sx.sc: Likewise. * scripttempl/h8300sxn.sc: Likewise. * scripttempl/h8500.sc: Likewise. * scripttempl/h8500b.sc: Likewise. * scripttempl/h8500c.sc: Likewise. * scripttempl/h8500m.sc: Likewise. * scripttempl/h8500s.sc: Likewise. * scripttempl/hppaelf.sc: Likewise. * scripttempl/i386beos.sc: Likewise. * scripttempl/i386coff.sc: Likewise. * scripttempl/i386go32.sc: Likewise. * scripttempl/i386msdos.sc: Likewise. * scripttempl/i860coff.sc: Likewise. * scripttempl/i960.sc: Likewise. * scripttempl/ia64vms.sc: Likewise. * scripttempl/ip2k.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/m68kaux.sc: Likewise. * scripttempl/m68kcoff.sc: Likewise. * scripttempl/m88kbcs.sc: Likewise. * scripttempl/mcorepe.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/mips.sc: Likewise. * scripttempl/mipsbsd.sc: Likewise. * scripttempl/mmo.sc: Likewise. * scripttempl/moxie.sc: Likewise. * scripttempl/nds32elf.sc: Likewise. * scripttempl/nw.sc: Likewise. * scripttempl/pe.sc: Likewise. * scripttempl/pep.sc: Likewise. * scripttempl/pj.sc: Likewise. * scripttempl/ppcpe.sc: Likewise. * scripttempl/psos.sc: Likewise. * scripttempl/riscix.sc: Likewise. * scripttempl/sh.sc: Likewise. * scripttempl/sparccoff.sc: Likewise. * scripttempl/st2000.sc: Likewise. * scripttempl/tic30aout.sc: Likewise. * scripttempl/tic30coff.sc: Likewise. * scripttempl/tic4xcoff.sc: Likewise. * scripttempl/tic54xcoff.sc: Likewise. * scripttempl/tic80coff.sc: Likewise. * scripttempl/v850.sc: Likewise. * scripttempl/v850_rh850.sc: Likewise. * scripttempl/vanilla.sc: Likewise. * scripttempl/visium.sc: Likewise. * scripttempl/w65.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. * scripttempl/z80.sc: Likewise. * scripttempl/z8000.sc: Likewise. * configure: Regenerate.
2017-10-12 12:58:30 +02:00
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsw
bfd/ * elflink.c (elf_bfd_final_link): Don't output STT_SECTION symbol into .dynsym if elf_section_data (sec)->dynindx <= 0. Adjust counting of last_local. (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt created by the linker nor !SHF_ALLOC. * elf32-i386.c (elf_i386_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. Set sh_entsize for .got section in addition to .got.plt. (elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. (elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. Set sh_entsize for .got section in addition to .got.plt. * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO. (bfd_section_from_phdr): Likewise. (map_sections_to_segments): Likewise. (assign_file_positions_for_segments): Likewise. (get_program_header_size): Likewise. * elflink.c (bfd_elf_size_dynamic_sections): Set elf_tdata (output_bfd)->relro from info->relro. * elf-bfd.h (struct elf_obj_tdata): Add relro field. include/ * bfdlink.h (struct bfd_link_info): Add relro, relro_start and relro_end fields. * elf/common.h (PT_GNU_EH_FRAME, PT_GNU_STACK): Add comments. (PT_GNU_RELRO): Define. binutils/ * readelf.c (get_segment_type): Handle PT_GNU_RELRO. ld/ * genscripts.sh: Generate -z combreloc -z now -z relro scripts for binaries, -shared and -pie. * emulparams/elf_i386.sh (SEPARATE_GOTPLT): Set. * emulparams/elf_x86_64.sh (SEPARATE_GOTPLT): Set. * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Rename to... (OTHER_RELRO_SECTIONS): ... this. * ldlex.l (DATA_SEGMENT_RELRO_END): Add. * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Handle -z relro and -z norelro. (gld${EMULATION_NAME}_list_options): Add it to usage. (gld${EMULATION_NAME}_get_script): Return -z combreloc -z now -z relro scripts when appropriate. * scripttempl/elf.sc: Unset SEPARATE_GOTPLT if RELRO_NOW is set. Create separate .got.plt section if SEPARATE_GOTPLT. Move sections which are only written during relocation handling to the beginning of RW segment. If NO_SMALL_DATA, move .got before .data. Add DATA_SEGMENT_RELRO_END directive. Include OTHER_RELRO_SECTIONS. * ldgram.y (DATA_SEGMENT_RELRO_END): Add. * ldexp.c (exp_print_token): Handle DATA_SEGMENT_RELRO_END. (fold_unary): Likewise. (fold_binary): Handle -z relro. * ldexp.h (struct exp_data_seg): Add exp_dataseg_relro_seen and exp_dataseg_relro_adjust phases. Add relro_end field. * ldmain.c (main): Initialize link_info.relro to FALSE. * ldlang.c (lang_size_sections): Handle -z relro. ld/testsuite/ * ld-i386/tlspic.rd: Adjust for section reordering changes and removal of unneeded STT_SECTION symbols from .dynsym. * ld-i386/tlspic.dd: Likewise. * ld-i386/tlspic.sd: Likewise. * ld-i386/tlsbin.rd: Likewise. * ld-i386/tlsbinpic.s: Likewise. * ld-i386/tlsbin.dd: Likewise. * ld-i386/tlsbin.sd: Likewise. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlsnopic1.s: Likewise. * ld-i386/combreloc.d: Likewise. * ld-i386/tlsnopic.dd: Likewise. * ld-i386/tlsnopic.sd: Likewise. * ld-x86-64/tlspic.rd: Likewise. * ld-x86-64/tlspic.dd: Likewise. * ld-x86-64/tlsbin.dd: Likewise. * ld-x86-64/tlspic.sd: Likewise. * ld-x86-64/tlsbin.sd: Likewise. * ld-x86-64/tlspic.td: Likewise. * ld-x86-64/tlsbin.td: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-s390/tlspic1.s: Likewise. * ld-s390/tlsbinpic.s: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlspic.dd: Likewise. * ld-s390/tlsbin.dd: Likewise. * ld-s390/tlsbin.sd: Likewise. * ld-s390/tlsbin.td: Likewise. * ld-s390/tlspic.sd: Likewise. * ld-s390/tlspic.td: Likewise. * ld-s390/tlspic1_64.s: Likewise. * ld-s390/tlsbinpic_64.s: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic_64.dd: Likewise. * ld-s390/tlsbin_64.dd: Likewise. * ld-s390/tlspic_64.sd: Likewise. * ld-s390/tlspic_64.td: Likewise. * ld-s390/tlsbin_64.td: Likewise. * ld-s390/tlsbin_64.sd: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.g: Likewise. * ld-powerpc/tlsso32.t: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-ia64/tlspic.rd: Likewise. * ld-ia64/tlspic.dd: Likewise. * ld-ia64/tlspic.sd: Likewise. * ld-ia64/tlspic.td: Likewise. * ld-ia64/tlsbin.rd: Likewise. * ld-ia64/tlsbin.sd: Likewise. * ld-ia64/tlsbin.td: Likewise. * ld-elfvsb/elfvsb.exp: XFAIL non-PIC load offset tests on s390x. * ld-shared/shared.exp: Likewise.
2004-05-11 19:08:38 +02:00
rm -f ${COMBRELOC}
LD_FLAG=wsharedtextonly
COMBRELOC=ldscripts/${EMULATION_NAME}.xswe.tmp
( echo "/* Script for -shared -z combreloc -z separate-code -z relro -z now */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xswe
rm -f ${COMBRELOC}
bfd/ * elflink.c (elf_bfd_final_link): Don't output STT_SECTION symbol into .dynsym if elf_section_data (sec)->dynindx <= 0. Adjust counting of last_local. (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt created by the linker nor !SHF_ALLOC. * elf32-i386.c (elf_i386_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. Set sh_entsize for .got section in addition to .got.plt. (elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. (elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. Set sh_entsize for .got section in addition to .got.plt. * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO. (bfd_section_from_phdr): Likewise. (map_sections_to_segments): Likewise. (assign_file_positions_for_segments): Likewise. (get_program_header_size): Likewise. * elflink.c (bfd_elf_size_dynamic_sections): Set elf_tdata (output_bfd)->relro from info->relro. * elf-bfd.h (struct elf_obj_tdata): Add relro field. include/ * bfdlink.h (struct bfd_link_info): Add relro, relro_start and relro_end fields. * elf/common.h (PT_GNU_EH_FRAME, PT_GNU_STACK): Add comments. (PT_GNU_RELRO): Define. binutils/ * readelf.c (get_segment_type): Handle PT_GNU_RELRO. ld/ * genscripts.sh: Generate -z combreloc -z now -z relro scripts for binaries, -shared and -pie. * emulparams/elf_i386.sh (SEPARATE_GOTPLT): Set. * emulparams/elf_x86_64.sh (SEPARATE_GOTPLT): Set. * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Rename to... (OTHER_RELRO_SECTIONS): ... this. * ldlex.l (DATA_SEGMENT_RELRO_END): Add. * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Handle -z relro and -z norelro. (gld${EMULATION_NAME}_list_options): Add it to usage. (gld${EMULATION_NAME}_get_script): Return -z combreloc -z now -z relro scripts when appropriate. * scripttempl/elf.sc: Unset SEPARATE_GOTPLT if RELRO_NOW is set. Create separate .got.plt section if SEPARATE_GOTPLT. Move sections which are only written during relocation handling to the beginning of RW segment. If NO_SMALL_DATA, move .got before .data. Add DATA_SEGMENT_RELRO_END directive. Include OTHER_RELRO_SECTIONS. * ldgram.y (DATA_SEGMENT_RELRO_END): Add. * ldexp.c (exp_print_token): Handle DATA_SEGMENT_RELRO_END. (fold_unary): Likewise. (fold_binary): Handle -z relro. * ldexp.h (struct exp_data_seg): Add exp_dataseg_relro_seen and exp_dataseg_relro_adjust phases. Add relro_end field. * ldmain.c (main): Initialize link_info.relro to FALSE. * ldlang.c (lang_size_sections): Handle -z relro. ld/testsuite/ * ld-i386/tlspic.rd: Adjust for section reordering changes and removal of unneeded STT_SECTION symbols from .dynsym. * ld-i386/tlspic.dd: Likewise. * ld-i386/tlspic.sd: Likewise. * ld-i386/tlsbin.rd: Likewise. * ld-i386/tlsbinpic.s: Likewise. * ld-i386/tlsbin.dd: Likewise. * ld-i386/tlsbin.sd: Likewise. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlsnopic1.s: Likewise. * ld-i386/combreloc.d: Likewise. * ld-i386/tlsnopic.dd: Likewise. * ld-i386/tlsnopic.sd: Likewise. * ld-x86-64/tlspic.rd: Likewise. * ld-x86-64/tlspic.dd: Likewise. * ld-x86-64/tlsbin.dd: Likewise. * ld-x86-64/tlspic.sd: Likewise. * ld-x86-64/tlsbin.sd: Likewise. * ld-x86-64/tlspic.td: Likewise. * ld-x86-64/tlsbin.td: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-s390/tlspic1.s: Likewise. * ld-s390/tlsbinpic.s: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlspic.dd: Likewise. * ld-s390/tlsbin.dd: Likewise. * ld-s390/tlsbin.sd: Likewise. * ld-s390/tlsbin.td: Likewise. * ld-s390/tlspic.sd: Likewise. * ld-s390/tlspic.td: Likewise. * ld-s390/tlspic1_64.s: Likewise. * ld-s390/tlsbinpic_64.s: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic_64.dd: Likewise. * ld-s390/tlsbin_64.dd: Likewise. * ld-s390/tlspic_64.sd: Likewise. * ld-s390/tlspic_64.td: Likewise. * ld-s390/tlsbin_64.td: Likewise. * ld-s390/tlsbin_64.sd: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.g: Likewise. * ld-powerpc/tlsso32.t: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-ia64/tlspic.rd: Likewise. * ld-ia64/tlspic.dd: Likewise. * ld-ia64/tlspic.sd: Likewise. * ld-ia64/tlspic.td: Likewise. * ld-ia64/tlsbin.rd: Likewise. * ld-ia64/tlsbin.sd: Likewise. * ld-ia64/tlsbin.td: Likewise. * ld-elfvsb/elfvsb.exp: XFAIL non-PIC load offset tests on s390x. * ld-shared/shared.exp: Likewise.
2004-05-11 19:08:38 +02:00
unset RELRO_NOW
if test -n "$GENERATE_RELRO_SCRIPT"; then
LD_FLAG=wshared
RELRO=" "
COMBRELOC=ldscripts/${EMULATION_NAME}.xsco.tmp
( echo "/* Script for -shared -z combreloc -z relro */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsco
rm -f ${COMBRELOC}
LD_FLAG=wsharedtextonly
COMBRELOC=ldscripts/${EMULATION_NAME}.xsceo.tmp
( echo "/* Script for -shared -z combreloc -z separate-code -z relro */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsceo
rm -f ${COMBRELOC}
unset RELRO
fi
COMBRELOC=
* elf-bfd.h (enum elf_reloc_type_class): New. (struct elf_backend_data): Add elf_backend_reloc_type_class. (_bfd_elf_reloc_type_class): New. * elfxx-target.h (elf_backend_reloc_type_class): Define. (elfNN_bed): Add elf_backend_reloc_type_class. * elf.c (_bfd_elf_reloc_type_class): New. * elf32-i386.c (elf_i386_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (elf_i386_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (elf_i386_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elf32-sparc.c (elf32_sparc_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (elf32_sparc_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (elf32_sparc_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elf64-sparc.c (sparc64_elf_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (sparc64_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (sparc64_elf_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add reltext field. (elfNN_ia64_hash_table_create): Clear ia64_info. (get_reloc_section): Set DF_TEXTREL if the reloc is against read-only section. (elfNN_ia64_size_dynamic_sections): Use ia64_info->reltext flag instead of looking up section names for DT_TEXTREL. (elfNN_ia64_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elflink.h (size_dynamic_sections): Add spare DT_NULL tags. (struct elf_link_sort_rela): New. (elf_link_sort_cmp1, elf_link_sort_cmp2, elf_link_sort_relocs): New. (elf_bfd_final_link): Call elf_link_sort_relocs. Convert one spare DT_NULL into DT_RELCOUNT resp. DT_RELACOUNT if necessary. * bfdlink.h (struct bfd_link_info): Add combreloc and spare_dynamic_tags fields. * emultempl/elf32.em (place_orphan): Place orphan .rel* sections into .rel.dyn resp. .rela.dyn if combreloc. (get_script): If .x linker script is equal to .xn, only put it once into the binary. Add .xc and .xsc scripts. (parse_args): Handle -z combreloc and -z nocombreloc. * scripttempl/elf.sc (.rela.sbss): Fix a typo. For .xc and .xsc scripts put all .rel* or .rela* input sections but .rel*.plt and PLT-like sections into .rel.dyn resp. .rela.dyn. * genscripts.sh (GENERATE_COMBRELOC_SCRIPT): Set if SCRIPT_NAME is elf. Strip trailing whitespace from script. Generate .xc and .xsc scripts if requested. * ldmain.c (main): Initialize link_info.combreloc and link_info.spare_dynamic_tags. * lexsup.c (OPTION_SPARE_DYNAMIC_TAGS): Define. (ld_options): Add --spare-dynamic-tags option. (parse_args): Likewise. * ld.texinfo: Document -z combreloc and -z nocombreloc. * ldint.texinfo: Document .xc and .xsc linker scripts. * NEWS: Add notes about -z combreloc and SHF_MERGE.
2001-08-23 17:14:18 +02:00
fi
bfd/ * elflink.h (elf_link_add_object_symbols): Use !info->executable instead of info->shared where appropriate. (bfd_elfNN_size_dynamic_sections, elf_link_output_extsym): Likewise. * elflink.c (_bfd_elf_create_got_section): Likewise. (_bfd_elf_link_create_dynamic_sections): Likewise. (_bfd_elf_link_assign_sym_version): Likewise. * elf32-i386.c (elf_i386_size_dynamic_sections): Create .interp section and DT_DEBUG dynamic tag even for position independent executables. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. * elf32-s390.c (elf_s390_size_dynamic_sections: Likewise. * elf64-ppc.c (ppc64_elf_size_dynamic_sections: Likewise. * elf64-s390.c (elf_s390_size_dynamic_sections: Likewise. * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections: Likewise. * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections: Likewise. * elf32-sparc.c (elf32_sparc_size_dynamic_sections: Likewise. * elf64-alpha.c (elf64_alpha_size_dynamic_sections: Likewise. * elf64-sparc.c (sparc64_elf_size_dynamic_sections: Likewise. include/ * bfdlink.h (struct bfd_link_info): Add pie and executable bits. ld/ * lexsup.c (OPTION_PIE): Define. (ld_options): Add -pie and --pic-executable options. (parse_args): Handle OPTION_PIE. * ldmain.c (main): Initialize link_info.pie and link_info.executable. * genscripts.sh: Generate PIE scripts. * ld.texinfo: Document -pie and --pic-executable options. * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): (gld${EMULATION_NAME}_place_orphan): Likewise. (gld${EMULATION_NAME}_get_script): Include PIE scripts. * scripttempl/elf.sc: In PIE scripts set . the same way as in shared scripts. * emulparams/elf_i386.sh (GENERATE_PIE_SCRIPT): Set to yes. * emulparams/elf64_ia64.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf32ppc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64ppc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_x86_64.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_s390.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf32_sparc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64_sparc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64alpha.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64_s390.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_i386.sh (GENERATE_PIE_SCRIPT): Likewise.
2003-05-30 17:50:12 +02:00
unset CREATE_SHLIB
fi
if test -n "$GENERATE_PIE_SCRIPT"; then
DATA_ALIGNMENT=${DATA_ALIGNMENT_s-${DATA_ALIGNMENT_}}
CREATE_PIE=" "
LD_FLAG=pie
( echo "/* Script for -pie */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
ld whitespace fixes * pe-dll.c: Formatting, whitespace fixes. * NEWS: Whitespace fixes. * configure.ac: Likewise. * configure.tgt: Likewise. * deffilep.y: Likewise. * genscripts.sh: Likewise. * ld.texinfo: Likewise. * ldgram.y: Likewise. * ldlang.c: Likewise. * ldlex.l: Likewise. * lexsup.c: Likewise. * plugin.c: Likewise. * emulparams/arc-endianness.sh: Likewise. * emulparams/elf32_x86_64.sh: Likewise. * emulparams/elf64mmix.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/h8300elf.sh: Likewise. * emulparams/h8300elf_linux.sh: Likewise. * emulparams/vxworks.sh: Likewise. * emultempl/aarch64elf.em: Likewise. * emultempl/aix.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/metagelf.em: Likewise. * emultempl/msp430.em: Likewise. * emultempl/nds32elf.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spu_ovl.S: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/tic6xdsbt.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vms.em: Likewise. * po/Make-in: Likewise. * scripttempl/DWARF.sc: Likewise. * scripttempl/aix.sc: Likewise. * scripttempl/alpha.sc: Likewise. * scripttempl/alphavms.sc: Likewise. * scripttempl/aout.sc: Likewise. * scripttempl/arclinux.sc: Likewise. * scripttempl/armaout.sc: Likewise. * scripttempl/armbpabi.sc: Likewise. * scripttempl/armcoff.sc: Likewise. * scripttempl/avr.sc: Likewise. * scripttempl/crisaout.sc: Likewise. * scripttempl/delta68.sc: Likewise. * scripttempl/dlx.sc: Likewise. * scripttempl/elf.sc: Likewise. * scripttempl/elf32cr16.sc: Likewise. * scripttempl/elf32cr16c.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/elf32msp430.sc: Likewise. * scripttempl/elf32msp430_3.sc: Likewise. * scripttempl/elf32sh-symbian.sc: Likewise. * scripttempl/elf32xc16x.sc: Likewise. * scripttempl/elf32xc16xl.sc: Likewise. * scripttempl/elf32xc16xs.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/elfarc.sc: Likewise. * scripttempl/elfarcv2.sc: Likewise. * scripttempl/elfd10v.sc: Likewise. * scripttempl/elfd30v.sc: Likewise. * scripttempl/elfi370.sc: Likewise. * scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. * scripttempl/elfmicroblaze.sc: Likewise. * scripttempl/elfxgate.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/epiphany_4x4.sc: Likewise. * scripttempl/epocpe.sc: Likewise. * scripttempl/h8300.sc: Likewise. * scripttempl/h8300h.sc: Likewise. * scripttempl/h8300hn.sc: Likewise. * scripttempl/h8300s.sc: Likewise. * scripttempl/h8300sn.sc: Likewise. * scripttempl/h8300sx.sc: Likewise. * scripttempl/h8300sxn.sc: Likewise. * scripttempl/h8500.sc: Likewise. * scripttempl/h8500b.sc: Likewise. * scripttempl/h8500c.sc: Likewise. * scripttempl/h8500m.sc: Likewise. * scripttempl/h8500s.sc: Likewise. * scripttempl/hppaelf.sc: Likewise. * scripttempl/i386beos.sc: Likewise. * scripttempl/i386coff.sc: Likewise. * scripttempl/i386go32.sc: Likewise. * scripttempl/i386msdos.sc: Likewise. * scripttempl/i860coff.sc: Likewise. * scripttempl/i960.sc: Likewise. * scripttempl/ia64vms.sc: Likewise. * scripttempl/ip2k.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/m68kaux.sc: Likewise. * scripttempl/m68kcoff.sc: Likewise. * scripttempl/m88kbcs.sc: Likewise. * scripttempl/mcorepe.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/mips.sc: Likewise. * scripttempl/mipsbsd.sc: Likewise. * scripttempl/mmo.sc: Likewise. * scripttempl/moxie.sc: Likewise. * scripttempl/nds32elf.sc: Likewise. * scripttempl/nw.sc: Likewise. * scripttempl/pe.sc: Likewise. * scripttempl/pep.sc: Likewise. * scripttempl/pj.sc: Likewise. * scripttempl/ppcpe.sc: Likewise. * scripttempl/psos.sc: Likewise. * scripttempl/riscix.sc: Likewise. * scripttempl/sh.sc: Likewise. * scripttempl/sparccoff.sc: Likewise. * scripttempl/st2000.sc: Likewise. * scripttempl/tic30aout.sc: Likewise. * scripttempl/tic30coff.sc: Likewise. * scripttempl/tic4xcoff.sc: Likewise. * scripttempl/tic54xcoff.sc: Likewise. * scripttempl/tic80coff.sc: Likewise. * scripttempl/v850.sc: Likewise. * scripttempl/v850_rh850.sc: Likewise. * scripttempl/vanilla.sc: Likewise. * scripttempl/visium.sc: Likewise. * scripttempl/w65.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. * scripttempl/z80.sc: Likewise. * scripttempl/z8000.sc: Likewise. * configure: Regenerate.
2017-10-12 12:58:30 +02:00
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xd
LD_FLAG=pietextonly
( echo "/* Script for -pie -z separate-code */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xde
if test -n "$GENERATE_RELRO_SCRIPT"; then
RELRO=" "
LD_FLAG=pie
( echo "/* Script for -pie -z relro */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdo
LD_FLAG=pietextonly
( echo "/* Script for -pie -z separate-code -z relro */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdeo
unset RELRO
fi
bfd/ * elflink.h (elf_link_add_object_symbols): Use !info->executable instead of info->shared where appropriate. (bfd_elfNN_size_dynamic_sections, elf_link_output_extsym): Likewise. * elflink.c (_bfd_elf_create_got_section): Likewise. (_bfd_elf_link_create_dynamic_sections): Likewise. (_bfd_elf_link_assign_sym_version): Likewise. * elf32-i386.c (elf_i386_size_dynamic_sections): Create .interp section and DT_DEBUG dynamic tag even for position independent executables. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. * elf32-s390.c (elf_s390_size_dynamic_sections: Likewise. * elf64-ppc.c (ppc64_elf_size_dynamic_sections: Likewise. * elf64-s390.c (elf_s390_size_dynamic_sections: Likewise. * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections: Likewise. * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections: Likewise. * elf32-sparc.c (elf32_sparc_size_dynamic_sections: Likewise. * elf64-alpha.c (elf64_alpha_size_dynamic_sections: Likewise. * elf64-sparc.c (sparc64_elf_size_dynamic_sections: Likewise. include/ * bfdlink.h (struct bfd_link_info): Add pie and executable bits. ld/ * lexsup.c (OPTION_PIE): Define. (ld_options): Add -pie and --pic-executable options. (parse_args): Handle OPTION_PIE. * ldmain.c (main): Initialize link_info.pie and link_info.executable. * genscripts.sh: Generate PIE scripts. * ld.texinfo: Document -pie and --pic-executable options. * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): (gld${EMULATION_NAME}_place_orphan): Likewise. (gld${EMULATION_NAME}_get_script): Include PIE scripts. * scripttempl/elf.sc: In PIE scripts set . the same way as in shared scripts. * emulparams/elf_i386.sh (GENERATE_PIE_SCRIPT): Set to yes. * emulparams/elf64_ia64.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf32ppc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64ppc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_x86_64.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_s390.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf32_sparc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64_sparc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64alpha.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64_s390.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_i386.sh (GENERATE_PIE_SCRIPT): Likewise.
2003-05-30 17:50:12 +02:00
if test -n "$GENERATE_COMBRELOC_SCRIPT"; then
DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}}
bfd/ * elflink.c (elf_bfd_final_link): Don't output STT_SECTION symbol into .dynsym if elf_section_data (sec)->dynindx <= 0. Adjust counting of last_local. (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt created by the linker nor !SHF_ALLOC. * elf32-i386.c (elf_i386_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. Set sh_entsize for .got section in addition to .got.plt. (elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. (elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. Set sh_entsize for .got section in addition to .got.plt. * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO. (bfd_section_from_phdr): Likewise. (map_sections_to_segments): Likewise. (assign_file_positions_for_segments): Likewise. (get_program_header_size): Likewise. * elflink.c (bfd_elf_size_dynamic_sections): Set elf_tdata (output_bfd)->relro from info->relro. * elf-bfd.h (struct elf_obj_tdata): Add relro field. include/ * bfdlink.h (struct bfd_link_info): Add relro, relro_start and relro_end fields. * elf/common.h (PT_GNU_EH_FRAME, PT_GNU_STACK): Add comments. (PT_GNU_RELRO): Define. binutils/ * readelf.c (get_segment_type): Handle PT_GNU_RELRO. ld/ * genscripts.sh: Generate -z combreloc -z now -z relro scripts for binaries, -shared and -pie. * emulparams/elf_i386.sh (SEPARATE_GOTPLT): Set. * emulparams/elf_x86_64.sh (SEPARATE_GOTPLT): Set. * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Rename to... (OTHER_RELRO_SECTIONS): ... this. * ldlex.l (DATA_SEGMENT_RELRO_END): Add. * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Handle -z relro and -z norelro. (gld${EMULATION_NAME}_list_options): Add it to usage. (gld${EMULATION_NAME}_get_script): Return -z combreloc -z now -z relro scripts when appropriate. * scripttempl/elf.sc: Unset SEPARATE_GOTPLT if RELRO_NOW is set. Create separate .got.plt section if SEPARATE_GOTPLT. Move sections which are only written during relocation handling to the beginning of RW segment. If NO_SMALL_DATA, move .got before .data. Add DATA_SEGMENT_RELRO_END directive. Include OTHER_RELRO_SECTIONS. * ldgram.y (DATA_SEGMENT_RELRO_END): Add. * ldexp.c (exp_print_token): Handle DATA_SEGMENT_RELRO_END. (fold_unary): Likewise. (fold_binary): Handle -z relro. * ldexp.h (struct exp_data_seg): Add exp_dataseg_relro_seen and exp_dataseg_relro_adjust phases. Add relro_end field. * ldmain.c (main): Initialize link_info.relro to FALSE. * ldlang.c (lang_size_sections): Handle -z relro. ld/testsuite/ * ld-i386/tlspic.rd: Adjust for section reordering changes and removal of unneeded STT_SECTION symbols from .dynsym. * ld-i386/tlspic.dd: Likewise. * ld-i386/tlspic.sd: Likewise. * ld-i386/tlsbin.rd: Likewise. * ld-i386/tlsbinpic.s: Likewise. * ld-i386/tlsbin.dd: Likewise. * ld-i386/tlsbin.sd: Likewise. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlsnopic1.s: Likewise. * ld-i386/combreloc.d: Likewise. * ld-i386/tlsnopic.dd: Likewise. * ld-i386/tlsnopic.sd: Likewise. * ld-x86-64/tlspic.rd: Likewise. * ld-x86-64/tlspic.dd: Likewise. * ld-x86-64/tlsbin.dd: Likewise. * ld-x86-64/tlspic.sd: Likewise. * ld-x86-64/tlsbin.sd: Likewise. * ld-x86-64/tlspic.td: Likewise. * ld-x86-64/tlsbin.td: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-s390/tlspic1.s: Likewise. * ld-s390/tlsbinpic.s: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlspic.dd: Likewise. * ld-s390/tlsbin.dd: Likewise. * ld-s390/tlsbin.sd: Likewise. * ld-s390/tlsbin.td: Likewise. * ld-s390/tlspic.sd: Likewise. * ld-s390/tlspic.td: Likewise. * ld-s390/tlspic1_64.s: Likewise. * ld-s390/tlsbinpic_64.s: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic_64.dd: Likewise. * ld-s390/tlsbin_64.dd: Likewise. * ld-s390/tlspic_64.sd: Likewise. * ld-s390/tlspic_64.td: Likewise. * ld-s390/tlsbin_64.td: Likewise. * ld-s390/tlsbin_64.sd: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.g: Likewise. * ld-powerpc/tlsso32.t: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-ia64/tlspic.rd: Likewise. * ld-ia64/tlspic.dd: Likewise. * ld-ia64/tlspic.sd: Likewise. * ld-ia64/tlspic.td: Likewise. * ld-ia64/tlsbin.rd: Likewise. * ld-ia64/tlsbin.sd: Likewise. * ld-ia64/tlsbin.td: Likewise. * ld-elfvsb/elfvsb.exp: XFAIL non-PIC load offset tests on s390x. * ld-shared/shared.exp: Likewise.
2004-05-11 19:08:38 +02:00
COMBRELOC=ldscripts/${EMULATION_NAME}.xdc.tmp
LD_FLAG=cpie
( echo "/* Script for -pie -z combreloc */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
ld whitespace fixes * pe-dll.c: Formatting, whitespace fixes. * NEWS: Whitespace fixes. * configure.ac: Likewise. * configure.tgt: Likewise. * deffilep.y: Likewise. * genscripts.sh: Likewise. * ld.texinfo: Likewise. * ldgram.y: Likewise. * ldlang.c: Likewise. * ldlex.l: Likewise. * lexsup.c: Likewise. * plugin.c: Likewise. * emulparams/arc-endianness.sh: Likewise. * emulparams/elf32_x86_64.sh: Likewise. * emulparams/elf64mmix.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/h8300elf.sh: Likewise. * emulparams/h8300elf_linux.sh: Likewise. * emulparams/vxworks.sh: Likewise. * emultempl/aarch64elf.em: Likewise. * emultempl/aix.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/metagelf.em: Likewise. * emultempl/msp430.em: Likewise. * emultempl/nds32elf.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spu_ovl.S: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/tic6xdsbt.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vms.em: Likewise. * po/Make-in: Likewise. * scripttempl/DWARF.sc: Likewise. * scripttempl/aix.sc: Likewise. * scripttempl/alpha.sc: Likewise. * scripttempl/alphavms.sc: Likewise. * scripttempl/aout.sc: Likewise. * scripttempl/arclinux.sc: Likewise. * scripttempl/armaout.sc: Likewise. * scripttempl/armbpabi.sc: Likewise. * scripttempl/armcoff.sc: Likewise. * scripttempl/avr.sc: Likewise. * scripttempl/crisaout.sc: Likewise. * scripttempl/delta68.sc: Likewise. * scripttempl/dlx.sc: Likewise. * scripttempl/elf.sc: Likewise. * scripttempl/elf32cr16.sc: Likewise. * scripttempl/elf32cr16c.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/elf32msp430.sc: Likewise. * scripttempl/elf32msp430_3.sc: Likewise. * scripttempl/elf32sh-symbian.sc: Likewise. * scripttempl/elf32xc16x.sc: Likewise. * scripttempl/elf32xc16xl.sc: Likewise. * scripttempl/elf32xc16xs.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/elfarc.sc: Likewise. * scripttempl/elfarcv2.sc: Likewise. * scripttempl/elfd10v.sc: Likewise. * scripttempl/elfd30v.sc: Likewise. * scripttempl/elfi370.sc: Likewise. * scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. * scripttempl/elfmicroblaze.sc: Likewise. * scripttempl/elfxgate.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/epiphany_4x4.sc: Likewise. * scripttempl/epocpe.sc: Likewise. * scripttempl/h8300.sc: Likewise. * scripttempl/h8300h.sc: Likewise. * scripttempl/h8300hn.sc: Likewise. * scripttempl/h8300s.sc: Likewise. * scripttempl/h8300sn.sc: Likewise. * scripttempl/h8300sx.sc: Likewise. * scripttempl/h8300sxn.sc: Likewise. * scripttempl/h8500.sc: Likewise. * scripttempl/h8500b.sc: Likewise. * scripttempl/h8500c.sc: Likewise. * scripttempl/h8500m.sc: Likewise. * scripttempl/h8500s.sc: Likewise. * scripttempl/hppaelf.sc: Likewise. * scripttempl/i386beos.sc: Likewise. * scripttempl/i386coff.sc: Likewise. * scripttempl/i386go32.sc: Likewise. * scripttempl/i386msdos.sc: Likewise. * scripttempl/i860coff.sc: Likewise. * scripttempl/i960.sc: Likewise. * scripttempl/ia64vms.sc: Likewise. * scripttempl/ip2k.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/m68kaux.sc: Likewise. * scripttempl/m68kcoff.sc: Likewise. * scripttempl/m88kbcs.sc: Likewise. * scripttempl/mcorepe.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/mips.sc: Likewise. * scripttempl/mipsbsd.sc: Likewise. * scripttempl/mmo.sc: Likewise. * scripttempl/moxie.sc: Likewise. * scripttempl/nds32elf.sc: Likewise. * scripttempl/nw.sc: Likewise. * scripttempl/pe.sc: Likewise. * scripttempl/pep.sc: Likewise. * scripttempl/pj.sc: Likewise. * scripttempl/ppcpe.sc: Likewise. * scripttempl/psos.sc: Likewise. * scripttempl/riscix.sc: Likewise. * scripttempl/sh.sc: Likewise. * scripttempl/sparccoff.sc: Likewise. * scripttempl/st2000.sc: Likewise. * scripttempl/tic30aout.sc: Likewise. * scripttempl/tic30coff.sc: Likewise. * scripttempl/tic4xcoff.sc: Likewise. * scripttempl/tic54xcoff.sc: Likewise. * scripttempl/tic80coff.sc: Likewise. * scripttempl/v850.sc: Likewise. * scripttempl/v850_rh850.sc: Likewise. * scripttempl/vanilla.sc: Likewise. * scripttempl/visium.sc: Likewise. * scripttempl/w65.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. * scripttempl/z80.sc: Likewise. * scripttempl/z8000.sc: Likewise. * configure: Regenerate.
2017-10-12 12:58:30 +02:00
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdc
bfd/ * elflink.h (elf_link_add_object_symbols): Use !info->executable instead of info->shared where appropriate. (bfd_elfNN_size_dynamic_sections, elf_link_output_extsym): Likewise. * elflink.c (_bfd_elf_create_got_section): Likewise. (_bfd_elf_link_create_dynamic_sections): Likewise. (_bfd_elf_link_assign_sym_version): Likewise. * elf32-i386.c (elf_i386_size_dynamic_sections): Create .interp section and DT_DEBUG dynamic tag even for position independent executables. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. * elf32-s390.c (elf_s390_size_dynamic_sections: Likewise. * elf64-ppc.c (ppc64_elf_size_dynamic_sections: Likewise. * elf64-s390.c (elf_s390_size_dynamic_sections: Likewise. * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections: Likewise. * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections: Likewise. * elf32-sparc.c (elf32_sparc_size_dynamic_sections: Likewise. * elf64-alpha.c (elf64_alpha_size_dynamic_sections: Likewise. * elf64-sparc.c (sparc64_elf_size_dynamic_sections: Likewise. include/ * bfdlink.h (struct bfd_link_info): Add pie and executable bits. ld/ * lexsup.c (OPTION_PIE): Define. (ld_options): Add -pie and --pic-executable options. (parse_args): Handle OPTION_PIE. * ldmain.c (main): Initialize link_info.pie and link_info.executable. * genscripts.sh: Generate PIE scripts. * ld.texinfo: Document -pie and --pic-executable options. * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): (gld${EMULATION_NAME}_place_orphan): Likewise. (gld${EMULATION_NAME}_get_script): Include PIE scripts. * scripttempl/elf.sc: In PIE scripts set . the same way as in shared scripts. * emulparams/elf_i386.sh (GENERATE_PIE_SCRIPT): Set to yes. * emulparams/elf64_ia64.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf32ppc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64ppc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_x86_64.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_s390.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf32_sparc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64_sparc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64alpha.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64_s390.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_i386.sh (GENERATE_PIE_SCRIPT): Likewise.
2003-05-30 17:50:12 +02:00
rm -f ${COMBRELOC}
LD_FLAG=cpietextonly
COMBRELOC=ldscripts/${EMULATION_NAME}.xdce.tmp
( echo "/* Script for -pie -z combreloc -z separate-code */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdce
rm -f ${COMBRELOC}
bfd/ * elflink.c (elf_bfd_final_link): Don't output STT_SECTION symbol into .dynsym if elf_section_data (sec)->dynindx <= 0. Adjust counting of last_local. (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt created by the linker nor !SHF_ALLOC. * elf32-i386.c (elf_i386_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. Set sh_entsize for .got section in addition to .got.plt. (elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. (elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. Set sh_entsize for .got section in addition to .got.plt. * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO. (bfd_section_from_phdr): Likewise. (map_sections_to_segments): Likewise. (assign_file_positions_for_segments): Likewise. (get_program_header_size): Likewise. * elflink.c (bfd_elf_size_dynamic_sections): Set elf_tdata (output_bfd)->relro from info->relro. * elf-bfd.h (struct elf_obj_tdata): Add relro field. include/ * bfdlink.h (struct bfd_link_info): Add relro, relro_start and relro_end fields. * elf/common.h (PT_GNU_EH_FRAME, PT_GNU_STACK): Add comments. (PT_GNU_RELRO): Define. binutils/ * readelf.c (get_segment_type): Handle PT_GNU_RELRO. ld/ * genscripts.sh: Generate -z combreloc -z now -z relro scripts for binaries, -shared and -pie. * emulparams/elf_i386.sh (SEPARATE_GOTPLT): Set. * emulparams/elf_x86_64.sh (SEPARATE_GOTPLT): Set. * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Rename to... (OTHER_RELRO_SECTIONS): ... this. * ldlex.l (DATA_SEGMENT_RELRO_END): Add. * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Handle -z relro and -z norelro. (gld${EMULATION_NAME}_list_options): Add it to usage. (gld${EMULATION_NAME}_get_script): Return -z combreloc -z now -z relro scripts when appropriate. * scripttempl/elf.sc: Unset SEPARATE_GOTPLT if RELRO_NOW is set. Create separate .got.plt section if SEPARATE_GOTPLT. Move sections which are only written during relocation handling to the beginning of RW segment. If NO_SMALL_DATA, move .got before .data. Add DATA_SEGMENT_RELRO_END directive. Include OTHER_RELRO_SECTIONS. * ldgram.y (DATA_SEGMENT_RELRO_END): Add. * ldexp.c (exp_print_token): Handle DATA_SEGMENT_RELRO_END. (fold_unary): Likewise. (fold_binary): Handle -z relro. * ldexp.h (struct exp_data_seg): Add exp_dataseg_relro_seen and exp_dataseg_relro_adjust phases. Add relro_end field. * ldmain.c (main): Initialize link_info.relro to FALSE. * ldlang.c (lang_size_sections): Handle -z relro. ld/testsuite/ * ld-i386/tlspic.rd: Adjust for section reordering changes and removal of unneeded STT_SECTION symbols from .dynsym. * ld-i386/tlspic.dd: Likewise. * ld-i386/tlspic.sd: Likewise. * ld-i386/tlsbin.rd: Likewise. * ld-i386/tlsbinpic.s: Likewise. * ld-i386/tlsbin.dd: Likewise. * ld-i386/tlsbin.sd: Likewise. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlsnopic1.s: Likewise. * ld-i386/combreloc.d: Likewise. * ld-i386/tlsnopic.dd: Likewise. * ld-i386/tlsnopic.sd: Likewise. * ld-x86-64/tlspic.rd: Likewise. * ld-x86-64/tlspic.dd: Likewise. * ld-x86-64/tlsbin.dd: Likewise. * ld-x86-64/tlspic.sd: Likewise. * ld-x86-64/tlsbin.sd: Likewise. * ld-x86-64/tlspic.td: Likewise. * ld-x86-64/tlsbin.td: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-s390/tlspic1.s: Likewise. * ld-s390/tlsbinpic.s: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlspic.dd: Likewise. * ld-s390/tlsbin.dd: Likewise. * ld-s390/tlsbin.sd: Likewise. * ld-s390/tlsbin.td: Likewise. * ld-s390/tlspic.sd: Likewise. * ld-s390/tlspic.td: Likewise. * ld-s390/tlspic1_64.s: Likewise. * ld-s390/tlsbinpic_64.s: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic_64.dd: Likewise. * ld-s390/tlsbin_64.dd: Likewise. * ld-s390/tlspic_64.sd: Likewise. * ld-s390/tlspic_64.td: Likewise. * ld-s390/tlsbin_64.td: Likewise. * ld-s390/tlsbin_64.sd: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.g: Likewise. * ld-powerpc/tlsso32.t: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-ia64/tlspic.rd: Likewise. * ld-ia64/tlspic.dd: Likewise. * ld-ia64/tlspic.sd: Likewise. * ld-ia64/tlspic.td: Likewise. * ld-ia64/tlsbin.rd: Likewise. * ld-ia64/tlsbin.sd: Likewise. * ld-ia64/tlsbin.td: Likewise. * ld-elfvsb/elfvsb.exp: XFAIL non-PIC load offset tests on s390x. * ld-shared/shared.exp: Likewise.
2004-05-11 19:08:38 +02:00
RELRO_NOW=" "
LD_FLAG=wpie
bfd/ * elflink.c (elf_bfd_final_link): Don't output STT_SECTION symbol into .dynsym if elf_section_data (sec)->dynindx <= 0. Adjust counting of last_local. (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt created by the linker nor !SHF_ALLOC. * elf32-i386.c (elf_i386_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. Set sh_entsize for .got section in addition to .got.plt. (elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. (elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. Set sh_entsize for .got section in addition to .got.plt. * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO. (bfd_section_from_phdr): Likewise. (map_sections_to_segments): Likewise. (assign_file_positions_for_segments): Likewise. (get_program_header_size): Likewise. * elflink.c (bfd_elf_size_dynamic_sections): Set elf_tdata (output_bfd)->relro from info->relro. * elf-bfd.h (struct elf_obj_tdata): Add relro field. include/ * bfdlink.h (struct bfd_link_info): Add relro, relro_start and relro_end fields. * elf/common.h (PT_GNU_EH_FRAME, PT_GNU_STACK): Add comments. (PT_GNU_RELRO): Define. binutils/ * readelf.c (get_segment_type): Handle PT_GNU_RELRO. ld/ * genscripts.sh: Generate -z combreloc -z now -z relro scripts for binaries, -shared and -pie. * emulparams/elf_i386.sh (SEPARATE_GOTPLT): Set. * emulparams/elf_x86_64.sh (SEPARATE_GOTPLT): Set. * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Rename to... (OTHER_RELRO_SECTIONS): ... this. * ldlex.l (DATA_SEGMENT_RELRO_END): Add. * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Handle -z relro and -z norelro. (gld${EMULATION_NAME}_list_options): Add it to usage. (gld${EMULATION_NAME}_get_script): Return -z combreloc -z now -z relro scripts when appropriate. * scripttempl/elf.sc: Unset SEPARATE_GOTPLT if RELRO_NOW is set. Create separate .got.plt section if SEPARATE_GOTPLT. Move sections which are only written during relocation handling to the beginning of RW segment. If NO_SMALL_DATA, move .got before .data. Add DATA_SEGMENT_RELRO_END directive. Include OTHER_RELRO_SECTIONS. * ldgram.y (DATA_SEGMENT_RELRO_END): Add. * ldexp.c (exp_print_token): Handle DATA_SEGMENT_RELRO_END. (fold_unary): Likewise. (fold_binary): Handle -z relro. * ldexp.h (struct exp_data_seg): Add exp_dataseg_relro_seen and exp_dataseg_relro_adjust phases. Add relro_end field. * ldmain.c (main): Initialize link_info.relro to FALSE. * ldlang.c (lang_size_sections): Handle -z relro. ld/testsuite/ * ld-i386/tlspic.rd: Adjust for section reordering changes and removal of unneeded STT_SECTION symbols from .dynsym. * ld-i386/tlspic.dd: Likewise. * ld-i386/tlspic.sd: Likewise. * ld-i386/tlsbin.rd: Likewise. * ld-i386/tlsbinpic.s: Likewise. * ld-i386/tlsbin.dd: Likewise. * ld-i386/tlsbin.sd: Likewise. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlsnopic1.s: Likewise. * ld-i386/combreloc.d: Likewise. * ld-i386/tlsnopic.dd: Likewise. * ld-i386/tlsnopic.sd: Likewise. * ld-x86-64/tlspic.rd: Likewise. * ld-x86-64/tlspic.dd: Likewise. * ld-x86-64/tlsbin.dd: Likewise. * ld-x86-64/tlspic.sd: Likewise. * ld-x86-64/tlsbin.sd: Likewise. * ld-x86-64/tlspic.td: Likewise. * ld-x86-64/tlsbin.td: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-s390/tlspic1.s: Likewise. * ld-s390/tlsbinpic.s: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlspic.dd: Likewise. * ld-s390/tlsbin.dd: Likewise. * ld-s390/tlsbin.sd: Likewise. * ld-s390/tlsbin.td: Likewise. * ld-s390/tlspic.sd: Likewise. * ld-s390/tlspic.td: Likewise. * ld-s390/tlspic1_64.s: Likewise. * ld-s390/tlsbinpic_64.s: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic_64.dd: Likewise. * ld-s390/tlsbin_64.dd: Likewise. * ld-s390/tlspic_64.sd: Likewise. * ld-s390/tlspic_64.td: Likewise. * ld-s390/tlsbin_64.td: Likewise. * ld-s390/tlsbin_64.sd: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.g: Likewise. * ld-powerpc/tlsso32.t: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-ia64/tlspic.rd: Likewise. * ld-ia64/tlspic.dd: Likewise. * ld-ia64/tlspic.sd: Likewise. * ld-ia64/tlspic.td: Likewise. * ld-ia64/tlsbin.rd: Likewise. * ld-ia64/tlsbin.sd: Likewise. * ld-ia64/tlsbin.td: Likewise. * ld-elfvsb/elfvsb.exp: XFAIL non-PIC load offset tests on s390x. * ld-shared/shared.exp: Likewise.
2004-05-11 19:08:38 +02:00
COMBRELOC=ldscripts/${EMULATION_NAME}.xdw.tmp
( echo "/* Script for -pie -z combreloc -z relro -z now */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
ld whitespace fixes * pe-dll.c: Formatting, whitespace fixes. * NEWS: Whitespace fixes. * configure.ac: Likewise. * configure.tgt: Likewise. * deffilep.y: Likewise. * genscripts.sh: Likewise. * ld.texinfo: Likewise. * ldgram.y: Likewise. * ldlang.c: Likewise. * ldlex.l: Likewise. * lexsup.c: Likewise. * plugin.c: Likewise. * emulparams/arc-endianness.sh: Likewise. * emulparams/elf32_x86_64.sh: Likewise. * emulparams/elf64mmix.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/h8300elf.sh: Likewise. * emulparams/h8300elf_linux.sh: Likewise. * emulparams/vxworks.sh: Likewise. * emultempl/aarch64elf.em: Likewise. * emultempl/aix.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/metagelf.em: Likewise. * emultempl/msp430.em: Likewise. * emultempl/nds32elf.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spu_ovl.S: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/tic6xdsbt.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vms.em: Likewise. * po/Make-in: Likewise. * scripttempl/DWARF.sc: Likewise. * scripttempl/aix.sc: Likewise. * scripttempl/alpha.sc: Likewise. * scripttempl/alphavms.sc: Likewise. * scripttempl/aout.sc: Likewise. * scripttempl/arclinux.sc: Likewise. * scripttempl/armaout.sc: Likewise. * scripttempl/armbpabi.sc: Likewise. * scripttempl/armcoff.sc: Likewise. * scripttempl/avr.sc: Likewise. * scripttempl/crisaout.sc: Likewise. * scripttempl/delta68.sc: Likewise. * scripttempl/dlx.sc: Likewise. * scripttempl/elf.sc: Likewise. * scripttempl/elf32cr16.sc: Likewise. * scripttempl/elf32cr16c.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/elf32msp430.sc: Likewise. * scripttempl/elf32msp430_3.sc: Likewise. * scripttempl/elf32sh-symbian.sc: Likewise. * scripttempl/elf32xc16x.sc: Likewise. * scripttempl/elf32xc16xl.sc: Likewise. * scripttempl/elf32xc16xs.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/elfarc.sc: Likewise. * scripttempl/elfarcv2.sc: Likewise. * scripttempl/elfd10v.sc: Likewise. * scripttempl/elfd30v.sc: Likewise. * scripttempl/elfi370.sc: Likewise. * scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. * scripttempl/elfmicroblaze.sc: Likewise. * scripttempl/elfxgate.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/epiphany_4x4.sc: Likewise. * scripttempl/epocpe.sc: Likewise. * scripttempl/h8300.sc: Likewise. * scripttempl/h8300h.sc: Likewise. * scripttempl/h8300hn.sc: Likewise. * scripttempl/h8300s.sc: Likewise. * scripttempl/h8300sn.sc: Likewise. * scripttempl/h8300sx.sc: Likewise. * scripttempl/h8300sxn.sc: Likewise. * scripttempl/h8500.sc: Likewise. * scripttempl/h8500b.sc: Likewise. * scripttempl/h8500c.sc: Likewise. * scripttempl/h8500m.sc: Likewise. * scripttempl/h8500s.sc: Likewise. * scripttempl/hppaelf.sc: Likewise. * scripttempl/i386beos.sc: Likewise. * scripttempl/i386coff.sc: Likewise. * scripttempl/i386go32.sc: Likewise. * scripttempl/i386msdos.sc: Likewise. * scripttempl/i860coff.sc: Likewise. * scripttempl/i960.sc: Likewise. * scripttempl/ia64vms.sc: Likewise. * scripttempl/ip2k.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/m68kaux.sc: Likewise. * scripttempl/m68kcoff.sc: Likewise. * scripttempl/m88kbcs.sc: Likewise. * scripttempl/mcorepe.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/mips.sc: Likewise. * scripttempl/mipsbsd.sc: Likewise. * scripttempl/mmo.sc: Likewise. * scripttempl/moxie.sc: Likewise. * scripttempl/nds32elf.sc: Likewise. * scripttempl/nw.sc: Likewise. * scripttempl/pe.sc: Likewise. * scripttempl/pep.sc: Likewise. * scripttempl/pj.sc: Likewise. * scripttempl/ppcpe.sc: Likewise. * scripttempl/psos.sc: Likewise. * scripttempl/riscix.sc: Likewise. * scripttempl/sh.sc: Likewise. * scripttempl/sparccoff.sc: Likewise. * scripttempl/st2000.sc: Likewise. * scripttempl/tic30aout.sc: Likewise. * scripttempl/tic30coff.sc: Likewise. * scripttempl/tic4xcoff.sc: Likewise. * scripttempl/tic54xcoff.sc: Likewise. * scripttempl/tic80coff.sc: Likewise. * scripttempl/v850.sc: Likewise. * scripttempl/v850_rh850.sc: Likewise. * scripttempl/vanilla.sc: Likewise. * scripttempl/visium.sc: Likewise. * scripttempl/w65.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. * scripttempl/z80.sc: Likewise. * scripttempl/z8000.sc: Likewise. * configure: Regenerate.
2017-10-12 12:58:30 +02:00
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdw
bfd/ * elflink.c (elf_bfd_final_link): Don't output STT_SECTION symbol into .dynsym if elf_section_data (sec)->dynindx <= 0. Adjust counting of last_local. (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt created by the linker nor !SHF_ALLOC. * elf32-i386.c (elf_i386_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. Set sh_entsize for .got section in addition to .got.plt. (elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. (elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. Set sh_entsize for .got section in addition to .got.plt. * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO. (bfd_section_from_phdr): Likewise. (map_sections_to_segments): Likewise. (assign_file_positions_for_segments): Likewise. (get_program_header_size): Likewise. * elflink.c (bfd_elf_size_dynamic_sections): Set elf_tdata (output_bfd)->relro from info->relro. * elf-bfd.h (struct elf_obj_tdata): Add relro field. include/ * bfdlink.h (struct bfd_link_info): Add relro, relro_start and relro_end fields. * elf/common.h (PT_GNU_EH_FRAME, PT_GNU_STACK): Add comments. (PT_GNU_RELRO): Define. binutils/ * readelf.c (get_segment_type): Handle PT_GNU_RELRO. ld/ * genscripts.sh: Generate -z combreloc -z now -z relro scripts for binaries, -shared and -pie. * emulparams/elf_i386.sh (SEPARATE_GOTPLT): Set. * emulparams/elf_x86_64.sh (SEPARATE_GOTPLT): Set. * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Rename to... (OTHER_RELRO_SECTIONS): ... this. * ldlex.l (DATA_SEGMENT_RELRO_END): Add. * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Handle -z relro and -z norelro. (gld${EMULATION_NAME}_list_options): Add it to usage. (gld${EMULATION_NAME}_get_script): Return -z combreloc -z now -z relro scripts when appropriate. * scripttempl/elf.sc: Unset SEPARATE_GOTPLT if RELRO_NOW is set. Create separate .got.plt section if SEPARATE_GOTPLT. Move sections which are only written during relocation handling to the beginning of RW segment. If NO_SMALL_DATA, move .got before .data. Add DATA_SEGMENT_RELRO_END directive. Include OTHER_RELRO_SECTIONS. * ldgram.y (DATA_SEGMENT_RELRO_END): Add. * ldexp.c (exp_print_token): Handle DATA_SEGMENT_RELRO_END. (fold_unary): Likewise. (fold_binary): Handle -z relro. * ldexp.h (struct exp_data_seg): Add exp_dataseg_relro_seen and exp_dataseg_relro_adjust phases. Add relro_end field. * ldmain.c (main): Initialize link_info.relro to FALSE. * ldlang.c (lang_size_sections): Handle -z relro. ld/testsuite/ * ld-i386/tlspic.rd: Adjust for section reordering changes and removal of unneeded STT_SECTION symbols from .dynsym. * ld-i386/tlspic.dd: Likewise. * ld-i386/tlspic.sd: Likewise. * ld-i386/tlsbin.rd: Likewise. * ld-i386/tlsbinpic.s: Likewise. * ld-i386/tlsbin.dd: Likewise. * ld-i386/tlsbin.sd: Likewise. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlsnopic1.s: Likewise. * ld-i386/combreloc.d: Likewise. * ld-i386/tlsnopic.dd: Likewise. * ld-i386/tlsnopic.sd: Likewise. * ld-x86-64/tlspic.rd: Likewise. * ld-x86-64/tlspic.dd: Likewise. * ld-x86-64/tlsbin.dd: Likewise. * ld-x86-64/tlspic.sd: Likewise. * ld-x86-64/tlsbin.sd: Likewise. * ld-x86-64/tlspic.td: Likewise. * ld-x86-64/tlsbin.td: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-s390/tlspic1.s: Likewise. * ld-s390/tlsbinpic.s: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlspic.dd: Likewise. * ld-s390/tlsbin.dd: Likewise. * ld-s390/tlsbin.sd: Likewise. * ld-s390/tlsbin.td: Likewise. * ld-s390/tlspic.sd: Likewise. * ld-s390/tlspic.td: Likewise. * ld-s390/tlspic1_64.s: Likewise. * ld-s390/tlsbinpic_64.s: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic_64.dd: Likewise. * ld-s390/tlsbin_64.dd: Likewise. * ld-s390/tlspic_64.sd: Likewise. * ld-s390/tlspic_64.td: Likewise. * ld-s390/tlsbin_64.td: Likewise. * ld-s390/tlsbin_64.sd: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.g: Likewise. * ld-powerpc/tlsso32.t: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-ia64/tlspic.rd: Likewise. * ld-ia64/tlspic.dd: Likewise. * ld-ia64/tlspic.sd: Likewise. * ld-ia64/tlspic.td: Likewise. * ld-ia64/tlsbin.rd: Likewise. * ld-ia64/tlsbin.sd: Likewise. * ld-ia64/tlsbin.td: Likewise. * ld-elfvsb/elfvsb.exp: XFAIL non-PIC load offset tests on s390x. * ld-shared/shared.exp: Likewise.
2004-05-11 19:08:38 +02:00
rm -f ${COMBRELOC}
LD_FLAG=wpietextonly
COMBRELOC=ldscripts/${EMULATION_NAME}.xdwe.tmp
( echo "/* Script for -pie -z combreloc -z separate-code -z relro -z now */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdwe
rm -f ${COMBRELOC}
bfd/ * elflink.c (elf_bfd_final_link): Don't output STT_SECTION symbol into .dynsym if elf_section_data (sec)->dynindx <= 0. Adjust counting of last_local. (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt created by the linker nor !SHF_ALLOC. * elf32-i386.c (elf_i386_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. Set sh_entsize for .got section in addition to .got.plt. (elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. (elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. Set sh_entsize for .got section in addition to .got.plt. * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO. (bfd_section_from_phdr): Likewise. (map_sections_to_segments): Likewise. (assign_file_positions_for_segments): Likewise. (get_program_header_size): Likewise. * elflink.c (bfd_elf_size_dynamic_sections): Set elf_tdata (output_bfd)->relro from info->relro. * elf-bfd.h (struct elf_obj_tdata): Add relro field. include/ * bfdlink.h (struct bfd_link_info): Add relro, relro_start and relro_end fields. * elf/common.h (PT_GNU_EH_FRAME, PT_GNU_STACK): Add comments. (PT_GNU_RELRO): Define. binutils/ * readelf.c (get_segment_type): Handle PT_GNU_RELRO. ld/ * genscripts.sh: Generate -z combreloc -z now -z relro scripts for binaries, -shared and -pie. * emulparams/elf_i386.sh (SEPARATE_GOTPLT): Set. * emulparams/elf_x86_64.sh (SEPARATE_GOTPLT): Set. * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Rename to... (OTHER_RELRO_SECTIONS): ... this. * ldlex.l (DATA_SEGMENT_RELRO_END): Add. * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Handle -z relro and -z norelro. (gld${EMULATION_NAME}_list_options): Add it to usage. (gld${EMULATION_NAME}_get_script): Return -z combreloc -z now -z relro scripts when appropriate. * scripttempl/elf.sc: Unset SEPARATE_GOTPLT if RELRO_NOW is set. Create separate .got.plt section if SEPARATE_GOTPLT. Move sections which are only written during relocation handling to the beginning of RW segment. If NO_SMALL_DATA, move .got before .data. Add DATA_SEGMENT_RELRO_END directive. Include OTHER_RELRO_SECTIONS. * ldgram.y (DATA_SEGMENT_RELRO_END): Add. * ldexp.c (exp_print_token): Handle DATA_SEGMENT_RELRO_END. (fold_unary): Likewise. (fold_binary): Handle -z relro. * ldexp.h (struct exp_data_seg): Add exp_dataseg_relro_seen and exp_dataseg_relro_adjust phases. Add relro_end field. * ldmain.c (main): Initialize link_info.relro to FALSE. * ldlang.c (lang_size_sections): Handle -z relro. ld/testsuite/ * ld-i386/tlspic.rd: Adjust for section reordering changes and removal of unneeded STT_SECTION symbols from .dynsym. * ld-i386/tlspic.dd: Likewise. * ld-i386/tlspic.sd: Likewise. * ld-i386/tlsbin.rd: Likewise. * ld-i386/tlsbinpic.s: Likewise. * ld-i386/tlsbin.dd: Likewise. * ld-i386/tlsbin.sd: Likewise. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlsnopic1.s: Likewise. * ld-i386/combreloc.d: Likewise. * ld-i386/tlsnopic.dd: Likewise. * ld-i386/tlsnopic.sd: Likewise. * ld-x86-64/tlspic.rd: Likewise. * ld-x86-64/tlspic.dd: Likewise. * ld-x86-64/tlsbin.dd: Likewise. * ld-x86-64/tlspic.sd: Likewise. * ld-x86-64/tlsbin.sd: Likewise. * ld-x86-64/tlspic.td: Likewise. * ld-x86-64/tlsbin.td: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-s390/tlspic1.s: Likewise. * ld-s390/tlsbinpic.s: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlspic.dd: Likewise. * ld-s390/tlsbin.dd: Likewise. * ld-s390/tlsbin.sd: Likewise. * ld-s390/tlsbin.td: Likewise. * ld-s390/tlspic.sd: Likewise. * ld-s390/tlspic.td: Likewise. * ld-s390/tlspic1_64.s: Likewise. * ld-s390/tlsbinpic_64.s: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic_64.dd: Likewise. * ld-s390/tlsbin_64.dd: Likewise. * ld-s390/tlspic_64.sd: Likewise. * ld-s390/tlspic_64.td: Likewise. * ld-s390/tlsbin_64.td: Likewise. * ld-s390/tlsbin_64.sd: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.g: Likewise. * ld-powerpc/tlsso32.t: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-ia64/tlspic.rd: Likewise. * ld-ia64/tlspic.dd: Likewise. * ld-ia64/tlspic.sd: Likewise. * ld-ia64/tlspic.td: Likewise. * ld-ia64/tlsbin.rd: Likewise. * ld-ia64/tlsbin.sd: Likewise. * ld-ia64/tlsbin.td: Likewise. * ld-elfvsb/elfvsb.exp: XFAIL non-PIC load offset tests on s390x. * ld-shared/shared.exp: Likewise.
2004-05-11 19:08:38 +02:00
unset RELRO_NOW
if test -n "$GENERATE_RELRO_SCRIPT"; then
LD_FLAG=wpie
RELRO=" "
COMBRELOC=ldscripts/${EMULATION_NAME}.xdco.tmp
( echo "/* Script for -pie -z combreloc -z relro */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdco
rm -f ${COMBRELOC}
LD_FLAG=wpietextonly
COMBRELOC=ldscripts/${EMULATION_NAME}.xdceo.tmp
( echo "/* Script for -pie -z combreloc -z separate-code -z relro */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdceo
rm -f ${COMBRELOC}
unset RELRO
fi
COMBRELOC=
bfd/ * elflink.h (elf_link_add_object_symbols): Use !info->executable instead of info->shared where appropriate. (bfd_elfNN_size_dynamic_sections, elf_link_output_extsym): Likewise. * elflink.c (_bfd_elf_create_got_section): Likewise. (_bfd_elf_link_create_dynamic_sections): Likewise. (_bfd_elf_link_assign_sym_version): Likewise. * elf32-i386.c (elf_i386_size_dynamic_sections): Create .interp section and DT_DEBUG dynamic tag even for position independent executables. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. * elf32-s390.c (elf_s390_size_dynamic_sections: Likewise. * elf64-ppc.c (ppc64_elf_size_dynamic_sections: Likewise. * elf64-s390.c (elf_s390_size_dynamic_sections: Likewise. * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections: Likewise. * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections: Likewise. * elf32-sparc.c (elf32_sparc_size_dynamic_sections: Likewise. * elf64-alpha.c (elf64_alpha_size_dynamic_sections: Likewise. * elf64-sparc.c (sparc64_elf_size_dynamic_sections: Likewise. include/ * bfdlink.h (struct bfd_link_info): Add pie and executable bits. ld/ * lexsup.c (OPTION_PIE): Define. (ld_options): Add -pie and --pic-executable options. (parse_args): Handle OPTION_PIE. * ldmain.c (main): Initialize link_info.pie and link_info.executable. * genscripts.sh: Generate PIE scripts. * ld.texinfo: Document -pie and --pic-executable options. * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): (gld${EMULATION_NAME}_place_orphan): Likewise. (gld${EMULATION_NAME}_get_script): Include PIE scripts. * scripttempl/elf.sc: In PIE scripts set . the same way as in shared scripts. * emulparams/elf_i386.sh (GENERATE_PIE_SCRIPT): Set to yes. * emulparams/elf64_ia64.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf32ppc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64ppc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_x86_64.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_s390.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf32_sparc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64_sparc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64alpha.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64_s390.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_i386.sh (GENERATE_PIE_SCRIPT): Likewise.
2003-05-30 17:50:12 +02:00
fi
unset CREATE_PIE
1999-05-03 09:29:11 +02:00
fi
if test -n "$GENERATE_AUTO_IMPORT_SCRIPT"; then
LD_FLAG=auto_import
DATA_ALIGNMENT=${DATA_ALIGNMENT_}
( echo "/* Script for --enable-auto-import */"
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh ${CUSTOMIZER_SCRIPT}
source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
ld whitespace fixes * pe-dll.c: Formatting, whitespace fixes. * NEWS: Whitespace fixes. * configure.ac: Likewise. * configure.tgt: Likewise. * deffilep.y: Likewise. * genscripts.sh: Likewise. * ld.texinfo: Likewise. * ldgram.y: Likewise. * ldlang.c: Likewise. * ldlex.l: Likewise. * lexsup.c: Likewise. * plugin.c: Likewise. * emulparams/arc-endianness.sh: Likewise. * emulparams/elf32_x86_64.sh: Likewise. * emulparams/elf64mmix.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/h8300elf.sh: Likewise. * emulparams/h8300elf_linux.sh: Likewise. * emulparams/vxworks.sh: Likewise. * emultempl/aarch64elf.em: Likewise. * emultempl/aix.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/metagelf.em: Likewise. * emultempl/msp430.em: Likewise. * emultempl/nds32elf.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spu_ovl.S: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/tic6xdsbt.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vms.em: Likewise. * po/Make-in: Likewise. * scripttempl/DWARF.sc: Likewise. * scripttempl/aix.sc: Likewise. * scripttempl/alpha.sc: Likewise. * scripttempl/alphavms.sc: Likewise. * scripttempl/aout.sc: Likewise. * scripttempl/arclinux.sc: Likewise. * scripttempl/armaout.sc: Likewise. * scripttempl/armbpabi.sc: Likewise. * scripttempl/armcoff.sc: Likewise. * scripttempl/avr.sc: Likewise. * scripttempl/crisaout.sc: Likewise. * scripttempl/delta68.sc: Likewise. * scripttempl/dlx.sc: Likewise. * scripttempl/elf.sc: Likewise. * scripttempl/elf32cr16.sc: Likewise. * scripttempl/elf32cr16c.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/elf32msp430.sc: Likewise. * scripttempl/elf32msp430_3.sc: Likewise. * scripttempl/elf32sh-symbian.sc: Likewise. * scripttempl/elf32xc16x.sc: Likewise. * scripttempl/elf32xc16xl.sc: Likewise. * scripttempl/elf32xc16xs.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/elfarc.sc: Likewise. * scripttempl/elfarcv2.sc: Likewise. * scripttempl/elfd10v.sc: Likewise. * scripttempl/elfd30v.sc: Likewise. * scripttempl/elfi370.sc: Likewise. * scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. * scripttempl/elfmicroblaze.sc: Likewise. * scripttempl/elfxgate.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/epiphany_4x4.sc: Likewise. * scripttempl/epocpe.sc: Likewise. * scripttempl/h8300.sc: Likewise. * scripttempl/h8300h.sc: Likewise. * scripttempl/h8300hn.sc: Likewise. * scripttempl/h8300s.sc: Likewise. * scripttempl/h8300sn.sc: Likewise. * scripttempl/h8300sx.sc: Likewise. * scripttempl/h8300sxn.sc: Likewise. * scripttempl/h8500.sc: Likewise. * scripttempl/h8500b.sc: Likewise. * scripttempl/h8500c.sc: Likewise. * scripttempl/h8500m.sc: Likewise. * scripttempl/h8500s.sc: Likewise. * scripttempl/hppaelf.sc: Likewise. * scripttempl/i386beos.sc: Likewise. * scripttempl/i386coff.sc: Likewise. * scripttempl/i386go32.sc: Likewise. * scripttempl/i386msdos.sc: Likewise. * scripttempl/i860coff.sc: Likewise. * scripttempl/i960.sc: Likewise. * scripttempl/ia64vms.sc: Likewise. * scripttempl/ip2k.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/m68kaux.sc: Likewise. * scripttempl/m68kcoff.sc: Likewise. * scripttempl/m88kbcs.sc: Likewise. * scripttempl/mcorepe.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/mips.sc: Likewise. * scripttempl/mipsbsd.sc: Likewise. * scripttempl/mmo.sc: Likewise. * scripttempl/moxie.sc: Likewise. * scripttempl/nds32elf.sc: Likewise. * scripttempl/nw.sc: Likewise. * scripttempl/pe.sc: Likewise. * scripttempl/pep.sc: Likewise. * scripttempl/pj.sc: Likewise. * scripttempl/ppcpe.sc: Likewise. * scripttempl/psos.sc: Likewise. * scripttempl/riscix.sc: Likewise. * scripttempl/sh.sc: Likewise. * scripttempl/sparccoff.sc: Likewise. * scripttempl/st2000.sc: Likewise. * scripttempl/tic30aout.sc: Likewise. * scripttempl/tic30coff.sc: Likewise. * scripttempl/tic4xcoff.sc: Likewise. * scripttempl/tic54xcoff.sc: Likewise. * scripttempl/tic80coff.sc: Likewise. * scripttempl/v850.sc: Likewise. * scripttempl/v850_rh850.sc: Likewise. * scripttempl/vanilla.sc: Likewise. * scripttempl/visium.sc: Likewise. * scripttempl/w65.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. * scripttempl/z80.sc: Likewise. * scripttempl/z8000.sc: Likewise. * configure: Regenerate.
2017-10-12 12:58:30 +02:00
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xa
fi
case "$COMPILE_IN: $EMULATION_LIBPATH " in
:*" ${EMULATION_NAME} "*) COMPILE_IN=yes;;
esac
1999-05-03 09:29:11 +02:00
# PR ld/5652:
# Determine if the shell has support for the variable BASH_LINENO.
# When it is the case, it is only available inside functions.
has_lineno()
{
test "x$BASH_LINENO" != "x"
}
# Enable accruate error source in the compiler error messages, if possible.
if has_lineno; then
. ${srcdir}/genscrba.sh
2007-07-19 Roland McGrath <roland@redhat.com> * genscripts.sh (source_em, fragment): New sh functions. Truncate e${EMULATION_NAME}.c file before .em script fills it. Use source_em in place of . for the .em script. * emultempl/generic.em: Use fragment and source_em functions. * emultempl/aix.em: Likewise. * emultempl/alphaelf.em: Likewise. * emultempl/armcoff.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/cr16elf.em: Likewise. * emultempl/crxelf.em: Likewise. * emultempl/elf-generic.em: Likewise. * emultempl/elf32.em: Likewise. * emultempl/genelf.em: Likewise. * emultempl/gld960.em: Likewise. * emultempl/gld960c.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/ia64elf.em: Likewise. * emultempl/irix.em: Likewise. * emultempl/linux.em: Likewise. * emultempl/lnk960.em: Likewise. * emultempl/m68hc1xelf.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/mipsecoff.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/mmix-elfnmmo.em: Likewise. * emultempl/mmixelf.em: Likewise. * emultempl/mmo.em: Likewise. * emultempl/needrelax.em: Likewise. * emultempl/netbsd.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/scoreelf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/sunos.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vanilla.em: Likewise. * emultempl/vxworks.em: Likewise. * emultempl/xtensaelf.em: Likewise. * emultempl/z80.em: Likewise.
2007-07-19 21:56:10 +02:00
else
source_em()
{
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
source_sh $1
2007-07-19 Roland McGrath <roland@redhat.com> * genscripts.sh (source_em, fragment): New sh functions. Truncate e${EMULATION_NAME}.c file before .em script fills it. Use source_em in place of . for the .em script. * emultempl/generic.em: Use fragment and source_em functions. * emultempl/aix.em: Likewise. * emultempl/alphaelf.em: Likewise. * emultempl/armcoff.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/cr16elf.em: Likewise. * emultempl/crxelf.em: Likewise. * emultempl/elf-generic.em: Likewise. * emultempl/elf32.em: Likewise. * emultempl/genelf.em: Likewise. * emultempl/gld960.em: Likewise. * emultempl/gld960c.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/ia64elf.em: Likewise. * emultempl/irix.em: Likewise. * emultempl/linux.em: Likewise. * emultempl/lnk960.em: Likewise. * emultempl/m68hc1xelf.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/mipsecoff.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/mmix-elfnmmo.em: Likewise. * emultempl/mmixelf.em: Likewise. * emultempl/mmo.em: Likewise. * emultempl/needrelax.em: Likewise. * emultempl/netbsd.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/scoreelf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/sunos.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vanilla.em: Likewise. * emultempl/vxworks.em: Likewise. * emultempl/xtensaelf.em: Likewise. * emultempl/z80.em: Likewise.
2007-07-19 21:56:10 +02:00
}
fragment()
{
cat >> e${EMULATION_NAME}.c
}
fi
1999-05-03 09:29:11 +02:00
# Generate e${EMULATION_NAME}.c.
2007-07-19 Roland McGrath <roland@redhat.com> * genscripts.sh (source_em, fragment): New sh functions. Truncate e${EMULATION_NAME}.c file before .em script fills it. Use source_em in place of . for the .em script. * emultempl/generic.em: Use fragment and source_em functions. * emultempl/aix.em: Likewise. * emultempl/alphaelf.em: Likewise. * emultempl/armcoff.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/cr16elf.em: Likewise. * emultempl/crxelf.em: Likewise. * emultempl/elf-generic.em: Likewise. * emultempl/elf32.em: Likewise. * emultempl/genelf.em: Likewise. * emultempl/gld960.em: Likewise. * emultempl/gld960c.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/ia64elf.em: Likewise. * emultempl/irix.em: Likewise. * emultempl/linux.em: Likewise. * emultempl/lnk960.em: Likewise. * emultempl/m68hc1xelf.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/mipsecoff.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/mmix-elfnmmo.em: Likewise. * emultempl/mmixelf.em: Likewise. * emultempl/mmo.em: Likewise. * emultempl/needrelax.em: Likewise. * emultempl/netbsd.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/scoreelf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/sunos.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vanilla.em: Likewise. * emultempl/vxworks.em: Likewise. * emultempl/xtensaelf.em: Likewise. * emultempl/z80.em: Likewise.
2007-07-19 21:56:10 +02:00
# Start with an empty file, then the sourced .em script
# can use the "fragment" function to append.
> e${EMULATION_NAME}.c
source_em ${srcdir}/emultempl/${TEMPLATE_NAME-generic}.em
Automatic makefile dependencies for generated ld/e*.c This patch modifies genscripts.sh to emit dependency info along with the generated emulation e*.c files. This is done by a new source_sh function that records its arg to a file (.deps/e*.Tc), using the function whenever a shell script is sourced. Entries in the file are made unique and written to .deps/e*.Pc. These files are then included by the Makefile. * Makefile.am (GENSCRIPTS): Pass LIB_PATH as a parameter. Add DEPDIR parameter. (ELF_DEPS, ELF_GEN_DEPS, ELF_X86_DEPS): Delete. (ALL_EMULATION_SOURCES, ALL_64_EMULATION_SOURCES): Depend on $GEN_DEPENDS. (e*.c): Delete all dependencies, instead include dependencies from $DEPDIR/*.Pc. * Makefile.in: Regenerate. * configure.ac (source_sh): Define and use function. * configure: Regenerate. * emulparams/aarch64cloudabib.sh, * emulparams/aarch64elf32b.sh, * emulparams/aarch64elfb.sh, * emulparams/aarch64fbsdb.sh, * emulparams/aarch64linux32b.sh, * emulparams/aarch64linuxb.sh, * emulparams/arcelf.sh, * emulparams/arcelf_prof.sh, * emulparams/arclinux.sh, * emulparams/arclinux_nps.sh, * emulparams/arclinux_prof.sh, * emulparams/arcv2elf.sh, * emulparams/arcv2elfx.sh, * emulparams/armelf_fbsd.sh, * emulparams/armelf_linux_eabi.sh, * emulparams/armelf_linux_fdpiceabi.sh, * emulparams/armelf_nacl.sh, * emulparams/armelf_nbsd.sh, * emulparams/armelf_vxworks.sh, * emulparams/armelfb.sh, * emulparams/armelfb_fbsd.sh, * emulparams/armelfb_fuchsia.sh, * emulparams/armelfb_linux.sh, * emulparams/armelfb_linux_eabi.sh, * emulparams/armelfb_linux_fdpiceabi.sh, * emulparams/armelfb_nacl.sh, * emulparams/armelfb_nbsd.sh, * emulparams/armsymbian.sh, * emulparams/cskyelf_linux.sh, * emulparams/elf32_sparc_sol2.sh, * emulparams/elf32_sparc_vxworks.sh, * emulparams/elf32_tic6x_be.sh, * emulparams/elf32_tic6x_elf_be.sh, * emulparams/elf32_tic6x_elf_le.sh, * emulparams/elf32_tic6x_linux_be.sh, * emulparams/elf32_tic6x_linux_le.sh, * emulparams/elf32_x86_64.sh, * emulparams/elf32_x86_64_nacl.sh, * emulparams/elf32b4300.sh, * emulparams/elf32bfinfd.sh, * emulparams/elf32bmipn32.sh, * emulparams/elf32bsmip.sh, * emulparams/elf32btsmip.sh, * emulparams/elf32btsmip_fbsd.sh, * emulparams/elf32btsmipn32.sh, * emulparams/elf32btsmipn32_fbsd.sh, * emulparams/elf32ebmip.sh, * emulparams/elf32ebmipvxworks.sh, * emulparams/elf32elmip.sh, * emulparams/elf32elmipvxworks.sh, * emulparams/elf32frvfd.sh, * emulparams/elf32l4300.sh, * emulparams/elf32lm32fd.sh, * emulparams/elf32lmip.sh, * emulparams/elf32lppc.sh, * emulparams/elf32lppclinux.sh, * emulparams/elf32lppcnto.sh, * emulparams/elf32lppcsim.sh, * emulparams/elf32lr5900.sh, * emulparams/elf32lr5900n32.sh, * emulparams/elf32lriscv.sh, * emulparams/elf32lriscv_ilp32.sh, * emulparams/elf32lriscv_ilp32f.sh, * emulparams/elf32lsmip.sh, * emulparams/elf32ltsmip.sh, * emulparams/elf32ltsmip_fbsd.sh, * emulparams/elf32ltsmipn32.sh, * emulparams/elf32ltsmipn32_fbsd.sh, * emulparams/elf32microblazeel.sh, * emulparams/elf32or1k_linux.sh, * emulparams/elf32ppc.sh, * emulparams/elf32ppc_fbsd.sh, * emulparams/elf32ppccommon.sh, * emulparams/elf32ppclinux.sh, * emulparams/elf32ppcnto.sh, * emulparams/elf32ppcsim.sh, * emulparams/elf32ppcvxworks.sh, * emulparams/elf32ppcwindiss.sh, * emulparams/elf32tilegx_be.sh, * emulparams/elf64_ia64_fbsd.sh, * emulparams/elf64_sparc_fbsd.sh, * emulparams/elf64_sparc_sol2.sh, * emulparams/elf64alpha_fbsd.sh, * emulparams/elf64alpha_nbsd.sh, * emulparams/elf64bmip-defs.sh, * emulparams/elf64bmip.sh, * emulparams/elf64btsmip.sh, * emulparams/elf64btsmip_fbsd.sh, * emulparams/elf64lppc.sh, * emulparams/elf64lriscv-defs.sh, * emulparams/elf64lriscv.sh, * emulparams/elf64lriscv_lp64.sh, * emulparams/elf64lriscv_lp64f.sh, * emulparams/elf64ltsmip.sh, * emulparams/elf64ltsmip_fbsd.sh, * emulparams/elf64ppc.sh, * emulparams/elf64ppc_fbsd.sh, * emulparams/elf64rdos.sh, * emulparams/elf64tilegx_be.sh, * emulparams/elf_i386.sh, * emulparams/elf_i386_be.sh, * emulparams/elf_i386_fbsd.sh, * emulparams/elf_i386_ldso.sh, * emulparams/elf_i386_nacl.sh, * emulparams/elf_i386_sol2.sh, * emulparams/elf_i386_vxworks.sh, * emulparams/elf_iamcu.sh, * emulparams/elf_k1om.sh, * emulparams/elf_k1om_fbsd.sh, * emulparams/elf_l1om.sh, * emulparams/elf_l1om_fbsd.sh, * emulparams/elf_x86_64.sh, * emulparams/elf_x86_64_cloudabi.sh, * emulparams/elf_x86_64_fbsd.sh, * emulparams/elf_x86_64_nacl.sh, * emulparams/elf_x86_64_sol2.sh, * emulparams/h8300helf.sh, * emulparams/h8300helf_linux.sh, * emulparams/h8300hnelf.sh, * emulparams/h8300self.sh, * emulparams/h8300self_linux.sh, * emulparams/h8300snelf.sh, * emulparams/h8300sxelf.sh, * emulparams/h8300sxelf_linux.sh, * emulparams/h8300sxnelf.sh, * emulparams/hppanbsd.sh, * emulparams/hppaobsd.sh, * emulparams/m32rlelf.sh, * emulparams/m32rlelf_linux.sh, * emulparams/m68kelfnbsd.sh, * emulparams/mn10300.sh, * emulparams/msp430X.sh, * emulparams/nds32belf.sh, * emulparams/nds32belf16m.sh, * emulparams/nds32belf_linux.sh, * emulparams/pjlelf.sh, * emulparams/ppclynx.sh, * emulparams/score7_elf.sh, * emulparams/shelf_fd.sh, * emulparams/shelf_linux.sh, * emulparams/shelf_nbsd.sh, * emulparams/shelf_uclinux.sh, * emulparams/shelf_vxworks.sh, * emulparams/shl.sh, * emulparams/shlelf.sh, * emulparams/shlelf_fd.sh, * emulparams/shlelf_nbsd.sh, * emulparams/shlelf_vxworks.sh: Use source_sh. * genscripts.sh: Adjust for changed parameters. Emit dependencies for e*.c to .deps/*.Pc. (source_sh): New function, use it throughout to source scripts. * genscrba.sh (source_em): Use source_sh.
2019-04-12 13:02:57 +02:00
if test -n "${DEPDIR}"; then
ecdeps=
for dep in `cat ${DEPDIR}/e${EMULATION_NAME}.Tc`; do
case " $ecdeps " in
*" $dep "*): ;;
*) ecdeps="$ecdeps $dep" ;;
esac
done
rm -f ${DEPDIR}/e${EMULATION_NAME}.Tc
echo "e${EMULATION_NAME}.c:${ecdeps}" > ${DEPDIR}/e${EMULATION_NAME}.Pc
fi