diff --git a/ld/NEWS b/ld/NEWS index 24458964188..8f67fbe1793 100644 --- a/ld/NEWS +++ b/ld/NEWS @@ -1,7 +1,7 @@ -*- text -*- * Add -z globalaudit command line option to force audit libraries to be run for every dynamic object loaded by an executable - provided that the loader - supports this functionality. + supports this functionality. * Tighten linker script grammar around file name specifiers to prevent the use of SORT_BY_ALIGNMENT and SORT_BY_INIT_PRIORITY on filenames. These would diff --git a/ld/configure b/ld/configure index eb6c2378267..473b6c0562f 100755 --- a/ld/configure +++ b/ld/configure @@ -15419,7 +15419,7 @@ fi if test "${enable_targets+set}" = set; then : enableval=$enable_targets; case "${enableval}" in yes | "") as_fn_error "enable-targets option must specify target names or 'all'" "$LINENO" 5 - ;; + ;; no) enable_targets= ;; *) enable_targets=$enableval ;; esac diff --git a/ld/configure.ac b/ld/configure.ac index 02b23e17db4..7e16cb49678 100644 --- a/ld/configure.ac +++ b/ld/configure.ac @@ -44,7 +44,7 @@ AC_ARG_ENABLE(targets, [ --enable-targets alternative target configurations], [case "${enableval}" in yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all') - ;; + ;; no) enable_targets= ;; *) enable_targets=$enableval ;; esac])dnl @@ -120,7 +120,7 @@ AC_SUBST(installed_linker) AC_ARG_ENABLE([got], AS_HELP_STRING([--enable-got=], - [GOT handling scheme (target, single, negative, multigot)]), + [GOT handling scheme (target, single, negative, multigot)]), [case "${enableval}" in target | single | negative | multigot) got_handling=$enableval ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-got option) ;; @@ -130,16 +130,16 @@ esac], case "${got_handling}" in target) AC_DEFINE([GOT_HANDLING_DEFAULT], [GOT_HANDLING_TARGET_DEFAULT], - [Define to choose default GOT handling scheme]) ;; + [Define to choose default GOT handling scheme]) ;; single) AC_DEFINE([GOT_HANDLING_DEFAULT], [GOT_HANDLING_SINGLE], - [Define to choose default GOT handling scheme]) ;; + [Define to choose default GOT handling scheme]) ;; negative) AC_DEFINE([GOT_HANDLING_DEFAULT], [GOT_HANDLING_NEGATIVE], - [Define to choose default GOT handling scheme]) ;; + [Define to choose default GOT handling scheme]) ;; multigot) AC_DEFINE([GOT_HANDLING_DEFAULT], [GOT_HANDLING_MULTIGOT], - [Define to choose default GOT handling scheme]) ;; + [Define to choose default GOT handling scheme]) ;; *) AC_MSG_ERROR(bad value ${got_handling} for --enable-got option) ;; esac diff --git a/ld/configure.tgt b/ld/configure.tgt index 3193844422b..42613e8f4f1 100644 --- a/ld/configure.tgt +++ b/ld/configure.tgt @@ -28,9 +28,9 @@ # targ_extra_libpath additional linker emulations using LIB_PATH # targ_extra_ofiles additional host-compiled objects needed by the emulation # targ64_extra_emuls additional linker emulations to provide if -# --enable-64-bit-bfd is given or if host is 64 bit. +# --enable-64-bit-bfd is given or if host is 64 bit. # targ64_extra_libpath additional linker emulations using LIB_PATH if -# --enable-64-bit-bfd is given or if host is 64 bit. +# --enable-64-bit-bfd is given or if host is 64 bit. # NATIVE_LIB_DIRS library directories to search on this host # (if we are a native or sysrooted linker) @@ -71,7 +71,7 @@ aarch64-*-linux*) targ_emul=aarch64linux targ_extra_libpath="aarch64linuxb aarch64linux32 aarch64linux32b armelfb_linux_eabi armelf_linux_eabi" targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb $targ_extra_libpath" ;; alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) - targ_emul=elf64alpha_fbsd + targ_emul=elf64alpha_fbsd targ_extra_emuls="elf64alpha alpha" tdir_alpha=`echo ${targ_alias} | sed -e 's/freebsd/freebsdecoff/'` ;; alpha*-*-linux*ecoff*) targ_emul=alpha targ_extra_emuls=elf64alpha @@ -87,7 +87,7 @@ alpha*-*-*vms*) targ_emul=alphavms ;; arc*-*-elf*) targ_emul=arcelf targ_extra_emuls="arcelf_prof arclinux arclinux_nps arclinux_prof arcv2elf arcv2elfx" - ;; + ;; arc*-*-linux*) case "${with_cpu}" in nps400) targ_emul=arclinux_nps targ_extra_emuls=arclinux @@ -110,22 +110,22 @@ arm-*-coff) targ_emul=armcoff ;; arm*b-*-freebsd*) targ_emul=armelfb_fbsd targ_extra_emuls="armelf_fbsd armelf" ;; arm*-*-freebsd* | arm-*-kfreebsd*-gnu) - targ_emul=armelf_fbsd + targ_emul=armelf_fbsd targ_extra_emuls="armelfb_fbsd armelf" ;; armeb-*-netbsdelf*) targ_emul=armelfb_nbsd; targ_extra_emuls="armelf_nbsd armelf armnbsd" ;; arm-*-netbsdelf*) targ_emul=armelf_nbsd; targ_extra_emuls="armelfb_nbsd armelf armnbsd" ;; arm-*-netbsd*) targ_emul=armnbsd; - targ_extra_emuls="armelf armelf_nbsd armelfb_nbsd" ;; + targ_extra_emuls="armelf armelf_nbsd armelfb_nbsd" ;; arm-*-nto*) targ_emul=armnto ;; arm-*-openbsd*) targ_emul=armnbsd ;; arm-*-phoenix*) targ_emul=armelf ;; armeb-*-elf | armeb-*-eabi*) targ_emul=armelfb ;; arm-*-elf | arm*-*-eabi* | arm-*-rtems*) - targ_emul=armelf ;; -arm*-*-symbianelf*) targ_emul=armsymbian;; + targ_emul=armelf ;; +arm*-*-symbianelf*) targ_emul=armsymbian;; arm-*-kaos*) targ_emul=armelf ;; arm9e-*-elf) targ_emul=armelf ;; arm*b-*-linux-*eabi*) targ_emul=armelfb_linux_eabi @@ -140,7 +140,7 @@ arm*-*-linux-*eabi*) targ_emul=armelf_linux_eabi targ_extra_emuls=armelfb_linux_eabi targ_extra_libpath=$targ_extra_emuls ;; -arm*-*-linux-*) targ_emul=armelf_linux +arm*-*-linux-*) targ_emul=armelf_linux targ_extra_emuls="armelf armelfb armelfb_linux" targ_extra_libpath="armelfb_linux" ;; @@ -185,8 +185,8 @@ bfin-*-linux-uclibc*) targ_emul=elf32bfinfd; targ_extra_emuls="elf32bfin" targ_extra_libpath=$targ_extra_emuls ;; -cr16-*-elf*) targ_emul=elf32cr16 ;; -cr16c-*-elf*) targ_emul=elf32cr16c +cr16-*-elf*) targ_emul=elf32cr16 ;; +cr16c-*-elf*) targ_emul=elf32cr16c ;; cris-*-*aout*) targ_emul=crisaout targ_extra_emuls="criself crislinux" @@ -284,15 +284,15 @@ x86_64-*-linux-*) targ_emul=elf_x86_64 tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'` tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'` ;; i[3-7]86-*-redox*) targ_emul=elf_i386 - targ_extra_emuls=elf_x86_64 ;; + targ_extra_emuls=elf_x86_64 ;; x86_64-*-redox*) targ_emul=elf_x86_64 targ_extra_emuls=elf_i386 ;; i[3-7]86-*-sysv[45]*) targ_emul=elf_i386 targ_extra_emuls=elf_iamcu ;; i[3-7]86-*-solaris2*) targ_emul=elf_i386_sol2 - targ_extra_emuls="elf_i386_ldso elf_i386 elf_iamcu elf_x86_64_sol2 elf_x86_64 elf_l1om elf_k1om" + targ_extra_emuls="elf_i386_ldso elf_i386 elf_iamcu elf_x86_64_sol2 elf_x86_64 elf_l1om elf_k1om" targ_extra_libpath=$targ_extra_emuls - ;; + ;; x86_64-*-solaris2*) targ_emul=elf_x86_64_sol2 targ_extra_emuls="elf_x86_64 elf_i386_sol2 elf_i386_ldso elf_i386 elf_iamcu elf_l1om elf_k1om" @@ -301,9 +301,9 @@ x86_64-*-solaris2*) i[3-7]86-*-unixware) targ_emul=elf_i386 targ_extra_emuls=elf_iamcu ;; i[3-7]86-*-solaris*) targ_emul=elf_i386_ldso - targ_extra_emuls="elf_i386" + targ_extra_emuls="elf_i386" targ_extra_libpath=$targ_extra_emuls - ;; + ;; i[3-7]86-*-netbsdelf* | \ i[3-7]86-*-netbsd*-gnu* | \ i[3-7]86-*-knetbsd*-gnu) @@ -320,14 +320,14 @@ x86_64-*-netbsd*) targ_emul=elf_x86_64 case "${tdir_elf_iamcu}" in *-netbsdelf*) ;; *) tdir_elf_iamcu=`echo ${tdir_elf_iamcu} | \ - sed -e 's/netbsd/netbsdelf/'`;; + sed -e 's/netbsd/netbsdelf/'`;; esac tdir_elf_i386=`echo ${targ_alias} | \ sed -e 's/x86_64/i386/'` case "${tdir_elf_i386}" in *-netbsdelf*) ;; *) tdir_elf_i386=`echo ${tdir_elf_i386} | \ - sed -e 's/netbsd/netbsdelf/'`;; + sed -e 's/netbsd/netbsdelf/'`;; esac ;; i[3-7]86-*-netware) targ_emul=i386nw ;; i[3-7]86-*-elfiamcu) targ_emul=elf_iamcu @@ -349,7 +349,7 @@ i[3-7]86-*-dragonfly*) targ_emul=elf_i386 x86_64-*-dragonfly*) targ_emul=elf_x86_64 targ_extra_emuls="elf_i386 elf_iamcu elf_l1om elf_k1om" ;; i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu) - targ_emul=elf_i386_fbsd + targ_emul=elf_i386_fbsd targ_extra_emuls="elf_i386 elf_iamcu i386bsd" ;; x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) targ_emul=elf_x86_64_fbsd @@ -388,7 +388,7 @@ x86_64-*-mingw*) targ_emul=i386pep ; targ_extra_emuls=i386pe targ_extra_ofiles="deffilep.o pep-dll.o pe-dll.o" ;; i[3-7]86-*-interix*) targ_emul=i386pe_posix; - targ_extra_ofiles="deffilep.o pe-dll.o" ;; + targ_extra_ofiles="deffilep.o pe-dll.o" ;; i[3-7]86-*-beospe*) targ_emul=i386beos ;; i[3-7]86-*-beos*) targ_emul=elf_i386_be ;; i[3-7]86-*-vxworks*) targ_emul=elf_i386_vxworks ;; @@ -419,7 +419,7 @@ i960-*-elf*) targ_emul=elf32_i960 ia16-*-elf*) targ_emul=elf_i386 targ_extra_emuls=i386msdos ;; ia64-*-elf*) targ_emul=elf64_ia64 ;; ia64-*-freebsd* | ia64-*-kfreebsd*-gnu) - targ_emul=elf64_ia64_fbsd + targ_emul=elf64_ia64_fbsd targ_extra_emuls="elf64_ia64" ;; ia64-*-netbsd*) targ_emul=elf64_ia64 ;; ia64-*-linux*) targ_emul=elf64_ia64 ;; @@ -428,19 +428,19 @@ ia64-*-aix*) targ_emul=elf64_aix ;; ip2k-*-elf) targ_emul=elf32ip2k ;; -iq2000-*-elf) targ_emul=elf32iq2000 ; targ_extra_emuls="elf32iq10" +iq2000-*-elf) targ_emul=elf32iq2000 ; targ_extra_emuls="elf32iq10" + ;; +lm32-*-*linux*) targ_emul=elf32lm32fd ;; +lm32-*-*) targ_emul=elf32lm32 ; targ_extra_emuls="elf32lm32fd" ;; -lm32-*-*linux*) targ_emul=elf32lm32fd ;; -lm32-*-*) targ_emul=elf32lm32 ; targ_extra_emuls="elf32lm32fd" - ;; m32c-*-elf | m32c-*-rtems*) targ_emul=elf32m32c ;; -m32r*le-*-elf*) targ_emul=m32rlelf ;; +m32r*le-*-elf*) targ_emul=m32rlelf ;; m32r*-*-elf* | m32r*-*-rtems*) targ_emul=m32relf ;; -m32r*le-*-linux-*) targ_emul=m32rlelf_linux ;; -m32r*-*-linux-*) targ_emul=m32relf_linux +m32r*le-*-linux-*) targ_emul=m32rlelf_linux ;; +m32r*-*-linux-*) targ_emul=m32relf_linux ;; m68hc11-*-*|m6811-*-*) targ_emul=m68hc11elf targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;; @@ -461,7 +461,7 @@ m68*-*-hpux*) targ_emul=hp3hpux ;; m68k-*-linux*aout*) targ_emul=m68klinux targ_extra_emuls=m68kelf tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'` ;; -m68k-*-linux-*) targ_emul=m68kelf +m68k-*-linux-*) targ_emul=m68kelf targ_extra_emuls=m68klinux tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'` ;; m68k-*-uclinux*) targ_emul=m68kelf ;; @@ -496,14 +496,14 @@ microblaze*) targ_emul=elf32microblaze ;; mips*-sgi-irix5*) targ_emul=elf32bsmip ;; mips*-sgi-irix6*) targ_emul=elf32bmipn32 - targ_extra_emuls="elf32bsmip elf64bmip" + targ_extra_emuls="elf32bsmip elf64bmip" targ_extra_libpath=$targ_extra_emuls ;; mips*el-*-netbsd*) targ_emul=elf32ltsmip targ_extra_emuls="elf32btsmip elf64ltsmip elf64btsmip" ;; mips*-*-netbsd*) targ_emul=elf32btsmip targ_extra_emuls="elf32ltsmip elf64btsmip elf64ltsmip" - ;; + ;; mips64el-*-openbsd*) targ_emul=elf64ltsmip targ_extra_emuls=elf64btsmip ;; @@ -534,7 +534,7 @@ mips*-*-elf* | mips*-*-rtems*) mips*el-*-vxworks*) targ_emul=elf32elmipvxworks targ_extra_emuls="elf32ebmipvxworks" ;; mips*-*-vxworks*) targ_emul=elf32ebmipvxworks - targ_extra_emuls="elf32elmipvxworks" ;; + targ_extra_emuls="elf32elmipvxworks" ;; mips*-*-windiss) targ_emul=elf32mipswindiss ;; mips64*el-*-linux-*) targ_emul=elf32ltsmipn32 targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" @@ -564,7 +564,7 @@ mips*-*-freebsd* | mips*-*-kfreebsd*-gnu) targ_emul=elf32btsmip_fbsd targ_extra_emuls="elf32ltsmip elf32btsmip elf32ltsmipn32 elf32btsmipn32 elf64ltsmip elf64btsmip elf32ltsmip_fbsd elf32btsmipn32_fbsd elf32ltsmipn32_fbsd elf64ltsmip_fbsd elf64btsmip_fbsd" targ_extra_libpath=$targ_extra_emuls ;; -mips*-*-sysv4*) targ_emul=elf32btsmip +mips*-*-sysv4*) targ_emul=elf32btsmip ;; mmix-*-*) targ_emul=mmo targ_extra_emuls=elf64mmix @@ -573,9 +573,9 @@ am33_2.0-*-linux*) targ_emul=elf32am33lin ;; mn10200-*-*) targ_emul=mn10200 ;; mn10300-*-*) targ_emul=mn10300 ;; -mt-*elf) targ_emul=elf32mt +mt-*elf) targ_emul=elf32mt ;; -msp430-*-*) targ_emul=msp430elf +msp430-*-*) targ_emul=msp430elf targ_extra_emuls="msp430X" ;; nds32*le-*-elf*) targ_emul=nds32elf @@ -596,9 +596,9 @@ or1k-*-elf | or1knd-*-elf | or1k-*-rtems* | or1knd-*-rtems*) or1k-*-linux* | or1knd-*-linux*) targ_emul=elf32or1k_linux ;; pdp11-*-*) targ_emul=pdp11 ;; -pjl*-*-*) targ_emul=pjlelf +pjl*-*-*) targ_emul=pjlelf targ_extra_emuls="elf_i386 elf_iamcu" ;; -pj*-*-*) targ_emul=pjelf +pj*-*-*) targ_emul=pjelf ;; powerpc-*-freebsd* | powerpc-*-kfreebsd*-gnu) targ_emul=elf32ppc_fbsd @@ -689,8 +689,8 @@ powerpc*-*-elf* | powerpc*-*-eabi* | powerpc*-*-sysv* \ eval test -n \"\$${td}sim\" || eval ${td}sim="${ta32}" eval test -n \"\$${td64}\" || eval ${td64}="${ta64}" ;; -powerpc-*-nto*) targ_emul=elf32ppcnto ;; -powerpcle-*-nto*) targ_emul=elf32lppcnto ;; +powerpc-*-nto*) targ_emul=elf32ppcnto ;; +powerpcle-*-nto*) targ_emul=elf32lppcnto ;; powerpc-*-macos*) targ_emul=ppcmacos ;; powerpc-*-netware*) targ_emul=ppcnw ;; powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin*) @@ -713,18 +713,18 @@ rs6000-*-aix*) targ_emul=aixrs6 ;; rl78-*-*) targ_emul=elf32rl78 ;; rx-*-*) targ_emul=elf32rx ;; -s390x-*-linux*) targ_emul=elf64_s390 +s390x-*-linux*) targ_emul=elf64_s390 targ_extra_emuls=elf_s390 targ_extra_libpath=$targ_extra_emuls tdir_elf_s390=`echo ${targ_alias} | sed -e 's/s390x/s390/'` ;; s390x-*-tpf*) targ_emul=elf64_s390 tdir_elf_s390=`echo ${targ_alias} | sed -e 's/s390x/s390/'` ;; -s390-*-linux*) targ_emul=elf_s390 +s390-*-linux*) targ_emul=elf_s390 targ64_extra_emuls=elf64_s390 targ64_extra_libpath=elf64_s390 tdir_elf64_s390=`echo ${targ_alias} | sed -e 's/s390/s390x/'` ;; -score-*-elf) targ_emul=score7_elf +score-*-elf) targ_emul=score7_elf targ_extra_emuls=score3_elf ;; sh-*-linux*) targ_emul=shlelf_linux targ_extra_emuls="shelf_linux shlelf_fd shelf_fd" @@ -776,7 +776,7 @@ sh64-*-elf*) targ_emul=shelf sparc64-*-aout*) targ_emul=sparcaout ;; sparc64-*-elf* | sparc64-*-rtems*) targ_emul=elf64_sparc ;; -sparc-sun-sunos4*) targ_emul=sun4 ;; +sparc-sun-sunos4*) targ_emul=sun4 ;; sparclite*-*-elf) targ_emul=elf32_sparc ;; sparclite*-*-coff) targ_emul=coff_sparc ;; sparclite*-fujitsu-*) targ_emul=sparcaout ;; @@ -829,7 +829,7 @@ sparc*-wrs-vxworks*) targ_emul=sparcaout ;; spu-*-elf*) targ_emul=elf32_spu ;; tic30-*-*aout*) targ_emul=tic30aout ;; tic30-*-*coff*) targ_emul=tic30coff ;; -tic4x-*-* | c4x-*-*) targ_emul=tic4xcoff ; targ_extra_emuls="tic3xcoff tic3xcoff_onchip" ;; +tic4x-*-* | c4x-*-*) targ_emul=tic4xcoff ; targ_extra_emuls="tic3xcoff tic3xcoff_onchip" ;; tic54x-*-* | c54x*-*-*) targ_emul=tic54xcoff ;; tic6x-*-elf) targ_emul=elf32_tic6x_elf_le targ_extra_emuls="elf32_tic6x_elf_be elf32_tic6x_le elf32_tic6x_be" @@ -859,24 +859,24 @@ vax-*-netbsdelf*) targ_emul=elf32vax vax-*-netbsdaout* | vax-*-netbsd*) targ_emul=vaxnbsd targ_extra_emuls=elf32vax ;; -vax-*-linux-*) targ_emul=elf32vax +vax-*-linux-*) targ_emul=elf32vax ;; visium-*-elf) targ_emul=elf32visium ;; w65-*-*) targ_emul=w65 ;; xc16x-*-elf) targ_emul=elf32xc16x - targ_extra_emuls="elf32xc16xl elf32xc16xs" - ;; + targ_extra_emuls="elf32xc16xl elf32xc16xs" + ;; xstormy16-*-*) targ_emul=elf32xstormy16 ;; xtensa*-*-*) targ_emul=elf32xtensa ;; -xgate-*-*) targ_emul=xgateelf +xgate-*-*) targ_emul=xgateelf ;; z80-*-coff) targ_emul=z80 ;; -z8k-*-coff) targ_emul=z8002; targ_extra_emuls=z8001 +z8k-*-coff) targ_emul=z8002; targ_extra_emuls=z8001 ;; *-*-ieee*) targ_emul=vanilla ;; diff --git a/ld/deffilep.y b/ld/deffilep.y index ccceed04997..108bafcc625 100644 --- a/ld/deffilep.y +++ b/ld/deffilep.y @@ -193,18 +193,18 @@ implist: ; impline: - ID '=' ID '.' ID '.' ID opt_equalequal_name - { def_import ($1, $3, $5, $7, -1, $8); } + ID '=' ID '.' ID '.' ID opt_equalequal_name + { def_import ($1, $3, $5, $7, -1, $8); } | ID '=' ID '.' ID '.' NUMBER opt_equalequal_name { def_import ($1, $3, $5, 0, $7, $8); } | ID '=' ID '.' ID opt_equalequal_name - { def_import ($1, $3, 0, $5, -1, $6); } + { def_import ($1, $3, 0, $5, -1, $6); } | ID '=' ID '.' NUMBER opt_equalequal_name - { def_import ($1, $3, 0, 0, $5, $6); } + { def_import ($1, $3, 0, 0, $5, $6); } | ID '.' ID '.' ID opt_equalequal_name - { def_import( 0, $1, $3, $5, -1, $6); } + { def_import( 0, $1, $3, $5, -1, $6); } | ID '.' ID opt_equalequal_name - { def_import ( 0, $1, 0, $3, -1, $4); } + { def_import ( 0, $1, 0, $3, -1, $4); } ; seclist: @@ -309,8 +309,8 @@ opt_ordinal: ; opt_equal_name: - '=' opt_name2 { $$ = $2; } - | { $$ = 0; } + '=' opt_name2 { $$ = $2; } + | { $$ = 0; } ; opt_base: BASE '=' VMA { $$ = $3;} @@ -636,7 +636,7 @@ find_export_in_list (def_file_export *b, int max, if ((e = cmp_export_elem (b, ex_name, in_name, its_name, ord)) <= 0) { if (!e) - *is_ident = 1; + *is_ident = 1; return 0; } if (max == 1) @@ -655,14 +655,14 @@ find_export_in_list (def_file_export *b, int max, p = (l + r) / 2; e = cmp_export_elem (b + p, ex_name, in_name, its_name, ord); if (!e) - { - *is_ident = 1; - return p; - } + { + *is_ident = 1; + return p; + } else if (e < 0) - r = p - 1; + r = p - 1; else if (e > 0) - l = p + 1; + l = p + 1; } if ((e = cmp_export_elem (b + l, ex_name, in_name, its_name, ord)) > 0) ++l; @@ -781,7 +781,7 @@ find_import_in_list (def_file_import *b, int max, if ((e = cmp_import_elem (b, ex_name, in_name, module, ord)) <= 0) { if (!e) - *is_ident = 1; + *is_ident = 1; return 0; } if (max == 1) @@ -791,7 +791,7 @@ find_import_in_list (def_file_import *b, int max, else if (!e || max == 2) { if (!e) - *is_ident = 1; + *is_ident = 1; return max - 1; } l = 0; r = max - 1; @@ -800,14 +800,14 @@ find_import_in_list (def_file_import *b, int max, p = (l + r) / 2; e = cmp_import_elem (b + p, ex_name, in_name, module, ord); if (!e) - { - *is_ident = 1; - return p; - } + { + *is_ident = 1; + return p; + } else if (e < 0) - r = p - 1; + r = p - 1; else if (e > 0) - l = p + 1; + l = p + 1; } if ((e = cmp_import_elem (b + l, ex_name, in_name, module, ord)) > 0) ++l; @@ -902,10 +902,10 @@ def_file_add_directive (def_file *my_def, const char *param, int len) break; /* Scan forward until we encounter any of: - - the end of the buffer + - the end of the buffer - the start of a new option - a newline separating options - - a NUL separating options. */ + - a NUL separating options. */ for (tend = (char *) (param + 1); (tend < pend && !(ISSPACE (tend[-1]) && *tend == '-') @@ -981,7 +981,7 @@ def_image_name (const char *name, bfd_vma base, int is_dll) def->name = xmalloc (strlen (image_name) + strlen (suffix) + 1); sprintf (def->name, "%s%s", image_name, suffix); - } + } else def->name = xstrdup (image_name); } @@ -1176,7 +1176,7 @@ def_aligncomm (char *str, int align) return; } if (e > 0) - break; + break; c = (p = c)->next; } @@ -1367,12 +1367,12 @@ def_lex (void) if (q == '@') { - if (ISBLANK (c) ) /* '@' followed by whitespace. */ + if (ISBLANK (c) ) /* '@' followed by whitespace. */ return (q); - else if (ISDIGIT (c)) /* '@' followed by digit. */ - { + else if (ISDIGIT (c)) /* '@' followed by digit. */ + { def_ungetc (c); - return (q); + return (q); } #if TRACE printf ("lex: @ returns itself\n"); @@ -1388,7 +1388,7 @@ def_lex (void) def_ungetc (c); if (ISALPHA (q)) /* Check for tokens. */ { - for (i = 0; tokens[i].name; i++) + for (i = 0; tokens[i].name; i++) if (strcmp (tokens[i].name, buffer) == 0) { #if TRACE @@ -1426,12 +1426,12 @@ def_lex (void) { c = def_getc (); if (c == '=') - { + { #if TRACE - printf ("lex: `==' returns EQUAL\n"); + printf ("lex: `==' returns EQUAL\n"); #endif - return EQUAL; - } + return EQUAL; + } def_ungetc (c); #if TRACE printf ("lex: `=' returns itself\n"); diff --git a/ld/emulparams/arc-endianness.sh b/ld/emulparams/arc-endianness.sh index 7a66deede30..9b716bf136b 100644 --- a/ld/emulparams/arc-endianness.sh +++ b/ld/emulparams/arc-endianness.sh @@ -3,9 +3,9 @@ # '*' pattern is for. case ${target} in arceb-*) - ARC_ENDIAN="big" - ;; + ARC_ENDIAN="big" + ;; arc-* | * ) - ARC_ENDIAN="little" - ;; + ARC_ENDIAN="little" + ;; esac diff --git a/ld/emulparams/elf32_x86_64.sh b/ld/emulparams/elf32_x86_64.sh index 06a0f3c6fe5..a7f16b1d325 100644 --- a/ld/emulparams/elf32_x86_64.sh +++ b/ld/emulparams/elf32_x86_64.sh @@ -41,11 +41,11 @@ case "$target" in x86_64*-linux*|i[3-7]86-*-linux-*) case "$EMULATION_NAME" in *32*) - LIBPATH_SUFFIX=x32 + LIBPATH_SUFFIX=x32 LIBPATH_SUFFIX_SKIP=64 ;; *64*) - LIBPATH_SUFFIX=64 + LIBPATH_SUFFIX=64 ;; esac ;; diff --git a/ld/emulparams/elf64mmix.sh b/ld/emulparams/elf64mmix.sh index bdb5d0abcd2..6b9173d95d4 100644 --- a/ld/emulparams/elf64mmix.sh +++ b/ld/emulparams/elf64mmix.sh @@ -40,7 +40,7 @@ EXTRA_EM_FILE=mmixelf OTHER_TEXT_SECTIONS=" ${RELOCATING+ _start. = (DEFINED (_start) ? _start - : (DEFINED (Main) ? Main : (DEFINED (.text) ? .text : 0))); + : (DEFINED (Main) ? Main : (DEFINED (.text) ? .text : 0))); PROVIDE (Main = DEFINED (Main) ? Main : (DEFINED (_start) ? _start : _start.)); }" diff --git a/ld/emulparams/elf_x86_64.sh b/ld/emulparams/elf_x86_64.sh index ad255266fce..c678479d240 100644 --- a/ld/emulparams/elf_x86_64.sh +++ b/ld/emulparams/elf_x86_64.sh @@ -41,7 +41,7 @@ case "$target" in x86_64*-linux*|i[3-7]86-*-linux-*) case "$EMULATION_NAME" in *64*) - LIBPATH_SUFFIX=64 + LIBPATH_SUFFIX=64 PARSE_AND_LIST_OPTIONS_BNDPLT=' fprintf (file, _("\ -z bndplt Always generate BND prefix in PLT entries\n")); @@ -52,7 +52,7 @@ case "$target" in ' PARSE_AND_LIST_OPTIONS="$PARSE_AND_LIST_OPTIONS $PARSE_AND_LIST_OPTIONS_BNDPLT" PARSE_AND_LIST_ARGS_CASE_Z="$PARSE_AND_LIST_ARGS_CASE_Z $PARSE_AND_LIST_ARGS_CASE_Z_BNDPLT" - ;; + ;; esac ;; *-*-solaris2*) diff --git a/ld/emulparams/h8300elf.sh b/ld/emulparams/h8300elf.sh index 38b8a3692f2..6db8c216d67 100644 --- a/ld/emulparams/h8300elf.sh +++ b/ld/emulparams/h8300elf.sh @@ -18,7 +18,7 @@ TINY_READONLY_SECTION=".tinyrodata : TINY_DATA_SECTION=".tinydata ${RELOCATING+0xff8000} : { *(.tinydata) - ${RELOCATING+ _tinydata = .; } + ${RELOCATING+ _tinydata = .; } }" TINY_BSS_SECTION=".tinybss : ${RELOCATING+AT (_tinydata)} { diff --git a/ld/emulparams/h8300elf_linux.sh b/ld/emulparams/h8300elf_linux.sh index 97050ddf4e3..4395cfc4da8 100644 --- a/ld/emulparams/h8300elf_linux.sh +++ b/ld/emulparams/h8300elf_linux.sh @@ -18,7 +18,7 @@ TINY_READONLY_SECTION=".tinyrodata : TINY_DATA_SECTION=".tinydata ${RELOCATING+0xff8000} : { *(.tinydata) - ${RELOCATING+ _tinydata = .; } + ${RELOCATING+ _tinydata = .; } }" TINY_BSS_SECTION=".tinybss : ${RELOCATING+AT (_tinydata)} { diff --git a/ld/emulparams/vxworks.sh b/ld/emulparams/vxworks.sh index 5760758d468..d2c377402e3 100644 --- a/ld/emulparams/vxworks.sh +++ b/ld/emulparams/vxworks.sh @@ -9,18 +9,18 @@ # be last. The other sections should be sorted, but the current linker script # parse does not seem to allow that with the SORT keyword in this context. INIT_START='_init = .; - KEEP (*(.init$00)); - KEEP (*(.init$0[1-9])); - KEEP (*(.init$[1-8][0-9])); - KEEP (*(.init$9[0-8]));' + KEEP (*(.init$00)); + KEEP (*(.init$0[1-9])); + KEEP (*(.init$[1-8][0-9])); + KEEP (*(.init$9[0-8]));' INIT_END='KEEP (*(.init$99));' FINI_START='_fini = .; - KEEP (*(.fini$00)); - KEEP (*(.fini$0[1-9])); - KEEP (*(.fini$[1-8][0-9])); - KEEP (*(.fini$9[0-8]));' + KEEP (*(.fini$00)); + KEEP (*(.fini$0[1-9])); + KEEP (*(.fini$[1-8][0-9])); + KEEP (*(.fini$9[0-8]));' FINI_END="KEEP (*(.fini\$99)); - PROVIDE (${SYMPREFIX}_etext = .);" + PROVIDE (${SYMPREFIX}_etext = .);" OTHER_READWRITE_SECTIONS=".tls_data ${RELOCATING-0} : {${RELOCATING+ __wrs_rtp_tls_data_start = .; diff --git a/ld/emultempl/aarch64elf.em b/ld/emultempl/aarch64elf.em index 5731ecd0718..3007e4d581c 100644 --- a/ld/emultempl/aarch64elf.em +++ b/ld/emultempl/aarch64elf.em @@ -55,10 +55,10 @@ aarch64_elf_before_allocation (void) { /* Here we rummage through the found bfds to collect information. */ LANG_FOR_EACH_INPUT_STATEMENT (is) - { - /* Initialise mapping tables for code/data. */ - bfd_elf${ELFSIZE}_aarch64_init_maps (is->the_bfd); - } + { + /* Initialise mapping tables for code/data. */ + bfd_elf${ELFSIZE}_aarch64_init_maps (is->the_bfd); + } } /* Call the standard elf routine. */ @@ -357,7 +357,7 @@ EOF PARSE_AND_LIST_PROLOGUE=' #define OPTION_NO_ENUM_SIZE_WARNING 309 #define OPTION_PIC_VENEER 310 -#define OPTION_STUBGROUP_SIZE 311 +#define OPTION_STUBGROUP_SIZE 311 #define OPTION_NO_WCHAR_SIZE_WARNING 312 #define OPTION_FIX_ERRATUM_835769 313 #define OPTION_FIX_ERRATUM_843419 314 @@ -430,8 +430,8 @@ PARSE_AND_LIST_ARGS_CASES=' { const char *end; - group_size = bfd_scan_vma (optarg, &end, 0); - if (*end) + group_size = bfd_scan_vma (optarg, &end, 0); + if (*end) einfo (_("%P%F: invalid number `%s'\''\n"), optarg); } break; diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em index 8d11863fb62..480bbbce100 100644 --- a/ld/emultempl/aix.em +++ b/ld/emultempl/aix.em @@ -345,23 +345,23 @@ read_file_list (const char *filename) { /* Skip empty lines. */ while (*b == '\n' || *b == '\r') - b++; + b++; /* Stop if end of buffer. */ if (b == buffer + len) - break; + break; /* Eat any byte until end of line. */ for (e = b; *e != '\0'; e++) - if (*e == '\n' || *e == '\r') - break; + if (*e == '\n' || *e == '\r') + break; /* Replace end of line by nul. */ if (*e != '\0') - *e++ = '\0'; + *e++ = '\0'; if (b != e) - lang_add_input_file (b, lang_input_file_is_search_file_enum, NULL); + lang_add_input_file (b, lang_input_file_is_search_file_enum, NULL); b = e; } return; @@ -388,7 +388,7 @@ gld${EMULATION_NAME}_handle_option (int optc) case 'f': /* This overrides --auxiliary. This option specifies a file containing - a list of input files. */ + a list of input files. */ read_file_list (optarg); break; diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em index 29c73ff92a8..34ff993cc7f 100644 --- a/ld/emultempl/armelf.em +++ b/ld/emultempl/armelf.em @@ -101,8 +101,8 @@ arm_elf_before_allocation (void) /* Here we rummage through the found bfds to collect glue information. */ LANG_FOR_EACH_INPUT_STATEMENT (is) { - /* Initialise mapping tables for code/data. */ - bfd_elf32_arm_init_maps (is->the_bfd); + /* Initialise mapping tables for code/data. */ + bfd_elf32_arm_init_maps (is->the_bfd); if (!bfd_elf32_arm_process_before_allocation (is->the_bfd, &link_info) @@ -422,9 +422,9 @@ gld${EMULATION_NAME}_finish (void) { LANG_FOR_EACH_INPUT_STATEMENT (is) { - /* Figure out where VFP11 erratum veneers (and the labels returning - from same) have been placed. */ - bfd_elf32_arm_vfp11_fix_veneer_locations (is->the_bfd, &link_info); + /* Figure out where VFP11 erratum veneers (and the labels returning + from same) have been placed. */ + bfd_elf32_arm_vfp11_fix_veneer_locations (is->the_bfd, &link_info); /* Figure out where STM32L4XX erratum veneers (and the labels returning from them) have been placed. */ @@ -531,13 +531,13 @@ arm_elf_create_output_section_statements (void) bfd_elf32_arm_set_target_params (link_info.output_bfd, &link_info, ¶ms); stub_file = lang_add_input_file ("linker stubs", - lang_input_file_is_fake_enum, - NULL); + lang_input_file_is_fake_enum, + NULL); stub_file->the_bfd = bfd_create ("linker stubs", link_info.output_bfd); if (stub_file->the_bfd == NULL || ! bfd_set_arch_mach (stub_file->the_bfd, - bfd_get_arch (link_info.output_bfd), - bfd_get_mach (link_info.output_bfd))) + bfd_get_arch (link_info.output_bfd), + bfd_get_mach (link_info.output_bfd))) { einfo (_("%X%P: can not create BFD %E\n")); return; @@ -704,26 +704,26 @@ PARSE_AND_LIST_ARGS_CASES=' case OPTION_VFP11_DENORM_FIX: if (strcmp (optarg, "none") == 0) - params.vfp11_denorm_fix = BFD_ARM_VFP11_FIX_NONE; + params.vfp11_denorm_fix = BFD_ARM_VFP11_FIX_NONE; else if (strcmp (optarg, "scalar") == 0) - params.vfp11_denorm_fix = BFD_ARM_VFP11_FIX_SCALAR; + params.vfp11_denorm_fix = BFD_ARM_VFP11_FIX_SCALAR; else if (strcmp (optarg, "vector") == 0) - params.vfp11_denorm_fix = BFD_ARM_VFP11_FIX_VECTOR; + params.vfp11_denorm_fix = BFD_ARM_VFP11_FIX_VECTOR; else - einfo (_("Unrecognized VFP11 fix type '\''%s'\''.\n"), optarg); + einfo (_("Unrecognized VFP11 fix type '\''%s'\''.\n"), optarg); break; case OPTION_STM32L4XX_FIX: if (!optarg) - params.stm32l4xx_fix = BFD_ARM_STM32L4XX_FIX_DEFAULT; + params.stm32l4xx_fix = BFD_ARM_STM32L4XX_FIX_DEFAULT; else if (strcmp (optarg, "none") == 0) - params.stm32l4xx_fix = BFD_ARM_STM32L4XX_FIX_NONE; + params.stm32l4xx_fix = BFD_ARM_STM32L4XX_FIX_NONE; else if (strcmp (optarg, "default") == 0) - params.stm32l4xx_fix = BFD_ARM_STM32L4XX_FIX_DEFAULT; + params.stm32l4xx_fix = BFD_ARM_STM32L4XX_FIX_DEFAULT; else if (strcmp (optarg, "all") == 0) - params.stm32l4xx_fix = BFD_ARM_STM32L4XX_FIX_ALL; + params.stm32l4xx_fix = BFD_ARM_STM32L4XX_FIX_ALL; else - einfo (_("Unrecognized STM32L4XX fix type '\''%s'\''.\n"), optarg); + einfo (_("Unrecognized STM32L4XX fix type '\''%s'\''.\n"), optarg); break; case OPTION_NO_ENUM_SIZE_WARNING: @@ -742,8 +742,8 @@ PARSE_AND_LIST_ARGS_CASES=' { const char *end; - group_size = bfd_scan_vma (optarg, &end, 0); - if (*end) + group_size = bfd_scan_vma (optarg, &end, 0); + if (*end) einfo (_("%P%F: invalid number `%s'\''\n"), optarg); } break; diff --git a/ld/emultempl/avrelf.em b/ld/emultempl/avrelf.em index 7aeecb7c161..451b59f60de 100644 --- a/ld/emultempl/avrelf.em +++ b/ld/emultempl/avrelf.em @@ -51,13 +51,13 @@ static void avr_elf_set_global_bfd_parameters (void) { elf32_avr_setup_params (& link_info, - stub_file->the_bfd, - avr_stub_section, - avr_no_stubs, - avr_debug_stubs, - avr_debug_relax, - avr_pc_wrap_around, - avr_replace_call_ret_sequences); + stub_file->the_bfd, + avr_stub_section, + avr_no_stubs, + avr_debug_stubs, + avr_debug_relax, + avr_pc_wrap_around, + avr_replace_call_ret_sequences); } @@ -122,14 +122,14 @@ avr_elf_create_output_section_statements (void) } stub_file = lang_add_input_file ("linker stubs", - lang_input_file_is_fake_enum, - NULL); + lang_input_file_is_fake_enum, + NULL); stub_file->the_bfd = bfd_create ("linker stubs", link_info.output_bfd); if (stub_file->the_bfd == NULL || !bfd_set_arch_mach (stub_file->the_bfd, - bfd_get_arch (link_info.output_bfd), - bfd_get_mach (link_info.output_bfd))) + bfd_get_arch (link_info.output_bfd), + bfd_get_mach (link_info.output_bfd))) { einfo (_("%X%P: can not create stub BFD %E\n")); return; @@ -138,7 +138,7 @@ avr_elf_create_output_section_statements (void) /* Now we add the stub section. */ flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE - | SEC_HAS_CONTENTS | SEC_RELOC | SEC_IN_MEMORY | SEC_KEEP); + | SEC_HAS_CONTENTS | SEC_RELOC | SEC_IN_MEMORY | SEC_KEEP); avr_stub_section = bfd_make_section_anyway_with_flags (stub_file->the_bfd, ".trampolines", flags); @@ -151,9 +151,9 @@ avr_elf_create_output_section_statements (void) return; - err_ret: - einfo (_("%X%P: can not make stub section: %E\n")); - return; + err_ret: + einfo (_("%X%P: can not make stub section: %E\n")); + return; } /* Re-calculates the size of the stubs so that we won't waste space. */ @@ -199,17 +199,17 @@ avr_finish (void) { avr_link_relax = TRUE; for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link.next) - { - /* Don't let the linker stubs prevent the final object being - marked as link-relax ready. */ - if ((elf_elfheader (abfd)->e_flags - & EF_AVR_LINKRELAX_PREPARED) == 0 - && abfd != stub_file->the_bfd) - { - avr_link_relax = FALSE; - break; - } - } + { + /* Don't let the linker stubs prevent the final object being + marked as link-relax ready. */ + if ((elf_elfheader (abfd)->e_flags + & EF_AVR_LINKRELAX_PREPARED) == 0 + && abfd != stub_file->the_bfd) + { + avr_link_relax = FALSE; + break; + } + } } else { @@ -234,15 +234,15 @@ EOF PARSE_AND_LIST_PROLOGUE=' #define OPTION_NO_CALL_RET_REPLACEMENT 301 -#define OPTION_PMEM_WRAP_AROUND 302 -#define OPTION_NO_STUBS 303 -#define OPTION_DEBUG_STUBS 304 -#define OPTION_DEBUG_RELAX 305 +#define OPTION_PMEM_WRAP_AROUND 302 +#define OPTION_NO_STUBS 303 +#define OPTION_DEBUG_STUBS 304 +#define OPTION_DEBUG_RELAX 305 ' PARSE_AND_LIST_LONGOPTS=' { "no-call-ret-replacement", no_argument, - NULL, OPTION_NO_CALL_RET_REPLACEMENT}, + NULL, OPTION_NO_CALL_RET_REPLACEMENT}, { "pmem-wrap-around", required_argument, NULL, OPTION_PMEM_WRAP_AROUND}, { "no-stubs", no_argument, @@ -286,17 +286,17 @@ PARSE_AND_LIST_ARGS_CASES=' case OPTION_PMEM_WRAP_AROUND: { - /* This variable is defined in the bfd library. */ - if ((!strcmp (optarg,"32k")) || (!strcmp (optarg,"32K"))) - avr_pc_wrap_around = 32768; - else if ((!strcmp (optarg,"8k")) || (!strcmp (optarg,"8K"))) - avr_pc_wrap_around = 8192; - else if ((!strcmp (optarg,"16k")) || (!strcmp (optarg,"16K"))) - avr_pc_wrap_around = 16384; - else if ((!strcmp (optarg,"64k")) || (!strcmp (optarg,"64K"))) - avr_pc_wrap_around = 0x10000; - else - return FALSE; + /* This variable is defined in the bfd library. */ + if ((!strcmp (optarg,"32k")) || (!strcmp (optarg,"32K"))) + avr_pc_wrap_around = 32768; + else if ((!strcmp (optarg,"8k")) || (!strcmp (optarg,"8K"))) + avr_pc_wrap_around = 8192; + else if ((!strcmp (optarg,"16k")) || (!strcmp (optarg,"16K"))) + avr_pc_wrap_around = 16384; + else if ((!strcmp (optarg,"64k")) || (!strcmp (optarg,"64K"))) + avr_pc_wrap_around = 0x10000; + else + return FALSE; } break; @@ -314,8 +314,8 @@ PARSE_AND_LIST_ARGS_CASES=' case OPTION_NO_CALL_RET_REPLACEMENT: { - /* This variable is defined in the bfd library. */ - avr_replace_call_ret_sequences = FALSE; + /* This variable is defined in the bfd library. */ + avr_replace_call_ret_sequences = FALSE; } break; ' diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em index ff447bd00fb..3128e2037b5 100644 --- a/ld/emultempl/beos.em +++ b/ld/emultempl/beos.em @@ -81,8 +81,8 @@ gld_${EMULATION_NAME}_before_parse (void) #define OPTION_MINOR_OS_VERSION (OPTION_MINOR_IMAGE_VERSION + 1) #define OPTION_MINOR_SUBSYSTEM_VERSION (OPTION_MINOR_OS_VERSION + 1) #define OPTION_SECTION_ALIGNMENT (OPTION_MINOR_SUBSYSTEM_VERSION + 1) -#define OPTION_STACK (OPTION_SECTION_ALIGNMENT + 1) -#define OPTION_SUBSYSTEM (OPTION_STACK + 1) +#define OPTION_STACK (OPTION_SECTION_ALIGNMENT + 1) +#define OPTION_SUBSYSTEM (OPTION_STACK + 1) #define OPTION_HEAP (OPTION_SUBSYSTEM + 1) static void diff --git a/ld/emultempl/hppaelf.em b/ld/emultempl/hppaelf.em index 08ed7ea643a..ead79129ef8 100644 --- a/ld/emultempl/hppaelf.em +++ b/ld/emultempl/hppaelf.em @@ -55,7 +55,7 @@ hppaelf_after_parse (void) /* Enable this once we split millicode stuff from libgcc: lang_add_input_file ("milli", - lang_input_file_is_l_enum, + lang_input_file_is_l_enum, NULL); */ @@ -370,8 +370,8 @@ PARSE_AND_LIST_ARGS_CASES=' case OPTION_STUBGROUP_SIZE: { const char *end; - group_size = bfd_scan_vma (optarg, &end, 0); - if (*end) + group_size = bfd_scan_vma (optarg, &end, 0); + if (*end) einfo (_("%P%F: invalid number `%s'\''\n"), optarg); } break; diff --git a/ld/emultempl/m68kcoff.em b/ld/emultempl/m68kcoff.em index a1383be92d7..359f0e0f6d1 100644 --- a/ld/emultempl/m68kcoff.em +++ b/ld/emultempl/m68kcoff.em @@ -72,7 +72,7 @@ gld${EMULATION_NAME}_after_open (void) asection *datasec; /* As first-order business, make sure that each input BFD is COFF. It - better be, as we are directly calling a COFF backend function. */ + better be, as we are directly calling a COFF backend function. */ if (bfd_get_flavour (abfd) != bfd_target_coff_flavour) einfo (_("%F%B: all input objects must be COFF " "for --embedded-relocs\n")); @@ -80,12 +80,12 @@ gld${EMULATION_NAME}_after_open (void) datasec = bfd_get_section_by_name (abfd, ".data"); /* Note that we assume that the reloc_count field has already - been set up. We could call bfd_get_reloc_upper_bound, but - that returns the size of a memory buffer rather than a reloc - count. We do not want to call bfd_canonicalize_reloc, - because although it would always work it would force us to - read in the relocs into BFD canonical form, which would waste - a significant amount of time and memory. */ + been set up. We could call bfd_get_reloc_upper_bound, but + that returns the size of a memory buffer rather than a reloc + count. We do not want to call bfd_canonicalize_reloc, + because although it would always work it would force us to + read in the relocs into BFD canonical form, which would waste + a significant amount of time and memory. */ if (datasec != NULL && datasec->reloc_count > 0) { asection *relsec; @@ -103,7 +103,7 @@ gld${EMULATION_NAME}_after_open (void) } /* Double check that all other data sections are empty, as is - required for embedded PIC code. */ + required for embedded PIC code. */ bfd_map_over_sections (abfd, check_sections, datasec); } } diff --git a/ld/emultempl/m68kelf.em b/ld/emultempl/m68kelf.em index 9da6e664a38..de4ef7d31e8 100644 --- a/ld/emultempl/m68kelf.em +++ b/ld/emultempl/m68kelf.em @@ -235,15 +235,15 @@ PARSE_AND_LIST_OPTIONS=' PARSE_AND_LIST_ARGS_CASES=' case OPTION_GOT: if (strcmp (optarg, "target") == 0) - got_handling = GOT_HANDLING_TARGET_DEFAULT; + got_handling = GOT_HANDLING_TARGET_DEFAULT; else if (strcmp (optarg, "single") == 0) - got_handling = 0; + got_handling = 0; else if (strcmp (optarg, "negative") == 0) - got_handling = 1; + got_handling = 1; else if (strcmp (optarg, "multigot") == 0) - got_handling = 2; + got_handling = 2; else - einfo (_("Unrecognized --got argument '\''%s'\''.\n"), optarg); + einfo (_("Unrecognized --got argument '\''%s'\''.\n"), optarg); break; ' diff --git a/ld/emultempl/metagelf.em b/ld/emultempl/metagelf.em index 0a2fbd481a1..b26a7383d5b 100644 --- a/ld/emultempl/metagelf.em +++ b/ld/emultempl/metagelf.em @@ -328,8 +328,8 @@ PARSE_AND_LIST_ARGS_CASES=' case OPTION_STUBGROUP_SIZE: { const char *end; - group_size = bfd_scan_vma (optarg, &end, 0); - if (*end) + group_size = bfd_scan_vma (optarg, &end, 0); + if (*end) einfo (_("%P%F: invalid number `%s'\''\n"), optarg); } break; diff --git a/ld/emultempl/msp430.em b/ld/emultempl/msp430.em index 5281ab4de54..0792e3cc75d 100644 --- a/ld/emultempl/msp430.em +++ b/ld/emultempl/msp430.em @@ -7,7 +7,7 @@ fragment <wild_statement.children.head); + amount += scan_children (l->wild_statement.children.head); break; case lang_data_statement_enum: @@ -214,7 +214,7 @@ scan_children (lang_statement_union_type * l) return amount; } - + /* Place an orphan section. We use this to put .either sections into either their lower or their upper equivalents. */ @@ -258,7 +258,7 @@ gld${EMULATION_NAME}_place_orphan (asection * s, } else name = (char *) secname; - + lower_name = concat (".lower", name, NULL); upper_name = concat (".upper", name, NULL); diff --git a/ld/emultempl/nds32elf.em b/ld/emultempl/nds32elf.em index d14389b32b6..a2416d24ccc 100644 --- a/ld/emultempl/nds32elf.em +++ b/ld/emultempl/nds32elf.em @@ -195,7 +195,7 @@ nds32_elf_after_allocation (void) { /* Initialize ex9 hash table. */ if (!nds32_elf_ex9_init ()) - return; + return; } /* Call default after allocation callback. diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index 3183caa672f..06934831dd7 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -242,9 +242,9 @@ fragment <map_head.link_order; l != NULL; l = l->next) - { - if (l->type == bfd_indirect_link_order) - { - if (l->u.indirect.section == t->build_id.sec) - { - link_order = l; - break; - } - } - } + { + if (l->type == bfd_indirect_link_order) + { + if (l->u.indirect.section == t->build_id.sec) + { + link_order = l; + break; + } + } + } if (link_order) - break; + break; } if (!link_order) { einfo (_("%P: warning: .buildid section discarded," - " --build-id ignored.\n")); + " --build-id ignored.\n")); return TRUE; } @@ -1947,7 +1947,7 @@ gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIB struct bfd_link_hash_entry *h; sprintf (buf, "%s%s", U (""), - pe_def_file->exports[i].internal_name); + pe_def_file->exports[i].internal_name); h = bfd_link_hash_lookup (link_info.hash, buf, TRUE, TRUE, TRUE); if (h == (struct bfd_link_hash_entry *) NULL) @@ -2342,8 +2342,8 @@ gld_${EMULATION_NAME}_open_dynamic_archive /* Alternate explicit import library for dll's. */ { "%s.dll.a", FALSE }, /* "libfoo.a" could be either an import lib or a static lib. - For backwards compatibility, libfoo.a needs to precede - libfoo.dll and foo.dll in the search. */ + For backwards compatibility, libfoo.a needs to precede + libfoo.dll and foo.dll in the search. */ { "lib%s.a", FALSE }, /* The 'native' spelling of an import lib name is "foo.lib". */ { "%s.lib", FALSE }, diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em index 6fef7d8cb2d..1446e046f77 100644 --- a/ld/emultempl/pep.em +++ b/ld/emultempl/pep.em @@ -493,10 +493,10 @@ set_entry_point (void) int i; static const struct - { - const int value; - const char *entry; - } + { + const int value; + const char *entry; + } v[] = { { 1, "NtProcessStartup" }, @@ -518,14 +518,14 @@ set_entry_point (void) else { for (i = 0; v[i].entry; i++) - if (v[i].value == pep_subsystem) - break; + if (v[i].value == pep_subsystem) + break; /* If no match, use the default. */ if (v[i].entry != NULL) - entry = v[i].entry; + entry = v[i].entry; else - entry = default_entry; + entry = default_entry; } /* Now we check target's default for getting proper symbol_char. */ @@ -1257,9 +1257,9 @@ pecoff_checksum_contents (bfd *abfd, status = bfd_bread (&b, (bfd_size_type) 1, abfd); if (status < 1) - { - break; - } + { + break; + } (*process) (&b, 1, arg); filepos += 1; @@ -1284,25 +1284,25 @@ write_build_id (bfd *abfd) { struct bfd_link_order *l = NULL; for (l = asec->map_head.link_order; l != NULL; l = l->next) - { - if (l->type == bfd_indirect_link_order) - { - if (l->u.indirect.section == t->build_id.sec) - { - link_order = l; - break; - } - } - } + { + if (l->type == bfd_indirect_link_order) + { + if (l->u.indirect.section == t->build_id.sec) + { + link_order = l; + break; + } + } + } if (link_order) - break; + break; } if (!link_order) { einfo (_("%P: warning: .buildid section discarded," - " --build-id ignored.\n")); + " --build-id ignored.\n")); return TRUE; } @@ -2115,8 +2115,8 @@ gld_${EMULATION_NAME}_open_dynamic_archive /* Alternate explicit import library for dll's. */ { "%s.dll.a", FALSE }, /* "libfoo.a" could be either an import lib or a static lib. - For backwards compatibility, libfoo.a needs to precede - libfoo.dll and foo.dll in the search. */ + For backwards compatibility, libfoo.a needs to precede + libfoo.dll and foo.dll in the search. */ { "lib%s.a", FALSE }, /* The 'native' spelling of an import lib name is "foo.lib". */ { "%s.lib", FALSE }, diff --git a/ld/emultempl/ppc64elf.em b/ld/emultempl/ppc64elf.em index 5c3ecb05c0d..ac306645d11 100644 --- a/ld/emultempl/ppc64elf.em +++ b/ld/emultempl/ppc64elf.em @@ -826,8 +826,8 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}' case OPTION_STUBGROUP_SIZE: { const char *end; - params.group_size = bfd_scan_vma (optarg, &end, 0); - if (*end) + params.group_size = bfd_scan_vma (optarg, &end, 0); + if (*end) einfo (_("%P%F: invalid number `%s'\''\n"), optarg); } break; diff --git a/ld/emultempl/sh64elf.em b/ld/emultempl/sh64elf.em index cdc73ccb536..1b18dfd8a9b 100644 --- a/ld/emultempl/sh64elf.em +++ b/ld/emultempl/sh64elf.em @@ -170,7 +170,7 @@ sh64_elf_${EMULATION_NAME}_before_allocation (void) break_1: /* Check that all input sections have the same contents-type flags - as the first input section. */ + as the first input section. */ { LANG_FOR_EACH_INPUT_STATEMENT (f) { @@ -302,7 +302,7 @@ sh64_elf_${EMULATION_NAME}_after_allocation (void) break_1: /* Check that all input sections have the same contents-type flags - as the first input section. */ + as the first input section. */ { LANG_FOR_EACH_INPUT_STATEMENT (f) { diff --git a/ld/emultempl/spu_ovl.S b/ld/emultempl/spu_ovl.S index 52cc08fca3c..ad69dfdac43 100644 --- a/ld/emultempl/spu_ovl.S +++ b/ld/emultempl/spu_ovl.S @@ -101,7 +101,7 @@ #define irq_stat save4 .text - .align 4 + .align 4 .type __rv_pattern, @object .size __rv_pattern, 16 __rv_pattern: @@ -126,7 +126,7 @@ __ovly_current: * Load the previous overlay and jump to the caller return address. * Updates __ovly_current. */ - .align 4 + .align 4 .global __ovly_return .type __ovly_return, @function __ovly_return: @@ -446,7 +446,7 @@ __ovly_xfer_loop: #endif andc oldvma, oldvma, pbit # 0,2 77 lqd save1, -16($sp) # 1,6 77 - nop # 0,0 78 + nop # 0,0 78 #lnop #nop stqx oldvma, tab5, off5 # 1,6 79 diff --git a/ld/emultempl/spuelf.em b/ld/emultempl/spuelf.em index 43be87bf08e..f8650a5e65e 100644 --- a/ld/emultempl/spuelf.em +++ b/ld/emultempl/spuelf.em @@ -421,7 +421,7 @@ gld${EMULATION_NAME}_finish (void) if (is_spu_target ()) { if (params.local_store_lo < params.local_store_hi) - { + { asection *s; s = spu_elf_check_vma (&link_info); diff --git a/ld/emultempl/tic6xdsbt.em b/ld/emultempl/tic6xdsbt.em index f7f1f25dcfb..b83dad956f8 100644 --- a/ld/emultempl/tic6xdsbt.em +++ b/ld/emultempl/tic6xdsbt.em @@ -103,7 +103,7 @@ gld${EMULATION_NAME}_after_allocation (void) the unwind table index. */ unsigned int list_size = 10; asection **sec_list = (asection **) - xmalloc (list_size * sizeof (asection *)); + xmalloc (list_size * sizeof (asection *)); unsigned int sec_count = 0; LANG_FOR_EACH_INPUT_STATEMENT (is) @@ -130,7 +130,7 @@ gld${EMULATION_NAME}_after_allocation (void) { list_size *= 2; sec_list = (asection **) - xrealloc (sec_list, list_size * sizeof (asection *)); + xrealloc (sec_list, list_size * sizeof (asection *)); } sec_list[sec_count++] = sec; diff --git a/ld/emultempl/ticoff.em b/ld/emultempl/ticoff.em index 926dbd9f94c..d394e12465c 100644 --- a/ld/emultempl/ticoff.em +++ b/ld/emultempl/ticoff.em @@ -78,17 +78,17 @@ gld${EMULATION_NAME}_handle_option (int optc) case OPTION_COFF_FORMAT: if ((*optarg == '0' || *optarg == '1' || *optarg == '2') - && optarg[1] == '\0') - { - static char buf[] = "coffX-${OUTPUT_FORMAT_TEMPLATE}"; - coff_version = *optarg - '0'; - buf[4] = *optarg; - lang_add_output_format (buf, NULL, NULL, 0); - } + && optarg[1] == '\0') + { + static char buf[] = "coffX-${OUTPUT_FORMAT_TEMPLATE}"; + coff_version = *optarg - '0'; + buf[4] = *optarg; + lang_add_output_format (buf, NULL, NULL, 0); + } else - { + { einfo (_("%P%F: invalid COFF format version %s\n"), optarg); - } + } break; } return FALSE; diff --git a/ld/emultempl/vms.em b/ld/emultempl/vms.em index cd39f97aed1..6f0153b6621 100644 --- a/ld/emultempl/vms.em +++ b/ld/emultempl/vms.em @@ -52,8 +52,8 @@ gld${EMULATION_NAME}_create_output_section_statements (void) static bfd_boolean gld${EMULATION_NAME}_open_dynamic_archive (const char *arch ATTRIBUTE_UNUSED, - search_dirs_type *search, - lang_input_statement_type *entry) + search_dirs_type *search, + lang_input_statement_type *entry) { char *string; @@ -198,7 +198,7 @@ gld${EMULATION_NAME}_before_allocation (void) if (elf_hash_table (&link_info)->dynamic_sections_created && bed->elf_backend_size_dynamic_sections && ! (*bed->elf_backend_size_dynamic_sections) (link_info.output_bfd, - &link_info)) + &link_info)) einfo (_("%P%F: failed to set dynamic section sizes: %E\n")); before_allocation_default (); diff --git a/ld/genscripts.sh b/ld/genscripts.sh index b6940d376d7..53cd5ad95c9 100755 --- a/ld/genscripts.sh +++ b/ld/genscripts.sh @@ -280,7 +280,7 @@ DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})" ( echo "/* Script for ld -r: link without relocation */" . ${CUSTOMIZER_SCRIPT} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xr +) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xr LD_FLAG=u DATA_ALIGNMENT=${DATA_ALIGNMENT_u} @@ -288,7 +288,7 @@ CONSTRUCTING=" " ( echo "/* Script for ld -Ur: link w/out relocation, do create constructors */" . ${CUSTOMIZER_SCRIPT} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xu +) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xu LD_FLAG= DATA_ALIGNMENT=${DATA_ALIGNMENT_} @@ -296,21 +296,21 @@ RELOCATING=" " ( echo "/* Default linker script, for normal executables */" . ${CUSTOMIZER_SCRIPT} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.x +) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.x LD_FLAG=n DATA_ALIGNMENT=${DATA_ALIGNMENT_n} ( echo "/* Script for -n: mix text and data on same page */" . ${CUSTOMIZER_SCRIPT} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xn +) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xn LD_FLAG=N DATA_ALIGNMENT=${DATA_ALIGNMENT_N} ( echo "/* Script for -N: mix text and data on same page; don't align data */" . ${CUSTOMIZER_SCRIPT} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc -) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xbn +) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xbn if test -n "$GENERATE_COMBRELOC_SCRIPT"; then DATA_ALIGNMENT=${DATA_ALIGNMENT_c-${DATA_ALIGNMENT_}} @@ -319,7 +319,7 @@ if test -n "$GENERATE_COMBRELOC_SCRIPT"; then ( echo "/* Script for -z combreloc: combine and sort reloc sections */" . ${CUSTOMIZER_SCRIPT} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc - ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xc + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xc rm -f ${COMBRELOC} LD_FLAG=w RELRO_NOW=" " @@ -327,7 +327,7 @@ if test -n "$GENERATE_COMBRELOC_SCRIPT"; then ( echo "/* Script for -z combreloc -z now -z relro: combine and sort reloc sections */" . ${CUSTOMIZER_SCRIPT} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc - ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xw + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xw rm -f ${COMBRELOC} COMBRELOC= unset RELRO_NOW @@ -341,7 +341,7 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; then echo "/* Script for ld --shared: link shared library */" . ${CUSTOMIZER_SCRIPT} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc - ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xs + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xs if test -n "$GENERATE_COMBRELOC_SCRIPT"; then LD_FLAG=cshared DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}} @@ -349,7 +349,7 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; then ( echo "/* Script for --shared -z combreloc: shared library, combine & sort relocs */" . ${CUSTOMIZER_SCRIPT} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc - ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsc + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsc rm -f ${COMBRELOC} LD_FLAG=wshared RELRO_NOW=" " @@ -357,7 +357,7 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; then ( echo "/* Script for --shared -z combreloc -z now -z relro: shared library, combine & sort relocs */" . ${CUSTOMIZER_SCRIPT} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc - ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsw + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsw rm -f ${COMBRELOC} COMBRELOC= unset RELRO_NOW @@ -373,7 +373,7 @@ if test -n "$GENERATE_PIE_SCRIPT"; then echo "/* Script for ld -pie: link position independent executable */" . ${CUSTOMIZER_SCRIPT} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc - ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xd + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xd if test -n "$GENERATE_COMBRELOC_SCRIPT"; then LD_FLAG=cpie DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}} @@ -381,7 +381,7 @@ if test -n "$GENERATE_PIE_SCRIPT"; then ( echo "/* Script for -pie -z combreloc: position independent executable, combine & sort relocs */" . ${CUSTOMIZER_SCRIPT} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc - ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdc + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdc rm -f ${COMBRELOC} LD_FLAG=wpie RELRO_NOW=" " @@ -389,7 +389,7 @@ if test -n "$GENERATE_PIE_SCRIPT"; then ( echo "/* Script for -pie -z combreloc -z now -z relro: position independent executable, combine & sort relocs */" . ${CUSTOMIZER_SCRIPT} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc - ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdw + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdw rm -f ${COMBRELOC} COMBRELOC= unset RELRO_NOW @@ -404,7 +404,7 @@ if test -n "$GENERATE_AUTO_IMPORT_SCRIPT"; then echo "/* Script for ld --enable-auto-import: Like the default script except read only data is placed into .data */" . ${CUSTOMIZER_SCRIPT} . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc - ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xa + ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xa fi case "$COMPILE_IN: $EMULATION_LIBPATH " in diff --git a/ld/ld.texinfo b/ld/ld.texinfo index b67a7154cd1..d6af574783a 100644 --- a/ld/ld.texinfo +++ b/ld/ld.texinfo @@ -846,7 +846,7 @@ from the place where the @command{ar}, @command{nm} and those commands to make use of a compiler based plugin it must first be copied into the @file{$@{libdir@}/bfd-plugins} directory. All gcc based linker plugins are backward compatible, so it is sufficient to -just copy in the newest one. +just copy in the newest one. @kindex --push-state @cindex push state governing input file handling @@ -1142,7 +1142,7 @@ This option marks the executable as requiring global auditing by setting the @code{DF_1_GLOBAUDIT} bit in the @code{DT_FLAGS_1} dynamic tag. Global auditing requires that any auditing library defined via the @option{--depaudit} or @option{-P} command line options be run for -all dynamic objects loaded by the application. +all dynamic objects loaded by the application. @item initfirst This option is only meaningful when building a shared object. diff --git a/ld/ldgram.y b/ld/ldgram.y index e2998f15533..d701e076a2c 100644 --- a/ld/ldgram.y +++ b/ld/ldgram.y @@ -199,27 +199,27 @@ mri_script_file: mri_script_lines: mri_script_lines mri_script_command NEWLINE - | + | ; mri_script_command: CHIP exp | CHIP exp ',' exp - | NAME { + | NAME { einfo(_("%P%F: unrecognised keyword in MRI style script '%s'\n"),$1); } - | LIST { + | LIST { config.map_filename = "-"; } - | ORDER ordernamelist - | ENDWORD - | PUBLIC NAME '=' exp - { mri_public($2, $4); } - | PUBLIC NAME ',' exp - { mri_public($2, $4); } - | PUBLIC NAME exp - { mri_public($2, $3); } - | FORMAT NAME + | ORDER ordernamelist + | ENDWORD + | PUBLIC NAME '=' exp + { mri_public($2, $4); } + | PUBLIC NAME ',' exp + { mri_public($2, $4); } + | PUBLIC NAME exp + { mri_public($2, $3); } + | FORMAT NAME { mri_format($2); } | SECT NAME ',' exp { mri_output_section($2, $4);} @@ -237,13 +237,13 @@ mri_script_command: { mri_alignmod($2,$4); } | ABSOLUTE mri_abs_name_list | LOAD mri_load_name_list - | NAMEWORD NAME + | NAMEWORD NAME { mri_name($2); } | ALIAS NAME ',' NAME { mri_alias($2,$4,0);} | ALIAS NAME ',' INT { mri_alias ($2, 0, (int) $4.integer); } - | BASE exp + | BASE exp { mri_base($2); } | TRUNCATE INT { mri_truncate ((unsigned int) $2.integer); } @@ -255,13 +255,13 @@ mri_script_command: { ldlex_popstate (); } | START NAME { lang_add_entry ($2, FALSE); } - | + | ; ordernamelist: - ordernamelist ',' NAME { mri_order($3); } - | ordernamelist NAME { mri_order($2); } - | + ordernamelist ',' NAME { mri_order($3); } + | ordernamelist NAME { mri_order($2); } + | ; mri_load_name_list: @@ -271,10 +271,10 @@ mri_load_name_list: ; mri_abs_name_list: - NAME - { mri_only_load($1); } + NAME + { mri_only_load($1); } | mri_abs_name_list ',' NAME - { mri_only_load($3); } + { mri_only_load($3); } ; casesymlist: @@ -302,11 +302,11 @@ script_file: { ldlex_both(); } ifile_list { ldlex_popstate(); } - ; + ; ifile_list: ifile_list ifile_p1 - | + | ; @@ -320,19 +320,19 @@ ifile_p1: | floating_point_support | statement_anywhere | version - | ';' + | ';' | TARGET_K '(' NAME ')' { lang_add_target($3); } | SEARCH_DIR '(' filename ')' { ldfile_add_library_path ($3, FALSE); } | OUTPUT '(' filename ')' { lang_add_output($3, 1); } - | OUTPUT_FORMAT '(' NAME ')' + | OUTPUT_FORMAT '(' NAME ')' { lang_add_output_format ($3, (char *) NULL, (char *) NULL, 1); } | OUTPUT_FORMAT '(' NAME ',' NAME ',' NAME ')' { lang_add_output_format ($3, $5, $7, 1); } - | OUTPUT_ARCH '(' NAME ')' + | OUTPUT_ARCH '(' NAME ')' { ldfile_set_output_arch ($3, bfd_arch_unknown); } | FORCE_COMMON_ALLOCATION { command_line.force_common_definition = TRUE ; } @@ -345,7 +345,7 @@ ifile_p1: { lang_enter_group (); } '(' input_list ')' { lang_leave_group (); } - | MAP '(' filename ')' + | MAP '(' filename ')' { lang_add_map($3); } | INCLUDE filename { ldlex_script (); ldfile_open_command_file($2); } @@ -455,7 +455,7 @@ wildcard_maybe_exclude: $$.exclude_name_list = NULL; $$.section_flag_list = NULL; } - | EXCLUDE_FILE '(' exclude_name_list ')' wildcard_name + | EXCLUDE_FILE '(' exclude_name_list ')' wildcard_name { $$.name = $5; $$.sorted = none; @@ -632,11 +632,11 @@ input_section_spec_no_keep: tmp.section_flag_list = $1; lang_add_wild (&tmp, NULL, ldgram_had_keep); } - | '[' section_name_list ']' + | '[' section_name_list ']' { lang_add_wild (NULL, $2, ldgram_had_keep); } - | sect_flags '[' section_name_list ']' + | sect_flags '[' section_name_list ']' { struct wildcard_spec tmp; tmp.name = NULL; @@ -665,13 +665,13 @@ input_section_spec: ; statement: - assignment end + assignment end | CREATE_OBJECT_SYMBOLS { - lang_add_attribute(lang_object_symbols_statement_enum); - } - | ';' - | CONSTRUCTORS + lang_add_attribute(lang_object_symbols_statement_enum); + } + | ';' + | CONSTRUCTORS { lang_add_attribute(lang_constructors_statement_enum); @@ -682,15 +682,15 @@ statement: lang_add_attribute (lang_constructors_statement_enum); } | input_section_spec - | length '(' mustbe_exp ')' - { - lang_add_data ((int) $1, $3); - } + | length '(' mustbe_exp ')' + { + lang_add_data ((int) $1, $3); + } | FILL '(' fill_exp ')' - { - lang_add_fill ($3); - } + { + lang_add_fill ($3); + } | ASSERT_K {ldlex_expression ();} '(' exp ',' NAME ')' end { ldlex_popstate (); lang_add_assignment (exp_assert ($4, $6)); } @@ -702,7 +702,7 @@ statement: statement_list: statement_list statement - | statement + | statement ; statement_list_opt: @@ -717,7 +717,7 @@ length: { $$ = $1; } | LONG { $$ = $1; } - | SHORT + | SHORT { $$ = $1; } | BYTE { $$ = $1; } @@ -733,7 +733,7 @@ fill_exp: fill_opt: '=' fill_exp { $$ = $2; } - | { $$ = (fill_type *) 0; } + | { $$ = (fill_type *) 0; } ; assign_op: @@ -741,17 +741,17 @@ assign_op: { $$ = '+'; } | MINUSEQ { $$ = '-'; } - | MULTEQ + | MULTEQ { $$ = '*'; } - | DIVEQ + | DIVEQ { $$ = '/'; } - | LSHIFTEQ + | LSHIFTEQ { $$ = LSHIFT; } - | RSHIFTEQ + | RSHIFTEQ { $$ = RSHIFT; } - | ANDEQ + | ANDEQ { $$ = '&'; } - | OREQ + | OREQ { $$ = '|'; } ; @@ -804,7 +804,7 @@ memory_spec_list: ; -memory_spec: NAME +memory_spec: NAME { region = lang_memory_region_lookup ($1, TRUE); } attributes_opt ':' origin_spec opt_comma length_spec @@ -824,7 +824,7 @@ origin_spec: ; length_spec: - LENGTH '=' mustbe_exp + LENGTH '=' mustbe_exp { region->length_exp = $3; } @@ -946,7 +946,7 @@ exp : { $$ = exp_binop (NE , $1, $3); } | exp LE exp { $$ = exp_binop (LE , $1, $3); } - | exp GE exp + | exp GE exp { $$ = exp_binop (GE , $1, $3); } | exp '<' exp { $$ = exp_binop ('<' , $1, $3); } @@ -968,7 +968,7 @@ exp : { $$ = exp_nameop (DEFINED, $3); } | INT { $$ = exp_bigintop ($1.integer, $1.str); } - | SIZEOF_HEADERS + | SIZEOF_HEADERS { $$ = exp_nameop (SIZEOF_HEADERS,0); } | ALIGNOF '(' NAME ')' @@ -993,8 +993,8 @@ exp : { $$ = exp_binop (DATA_SEGMENT_RELRO_END, $5, $3); } | DATA_SEGMENT_END '(' exp ')' { $$ = exp_unop (DATA_SEGMENT_END, $3); } - | SEGMENT_START '(' NAME ',' exp ')' - { /* The operands to the expression node are + | SEGMENT_START '(' NAME ',' exp ')' + { /* The operands to the expression node are placed in the opposite order from the way in which they appear in the script as that allows us to reuse more code in @@ -1022,9 +1022,9 @@ exp : memspec_at_opt: - AT '>' NAME { $$ = $3; } - | { $$ = 0; } - ; + AT '>' NAME { $$ = $3; } + | { $$ = 0; } + ; opt_at: AT '(' exp ')' { $$ = $3; } @@ -1053,7 +1053,7 @@ sect_constraint: | { $$ = 0; } ; -section: NAME { ldlex_expression(); } +section: NAME { ldlex_expression(); } opt_exp_with_type opt_at opt_align @@ -1067,7 +1067,7 @@ section: NAME { ldlex_expression(); } $5, $7, $4, $9, $6); } statement_list_opt - '}' { ldlex_popstate (); ldlex_expression (); } + '}' { ldlex_popstate (); ldlex_expression (); } memspec_opt memspec_at_opt phdr_opt fill_opt { ldlex_popstate (); @@ -1119,9 +1119,9 @@ type: ; atype: - '(' type ')' - | /* EMPTY */ { sectype = normal_section; } - | '(' ')' { sectype = normal_section; } + '(' type ')' + | /* EMPTY */ { sectype = normal_section; } + | '(' ')' { sectype = normal_section; } ; opt_exp_with_type: @@ -1402,7 +1402,7 @@ vers_defns: { $$ = lang_new_vers_pattern (NULL, $1, ldgram_vers_current_lang, FALSE); } - | NAME + | NAME { $$ = lang_new_vers_pattern (NULL, $1, ldgram_vers_current_lang, TRUE); } diff --git a/ld/ldlang.c b/ld/ldlang.c index ba8dcc17402..0018188205a 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -227,7 +227,7 @@ unique_section_p (const asection *sec, static bfd_boolean walk_wild_file_in_exclude_list (struct name_list *exclude_list, - lang_input_statement_type *file) + lang_input_statement_type *file) { struct name_list *list_tmp; @@ -2367,9 +2367,9 @@ lang_add_section (lang_statement_list_type *ptr, if ((flags & (SEC_LINK_ONCE | SEC_GROUP)) == (SEC_LINK_ONCE | SEC_GROUP)) { if (link_info.resolve_section_groups) - flags &= ~(SEC_LINK_ONCE | SEC_LINK_DUPLICATES | SEC_RELOC); + flags &= ~(SEC_LINK_ONCE | SEC_LINK_DUPLICATES | SEC_RELOC); else - flags &= ~(SEC_LINK_DUPLICATES | SEC_RELOC); + flags &= ~(SEC_LINK_DUPLICATES | SEC_RELOC); } else if (!bfd_link_relocatable (&link_info)) flags &= ~(SEC_LINK_ONCE | SEC_LINK_DUPLICATES | SEC_RELOC); @@ -4425,7 +4425,7 @@ print_wild_statement (lang_wild_statement_type *w, name_list *tmp; minfo ("EXCLUDE_FILE(%s", w->exclude_name_list->name); for (tmp = w->exclude_name_list->next; tmp; tmp = tmp->next) - minfo (" %s", tmp->name); + minfo (" %s", tmp->name); minfo (") "); } @@ -4444,40 +4444,40 @@ print_wild_statement (lang_wild_statement_type *w, int closing_paren = 0; switch (sec->spec.sorted) - { - case none: - break; + { + case none: + break; - case by_name: - minfo ("SORT_BY_NAME("); - closing_paren = 1; - break; + case by_name: + minfo ("SORT_BY_NAME("); + closing_paren = 1; + break; - case by_alignment: - minfo ("SORT_BY_ALIGNMENT("); - closing_paren = 1; - break; + case by_alignment: + minfo ("SORT_BY_ALIGNMENT("); + closing_paren = 1; + break; - case by_name_alignment: - minfo ("SORT_BY_NAME(SORT_BY_ALIGNMENT("); - closing_paren = 2; - break; + case by_name_alignment: + minfo ("SORT_BY_NAME(SORT_BY_ALIGNMENT("); + closing_paren = 2; + break; - case by_alignment_name: - minfo ("SORT_BY_ALIGNMENT(SORT_BY_NAME("); - closing_paren = 2; - break; + case by_alignment_name: + minfo ("SORT_BY_ALIGNMENT(SORT_BY_NAME("); + closing_paren = 2; + break; - case by_none: - minfo ("SORT_NONE("); - closing_paren = 1; - break; + case by_none: + minfo ("SORT_NONE("); + closing_paren = 1; + break; - case by_init_priority: - minfo ("SORT_BY_INIT_PRIORITY("); - closing_paren = 1; - break; - } + case by_init_priority: + minfo ("SORT_BY_INIT_PRIORITY("); + closing_paren = 1; + break; + } if (sec->spec.exclude_name_list != NULL) { @@ -4492,7 +4492,7 @@ print_wild_statement (lang_wild_statement_type *w, else minfo ("*"); for (;closing_paren > 0; closing_paren--) - minfo (")"); + minfo (")"); if (sec->next) minfo (" "); } diff --git a/ld/ldlex.l b/ld/ldlex.l index fd508564a22..207c97f3235 100644 --- a/ld/ldlex.l +++ b/ld/ldlex.l @@ -79,7 +79,7 @@ static void lex_warn_invalid (char *where, char *what); INPUTLIST definitely in a script, a filename-list BOTH either EXPRESSION or SCRIPT DEFSYMEXP in an argument to -defsym - MRI in an MRI script + MRI in an MRI script VERS_START starting a Sun style mapfile VERS_SCRIPT a Sun style mapfile VERS_NODE a node within a Sun style mapfile @@ -135,13 +135,13 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* "/*" { comment (); } -"-" { RTOKEN('-');} -"+" { RTOKEN('+');} +"-" { RTOKEN('-');} +"+" { RTOKEN('+');} {SYMBOLNAMECHAR1}{SYMBOLCHARN}* { yylval.name = xstrdup (yytext); return NAME; } -"=" { RTOKEN('='); } +"=" { RTOKEN('='); } "$"([0-9A-Fa-f])+ { - yylval.integer = bfd_scan_vma (yytext + 1, 0, 16); + yylval.integer = bfd_scan_vma (yytext + 1, 0, 16); yylval.bigint.str = NULL; return INT; } @@ -231,7 +231,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* "/" { RTOKEN('/');} "%" { RTOKEN('%');} "<" { RTOKEN('<');} -"=" { RTOKEN('=');} +"=" { RTOKEN('=');} "}" { RTOKEN('}') ; } "{" { RTOKEN('{'); } ")" { RTOKEN(')');} @@ -327,42 +327,42 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* "EXCLUDE_FILE" { RTOKEN(EXCLUDE_FILE); } "CONSTANT" { RTOKEN(CONSTANT);} "#".*\n? { ++ lineno; } -"\n" { ++ lineno; RTOKEN(NEWLINE); } +"\n" { ++ lineno; RTOKEN(NEWLINE); } "*".* { /* Mri comment line */ } ";".* { /* Mri comment line */ } -"END" { RTOKEN(ENDWORD); } +"END" { RTOKEN(ENDWORD); } "ALIGNMOD" { RTOKEN(ALIGNMOD);} "ALIGN" { RTOKEN(ALIGN_K);} -"CHIP" { RTOKEN(CHIP); } -"BASE" { RTOKEN(BASE); } -"ALIAS" { RTOKEN(ALIAS); } -"TRUNCATE" { RTOKEN(TRUNCATE); } -"LOAD" { RTOKEN(LOAD); } -"PUBLIC" { RTOKEN(PUBLIC); } -"ORDER" { RTOKEN(ORDER); } -"NAME" { RTOKEN(NAMEWORD); } -"FORMAT" { RTOKEN(FORMAT); } -"CASE" { RTOKEN(CASE); } -"START" { RTOKEN(START); } -"LIST".* { RTOKEN(LIST); /* LIST and ignore to end of line */ } +"CHIP" { RTOKEN(CHIP); } +"BASE" { RTOKEN(BASE); } +"ALIAS" { RTOKEN(ALIAS); } +"TRUNCATE" { RTOKEN(TRUNCATE); } +"LOAD" { RTOKEN(LOAD); } +"PUBLIC" { RTOKEN(PUBLIC); } +"ORDER" { RTOKEN(ORDER); } +"NAME" { RTOKEN(NAMEWORD); } +"FORMAT" { RTOKEN(FORMAT); } +"CASE" { RTOKEN(CASE); } +"START" { RTOKEN(START); } +"LIST".* { RTOKEN(LIST); /* LIST and ignore to end of line */ } "SECT" { RTOKEN(SECT); } "ABSOLUTE" { RTOKEN(ABSOLUTE); } -"end" { RTOKEN(ENDWORD); } +"end" { RTOKEN(ENDWORD); } "alignmod" { RTOKEN(ALIGNMOD);} "align" { RTOKEN(ALIGN_K);} -"chip" { RTOKEN(CHIP); } -"base" { RTOKEN(BASE); } -"alias" { RTOKEN(ALIAS); } -"truncate" { RTOKEN(TRUNCATE); } -"load" { RTOKEN(LOAD); } -"public" { RTOKEN(PUBLIC); } -"order" { RTOKEN(ORDER); } -"name" { RTOKEN(NAMEWORD); } -"format" { RTOKEN(FORMAT); } -"case" { RTOKEN(CASE); } -"extern" { RTOKEN(EXTERN); } -"start" { RTOKEN(START); } -"list".* { RTOKEN(LIST); /* LIST and ignore to end of line */ } +"chip" { RTOKEN(CHIP); } +"base" { RTOKEN(BASE); } +"alias" { RTOKEN(ALIAS); } +"truncate" { RTOKEN(TRUNCATE); } +"load" { RTOKEN(LOAD); } +"public" { RTOKEN(PUBLIC); } +"order" { RTOKEN(ORDER); } +"name" { RTOKEN(NAMEWORD); } +"format" { RTOKEN(FORMAT); } +"case" { RTOKEN(CASE); } +"extern" { RTOKEN(EXTERN); } +"start" { RTOKEN(START); } +"list".* { RTOKEN(LIST); /* LIST and ignore to end of line */ } "sect" { RTOKEN(SECT); } "absolute" { RTOKEN(ABSOLUTE); } @@ -463,7 +463,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* #.* { /* Eat up comments */ } -[ \t\r]+ { /* Eat up whitespace */ } +[ \t\r]+ { /* Eat up whitespace */ } <> { include_stack_ptr--; diff --git a/ld/lexsup.c b/ld/lexsup.c index 1adb302a14e..cb9edaf7a6a 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -770,9 +770,9 @@ parse_args (unsigned argc, char **argv) case 'd': command_line.force_common_definition = TRUE; break; - case OPTION_FORCE_GROUP_ALLOCATION: - command_line.force_group_allocation = TRUE; - break; + case OPTION_FORCE_GROUP_ALLOCATION: + command_line.force_group_allocation = TRUE; + break; case OPTION_DEFSYM: lex_string = optarg; lex_redirect (optarg, "--defsym", ++defsym_count); @@ -828,7 +828,7 @@ parse_args (unsigned argc, char **argv) if (command_line.auxiliary_filters == NULL) { command_line.auxiliary_filters = (char **) - xmalloc (2 * sizeof (char *)); + xmalloc (2 * sizeof (char *)); command_line.auxiliary_filters[0] = optarg; command_line.auxiliary_filters[1] = NULL; } @@ -841,8 +841,8 @@ parse_args (unsigned argc, char **argv) for (p = command_line.auxiliary_filters; *p != NULL; p++) ++c; command_line.auxiliary_filters = (char **) - xrealloc (command_line.auxiliary_filters, - (c + 2) * sizeof (char *)); + xrealloc (command_line.auxiliary_filters, + (c + 2) * sizeof (char *)); command_line.auxiliary_filters[c] = optarg; command_line.auxiliary_filters[c + 1] = NULL; } @@ -952,7 +952,7 @@ parse_args (unsigned argc, char **argv) link_info.unresolved_syms_in_shared_libs = how_to_report_unresolved_symbols; } - else if (strcmp (optarg, "ignore-in-shared-libs") == 0) + else if (strcmp (optarg, "ignore-in-shared-libs") == 0) { link_info.unresolved_syms_in_objects = how_to_report_unresolved_symbols; @@ -1130,8 +1130,8 @@ parse_args (unsigned argc, char **argv) char *buf; buf = (char *) xmalloc (strlen (command_line.rpath_link) - + strlen (optarg) - + 2); + + strlen (optarg) + + 2); sprintf (buf, "%s%c%s", command_line.rpath_link, config.rpath_separator, optarg); free (command_line.rpath_link); @@ -1198,8 +1198,8 @@ parse_args (unsigned argc, char **argv) case OPTION_SORT_COMMON: if (optarg == NULL || strcmp (optarg, N_("descending")) == 0) - config.sort_common = sort_descending; - else if (strcmp (optarg, N_("ascending")) == 0) + config.sort_common = sort_descending; + else if (strcmp (optarg, N_("ascending")) == 0) config.sort_common = sort_ascending; else einfo (_("%P%F: invalid common section sorting option: %s\n"), @@ -1308,8 +1308,8 @@ parse_args (unsigned argc, char **argv) case 'u': ldlang_add_undef (optarg, TRUE); break; - case OPTION_REQUIRE_DEFINED_SYMBOL: - ldlang_add_require_defined (optarg); + case OPTION_REQUIRE_DEFINED_SYMBOL: + ldlang_add_require_defined (optarg); break; case OPTION_UNIQUE: if (optarg != NULL) @@ -1522,17 +1522,17 @@ parse_args (unsigned argc, char **argv) config.hash_table_size = 1021; break; - case OPTION_HASH_SIZE: + case OPTION_HASH_SIZE: { bfd_size_type new_size; - new_size = strtoul (optarg, NULL, 0); - if (new_size) - config.hash_table_size = new_size; - else - einfo (_("%P%X: --hash-size needs a numeric argument\n")); - } - break; + new_size = strtoul (optarg, NULL, 0); + if (new_size) + config.hash_table_size = new_size; + else + einfo (_("%P%X: --hash-size needs a numeric argument\n")); + } + break; case OPTION_PUSH_STATE: input_flags.pushed = xmemdup (&input_flags, diff --git a/ld/pe-dll.c b/ld/pe-dll.c index a88afacde3d..aee7b9dacbf 100644 --- a/ld/pe-dll.c +++ b/ld/pe-dll.c @@ -552,7 +552,7 @@ auto_export (bfd *abfd, def_file *d, const char *n) /* Return false if n is in the d->exports table. */ if (bsearch (&key, d->exports, d->num_exports, - sizeof (pe_def_file->exports[0]), pe_export_sort)) + sizeof (pe_def_file->exports[0]), pe_export_sort)) return 0; if (pe_dll_do_default_excludes) @@ -692,9 +692,9 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info * { struct coff_link_hash_entry *sym_hash; sym_hash = coff_link_hash_lookup (coff_hash_table (info), - ac->symbol_name, FALSE, FALSE, FALSE); + ac->symbol_name, FALSE, FALSE, FALSE); if (sym_hash && sym_hash->root.type == bfd_link_hash_common - && sym_hash->root.u.c.p->alignment_power < (unsigned) ac->alignment) + && sym_hash->root.u.c.p->alignment_power < (unsigned) ac->alignment) { sym_hash->root.u.c.p->alignment_power = (unsigned) ac->alignment; } @@ -736,9 +736,9 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info * && ((symbols[j]->flags & BSF_GLOBAL) || (symbols[j]->flags == 0))); if (link_info.version_info && would_export) - would_export - = !bfd_hide_sym_by_version (link_info.version_info, - symbols[j]->name); + would_export + = !bfd_hide_sym_by_version (link_info.version_info, + symbols[j]->name); if (would_export) { const char *sn = symbols[j]->name; @@ -747,7 +747,7 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info * { char *name; if (is_import (sn)) - continue; + continue; name = xmalloc (strlen ("__imp_") + strlen (sn) + 1); sprintf (name, "%s%s", "__imp_", sn); @@ -772,7 +772,7 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info * NULL, &is_dup); /* Fill data flag properly, from dlltool.c. */ if (!is_dup) - p->flag_data = !(symbols[j]->flags & BSF_FUNCTION); + p->flag_data = !(symbols[j]->flags & BSF_FUNCTION); } } } @@ -806,12 +806,12 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info * char *tmp_at = strrchr (tmp, '@'); if (tmp_at) - *tmp_at = 0; + *tmp_at = 0; else - einfo (_("%P%X: Cannot export %s: invalid export name\n"), + einfo (_("%P%X: Cannot export %s: invalid export name\n"), pe_def_file->exports[i].name); pe_def_file->exports[i].name = tmp; - resort_needed = TRUE; + resort_needed = TRUE; } } } @@ -820,7 +820,7 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info * by removing leading @. */ if (resort_needed) qsort (pe_def_file->exports, NE, sizeof (pe_def_file->exports[0]), - pe_export_sort); + pe_export_sort); if (pe_dll_stdcall_aliases) { @@ -841,7 +841,7 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info * pe_def_file->exports[i].internal_name, -1, NULL, &is_dup); if (is_dup) - free (tmp); + free (tmp); } } } @@ -953,7 +953,7 @@ process_def_file_and_drectve (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info * } } /* Check for forward exports. These are indicated in DEF files by an - export directive of the form NAME1 = MODULE-NAME.EXTERNAL-NAME + export directive of the form NAME1 = MODULE-NAME.EXTERNAL-NAME but we must take care not to be fooled when the user wants to export a symbol that actually really has a dot in it, so we only check for them here, after real defined symbols have already been matched. */ @@ -1093,8 +1093,8 @@ generate_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED) /* Now we need to assign ordinals to those that don't have them. */ for (i = 0; i < NE; i++) { - if (exported_symbol_sections[i] || - pe_def_file->exports[i].flag_forward) + if (exported_symbol_sections[i] + || pe_def_file->exports[i].flag_forward) { if (pe_def_file->exports[i].ordinal != -1) { @@ -1126,9 +1126,9 @@ generate_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED) next_ordinal = min_ordinal; for (i = 0; i < NE; i++) - if ((exported_symbol_sections[i] || - pe_def_file->exports[i].flag_forward) && - pe_def_file->exports[i].ordinal == -1) + if ((exported_symbol_sections[i] + || pe_def_file->exports[i].flag_forward) + && pe_def_file->exports[i].ordinal == -1) { while (exported_symbols[next_ordinal - min_ordinal] != -1) next_ordinal++; @@ -1166,7 +1166,7 @@ fill_exported_offsets (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info) name = xmalloc (strlen (pe_def_file->exports[i].internal_name) + 2); if (pe_details->underscored - && *pe_def_file->exports[i].internal_name != '@') + && *pe_def_file->exports[i].internal_name != '@') { *name = '_'; strcpy (name + 1, pe_def_file->exports[i].internal_name); @@ -1234,21 +1234,21 @@ fill_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED) Scan alphabetically - ie the ordering in the exports[] table, rather than by ordinal - the ordering in the exported_symbol[] table. See dlltool.c and: - http://sources.redhat.com/ml/binutils/2003-04/msg00379.html + http://sources.redhat.com/ml/binutils/2003-04/msg00379.html for more information. */ hint = 0; for (s = 0; s < NE; s++) { struct bfd_section *ssec = exported_symbol_sections[s]; - if (pe_def_file->exports[s].ordinal != -1 && - (pe_def_file->exports[s].flag_forward || ssec != NULL)) + if (pe_def_file->exports[s].ordinal != -1 + && (pe_def_file->exports[s].flag_forward || ssec != NULL)) { int ord = pe_def_file->exports[s].ordinal; if (pe_def_file->exports[s].flag_forward) { bfd_put_32 (abfd, ERVA (enamestr), - eaddresses + 4 * (ord - min_ordinal)); + eaddresses + 4 * (ord - min_ordinal)); strcpy (enamestr, pe_def_file->exports[s].internal_name); enamestr += strlen (pe_def_file->exports[s].internal_name) + 1; @@ -1260,7 +1260,7 @@ fill_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED) + ssec->output_offset); bfd_put_32 (abfd, srva - image_base, - eaddresses + 4 * (ord - min_ordinal)); + eaddresses + 4 * (ord - min_ordinal)); } if (!pe_def_file->exports[s].flag_noname) @@ -1880,20 +1880,20 @@ save_relocs (asection *sec) } /* .section .idata$2 - .global __head_my_dll + .global __head_my_dll __head_my_dll: - .rva hname - .long 0 - .long 0 - .rva __my_dll_iname - .rva fthunk + .rva hname + .long 0 + .long 0 + .rva __my_dll_iname + .rva fthunk - .section .idata$5 - .long 0 + .section .idata$5 + .long 0 fthunk: - .section .idata$4 - .long 0 + .section .idata$4 + .long 0 hname: */ static bfd * @@ -1974,15 +1974,15 @@ make_head (bfd *parent) } /* .section .idata$4 - .long 0 + .long 0 [.long 0] for PE+ - .section .idata$5 - .long 0 + .section .idata$5 + .long 0 [.long 0] for PE+ - .section idata$7 - .global __my_dll_iname + .section idata$7 + .global __my_dll_iname __my_dll_iname: - .asciz "my.dll" */ + .asciz "my.dll" */ static bfd * make_tail (bfd *parent) @@ -2044,25 +2044,25 @@ make_tail (bfd *parent) } /* .text - .global _function - .global ___imp_function - .global __imp__function + .global _function + .global ___imp_function + .global __imp__function _function: - jmp *__imp__function: + jmp *__imp__function: - .section idata$7 - .long __head_my_dll + .section idata$7 + .long __head_my_dll - .section .idata$5 + .section .idata$5 ___imp_function: __imp__function: iat? - .section .idata$4 + .section .idata$4 iat? - .section .idata$6 + .section .idata$6 ID: - .short - .asciz "function" xlate? (add underscore, kill at) */ + .short + .asciz "function" xlate? (add underscore, kill at) */ static const unsigned char jmp_ix86_bytes[] = { @@ -2070,11 +2070,11 @@ static const unsigned char jmp_ix86_bytes[] = }; /* _function: - mov.l ip+8,r0 - mov.l @r0,r0 - jmp @r0 - nop - .dw __imp_function */ + mov.l ip+8,r0 + mov.l @r0,r0 + jmp @r0 + nop + .dw __imp_function */ static const unsigned char jmp_sh_bytes[] = { @@ -2082,10 +2082,10 @@ static const unsigned char jmp_sh_bytes[] = }; /* _function: - lui $t0, - lw $t0, - jr $t0 - nop */ + lui $t0, + lw $t0, + jr $t0 + nop */ static const unsigned char jmp_mips_bytes[] = { @@ -2211,7 +2211,7 @@ make_one (def_file_export *exp, bfd *parent, bfd_boolean include_jmp_stub) /* Mark this object as SAFESEH compatible. */ quick_symbol (abfd, "", "@feat.00", "", bfd_abs_section_ptr, BSF_LOCAL, 1); - quick_reloc (abfd, 2, BFD_RELOC_32, 2); + quick_reloc (abfd, 2, BFD_RELOC_32, 2); #endif break; case PE_ARCH_sh: @@ -2223,8 +2223,8 @@ make_one (def_file_export *exp, bfd *parent, bfd_boolean include_jmp_stub) quick_reloc (abfd, 4, BFD_RELOC_LO16, 2); break; case PE_ARCH_arm: - case PE_ARCH_arm_epoc: - case PE_ARCH_arm_wince: + case PE_ARCH_arm_epoc: + case PE_ARCH_arm_wince: quick_reloc (abfd, 8, BFD_RELOC_32, 2); break; default: @@ -2432,11 +2432,11 @@ make_import_fixup_mark (arelent *rel, char *name) } /* .section .idata$2 - .rva __nm_thnk_SYM (singleton thunk with name of func) - .long 0 - .long 0 - .rva __my_dll_iname (name of dll) - .rva __fuNN_SYM (pointer to reference (address) in text) */ + .rva __nm_thnk_SYM (singleton thunk with name of func) + .long 0 + .long 0 + .rva __my_dll_iname (name of dll) + .rva __fuNN_SYM (pointer to reference (address) in text) */ static bfd * make_import_fixup_entry (const char *name, @@ -2492,8 +2492,8 @@ make_import_fixup_entry (const char *name, } /* .section .rdata_runtime_pseudo_reloc - .long addend - .rva __fuNN_SYM (pointer to reference (address) in text) */ + .long addend + .rva __fuNN_SYM (pointer to reference (address) in text) */ static bfd * make_runtime_pseudo_reloc (const char *name ATTRIBUTE_UNUSED, @@ -2577,7 +2577,7 @@ make_runtime_pseudo_reloc (const char *name ATTRIBUTE_UNUSED, } /* .section .rdata - .rva __pei386_runtime_relocator */ + .rva __pei386_runtime_relocator */ static bfd * pe_create_runtime_relocator_reference (bfd *parent) @@ -2655,16 +2655,16 @@ pe_create_import_fixup (arelent *rel, asection *s, bfd_vma addend, char *name) add_bfd_to_link (b, b->filename, &link_info); /* If we ever use autoimport, we have to cast text section writable. - But not for version 2. */ + But not for version 2. */ if (link_info.pei386_runtime_pseudo_reloc != 2) - { - config.text_read_only = FALSE; - link_info.output_bfd->flags &= ~WP_TEXT; - } + { + config.text_read_only = FALSE; + link_info.output_bfd->flags &= ~WP_TEXT; + } if (link_info.pei386_runtime_pseudo_reloc == 2) - { + { b = make_singleton_name_imp (name, link_info.output_bfd); - add_bfd_to_link (b, b->filename, &link_info); + add_bfd_to_link (b, b->filename, &link_info); } } @@ -2679,27 +2679,27 @@ pe_create_import_fixup (arelent *rel, asection *s, bfd_vma addend, char *name) add_bfd_to_link (b, b->filename, &link_info); } - if ((link_info.pei386_runtime_pseudo_reloc != 0 && addend != 0) - || link_info.pei386_runtime_pseudo_reloc == 2) - { - if (pe_dll_extra_pe_debug) - printf ("creating runtime pseudo-reloc entry for %s (addend=%d)\n", - fixup_name, (int) addend); + if ((link_info.pei386_runtime_pseudo_reloc != 0 && addend != 0) + || link_info.pei386_runtime_pseudo_reloc == 2) + { + if (pe_dll_extra_pe_debug) + printf ("creating runtime pseudo-reloc entry for %s (addend=%d)\n", + fixup_name, (int) addend); - b = make_runtime_pseudo_reloc (name, fixup_name, addend, rel->howto->bitsize, - link_info.output_bfd); - add_bfd_to_link (b, b->filename, &link_info); + b = make_runtime_pseudo_reloc (name, fixup_name, addend, rel->howto->bitsize, + link_info.output_bfd); + add_bfd_to_link (b, b->filename, &link_info); - if (runtime_pseudo_relocs_created == 0) - { - b = pe_create_runtime_relocator_reference (link_info.output_bfd); - add_bfd_to_link (b, b->filename, &link_info); - } - runtime_pseudo_relocs_created++; - } - else if (addend != 0) - einfo (_("%P%X%C: variable '%T' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.\n"), - s->owner, s, rel->address, sym->name); + if (runtime_pseudo_relocs_created == 0) + { + b = pe_create_runtime_relocator_reference (link_info.output_bfd); + add_bfd_to_link (b, b->filename, &link_info); + } + runtime_pseudo_relocs_created++; + } + else if (addend != 0) + einfo (_("%P%X%C: variable '%T' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.\n"), + s->owner, s, rel->address, sym->name); } @@ -2753,8 +2753,8 @@ pe_dll_generate_implib (def_file *def, const char *impfilename, struct bfd_link_ found = (filename_cmp (ex->string, ibfd->filename) == 0); } /* If it matched, we must open a fresh BFD for it (the original - input BFD is still needed for the DLL's final link) and add - it into the archive member chain. */ + input BFD is still needed for the DLL's final link) and add + it into the archive member chain. */ if (found) { bfd *newbfd = bfd_openr (ibfd->my_archive @@ -2913,7 +2913,7 @@ pe_find_cdecl_alias_match (struct bfd_link_info *linfo, char *name) { h = bfd_link_hash_lookup (linfo->hash, kv->oname, FALSE, FALSE, FALSE); if (h->type == bfd_link_hash_undefined) - goto return_h; + goto return_h; } if (lname[0] == '?') @@ -2922,7 +2922,7 @@ pe_find_cdecl_alias_match (struct bfd_link_info *linfo, char *name) if (at || lname[0] == '@') { if (lname[0] == '@') - { + { if (pe_details->underscored) lname[0] = '_'; else @@ -2938,7 +2938,7 @@ pe_find_cdecl_alias_match (struct bfd_link_info *linfo, char *name) } } if (at) - *strchr (lname, '@') = 0; + *strchr (lname, '@') = 0; key.key = lname; kv = bsearch (&key, udef_table, undef_count, sizeof (struct key_value), undef_sort_cmp); @@ -2979,7 +2979,7 @@ pe_find_cdecl_alias_match (struct bfd_link_info *linfo, char *name) { h = bfd_link_hash_lookup (linfo->hash, kv->oname, FALSE, FALSE, FALSE); if (h->type == bfd_link_hash_undefined) - goto return_h; + goto return_h; } return_NULL: @@ -2991,7 +2991,7 @@ pe_find_cdecl_alias_match (struct bfd_link_info *linfo, char *name) static bfd_boolean pe_undef_count (struct bfd_link_hash_entry *h ATTRIBUTE_UNUSED, - void *inf ATTRIBUTE_UNUSED) + void *inf ATTRIBUTE_UNUSED) { if (h->type == bfd_link_hash_undefined) undef_count++; @@ -3009,7 +3009,7 @@ pe_undef_fill (struct bfd_link_hash_entry *h, void *inf ATTRIBUTE_UNUSED) at = strchr (udef_table[undef_count].key + (udef_table[undef_count].key[0] == '@'), '@'); if (at) - at[1] = 0; + at[1] = 0; udef_table[undef_count].oname = h->root.string; undef_count++; } @@ -3073,7 +3073,7 @@ pe_process_import_defs (bfd *output_bfd, struct bfd_link_info *linfo) for (i = 0; i < pe_def_file->num_imports && imp[i].module != module; i++) ; if (i >= pe_def_file->num_imports) - continue; + continue; dll_filename = module->name; dll_symname = xstrdup (module->name); @@ -3117,7 +3117,7 @@ pe_process_import_defs (bfd *output_bfd, struct bfd_link_info *linfo) blhe = bfd_link_hash_lookup (linfo->hash, name, FALSE, FALSE, FALSE); if (blhe) - is_undef = (blhe->type == bfd_link_hash_undefined); + is_undef = (blhe->type == bfd_link_hash_undefined); } else { @@ -3131,7 +3131,7 @@ pe_process_import_defs (bfd *output_bfd, struct bfd_link_info *linfo) blhe = pe_find_cdecl_alias_match (linfo, name); include_jmp_stub = TRUE; if (blhe) - is_undef = (blhe->type == bfd_link_hash_undefined); + is_undef = (blhe->type == bfd_link_hash_undefined); } free (name); @@ -3380,26 +3380,26 @@ pe_implied_import_dll (const char *filename) /* Skip unwanted symbols, which are exported in buggy auto-import releases. */ if (! CONST_STRNEQ (erva + name_rva, "__nm_")) - { + { int is_dup = 0; - /* is_data is true if the address is in the data, rdata or bss + /* is_data is true if the address is in the data, rdata or bss segment. */ - is_data = + is_data = (func_rva >= data_start && func_rva < data_end) || (func_rva >= rdata_start && func_rva < rdata_end) || (func_rva >= bss_start && func_rva < bss_end); imp = def_file_add_import (pe_def_file, erva + name_rva, dllname, i, NULL, NULL, &is_dup); - /* Mark symbol type. */ - if (!is_dup) - imp->data = is_data; + /* Mark symbol type. */ + if (!is_dup) + imp->data = is_data; - if (pe_dll_extra_pe_debug) + if (pe_dll_extra_pe_debug) printf ("%s dll-name: %s sym: %s addr: 0x%lx %s\n", __FUNCTION__, dllname, erva + name_rva, (unsigned long) func_rva, is_data ? "(data)" : ""); - } + } } return TRUE; @@ -3504,6 +3504,6 @@ bfd_boolean pe_bfd_is_dll (bfd *abfd) { return (bfd_get_format (abfd) == bfd_object - && obj_pe (abfd) - && pe_data (abfd)->dll); + && obj_pe (abfd) + && pe_data (abfd)->dll); } diff --git a/ld/plugin.c b/ld/plugin.c index 1590c0d1f78..a7aa3a3911c 100644 --- a/ld/plugin.c +++ b/ld/plugin.c @@ -1014,7 +1014,7 @@ plugin_load_plugins (void) if (!onloadfn) onloadfn = (ld_plugin_onload) dlsym (curplug->dlhandle, "_onload"); if (!onloadfn) - einfo (_("%P%F: %s: error loading plugin: %s\n"), + einfo (_("%P%F: %s: error loading plugin: %s\n"), curplug->name, dlerror ()); set_tv_plugin_args (curplug, &my_tv[tv_header_size]); called_plugin = curplug; diff --git a/ld/po/Make-in b/ld/po/Make-in index 561d9929ba6..05395af9611 100644 --- a/ld/po/Make-in +++ b/ld/po/Make-in @@ -239,7 +239,7 @@ POTFILES: POTFILES.in posrcprefix="../"; \ fi; \ rm -f $@-t $@ \ - && (sed -e '/^#/d' -e '/^[ ]*$$/d' \ + && (sed -e '/^#/d' -e '/^[ ]*$$/d' \ -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ | sed -e '$$s/\\$$//') > $@-t \ && chmod a-w $@-t \ diff --git a/ld/scripttempl/DWARF.sc b/ld/scripttempl/DWARF.sc index 0f2325116cd..7f6773319d6 100644 --- a/ld/scripttempl/DWARF.sc +++ b/ld/scripttempl/DWARF.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. diff --git a/ld/scripttempl/aix.sc b/ld/scripttempl/aix.sc index 01a0104ffa8..c84b16ada46 100644 --- a/ld/scripttempl/aix.sc +++ b/ld/scripttempl/aix.sc @@ -4,7 +4,7 @@ # specified by the -H option. # # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -67,7 +67,7 @@ SECTIONS .loader : { *(.loader) } - + .debug : { *(.debug) } diff --git a/ld/scripttempl/alpha.sc b/ld/scripttempl/alpha.sc index 21dab549af8..188ad6d568d 100644 --- a/ld/scripttempl/alpha.sc +++ b/ld/scripttempl/alpha.sc @@ -4,7 +4,7 @@ # defaults are appropriate for an Alpha running OSF/1. # # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. diff --git a/ld/scripttempl/alphavms.sc b/ld/scripttempl/alphavms.sc index 81d6f38cc12..fac087fe6c1 100644 --- a/ld/scripttempl/alphavms.sc +++ b/ld/scripttempl/alphavms.sc @@ -2,7 +2,7 @@ # Tristan Gingold . # # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. diff --git a/ld/scripttempl/aout.sc b/ld/scripttempl/aout.sc index 896541e6f09..f678d00937e 100644 --- a/ld/scripttempl/aout.sc +++ b/ld/scripttempl/aout.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. diff --git a/ld/scripttempl/arclinux.sc b/ld/scripttempl/arclinux.sc index e692f13e9da..82a79370ca2 100644 --- a/ld/scripttempl/arclinux.sc +++ b/ld/scripttempl/arclinux.sc @@ -54,9 +54,9 @@ # INPUT_FILES - INPUT command of files to always include # WRITABLE_RODATA - if set, the .rodata section should be writable # INIT_START, INIT_END - statements just before and just after -# combination of .init sections. +# combination of .init sections. # FINI_START, FINI_END - statements just before and just after -# combination of .fini sections. +# combination of .fini sections. # STACK_ADDR - start of a .stack section. # OTHER_SYMBOLS - symbols to place right at the end of the script. # ETEXT_NAME - name of a symbol for the end of the text section, @@ -427,13 +427,13 @@ cat >> ldscripts/dyntmp.$$ <> ldscripts/dyntmp.$$ +sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;/__rela_iplt_/d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$ cat >> ldscripts/dyntmp.$$ <> ldscripts/dyntmp.$$ +sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;/__rel_iplt_/d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$ cat >> ldscripts/dyntmp.$$ <. # # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -49,9 +49,9 @@ SECTIONS *(.glue_7t) *(.glue_7) *(.rdata) - ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; + ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; LONG (-1); *(.ctors); *(.ctor); LONG (0); } - ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; + ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; LONG (-1); *(.dtors); *(.dtor); LONG (0); } *(.fini) ${RELOCATING+ etext = .;} @@ -60,13 +60,13 @@ SECTIONS .data ${RELOCATING+${DATA_ADDR-0x40000 + (ALIGN(0x8) & 0xfffc0fff)}} : { ${RELOCATING+ __data_start__ = . ;} *(.data*) - + ${RELOCATING+*(.gcc_exc*)} ${RELOCATING+___EH_FRAME_BEGIN__ = . ;} ${RELOCATING+*(.eh_fram*)} ${RELOCATING+___EH_FRAME_END__ = . ;} ${RELOCATING+LONG(0);} - + ${RELOCATING+ __data_end__ = . ;} ${RELOCATING+ edata = .;} ${RELOCATING+ _edata = .;} @@ -74,7 +74,7 @@ SECTIONS ${CONSTRUCTING+${RELOCATING-$CTOR}} ${CONSTRUCTING+${RELOCATING-$DTOR}} .bss ${RELOCATING+ ALIGN(0x8)} : - { + { ${RELOCATING+ __bss_start__ = . ;} *(.bss) *(COMMON) @@ -85,7 +85,7 @@ SECTIONS ${RELOCATING+ _end = .;} ${RELOCATING+ __end__ = .;} - .stab 0 ${RELOCATING+(NOLOAD)} : + .stab 0 ${RELOCATING+(NOLOAD)} : { [ .stab ] } diff --git a/ld/scripttempl/avr.sc b/ld/scripttempl/avr.sc index 7a146b7777e..eb4b0458dca 100644 --- a/ld/scripttempl/avr.sc +++ b/ld/scripttempl/avr.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -129,7 +129,7 @@ SECTIONS ${RELOCATING+ *libc.a:*(.progmem.data)} ${RELOCATING+ *(.progmem.*)} - + ${RELOCATING+. = ALIGN(2);} /* For code that needs to reside in the lower 128k progmem. */ @@ -331,7 +331,7 @@ cat <> ldscripts/dyntmp.$$ <> ldscripts/dyntmp.$$ +sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;/__rela_iplt_/d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$ cat >> ldscripts/dyntmp.$$ <> ldscripts/dyntmp.$$ +sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;/__rel_iplt_/d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$ cat >> ldscripts/dyntmp.$$ < rom .fini : - { - __FINI_START = .; + { + __FINI_START = .; KEEP (*(.fini)) - __FINI_END = .; + __FINI_END = .; } > rom .jcr : - { + { KEEP (*(.jcr)) } > rom - .text : + .text : { __TEXT_START = .; *(.text) *(.text.*) *(.gnu.linkonce.t.*) @@ -82,9 +82,9 @@ SECTIONS __RDATA_END = .; } > rom - .ctor ALIGN(4) : - { - __CTOR_START = .; + .ctor ALIGN(4) : + { + __CTOR_START = .; /* The compiler uses crtbegin.o to find the start of the constructors, so we make sure it is first. Because this is a wildcard, it @@ -105,17 +105,17 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend*.o) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) - __CTOR_END = .; + __CTOR_END = .; } > rom - .dtor ALIGN(4) : - { - __DTOR_START = .; + .dtor ALIGN(4) : + { + __DTOR_START = .; KEEP (*crtbegin*.o(.dtors)) KEEP (*(EXCLUDE_FILE (*crtend*.o) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) - __DTOR_END = .; + __DTOR_END = .; } > rom .data : diff --git a/ld/scripttempl/elf32cr16c.sc b/ld/scripttempl/elf32cr16c.sc index d9d884046df..b4c4335aab3 100644 --- a/ld/scripttempl/elf32cr16c.sc +++ b/ld/scripttempl/elf32cr16c.sc @@ -1,7 +1,7 @@ # Linker Script for National Semiconductor's CR16C-ELF32. # # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -26,8 +26,8 @@ MEMORY { near_rom : ORIGIN = 0x4, LENGTH = 512K - 4 near_ram : ORIGIN = 512K, LENGTH = 512K - 64K - rom : ORIGIN = 1M, LENGTH = 3M - ram : ORIGIN = 4M, LENGTH = 10M + rom : ORIGIN = 1M, LENGTH = 3M + ram : ORIGIN = 4M, LENGTH = 10M } SECTIONS @@ -38,7 +38,7 @@ SECTIONS there. The alignment to 4 bytes is compatible for both the CR16C bus width (2 bytes) and CR16CPlus bus width (4 bytes). */ - .text : { __TEXT_START = .; *(.text) __TEXT_END = .; } > rom + .text : { __TEXT_START = .; *(.text) __TEXT_END = .; } > rom .rdata : { __RDATA_START = .; *(.rdata_4) *(.rdata_2) *(.rdata_1) __RDATA_END = .; } > near_rom .ctor ALIGN(4) : { __CTOR_LIST = .; *(.ctors) __CTOR_END = .; } > near_rom .dtor ALIGN(4) : { __DTOR_LIST = .; *(.dtors) __DTOR_END = .; } > near_rom diff --git a/ld/scripttempl/elf32crx.sc b/ld/scripttempl/elf32crx.sc index 0eca32d6d60..3cc45c7857a 100644 --- a/ld/scripttempl/elf32crx.sc +++ b/ld/scripttempl/elf32crx.sc @@ -1,7 +1,7 @@ # Linker Script for National Semiconductor's CRX-ELF32. # # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -30,8 +30,8 @@ ${RELOCATING+ENTRY(${ENTRY})} /* Define memory regions. */ MEMORY { - rom : ORIGIN = 0x2, LENGTH = 3M - ram : ORIGIN = 4M, LENGTH = 10M + rom : ORIGIN = 0x2, LENGTH = 3M + ram : ORIGIN = 4M, LENGTH = 10M } /* Many sections come in three flavours. There is the 'real' section, @@ -52,25 +52,25 @@ MEMORY SECTIONS { .init : - { - __INIT_START = .; + { + __INIT_START = .; KEEP (*(.init)) - __INIT_END = .; + __INIT_END = .; } > rom .fini : - { - __FINI_START = .; + { + __FINI_START = .; KEEP (*(.fini)) - __FINI_END = .; + __FINI_END = .; } > rom .jcr : - { + { KEEP (*(.jcr)) } > rom - .text : + .text : { __TEXT_START = .; *(.text) *(.text.*) *(.gnu.linkonce.t.*) @@ -84,9 +84,9 @@ SECTIONS __RDATA_END = .; } > rom - .ctor ALIGN(4) : - { - __CTOR_START = .; + .ctor ALIGN(4) : + { + __CTOR_START = .; /* The compiler uses crtbegin.o to find the start of the constructors, so we make sure it is first. Because this is a wildcard, it @@ -99,7 +99,7 @@ SECTIONS KEEP (*crtbegin.o(.ctors)) KEEP (*crtbegin?.o(.ctors)) - + /* We don't want to include the .ctor section from the crtend.o file until after the sorted ctors. The .ctor section from the crtend file contains the @@ -108,18 +108,18 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) - __CTOR_END = .; + __CTOR_END = .; } > rom - .dtor ALIGN(4) : - { - __DTOR_START = .; + .dtor ALIGN(4) : + { + __DTOR_START = .; KEEP (*crtbegin.o(.dtors)) KEEP (*crtbegin?.o(.dtors)) KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) - __DTOR_END = .; + __DTOR_END = .; } > rom .data : diff --git a/ld/scripttempl/elf32msp430.sc b/ld/scripttempl/elf32msp430.sc index 7ba02d9460b..2fed94ae09e 100644 --- a/ld/scripttempl/elf32msp430.sc +++ b/ld/scripttempl/elf32msp430.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -7,8 +7,8 @@ HEAP_SECTION_MSP430=" " HEAP_MEMORY_MSP430=" " -if test ${GOT_HEAP_MSP-0} -ne 0 -then +if test ${GOT_HEAP_MSP-0} -ne 0 +then HEAP_SECTION_MSP430=".heap ${RELOCATING-0} : { ${RELOCATING+ PROVIDE (__heap_data_start = .) ; } @@ -18,7 +18,7 @@ HEAP_SECTION_MSP430=".heap ${RELOCATING-0} : ${RELOCATING+ PROVIDE (__heap_bottom = .) ; } ${RELOCATING+ PROVIDE (__heap_top = ${HEAP_START} + ${HEAP_LENGTH}) ; } } ${RELOCATING+ > heap}" -HEAP_MEMORY_MSP430="heap(rwx) : ORIGIN = $HEAP_START, LENGTH = $HEAP_LENGTH" +HEAP_MEMORY_MSP430="heap(rwx) : ORIGIN = $HEAP_START, LENGTH = $HEAP_LENGTH" fi @@ -34,9 +34,9 @@ OUTPUT_ARCH(${ARCH}) MEMORY { - text (rx) : ORIGIN = $ROM_START, LENGTH = $ROM_SIZE - data (rwx) : ORIGIN = $RAM_START, LENGTH = $RAM_SIZE - vectors (rw) : ORIGIN = 0xffe0, LENGTH = 0x20 + text (rx) : ORIGIN = $ROM_START, LENGTH = $ROM_SIZE + data (rwx) : ORIGIN = $RAM_START, LENGTH = $RAM_SIZE + vectors (rw) : ORIGIN = 0xffe0, LENGTH = 0x20 bootloader(rx) : ORIGIN = 0x0c00, LENGTH = 1K infomem(rx) : ORIGIN = 0x1000, LENGTH = 256 infomemnobits(rx) : ORIGIN = 0x1000, LENGTH = 256 @@ -53,7 +53,7 @@ SECTIONS ${RELOCATING+. = ALIGN(2);} *(.bootloader.*) } ${RELOCATING+ > bootloader} - + /* Information memory. */ .infomem ${RELOCATING-0} : { @@ -270,7 +270,7 @@ SECTIONS __romdatastart = LOADADDR(.data); __romdatacopysize = SIZEOF(.data); - + .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : { ${RELOCATING+. = ALIGN(2);} @@ -304,9 +304,9 @@ SECTIONS /* Stabs for profiling information*/ .profiler 0 : { *(.profiler) } - + /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } + .stab 0 : { *(.stab) } .stabstr 0 : { *(.stabstr) } .stab.excl 0 : { *(.stab.excl) } .stab.exclstr 0 : { *(.stab.exclstr) } diff --git a/ld/scripttempl/elf32msp430_3.sc b/ld/scripttempl/elf32msp430_3.sc index 3a02c7e09d0..7849b9bc213 100644 --- a/ld/scripttempl/elf32msp430_3.sc +++ b/ld/scripttempl/elf32msp430_3.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -17,7 +17,7 @@ OUTPUT_ARCH(${ARCH}) MEMORY { text (rx) : ORIGIN = $ROM_START, LENGTH = $ROM_SIZE - data (rwx) : ORIGIN = $RAM_START, LENGTH = $RAM_SIZE + data (rwx) : ORIGIN = $RAM_START, LENGTH = $RAM_SIZE vectors (rw) : ORIGIN = 0xffe0, LENGTH = 0x20 } @@ -137,7 +137,7 @@ SECTIONS } ${RELOCATING+ > text} .data ${RELOCATING-0} : - { + { ${RELOCATING+ PROVIDE (__data_start = .) ; } ${RELOCATING+. = ALIGN(2);} *(.data) @@ -146,10 +146,10 @@ SECTIONS ${RELOCATING+. = ALIGN(2);} ${RELOCATING+ _edata = . ; } } ${RELOCATING+ > data ${RELOCATING+AT> text}} - + __romdatastart = LOADADDR(.data); __romdatacopysize = SIZEOF(.data); - + .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : { ${RELOCATING+. = ALIGN(2);} @@ -193,14 +193,14 @@ SECTIONS } /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } + .stab 0 : { *(.stab) } .stabstr 0 : { *(.stabstr) } .stab.excl 0 : { *(.stab.excl) } .stab.exclstr 0 : { *(.stab.exclstr) } .stab.index 0 : { *(.stab.index) } .stab.indexstr 0 : { *(.stab.indexstr) } .comment 0 : { *(.comment) } - + EOF . $srcdir/scripttempl/DWARF.sc diff --git a/ld/scripttempl/elf32sh-symbian.sc b/ld/scripttempl/elf32sh-symbian.sc index b44b643c321..9a7d5d3d11c 100644 --- a/ld/scripttempl/elf32sh-symbian.sc +++ b/ld/scripttempl/elf32sh-symbian.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -29,15 +29,15 @@ # DATA_PLT - .plt should be in data segment, not text segment. # BSS_PLT - .plt should be in bss segment # TEXT_DYNAMIC - .dynamic in text segment, not data segment. -# EMBEDDED - whether this is for an embedded system. +# EMBEDDED - whether this is for an embedded system. # SHLIB_TEXT_START_ADDR - if set, add to SIZEOF_HEADERS to set # start address of shared library. # INPUT_FILES - INPUT command of files to always include # WRITABLE_RODATA - if set, the .rodata section should be writable # INIT_START, INIT_END - statements just before and just after -# combination of .init sections. +# combination of .init sections. # FINI_START, FINI_END - statements just before and just after -# combination of .fini sections. +# combination of .fini sections. # STACK_ADDR - start of a .stack section. # OTHER_SYMBOLS - symbols to place right at the end of the script. # @@ -104,7 +104,7 @@ FINI_ARRAY=".fini_array ${RELOCATING-0} : KEEP (*(.fini_array)) ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__fini_array_end = .);}} }" -CTOR=".ctors ALIGN(4) : +CTOR=".ctors ALIGN(4) : { ${CONSTRUCTING+${CTOR_START}} /* gcc uses crtbegin.o to find the start of @@ -191,11 +191,11 @@ SECTIONS ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0};}} ${CREATE_PIE+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0};}} ${CREATE_SHLIB-${INTERP}} - + ${INITIAL_READONLY_SECTIONS} - .init ALIGN(4) : - { + .init ALIGN(4) : + { ${RELOCATING+${INIT_START}} KEEP (*(.init)) ${RELOCATING+${INIT_END}} @@ -209,24 +209,24 @@ SECTIONS *(.gnu.warning) ${RELOCATING+${OTHER_TEXT_SECTIONS}} } =${NOP-0} - + ${RELOCATING+${CTOR}} ${RELOCATING+${DTOR}} - + .fini ALIGN(4) : { ${RELOCATING+${FINI_START}} KEEP (*(.fini)) ${RELOCATING+${FINI_END}} } =${NOP-0} - + ${RELOCATING+PROVIDE (__etext = .);} ${RELOCATING+PROVIDE (_etext = .);} ${RELOCATING+PROVIDE (etext = .);} - + ${WRITABLE_RODATA-${RODATA}} .rodata1 ALIGN(4) : { *(.rodata1) } - + ExportTable ALIGN(4) : { KEEP (*(ExportTable)) } .eh_frame_hdr ALIGN(4) : { *(.eh_frame_hdr) } :text @@ -252,7 +252,7 @@ SECTIONS *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*}) ${CONSTRUCTING+SORT(CONSTRUCTORS)} } :data - + .data1 ALIGN(4) : { *(.data1) } :data .tdata ALIGN(4) : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) } :data .tbss ALIGN(4) : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} } :data @@ -331,13 +331,13 @@ cat <introm} - + { + *(.init) + } ${RELOCATING+ >introm} + .text : { - *(.rodata) + *(.rodata) *(.text.*) *(.text) - ${RELOCATING+ _etext = . ; } + ${RELOCATING+ _etext = . ; } } ${RELOCATING+ > introm} .data : { *(.data) *(.data.*) - + ${RELOCATING+ _edata = . ; } } ${RELOCATING+ > dram} @@ -58,16 +58,16 @@ SECTIONS ${RELOCATING+ _end = . ; } } ${RELOCATING+ > dram} - .ldata : - { - *(.ldata) - } ${RELOCATING+ > ldata} +.ldata : + { + *(.ldata) + } ${RELOCATING+ > ldata} - - .vects : - { - *(.vects) - } ${RELOCATING+ > vectarea} + +.vects : + { + *(.vects) + } ${RELOCATING+ > vectarea} } EOF diff --git a/ld/scripttempl/elf32xc16xl.sc b/ld/scripttempl/elf32xc16xl.sc index bd81e9d8db3..2c44f96ff36 100644 --- a/ld/scripttempl/elf32xc16xl.sc +++ b/ld/scripttempl/elf32xc16xl.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -16,39 +16,39 @@ OUTPUT_ARCH(${ARCH}) ${RELOCATING+ENTRY ("_start")} MEMORY { - vectarea : o =0xc00000, l = 0x0300 - + vectarea : o =0xc00000, l = 0x0300 + introm : o = 0xc00300, l = 0x16000 /* The stack starts at the top of main ram. */ - + dram : o = 0x8000 , l = 0xffff /* At the very top of the address space is the 8-bit area. */ - - ldata : o =0x4000 ,l = 0x0200 + + ldata : o =0x4000 ,l = 0x0200 } SECTIONS { /*.vects : - { - *(.vects) - } ${RELOCATING+ > vectarea} */ + { + *(.vects) + } ${RELOCATING+ > vectarea} */ .init : - { - *(.init) - } ${RELOCATING+ >introm} - + { + *(.init) + } ${RELOCATING+ >introm} + .text : { - *(.rodata) + *(.rodata) *(.text.*) *(.text) - ${RELOCATING+ _etext = . ; } + ${RELOCATING+ _etext = . ; } } ${RELOCATING+ > introm} .data : { *(.data) *(.data.*) - + ${RELOCATING+ _edata = . ; } } ${RELOCATING+ > dram} @@ -60,17 +60,14 @@ SECTIONS ${RELOCATING+ _end = . ; } } ${RELOCATING+ > dram} - .ldata : - { - *(.ldata) - } ${RELOCATING+ > ldata} - - - .vects : - { - *(.vects) - } ${RELOCATING+ > vectarea} - +.ldata : + { + *(.ldata) + } ${RELOCATING+ > ldata} +.vects : + { + *(.vects) + } ${RELOCATING+ > vectarea} } EOF diff --git a/ld/scripttempl/elf32xc16xs.sc b/ld/scripttempl/elf32xc16xs.sc index bb71e19120e..2c44f96ff36 100644 --- a/ld/scripttempl/elf32xc16xs.sc +++ b/ld/scripttempl/elf32xc16xs.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -16,39 +16,39 @@ OUTPUT_ARCH(${ARCH}) ${RELOCATING+ENTRY ("_start")} MEMORY { - vectarea : o =0xc00000, l = 0x0300 - + vectarea : o =0xc00000, l = 0x0300 + introm : o = 0xc00300, l = 0x16000 /* The stack starts at the top of main ram. */ - + dram : o = 0x8000 , l = 0xffff /* At the very top of the address space is the 8-bit area. */ - - ldata : o =0x4000 ,l = 0x0200 + + ldata : o =0x4000 ,l = 0x0200 } SECTIONS { /*.vects : - { - *(.vects) - } ${RELOCATING+ > vectarea} */ + { + *(.vects) + } ${RELOCATING+ > vectarea} */ .init : - { - *(.init) - } ${RELOCATING+ >introm} - + { + *(.init) + } ${RELOCATING+ >introm} + .text : { - *(.rodata) + *(.rodata) *(.text.*) *(.text) - ${RELOCATING+ _etext = . ; } + ${RELOCATING+ _etext = . ; } } ${RELOCATING+ > introm} .data : { *(.data) *(.data.*) - + ${RELOCATING+ _edata = . ; } } ${RELOCATING+ > dram} @@ -60,14 +60,14 @@ SECTIONS ${RELOCATING+ _end = . ; } } ${RELOCATING+ > dram} - .ldata : - { - *(.ldata) - } ${RELOCATING+ > ldata} +.ldata : + { + *(.ldata) + } ${RELOCATING+ > ldata} - .vects : - { - *(.vects) - } ${RELOCATING+ > vectarea} +.vects : + { + *(.vects) + } ${RELOCATING+ > vectarea} } EOF diff --git a/ld/scripttempl/elf64hppa.sc b/ld/scripttempl/elf64hppa.sc index dec42b54f55..736e50a0f30 100644 --- a/ld/scripttempl/elf64hppa.sc +++ b/ld/scripttempl/elf64hppa.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -45,15 +45,15 @@ # NO_RELA_RELOCS - Don't include .rela.* sections in script # NON_ALLOC_DYN - Place dynamic sections after data segment. # TEXT_DYNAMIC - .dynamic in text segment, not data segment. -# EMBEDDED - whether this is for an embedded system. +# EMBEDDED - whether this is for an embedded system. # SHLIB_TEXT_START_ADDR - if set, add to SIZEOF_HEADERS to set # start address of shared library. # INPUT_FILES - INPUT command of files to always include # WRITABLE_RODATA - if set, the .rodata section should be writable # INIT_START, INIT_END - statements just before and just after -# combination of .init sections. +# combination of .init sections. # FINI_START, FINI_END - statements just before and just after -# combination of .fini sections. +# combination of .fini sections. # STACK_ADDR - start of a .stack section. # OTHER_SYMBOLS - symbols to place right at the end of the script. # ETEXT_NAME - name of a symbol for the end of the text section, @@ -147,7 +147,7 @@ if test -z "${NO_SMALL_DATA}"; then SDATA="/* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ - .sdata ${RELOCATING-0} : + .sdata ${RELOCATING-0} : { ${RELOCATING+${SDATA_START_SYMBOLS}} ${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)} @@ -219,7 +219,7 @@ FINI_ARRAY=".fini_array ${RELOCATING-0} : KEEP (*(.fini_array)) ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (${USER_LABEL_PREFIX}__fini_array_end = .);}} }" -CTOR=".ctors ${CONSTRUCTING-0} : +CTOR=".ctors ${CONSTRUCTING-0} : { ${CONSTRUCTING+${CTOR_START}} /* gcc uses crtbegin.o to find the start of @@ -359,7 +359,7 @@ cat >> ldscripts/dyntmp.$$ <> ldscripts/dyntmp.$$ +sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$ cat >> ldscripts/dyntmp.$$ <> ldscripts/dyntmp.$$ <> ldscripts/dyntmp.$$ +sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$ cat >> ldscripts/dyntmp.$$ <> ldscripts/dyntmp.$$ <> ldscripts/dyntmp.$$ +sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$ cat >> ldscripts/dyntmp.$$ <> ldscripts/dyntmp.$$ +sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$ cat >> ldscripts/dyntmp.$$ < INTERNAL_RAM*/" DTOR=".dtors ADDR(.ctors) + SIZEOF(.ctors) ${CONSTRUCTING-0} : { ${CONSTRUCTING+${DTOR_START}} @@ -291,26 +291,26 @@ __CORE_NUM_ = (__CORE_ROW_ - __FIRST_CORE_ROW_ )* __MAX_NUM_CORES_IN_COLS__ + MEMORY { - EXTERNAL_DRAM_0 (WXAI) : ORIGIN = 0x80000000, LENGTH = 0x1000000 /*.text, data, rodata, bss and .stack*/ + EXTERNAL_DRAM_0 (WXAI) : ORIGIN = 0x80000000, LENGTH = 0x1000000 /*.text, data, rodata, bss and .stack*/ EXTERNAL_DRAM_1 (WXAI) : ORIGIN = 0x81000000, LENGTH = 0x1000000 /*.heap */ - + EXTERNAL_SRAM (WXAI) : ORIGIN = 0x92000000, LENGTH = 8K /* small external RAM, used for testing*/ - + /* run time lib and crt0*/ RESERVED_CRT0_RAM (WXAI) : ORIGIN = 0, LENGTH = 0x400 - + /* user program, per bank usage */ BANK0_SRAM (WXAI) : ORIGIN = LENGTH(RESERVED_CRT0_RAM), LENGTH = 8K - LENGTH(RESERVED_CRT0_RAM) BANK1_SRAM (WXAI) : ORIGIN = 0x2000, LENGTH = 8K BANK2_SRAM (WXAI) : ORIGIN = 0x4000, LENGTH = 8K BANK3_SRAM (WXAI) : ORIGIN = 0x6000, LENGTH = 8K - + /* user program, continious placement */ INTERNAL_RAM (WXAI) : ORIGIN = LENGTH(RESERVED_CRT0_RAM), LENGTH = 32K - LENGTH(RESERVED_CRT0_RAM) - - MMR (WAI) : ORIGIN = 0xF000, LENGTH = 32K - - /* multi cores space */ + + MMR (WAI) : ORIGIN = 0xF000, LENGTH = 32K + + /* multi cores space */ CORE_0x20_0x24_INTERNAL_RAM : ORIGIN = 0x82400000+LENGTH(RESERVED_CRT0_RAM), LENGTH = 32K- LENGTH(RESERVED_CRT0_RAM) CORE_0x20_0x25_INTERNAL_RAM : ORIGIN = 0x82500000+LENGTH(RESERVED_CRT0_RAM), LENGTH = 32K- LENGTH(RESERVED_CRT0_RAM) CORE_0x20_0x26_INTERNAL_RAM : ORIGIN = 0x82600000+LENGTH(RESERVED_CRT0_RAM), LENGTH = 32K- LENGTH(RESERVED_CRT0_RAM) @@ -328,7 +328,7 @@ MEMORY CORE_0x23_0x26_INTERNAL_RAM : ORIGIN = 0x8e600000+LENGTH(RESERVED_CRT0_RAM), LENGTH = 32K- LENGTH(RESERVED_CRT0_RAM) CORE_0x23_0x27_INTERNAL_RAM : ORIGIN = 0x8e700000+LENGTH(RESERVED_CRT0_RAM), LENGTH = 32K- LENGTH(RESERVED_CRT0_RAM) CORE_0x24_0x24_INTERNAL_RAM : ORIGIN = 0x82000000+LENGTH(RESERVED_CRT0_RAM), LENGTH = 32K- LENGTH(RESERVED_CRT0_RAM) - + } @@ -338,35 +338,35 @@ SECTIONS IVT 0 : {*.o(IVT) } > RESERVED_CRT0_RAM RESERVED_CRT0 : {*.o(RESERVED_CRT0) } > RESERVED_CRT0_RAM RESERVED_CRT0 : {*.o(reserved_crt0) } > RESERVED_CRT0_RAM - + CORE_RAM_0 : {*.o(core_ram_0) } > BANK0_SRAM CORE_RAM_1 : {*.o(core_ram_1) } > BANK1_SRAM CORE_RAM_2 : {*.o(core_ram_2) } > BANK2_SRAM CORE_RAM_3 : {*.o(core_ram_3) } > BANK3_SRAM - + SRAM_SOUTH : {*.o(sram) } > EXTERNAL_SRAM DRAM_WEST : {*.o(dram) } > EXTERNAL_DRAM_1 - + CORE_INTERNAL : {*.o(core_ram_internal) } /*> INTERNAL_RAM*/ - + /* the newlib (libc and libm) library is maped to the dedicated section */ - + __new_lib_start_external_ = ( ORIGIN(EXTERNAL_DRAM_0) + __PROG_SIZE_FOR_CORE__ *__CORE_NUM_ ); __new_lib_start_ = DEFINED(__USE_INTERNAL_MEM_FOR_NEW_LIB_) ? ORIGIN(BANK1_SRAM) : __new_lib_start_external_ ; - + NEW_LIB_RO ${RELOCATING+__new_lib_start_} : { lib_a-*.o(.text .rodata ) *.o(libgloss_epiphany) } /* > INTERNAL_RAM*/ - GNU_C_BUILTIN_LIB_RO ADDR(NEW_LIB_RO) + SIZEOF(NEW_LIB_RO) : { - *mulsi3.o(.text .rodata) *modsi3.o(.text .rodata) - *divsi3.o(.text .rodata) *udivsi3.o(.text .rodata) - *umodsi3.o(.text .rodata) _*.o(.text .rodata) - } - - NEW_LIB_WR ADDR(GNU_C_BUILTIN_LIB_RO) + SIZEOF(GNU_C_BUILTIN_LIB_RO) : { lib_a-*.o(.data ) } /* > INTERNAL_RAM*/ - - - __init_start = DEFINED(__USE_INTERNAL_MEM_) ? ORIGIN(BANK1_SRAM) : (ADDR(NEW_LIB_WR) + SIZEOF(NEW_LIB_WR) ) ; + GNU_C_BUILTIN_LIB_RO ADDR(NEW_LIB_RO) + SIZEOF(NEW_LIB_RO) : { + *mulsi3.o(.text .rodata) *modsi3.o(.text .rodata) + *divsi3.o(.text .rodata) *udivsi3.o(.text .rodata) + *umodsi3.o(.text .rodata) _*.o(.text .rodata) + } + + NEW_LIB_WR ADDR(GNU_C_BUILTIN_LIB_RO) + SIZEOF(GNU_C_BUILTIN_LIB_RO) : { lib_a-*.o(.data ) } /* > INTERNAL_RAM*/ + + + __init_start = DEFINED(__USE_INTERNAL_MEM_) ? ORIGIN(BANK1_SRAM) : (ADDR(NEW_LIB_WR) + SIZEOF(NEW_LIB_WR) ) ; __init_start = DEFINED(__USE_INTERNAL_MEM_FOR_NEW_LIB_) ? ADDR(NEW_LIB_WR) + SIZEOF(NEW_LIB_WR) : __init_start; - + /* Read-only sections, merged into text segment: */ /*${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR}); . = ${TEXT_BASE_ADDRESS};}}}*/ @@ -433,13 +433,13 @@ cat >> ldscripts/dyntmp.$$ <> ldscripts/dyntmp.$$ +sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$ cat >> ldscripts/dyntmp.$$ <> ldscripts/dyntmp.$$ +sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$ cat >> ldscripts/dyntmp.$$ < INTERNAL_RAM*/ =${NOP-0} - + .text ${RELOCATING+ADDR(.fini)+SIZEOF(.fini)} ${RELOCATING-0} : { ${RELOCATING+${TEXT_START_SYMBOLS}} @@ -497,7 +497,7 @@ cat < INTERNAL_RAM*/ - .data1 ${RELOCATING-0} : { *(.data1) } + .data1 ${RELOCATING-0} : { *(.data1) } ${WRITABLE_RODATA+${RODATA}} ${OTHER_READWRITE_SECTIONS} ${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}} @@ -615,10 +615,10 @@ if test -n "${NON_ALLOC_DYN}"; then cat ldscripts/dyntmp.$$ else if test -z "${NO_REL_RELOCS}"; then - sed -e '/^[ ]*\.rela\.[^}]*$/,/}/d' -e '/^[ ]*\.rela\./d' ldscripts/dyntmp.$$ + sed -e '/^[ ]*\.rela\.[^}]*$/,/}/d' -e '/^[ ]*\.rela\./d' ldscripts/dyntmp.$$ fi if test -z "${NO_RELA_RELOCS}"; then - sed -e '/^[ ]*\.rel\.[^}]*$/,/}/d' -e '/^[ ]*\.rel\./d' ldscripts/dyntmp.$$ + sed -e '/^[ ]*\.rel\.[^}]*$/,/}/d' -e '/^[ ]*\.rel\./d' ldscripts/dyntmp.$$ fi fi rm -f ldscripts/dyntmp.$$ diff --git a/ld/scripttempl/epocpe.sc b/ld/scripttempl/epocpe.sc index 518e0b4d7e3..c9e552c9b89 100644 --- a/ld/scripttempl/epocpe.sc +++ b/ld/scripttempl/epocpe.sc @@ -1,7 +1,7 @@ # Linker script for PE. # # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -57,7 +57,7 @@ ${RELOCATING+ENTRY (_mainCRTStartup)} SECTIONS { - .text ${RELOCATING+ __image_base__ + __section_alignment__ } : + .text ${RELOCATING+ __image_base__ + __section_alignment__ } : { ${RELOCATING+ *(.init)} *(.text) @@ -65,9 +65,9 @@ SECTIONS *(.glue_7t) *(.glue_7) ${RELOCATING+ *(.text.*)} - ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; + ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; LONG (-1); *(.ctors); *(.ctor); LONG (0); } - ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; + ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; LONG (-1); *(.dtors); *(.dtor); LONG (0); } ${RELOCATING+ *(.fini)} /* ??? Why is .gcc_exc here? */ @@ -88,7 +88,7 @@ SECTIONS breaks building the cygwin32 dll. Instead, we name the section ".data_cygwin_nocopy" and explicitly include it after __data_end__. */ - .data ${RELOCATING+BLOCK(__section_alignment__)} : + .data ${RELOCATING+BLOCK(__section_alignment__)} : { ${RELOCATING+__data_start__ = . ;} *(.data) @@ -125,9 +125,9 @@ SECTIONS See pe.em:sort_sections. */ ${R_IDATA} } - + .CRT ${RELOCATING+BLOCK(__section_alignment__)} : - { + { ${R_CRT} } @@ -140,12 +140,12 @@ SECTIONS } .reloc ${RELOCATING+BLOCK(__section_alignment__)} : - { + { *(.reloc) } .rsrc ${RELOCATING+BLOCK(__section_alignment__)} : - { + { *(.rsrc) ${R_RSRC} } diff --git a/ld/scripttempl/h8300.sc b/ld/scripttempl/h8300.sc index 5204db25b2c..e8d72d6a2c4 100644 --- a/ld/scripttempl/h8300.sc +++ b/ld/scripttempl/h8300.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -51,7 +51,7 @@ SECTIONS } ${RELOCATING+ > vectors} .init : - { + { *(.init) } ${RELOCATING+ > ram} @@ -61,7 +61,7 @@ SECTIONS *(.text) *(.text.*) *(.strings) - ${RELOCATING+ _etext = . ; } + ${RELOCATING+ _etext = . ; } } ${RELOCATING+ > ram} ${CONSTRUCTING+${TORS}} diff --git a/ld/scripttempl/h8300h.sc b/ld/scripttempl/h8300h.sc index d621002ecf7..aa1c9803483 100644 --- a/ld/scripttempl/h8300h.sc +++ b/ld/scripttempl/h8300h.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -61,7 +61,7 @@ SECTIONS *(.rodata) *(.text) *(.strings) - ${RELOCATING+ _etext = . ; } + ${RELOCATING+ _etext = . ; } } ${RELOCATING+ > ram} ${CONSTRUCTING+${TORS}} diff --git a/ld/scripttempl/h8300hn.sc b/ld/scripttempl/h8300hn.sc index ca61341b40a..543a779274d 100644 --- a/ld/scripttempl/h8300hn.sc +++ b/ld/scripttempl/h8300hn.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -55,7 +55,7 @@ SECTIONS *(.rodata) *(.text) *(.strings) - ${RELOCATING+ _etext = . ; } + ${RELOCATING+ _etext = . ; } } ${RELOCATING+ > ram} ${CONSTRUCTING+${TORS}} diff --git a/ld/scripttempl/h8300s.sc b/ld/scripttempl/h8300s.sc index 6d6d206be00..00f40f0c20d 100644 --- a/ld/scripttempl/h8300s.sc +++ b/ld/scripttempl/h8300s.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -61,7 +61,7 @@ SECTIONS *(.rodata) *(.text) *(.strings) - ${RELOCATING+ _etext = . ; } + ${RELOCATING+ _etext = . ; } } ${RELOCATING+ > ram} ${CONSTRUCTING+${TORS}} diff --git a/ld/scripttempl/h8300sn.sc b/ld/scripttempl/h8300sn.sc index 64eef7b4462..31b393b67d2 100644 --- a/ld/scripttempl/h8300sn.sc +++ b/ld/scripttempl/h8300sn.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -55,7 +55,7 @@ SECTIONS *(.rodata) *(.text) *(.strings) - ${RELOCATING+ _etext = . ; } + ${RELOCATING+ _etext = . ; } } ${RELOCATING+ > ram} ${CONSTRUCTING+${TORS}} diff --git a/ld/scripttempl/h8300sx.sc b/ld/scripttempl/h8300sx.sc index f1259d5b6c2..055982eb2c8 100644 --- a/ld/scripttempl/h8300sx.sc +++ b/ld/scripttempl/h8300sx.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -61,7 +61,7 @@ SECTIONS *(.rodata) *(.text) *(.strings) - ${RELOCATING+ _etext = . ; } + ${RELOCATING+ _etext = . ; } } ${RELOCATING+ > ram} ${CONSTRUCTING+${TORS}} diff --git a/ld/scripttempl/h8300sxn.sc b/ld/scripttempl/h8300sxn.sc index 5e789620f6f..740a437cbf8 100644 --- a/ld/scripttempl/h8300sxn.sc +++ b/ld/scripttempl/h8300sxn.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -55,7 +55,7 @@ SECTIONS *(.rodata) *(.text) *(.strings) - ${RELOCATING+ _etext = . ; } + ${RELOCATING+ _etext = . ; } } ${RELOCATING+ > ram} ${CONSTRUCTING+${TORS}} diff --git a/ld/scripttempl/h8500.sc b/ld/scripttempl/h8500.sc index 0888e7a37d8..236cc778140 100644 --- a/ld/scripttempl/h8500.sc +++ b/ld/scripttempl/h8500.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. diff --git a/ld/scripttempl/h8500b.sc b/ld/scripttempl/h8500b.sc index 0cb6ddea378..a62baa21b30 100644 --- a/ld/scripttempl/h8500b.sc +++ b/ld/scripttempl/h8500b.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. diff --git a/ld/scripttempl/h8500c.sc b/ld/scripttempl/h8500c.sc index 2e4857a921a..1f698ca791c 100644 --- a/ld/scripttempl/h8500c.sc +++ b/ld/scripttempl/h8500c.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. diff --git a/ld/scripttempl/h8500m.sc b/ld/scripttempl/h8500m.sc index 87ddf15916f..565358149a5 100644 --- a/ld/scripttempl/h8500m.sc +++ b/ld/scripttempl/h8500m.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. diff --git a/ld/scripttempl/h8500s.sc b/ld/scripttempl/h8500s.sc index 2a1b12c4960..d7758d63e95 100644 --- a/ld/scripttempl/h8500s.sc +++ b/ld/scripttempl/h8500s.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. diff --git a/ld/scripttempl/hppaelf.sc b/ld/scripttempl/hppaelf.sc index a4b4d4d1a3a..01b1cf957f3 100644 --- a/ld/scripttempl/hppaelf.sc +++ b/ld/scripttempl/hppaelf.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. diff --git a/ld/scripttempl/i386beos.sc b/ld/scripttempl/i386beos.sc index 377b1817b5f..a1bcf3c0d44 100644 --- a/ld/scripttempl/i386beos.sc +++ b/ld/scripttempl/i386beos.sc @@ -1,7 +1,7 @@ # Linker script for PE. # # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -56,7 +56,7 @@ ${RELOCATING+__fltused = .; /* set up floating pt for MS .obj\'s */} ${RELOCATING+__ldused = .;} SECTIONS { - .text ${RELOCATING+ __image_base__ + __section_alignment__ } : + .text ${RELOCATING+ __image_base__ + __section_alignment__ } : { ${RELOCATING+ __text_start__ = . ;} ${RELOCATING+ *(.init)} @@ -64,9 +64,9 @@ SECTIONS ${R_TEXT} *(.glue_7t) *(.glue_7) - ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; + ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; LONG (-1); *(.ctors); *(.ctor); LONG (0); } - ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; + ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; LONG (-1); *(.dtors); *(.dtor); LONG (0); } ${RELOCATING+ *(.fini)} /* ??? Why is .gcc_exc here? */ @@ -82,7 +82,7 @@ SECTIONS breaks building the cygwin32 dll. Instead, we name the section ".data_cygwin_nocopy" and explicitly include it after __data_end__. */ - .data ${RELOCATING+BLOCK(__section_alignment__)} : + .data ${RELOCATING+BLOCK(__section_alignment__)} : { ${RELOCATING+__data_start__ = . ;} *(.data) @@ -134,7 +134,7 @@ SECTIONS ${R_IDATA} } .CRT ${RELOCATING+BLOCK(__section_alignment__)} : - { + { ${R_CRT} } @@ -147,18 +147,18 @@ SECTIONS } .reloc ${RELOCATING+BLOCK(__section_alignment__)} : - { + { *(.reloc) } .rsrc ${RELOCATING+BLOCK(__section_alignment__)} : - { + { *(.rsrc) ${R_RSRC} } .exc ${RELOCATING+BLOCK(__section_alignment__)} : - { + { *(.exc) ${R_EXC} } diff --git a/ld/scripttempl/i386coff.sc b/ld/scripttempl/i386coff.sc index f3b013e7fc9..17fbfc22e87 100644 --- a/ld/scripttempl/i386coff.sc +++ b/ld/scripttempl/i386coff.sc @@ -2,7 +2,7 @@ # Ian Taylor . # # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -38,14 +38,14 @@ SECTIONS ${RELOCATING+ edata = .}; } .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : - { + { *(.bss) *(COMMON) ${RELOCATING+ end = .}; } ${RELOCATING- ${INIT}} ${RELOCATING- ${FINI}} - .stab 0 ${RELOCATING+(NOLOAD)} : + .stab 0 ${RELOCATING+(NOLOAD)} : { [ .stab ] } diff --git a/ld/scripttempl/i386go32.sc b/ld/scripttempl/i386go32.sc index 49f2a3d0a99..059e33d7071 100644 --- a/ld/scripttempl/i386go32.sc +++ b/ld/scripttempl/i386go32.sc @@ -1,7 +1,7 @@ # Linker script for i386 go32 (DJGPP) # # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -68,7 +68,7 @@ SECTIONS ${CONSTRUCTING+${RELOCATING-$CTOR}} ${CONSTRUCTING+${RELOCATING-$DTOR}} .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : - { + { *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) *(COMMON) ${RELOCATING+ end = . ; PROVIDE(_end = .) ;} diff --git a/ld/scripttempl/i386msdos.sc b/ld/scripttempl/i386msdos.sc index 606a11313e7..9c456715e33 100644 --- a/ld/scripttempl/i386msdos.sc +++ b/ld/scripttempl/i386msdos.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. diff --git a/ld/scripttempl/i860coff.sc b/ld/scripttempl/i860coff.sc index 1f2f1ea42f8..526eed84652 100644 --- a/ld/scripttempl/i860coff.sc +++ b/ld/scripttempl/i860coff.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -13,7 +13,7 @@ cat <. # # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -120,7 +120,7 @@ EOF . $srcdir/scripttempl/DWARF.sc -cat <. # # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. diff --git a/ld/scripttempl/mipsbsd.sc b/ld/scripttempl/mipsbsd.sc index 8ba18f5d456..67e3a27cc55 100644 --- a/ld/scripttempl/mipsbsd.sc +++ b/ld/scripttempl/mipsbsd.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. diff --git a/ld/scripttempl/mmo.sc b/ld/scripttempl/mmo.sc index 5522baaaa9e..f13c62106b4 100644 --- a/ld/scripttempl/mmo.sc +++ b/ld/scripttempl/mmo.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. diff --git a/ld/scripttempl/moxie.sc b/ld/scripttempl/moxie.sc index 062e2a9ecf0..995279e0853 100644 --- a/ld/scripttempl/moxie.sc +++ b/ld/scripttempl/moxie.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. diff --git a/ld/scripttempl/nds32elf.sc b/ld/scripttempl/nds32elf.sc index db4bf577949..d7a90178c55 100644 --- a/ld/scripttempl/nds32elf.sc +++ b/ld/scripttempl/nds32elf.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -374,13 +374,13 @@ cat >> ldscripts/dyntmp.$$ <> ldscripts/dyntmp.$$ +sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;/__rela_iplt_/d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$ cat >> ldscripts/dyntmp.$$ <> ldscripts/dyntmp.$$ +sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;/__rel_iplt_/d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$ cat >> ldscripts/dyntmp.$$ <. # # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -45,12 +45,12 @@ SECTIONS ${RELOCATING+ edata = .}; } .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : - { + { *(.bss) *(COMMON) ${RELOCATING+ end = .}; } - .stab 0 ${RELOCATING+(NOLOAD)} : + .stab 0 ${RELOCATING+(NOLOAD)} : { [ .stab ] } diff --git a/ld/scripttempl/st2000.sc b/ld/scripttempl/st2000.sc index 03519568fec..f1755cd52ef 100644 --- a/ld/scripttempl/st2000.sc +++ b/ld/scripttempl/st2000.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -14,13 +14,13 @@ cat < rom diff --git a/ld/scripttempl/tic4xcoff.sc b/ld/scripttempl/tic4xcoff.sc index 396278f7075..c8a718efe60 100644 --- a/ld/scripttempl/tic4xcoff.sc +++ b/ld/scripttempl/tic4xcoff.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -27,11 +27,11 @@ # 6. EXT_ROM EXT_RAM (mpmode,extram,extrom) # 7. EXT_RAM EXT_RAM (mpmode,extram) # -# In MC mode, TEXT and DATA are copied into RAM by the bootloader. +# In MC mode, TEXT and DATA are copied into RAM by the bootloader. # # In MP mode with external ROM, DATA needs to be copied into RAM at boot time. # -# If there is external RAM it is better to use that and reserve the internal RAM +# If there is external RAM it is better to use that and reserve the internal RAM # for data buffers. However, the address of the external RAM needs to be specified. # # This emulation assumes config 7. @@ -126,32 +126,32 @@ SECTIONS } ${RELOCATING+ > ${TEXT_MEMORY}} /* Global initialised variables. */ .data : - { + { ${RELOCATING+ __data = .;} *(.data) ${RELOCATING+ __edata = .;} } ${RELOCATING+ > ${DATA_MEMORY}} /* Global uninitialised variables. */ .bss : { - ${RELOCATING+ __bss = .;} + ${RELOCATING+ __bss = .;} *(.bss) *(COMMON) ${RELOCATING+ __end = .;} } ${RELOCATING+ > ${DATA_MEMORY}} /* Heap. */ .heap : - { - ${RELOCATING+ __heap = .;} + { + ${RELOCATING+ __heap = .;} ${RELOCATING+ . += __HEAP_SIZE}; } ${RELOCATING+ > ${DATA_MEMORY}} /* Stack (grows upward). */ .stack : - { - ${RELOCATING+ __stack = .;} + { + ${RELOCATING+ __stack = .;} *(.stack) - ${RELOCATING+ . = . + __STACK_SIZE}; + ${RELOCATING+ . = . + __STACK_SIZE}; } ${RELOCATING+ > ${DATA_MEMORY}} - .stab 0 ${RELOCATING+(NOLOAD)} : + .stab 0 ${RELOCATING+(NOLOAD)} : { [ .stab ] } diff --git a/ld/scripttempl/tic54xcoff.sc b/ld/scripttempl/tic54xcoff.sc index 75d81d2bcd0..8bc8cb3f53e 100644 --- a/ld/scripttempl/tic54xcoff.sc +++ b/ld/scripttempl/tic54xcoff.sc @@ -2,7 +2,7 @@ # patterned after description in TI Assembler Tools PDF, SPRU102C, 7-53 # # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -27,16 +27,16 @@ MEMORY ${RELOCATING+ENTRY (${ENTRY})} -SECTIONS -{ - .text : +SECTIONS +{ + .text : { ___text__ = .; *(.text) etext = .; ___etext__ = .; } > prog - .data : + .data : { ___data__ = .; __data = .; @@ -46,11 +46,11 @@ SECTIONS ___edata__ = .; } > prog /* all other initialized sections should be allocated here */ - .cinit : + .cinit : { *(.cinit) } > prog - .bss : + .bss : { ___bss__ = .; __bss = .; diff --git a/ld/scripttempl/tic80coff.sc b/ld/scripttempl/tic80coff.sc index eeeb236741e..750af9e3955 100644 --- a/ld/scripttempl/tic80coff.sc +++ b/ld/scripttempl/tic80coff.sc @@ -1,7 +1,7 @@ # Linker script for TI TMS320C80 (tic80) COFF. # # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -67,14 +67,14 @@ SECTIONS *(.data) ${RELOCATING+ __edata = .}; } - .bss : { + .bss : { ${RELOCATING+ __bss_start = .}; *(.bss) *(COMMON) ${RELOCATING+ _end = ALIGN(0x8)}; ${RELOCATING+ __end = ALIGN(0x8)}; } - .stab 0 ${RELOCATING+(NOLOAD)} : + .stab 0 ${RELOCATING+(NOLOAD)} : { [ .stab ] } diff --git a/ld/scripttempl/v850.sc b/ld/scripttempl/v850.sc index 76e7e9a7e2d..1ad2ac1d8e5 100644 --- a/ld/scripttempl/v850.sc +++ b/ld/scripttempl/v850.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -78,7 +78,7 @@ SECTIONS { *(.text) ${RELOCATING+*(.text.*)} - + /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) *(.gnu.linkonce.t*) @@ -96,7 +96,7 @@ SECTIONS ${RELOCATING+PROVIDE(__ctbp = .);} *(.call_table_data) } = 0xff /* Fill gaps with 0xff. */ - + .call_table_text : { *(.call_table_text) @@ -153,7 +153,7 @@ SECTIONS /* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ - + .sdata ${SDATA_START_ADDR} : { ${RELOCATING+PROVIDE (__gp = . + 0x8000);} @@ -170,7 +170,7 @@ SECTIONS it can directly precede the .bss section. This allows runtime startup code to initialise all the zero-data sections by simply taking the value of '_edata' and zeroing until it reaches '_end'. */ - + .sbss : { ${RELOCATING+__sbss_start = .;} @@ -194,7 +194,7 @@ SECTIONS ${RELOCATING+PROVIDE (end = .);} ${RELOCATING+PROVIDE (_heap_start = .);} - .note.renesas 0 : { KEEP(*(.note.renesas)) } + .note.renesas 0 : { KEEP(*(.note.renesas)) } /* Stabs debugging sections. */ .stab 0 : { *(.stab) } diff --git a/ld/scripttempl/v850_rh850.sc b/ld/scripttempl/v850_rh850.sc index 85e33d41276..bd4628362c9 100644 --- a/ld/scripttempl/v850_rh850.sc +++ b/ld/scripttempl/v850_rh850.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -82,7 +82,7 @@ SECTIONS { *(.text) ${RELOCATING+*(.text.*)} - + /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) *(.gnu.linkonce.t*) @@ -100,7 +100,7 @@ SECTIONS ${RELOCATING+PROVIDE(__ctbp = .);} *(.call_table_data) } = 0xff /* Fill gaps with 0xff. */ - + .call_table_text : { *(.call_table_text) @@ -169,7 +169,7 @@ SECTIONS /* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ - + .sdata ${SDATA_START_ADDR} : { ${RELOCATING+PROVIDE (__gp = . + 0x8000);} @@ -189,7 +189,7 @@ SECTIONS it can directly precede the .bss section. This allows runtime startup code to initialise all the zero-data sections by simply taking the value of '_edata' and zeroing until it reaches '_end'. */ - + .sbss : { ${RELOCATING+__sbss_start = .;} @@ -214,7 +214,7 @@ SECTIONS ${RELOCATING+PROVIDE (end = .);} ${RELOCATING+PROVIDE (_heap_start = .);} - .note.renesas 0 : { KEEP(*(.note.renesas)) } + .note.renesas 0 : { KEEP(*(.note.renesas)) } /* Stabs debugging sections. */ .stab 0 : { *(.stab) } diff --git a/ld/scripttempl/vanilla.sc b/ld/scripttempl/vanilla.sc index 0f1f48069b4..270b8fe42d6 100644 --- a/ld/scripttempl/vanilla.sc +++ b/ld/scripttempl/vanilla.sc @@ -1,6 +1,6 @@ # Nothing to do. # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. diff --git a/ld/scripttempl/visium.sc b/ld/scripttempl/visium.sc index 1a3c1fef47f..796095f9796 100644 --- a/ld/scripttempl/visium.sc +++ b/ld/scripttempl/visium.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -134,7 +134,7 @@ SECTIONS ${RELOCATING+ . = ALIGN(4);} ${RELOCATING+ _edata = .;} } ${RELOCATING+ > ram} - .bss ${RELOCATING-0} : { + .bss ${RELOCATING-0} : { ${RELOCATING+ . = ALIGN(4);} ${RELOCATING+ __bss_start = .;} *(.bss) diff --git a/ld/scripttempl/w65.sc b/ld/scripttempl/w65.sc index 7f6abb9bae1..e457782c3e3 100644 --- a/ld/scripttempl/w65.sc +++ b/ld/scripttempl/w65.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -29,13 +29,13 @@ MEMORY ram : o = 0x1000, l = 512k } -SECTIONS -{ +SECTIONS +{ .text : - { - *(.text) + { + *(.text) *(.strings) - ${RELOCATING+ _etext = . ; } + ${RELOCATING+ _etext = . ; } } ${RELOCATING+ > ram} ${CONSTRUCTING+${TORS}} @@ -45,7 +45,7 @@ SECTIONS *(.data) ${RELOCATING+ _edata = . ; } } ${RELOCATING+ > ram} - + .bss : { ${RELOCATING+ _bss_start = . ; } @@ -53,18 +53,18 @@ SECTIONS *(COMMON) ${RELOCATING+ _end = . ; } } ${RELOCATING+ >ram} - + .stack ${RELOCATING+ 0x30000 } : { ${RELOCATING+ _stack = . ; } *(.stack) } ${RELOCATING+ > ram} - + .stab . (NOLOAD) : { [ .stab ] } - + .stabstr . (NOLOAD) : { [ .stabstr ] diff --git a/ld/scripttempl/xstormy16.sc b/ld/scripttempl/xstormy16.sc index 3be376af362..17e63cecf3f 100644 --- a/ld/scripttempl/xstormy16.sc +++ b/ld/scripttempl/xstormy16.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -25,9 +25,9 @@ # .bss section besides __bss_start. # INPUT_FILES - INPUT command of files to always include # INIT_START, INIT_END - statements just before and just after -# combination of .init sections. +# combination of .init sections. # FINI_START, FINI_END - statements just before and just after -# combination of .fini sections. +# combination of .fini sections. # # When adding sections, do note that the names of some sections are used # when specifying the start address of the next. @@ -59,7 +59,7 @@ test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT} if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi test -z "${ELFSIZE}" && ELFSIZE=32 test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8" -CTOR=".ctors ${CONSTRUCTING-0} : +CTOR=".ctors ${CONSTRUCTING-0} : { ${CONSTRUCTING+${CTOR_START}} /* gcc uses crtbegin.o to find the start of @@ -119,7 +119,7 @@ ${RELOCATING- /* For some reason, the Solaris linker makes bad executables /* There are two memory regions we care about, one from 0 through 0x7F00 that is RAM and one from 0x8000 up which is ROM. */ -MEMORY +MEMORY { RAM (w) : ORIGIN = 0, LENGTH = 0x7F00 ROM (!w) : ORIGIN = 0x8000, LENGTH = 0xFF8000 @@ -185,8 +185,8 @@ SECTIONS ${RELOCATING+*(.gnu.linkonce.t.*)} ${RELOCATING+${OTHER_TEXT_SECTIONS}} } ${RELOCATING+> ROM =${NOP-0}} - .init ${RELOCATING-0} : - { + .init ${RELOCATING-0} : + { ${RELOCATING+${INIT_START}} KEEP (*(.init)) ${RELOCATING+${INIT_END}} diff --git a/ld/scripttempl/z80.sc b/ld/scripttempl/z80.sc index 34127a629f7..6f156c4a113 100644 --- a/ld/scripttempl/z80.sc +++ b/ld/scripttempl/z80.sc @@ -1,5 +1,5 @@ # Copyright (C) 2014-2017 Free Software Foundation, Inc. -# +# # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. @@ -19,7 +19,7 @@ OUTPUT_FORMAT("binary") __Ltext = .; ENTRY (__Ltext) EOF -else +else echo "OUTPUT_FORMAT(\"${OUTPUT_FORMAT}\")" fi cat <