| commit 79a117c82c59a07b041c1396a8270d2905b91d01 |
| Author: Roland McGrath <mcgrathr@google.com> |
| Date: Tue Aug 9 12:09:17 2016 -0700 |
| |
| Support -pie for arm*-eabi targets. |
| |
| ld/ |
| * emulparams/armelf.sh (GENERATE_PIE_SCRIPT): Set to yes. |
| |
| diff --git a/ld/emulparams/armelf.sh b/ld/emulparams/armelf.sh |
| index 672b208..f581c68 100644 |
| --- a/ld/emulparams/armelf.sh |
| +++ b/ld/emulparams/armelf.sh |
| @@ -21,6 +21,7 @@ OTHER_READONLY_SECTIONS=" |
| DATA_START_SYMBOLS='__data_start = . ;'; |
| |
| GENERATE_SHLIB_SCRIPT=yes |
| +GENERATE_PIE_SCRIPT=yes |
| |
| ARCH=arm |
| MACHINE= |
| |
| |
| commit 37bb4d970f17d7f33d0621f7b81b623456b1d183 |
| Author: Roland McGrath <mcgrathr@google.com> |
| Date: Fri Aug 12 09:50:49 2016 -0700 |
| |
| [gold] Implement HIDDEN syntax in linker scripts |
| |
| gold/ |
| * yyscript.y (HIDDEN): New %token. |
| (assignment): Handle HIDDEN(string = expr) syntax. |
| * script.cc (script_keyword_parsecodes): Add HIDDEN. |
| |
| (cherry picked from commit f300578f78f5ecddc9cfb28c02d032a0acffdf70) |
| |
| diff --git a/gold/script.cc b/gold/script.cc |
| index d6aa7b2..bb8b437 100644 |
| --- a/gold/script.cc |
| +++ b/gold/script.cc |
| @@ -1755,6 +1755,7 @@ script_keyword_parsecodes[] = |
| { "FLOAT", FLOAT }, |
| { "FORCE_COMMON_ALLOCATION", FORCE_COMMON_ALLOCATION }, |
| { "GROUP", GROUP }, |
| + { "HIDDEN", HIDDEN }, |
| { "HLL", HLL }, |
| { "INCLUDE", INCLUDE }, |
| { "INFO", INFO }, |
| diff --git a/gold/yyscript.y b/gold/yyscript.y |
| index 7e6bd27..38831d5 100644 |
| --- a/gold/yyscript.y |
| +++ b/gold/yyscript.y |
| @@ -137,6 +137,7 @@ |
| %token FORCE_COMMON_ALLOCATION |
| %token GLOBAL /* global */ |
| %token GROUP |
| +%token HIDDEN |
| %token HLL |
| %token INCLUDE |
| %token INHIBIT_COMMON_ALLOCATION |
| @@ -864,6 +865,8 @@ assignment: |
| Expression_ptr e = script_exp_binary_bitwise_or(s, $3); |
| script_set_symbol(closure, $1.value, $1.length, e, 0, 0); |
| } |
| + | HIDDEN '(' string '=' parse_exp ')' |
| + { script_set_symbol(closure, $3.value, $3.length, $5, 0, 1); } |
| | PROVIDE '(' string '=' parse_exp ')' |
| { script_set_symbol(closure, $3.value, $3.length, $5, 1, 0); } |
| | PROVIDE_HIDDEN '(' string '=' parse_exp ')' |
| |
| commit 9dfbd0e7d0765a35dce7423d79a975d7c5bad3ae |
| Author: Roland McGrath <mcgrathr@google.com> |
| Date: Fri Aug 12 09:55:25 2016 -0700 |
| |
| PR gold/20462: Fix bogus layout on ARM with linker script using PHDRS clause |
| |
| gold/ |
| PR gold/20462 |
| * script-sections.cc (Script_sections::release_segments): |
| Reset this->segments_created_. |
| |
| (cherry picked from commit 3785f51aa2454dba199db8aafa80019795d536ec) |
| |
| diff --git a/gold/script-sections.cc b/gold/script-sections.cc |
| index 96c68de..bf25391 100644 |
| --- a/gold/script-sections.cc |
| +++ b/gold/script-sections.cc |
| @@ -4459,6 +4459,7 @@ Script_sections::release_segments() |
| ++p) |
| (*p)->release_segment(); |
| } |
| + this->segments_created_ = false; |
| } |
| |
| // Print the SECTIONS clause to F for debugging. |
| diff -dcp -r binutils-2.27/bfd/config.bfd binutils-2.27-fuchsia/bfd/config.bfd |
| *** binutils-2.27/bfd/config.bfd 2016-08-03 00:36:50.000000000 -0700 |
| --- binutils-2.27-fuchsia/bfd/config.bfd 2016-10-24 17:43:42.471794309 -0700 |
| *************** case "${targ}" in |
| *** 693,699 **** |
| targ_selvecs="i386_elf32_vec iamcu_elf32_vec l1om_elf64_vec k1om_elf64_vec" |
| want64=true |
| ;; |
| ! x86_64-*-elf* | x86_64-*-rtems*) |
| targ_defvec=x86_64_elf64_vec |
| targ_selvecs="i386_elf32_vec iamcu_elf32_vec x86_64_elf32_vec l1om_elf64_vec k1om_elf64_vec" |
| want64=true |
| --- 693,699 ---- |
| targ_selvecs="i386_elf32_vec iamcu_elf32_vec l1om_elf64_vec k1om_elf64_vec" |
| want64=true |
| ;; |
| ! x86_64-*-elf* | x86_64-*-rtems* | x86_64-*-fuchsia) |
| targ_defvec=x86_64_elf64_vec |
| targ_selvecs="i386_elf32_vec iamcu_elf32_vec x86_64_elf32_vec l1om_elf64_vec k1om_elf64_vec" |
| want64=true |
| diff -dcp -r binutils-2.27/config.sub binutils-2.27-fuchsia/config.sub |
| *** binutils-2.27/config.sub 2016-08-03 00:36:51.000000000 -0700 |
| --- binutils-2.27-fuchsia/config.sub 2016-10-24 17:41:14.128384816 -0700 |
| *************** case $os in |
| *** 1399,1405 **** |
| | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ |
| | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ |
| | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ |
| ! | -onefs* | -tirtos* | -phoenix*) |
| # Remember, each alternative MUST END IN *, to match a version number. |
| ;; |
| -qnx*) |
| --- 1399,1405 ---- |
| | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ |
| | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ |
| | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ |
| ! | -onefs* | -tirtos* | -phoenix* | -fuchsia*) |
| # Remember, each alternative MUST END IN *, to match a version number. |
| ;; |
| -qnx*) |
| diff -dcp -r binutils-2.27/configure binutils-2.27-fuchsia/configure |
| *** binutils-2.27/configure 2016-08-03 00:54:55.000000000 -0700 |
| --- binutils-2.27-fuchsia/configure 2016-10-31 12:00:06.513896294 -0700 |
| *************** case "${ENABLE_GOLD}" in |
| *** 2959,2965 **** |
| *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \ |
| | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \ |
| | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \ |
| ! | *-*-solaris2* | *-*-nto* | *-*-nacl*) |
| case "${target}" in |
| *-*-linux*aout* | *-*-linux*oldld*) |
| ;; |
| --- 2959,2965 ---- |
| *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \ |
| | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \ |
| | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \ |
| ! | *-*-solaris2* | *-*-nto* | *-*-nacl* | *-*-fuchsia*) |
| case "${target}" in |
| *-*-linux*aout* | *-*-linux*oldld*) |
| ;; |
| diff -dcp -r binutils-2.27/gas/configure.tgt binutils-2.27-fuchsia/gas/configure.tgt |
| *** binutils-2.27/gas/configure.tgt 2016-08-03 00:36:51.000000000 -0700 |
| --- binutils-2.27-fuchsia/gas/configure.tgt 2016-10-24 17:47:01.051004624 -0700 |
| *************** case ${generic_target} in |
| *** 219,224 **** |
| --- 219,225 ---- |
| i386-*-coff) fmt=coff ;; |
| i386-*-elfiamcu) fmt=elf arch=iamcu ;; |
| i386-*-elf*) fmt=elf ;; |
| + i386-*-fuchsia*) fmt=elf ;; |
| i386-*-kaos*) fmt=elf ;; |
| i386-*-bsd*) fmt=aout em=386bsd ;; |
| i386-*-nacl*) fmt=elf em=nacl |
| diff -dcp -r binutils-2.27/ld/configure.tgt binutils-2.27-fuchsia/ld/configure.tgt |
| *** binutils-2.27/ld/configure.tgt 2016-08-03 00:36:54.000000000 -0700 |
| --- binutils-2.27-fuchsia/ld/configure.tgt 2016-10-24 17:50:01.570287514 -0700 |
| *************** i[3-7]86-*-elfiamcu) targ_emul=elf_iamcu |
| *** 316,322 **** |
| targ_extra_emuls=elf_i386 ;; |
| i[3-7]86-*-elf*) targ_emul=elf_i386 |
| targ_extra_emuls=elf_iamcu ;; |
| ! x86_64-*-elf* | x86_64-*-rtems*) |
| targ_emul=elf_x86_64 |
| targ_extra_emuls="elf_i386 elf_iamcu elf32_x86_64 elf_l1om elf_k1om" |
| targ_extra_libpath="elf_i386 elf_iamcu elf32_x86_64 elf_l1om elf_k1om" |
| --- 316,322 ---- |
| targ_extra_emuls=elf_i386 ;; |
| i[3-7]86-*-elf*) targ_emul=elf_i386 |
| targ_extra_emuls=elf_iamcu ;; |
| ! x86_64-*-elf* | x86_64-*-rtems* | x86_64-*-fuchsia*) |
| targ_emul=elf_x86_64 |
| targ_extra_emuls="elf_i386 elf_iamcu elf32_x86_64 elf_l1om elf_k1om" |
| targ_extra_libpath="elf_i386 elf_iamcu elf32_x86_64 elf_l1om elf_k1om" |
| diff -rdcp binutils-2.27-orig/bfd/config.bfd binutils-2.27/bfd/config.bfd |
| *** binutils-2.27-orig/bfd/config.bfd 2016-11-14 16:52:46.909843404 -0800 |
| --- binutils-2.27/bfd/config.bfd 2016-11-15 08:37:21.691710128 -0800 |
| *************** case "${targ}" in |
| *** 192,197 **** |
| --- 192,202 ---- |
| targ_selvecs="aarch64_elf64_be_vec arm_elf32_le_vec arm_elf32_be_vec" |
| want64=true |
| ;; |
| + aarch64-*-fuchsia*) |
| + targ_defvec=aarch64_elf64_le_vec |
| + targ_selvecs="aarch64_elf64_be_vec arm_elf32_le_vec arm_elf32_be_vec" |
| + want64=true |
| + ;; |
| aarch64-*-cloudabi*) |
| targ_defvec=aarch64_elf64_le_cloudabi_vec |
| targ_selvecs=aarch64_elf64_be_cloudabi_vec |
| *************** case "${targ}" in |
| *** 286,291 **** |
| --- 291,300 ---- |
| targ_selvecs="mach_o_le_vec mach_o_be_vec mach_o_fat_vec" |
| targ_archs="$targ_archs bfd_i386_arch bfd_powerpc_arch bfd_rs6000_arch" |
| ;; |
| + arm-*-fuchsia*) |
| + targ_defvec=arm_elf32_le_vec |
| + targ_selvecs="arm_elf32_be_vec" |
| + ;; |
| arm-*-nacl*) |
| targ_defvec=arm_elf32_nacl_le_vec |
| targ_selvecs="arm_elf32_nacl_be_vec i386_elf32_nacl_vec" |
| diff -rdcp binutils-2.27-orig/gas/configure.tgt binutils-2.27/gas/configure.tgt |
| *** binutils-2.27-orig/gas/configure.tgt 2016-11-14 16:52:47.073842705 -0800 |
| --- binutils-2.27/gas/configure.tgt 2016-11-15 08:39:07.799302559 -0800 |
| *************** generic_target=${cpu_type}-$vendor-$os |
| *** 121,126 **** |
| --- 121,127 ---- |
| # Note: This table is alpha-sorted, please try to keep it that way. |
| case ${generic_target} in |
| aarch64*-*-elf | aarch64*-*-rtems*) fmt=elf;; |
| + aarch64*-*-fuchsia*) fmt=elf;; |
| aarch64*-*-linux*) fmt=elf em=linux ;; |
| |
| alpha-*-*vms*) fmt=evax ;; |
| *************** case ${generic_target} in |
| *** 159,164 **** |
| --- 160,166 ---- |
| fmt=coff em=wince-pe ;; |
| arm-*-pe) fmt=coff em=pe ;; |
| arm-*-riscix*) fmt=aout em=riscix ;; |
| + arm-*-fuchsia*) fmt=elf ;; |
| |
| avr-*-*) fmt=elf bfd_gas=yes ;; |
| |
| diff -rdcp binutils-2.27-orig/ld/configure.tgt binutils-2.27/ld/configure.tgt |
| *** binutils-2.27-orig/ld/configure.tgt 2016-11-14 16:52:46.665844445 -0800 |
| --- binutils-2.27/ld/configure.tgt 2016-11-15 08:40:41.870942601 -0800 |
| *************** aarch64-*-cloudabi*) targ_emul=aarch64cl |
| *** 54,59 **** |
| --- 54,61 ---- |
| targ_extra_emuls=aarch64cloudabib ;; |
| aarch64-*-freebsd*) targ_emul=aarch64fbsd |
| targ_extra_emuls="aarch64fbsdb aarch64elf" ;; |
| + aarch64-*-fuchsia*) targ_emul=aarch64elf |
| + targ_extra_emuls="aarch64elfb armelf armelfb" ;; |
| aarch64_be-*-linux*) targ_emul=aarch64linuxb |
| targ_extra_libpath="aarch64linux aarch64linux32 aarch64linux32b armelfb_linux_eabi armelf_linux_eabi" |
| targ_extra_emuls="aarch64elfb aarch64elf aarch64elf32 aarch64elf32b armelfb armelf $targ_extra_libpath" ;; |
| *************** arm*-*-uclinux*) targ_emul=armelf_linux |
| *** 150,155 **** |
| --- 152,160 ---- |
| ;; |
| arm-*-vxworks) targ_emul=armelf_vxworks ;; |
| arm*-*-conix*) targ_emul=armelf ;; |
| + arm*-*-fuchsia*) targ_emul=armelf |
| + targ_extra_emuls="armelfb" |
| + ;; |
| avr-*-*) targ_emul=avr2 |
| targ_extra_emuls="avr1 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega1 avrxmega2 avrxmega3 avrxmega4 avrxmega5 avrxmega6 avrxmega7 avrtiny" |
| ;; |