From 9972077c74d258da674ec4a77b3854e678a9fab7 Mon Sep 17 00:00:00 2001 From: Matthias Klose Date: Wed, 21 Feb 2024 23:41:40 +0100 Subject: [PATCH] branch-updates # DP: updates from the binutils-2.42 branch # DP: updates from the binutils-2.42 branch # git diff c7f28aad0c99d1d2fec4e52ebfa3735d90ceb8e9 303aeec545892bc02ef63a7c8de599853077cf65 Gbp-Pq: Name branch-updates.diff --- bfd/bfd-in2.h | 6 + bfd/configure | 20 +- bfd/development.sh | 2 +- bfd/doc/chew.c | 2 - bfd/doc/proto.str | 1 + bfd/elf.c | 2 +- bfd/elf64-x86-64.c | 113 +++++++- bfd/libbfd.h | 6 + bfd/po/bfd.pot | 2 +- bfd/reloc.c | 12 + bfd/version.h | 2 +- bfd/version.m4 | 2 +- binutils/README-how-to-make-a-release | 4 +- binutils/config.in | 15 ++ binutils/configure | 250 +++++++++++++++++- binutils/configure.ac | 2 + binutils/doc/binutils.texi | 11 +- binutils/winduni.c | 16 +- elfcpp/x86_64.h | 24 ++ gas/NEWS | 2 + gas/config/tc-i386.c | 108 ++++++-- gas/config/tc-loongarch.c | 3 + gas/config/tc-ppc.c | 2 + gas/configure | 20 +- gas/doc/c-ppc.texi | 3 + gas/testsuite/gas/i386/oversized16.l | 30 +-- gas/testsuite/gas/i386/oversized64.l | 30 +-- gas/testsuite/gas/i386/x86-64-apx-inval.l | 3 + gas/testsuite/gas/i386/x86-64-apx-inval.s | 4 + gas/testsuite/gas/i386/x86-64-gottpoff.d | 4 + gas/testsuite/gas/i386/x86-64-gottpoff.s | 10 + gas/testsuite/gas/i386/x86-64.exp | 1 + .../gas/loongarch/tls_le_r_sym_type.d | 3 + .../gas/loongarch/tls_le_r_sym_type.s | 6 + gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.l | 38 +++ gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.s | 20 ++ gold/testsuite/x86_64_ie_to_le.s | 2 + gold/testsuite/x86_64_ie_to_le.sh | 2 + gold/x86_64.cc | 47 +++- gprof/configure | 20 +- include/elf/x86-64.h | 20 ++ ld/configure | 20 +- ld/scripttempl/avr.sc | 6 +- ld/testsuite/ld-x86-64/tlsbindesc.dd | 24 ++ ld/testsuite/ld-x86-64/tlsbindesc.rd | 36 +-- ld/testsuite/ld-x86-64/tlsbindesc.s | 8 + ld/testsuite/ld-x86-64/x86-64.exp | 2 +- opcodes/configure | 20 +- opcodes/i386-opc.tbl | 4 +- opcodes/i386-tbl.h | 8 +- opcodes/ppc-dis.c | 12 +- 51 files changed, 843 insertions(+), 167 deletions(-) create mode 100644 gas/testsuite/gas/i386/x86-64-apx-inval.l create mode 100644 gas/testsuite/gas/i386/x86-64-apx-inval.s create mode 100644 gas/testsuite/gas/loongarch/tls_le_r_sym_type.d create mode 100644 gas/testsuite/gas/loongarch/tls_le_r_sym_type.s create mode 100644 gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.l create mode 100644 gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.s diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 581d8fe0b..dbafcf8da 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -3894,6 +3894,12 @@ enum bfd_reloc_code_real BFD_RELOC_X86_64_CODE_4_GOTPCRELX, BFD_RELOC_X86_64_CODE_4_GOTTPOFF, BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC, + BFD_RELOC_X86_64_CODE_5_GOTPCRELX, + BFD_RELOC_X86_64_CODE_5_GOTTPOFF, + BFD_RELOC_X86_64_CODE_5_GOTPC32_TLSDESC, + BFD_RELOC_X86_64_CODE_6_GOTPCRELX, + BFD_RELOC_X86_64_CODE_6_GOTTPOFF, + BFD_RELOC_X86_64_CODE_6_GOTPC32_TLSDESC, /* ns32k relocations. */ BFD_RELOC_NS32K_IMM_8, diff --git a/bfd/configure b/bfd/configure index 5618c5d32..acbac2f36 100755 --- a/bfd/configure +++ b/bfd/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for bfd 2.42. +# Generated by GNU Autoconf 2.69 for bfd 2.42.0. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='bfd' PACKAGE_TARNAME='bfd' -PACKAGE_VERSION='2.42' -PACKAGE_STRING='bfd 2.42' +PACKAGE_VERSION='2.42.0' +PACKAGE_STRING='bfd 2.42.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1411,7 +1411,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures bfd 2.42 to adapt to many kinds of systems. +\`configure' configures bfd 2.42.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1482,7 +1482,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of bfd 2.42:";; + short | recursive ) echo "Configuration of bfd 2.42.0:";; esac cat <<\_ACEOF @@ -1627,7 +1627,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -bfd configure 2.42 +bfd configure 2.42.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2221,7 +2221,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by bfd $as_me 2.42, which was +It was created by bfd $as_me 2.42.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3204,7 +3204,7 @@ fi # Define the identity of the package. PACKAGE='bfd' - VERSION='2.42' + VERSION='2.42.0' cat >>confdefs.h <<_ACEOF @@ -18090,7 +18090,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by bfd $as_me 2.42, which was +This file was extended by bfd $as_me 2.42.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18156,7 +18156,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -bfd config.status 2.42 +bfd config.status 2.42.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/bfd/development.sh b/bfd/development.sh index 535d74063..1112d2ecd 100644 --- a/bfd/development.sh +++ b/bfd/development.sh @@ -16,7 +16,7 @@ # along with this program. If not, see . # Controls whether to enable development-mode features by default. -development=false +development=true # Indicate whether this is a release branch. experimental=false diff --git a/bfd/doc/chew.c b/bfd/doc/chew.c index 28c8072c2..842d41530 100644 --- a/bfd/doc/chew.c +++ b/bfd/doc/chew.c @@ -541,8 +541,6 @@ wrap_comment (void) overwrite_string (tos - 1, &out); drop (); - - pc++; } /* Mod tos so that only lines with leading dots remain */ diff --git a/bfd/doc/proto.str b/bfd/doc/proto.str index ee06c31fa..9a56397d7 100644 --- a/bfd/doc/proto.str +++ b/bfd/doc/proto.str @@ -166,6 +166,7 @@ : SUBSUBSECTION ignore ; : INODE ignore ; : DESCRIPTION ignore ; +: DOCDD ignore ; : ENDDD EXTERNAL ; : FUNCTION EXTERNAL ; : INTERNAL_FUNCTION INTERNAL ; diff --git a/bfd/elf.c b/bfd/elf.c index 88c75ae3c..8bffd3c51 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -5789,7 +5789,7 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, elf_seg_map (abfd) = mfirst; } - if (!elf_modify_segment_map (abfd, info, no_user_phdrs)) + if (!elf_modify_segment_map (abfd, info, no_user_phdrs || info == NULL)) return false; for (count = 0, m = elf_seg_map (abfd); m != NULL; m = m->next) diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index f1253751b..2ed120af7 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -179,12 +179,30 @@ static reloc_howto_type x86_64_elf_howto_table[] = HOWTO(R_X86_64_CODE_4_GOTPC32_TLSDESC, 0, 4, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_X86_64_CODE_4_GOTPC32_TLSDESC", false, 0, 0xffffffff, true), + HOWTO(R_X86_64_CODE_5_GOTPCRELX, 0, 4, 32, true, 0, + complain_overflow_signed, bfd_elf_generic_reloc, + "R_X86_64_CODE_5_GOTPCRELX", false, 0, 0xffffffff, true), + HOWTO(R_X86_64_CODE_5_GOTTPOFF, 0, 4, 32, true, 0, + complain_overflow_signed, bfd_elf_generic_reloc, + "R_X86_64_CODE_5_GOTTPOFF", false, 0, 0xffffffff, true), + HOWTO(R_X86_64_CODE_5_GOTPC32_TLSDESC, 0, 4, 32, true, 0, + complain_overflow_bitfield, bfd_elf_generic_reloc, + "R_X86_64_CODE_5_GOTPC32_TLSDESC", false, 0, 0xffffffff, true), + HOWTO(R_X86_64_CODE_6_GOTPCRELX, 0, 4, 32, true, 0, + complain_overflow_signed, bfd_elf_generic_reloc, + "R_X86_64_CODE_6_GOTPCRELX", false, 0, 0xffffffff, true), + HOWTO(R_X86_64_CODE_6_GOTTPOFF, 0, 4, 32, true, 0, + complain_overflow_signed, bfd_elf_generic_reloc, + "R_X86_64_CODE_6_GOTTPOFF", false, 0, 0xffffffff, true), + HOWTO(R_X86_64_CODE_6_GOTPC32_TLSDESC, 0, 4, 32, true, 0, + complain_overflow_bitfield, bfd_elf_generic_reloc, + "R_X86_64_CODE_6_GOTPC32_TLSDESC", false, 0, 0xffffffff, true), /* We have a gap in the reloc numbers here. R_X86_64_standard counts the number up to this point, and R_X86_64_vt_offset is the value to subtract from a reloc type of R_X86_64_GNU_VT* to form an index into this table. */ -#define R_X86_64_standard (R_X86_64_CODE_4_GOTPC32_TLSDESC + 1) +#define R_X86_64_standard (R_X86_64_CODE_6_GOTPC32_TLSDESC + 1) #define R_X86_64_vt_offset (R_X86_64_GNU_VTINHERIT - R_X86_64_standard) /* GNU extension to record C++ vtable hierarchy. */ @@ -256,6 +274,12 @@ static const struct elf_reloc_map x86_64_reloc_map[] = { BFD_RELOC_X86_64_CODE_4_GOTPCRELX, R_X86_64_CODE_4_GOTPCRELX, }, { BFD_RELOC_X86_64_CODE_4_GOTTPOFF, R_X86_64_CODE_4_GOTTPOFF, }, { BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC, R_X86_64_CODE_4_GOTPC32_TLSDESC, }, + { BFD_RELOC_X86_64_CODE_5_GOTPCRELX, R_X86_64_CODE_5_GOTPCRELX, }, + { BFD_RELOC_X86_64_CODE_5_GOTTPOFF, R_X86_64_CODE_5_GOTTPOFF, }, + { BFD_RELOC_X86_64_CODE_5_GOTPC32_TLSDESC, R_X86_64_CODE_5_GOTPC32_TLSDESC, }, + { BFD_RELOC_X86_64_CODE_6_GOTPCRELX, R_X86_64_CODE_6_GOTPCRELX, }, + { BFD_RELOC_X86_64_CODE_6_GOTTPOFF, R_X86_64_CODE_6_GOTTPOFF, }, + { BFD_RELOC_X86_64_CODE_6_GOTPC32_TLSDESC, R_X86_64_CODE_6_GOTPC32_TLSDESC, }, { BFD_RELOC_VTABLE_INHERIT, R_X86_64_GNU_VTINHERIT, }, { BFD_RELOC_VTABLE_ENTRY, R_X86_64_GNU_VTENTRY, }, }; @@ -1283,6 +1307,23 @@ elf_x86_64_check_tls_transition (bfd *abfd, goto check_gottpoff; + case R_X86_64_CODE_6_GOTTPOFF: + /* Check transition from IE access model: + add %reg1, foo@gottpoff(%rip), %reg2 + where reg1/reg2 are one of r16 to r31. */ + + if (offset < 6 + || (offset + 4) > sec->size + || contents[offset - 6] != 0x62) + return false; + + val = bfd_get_8 (abfd, contents + offset - 2); + if (val != 0x01 && val != 0x03) + return false; + + val = bfd_get_8 (abfd, contents + offset - 1); + return (val & 0xc7) == 5; + case R_X86_64_GOTTPOFF: /* Check transition from IE access model: mov foo@gottpoff(%rip), %reg @@ -1417,6 +1458,7 @@ elf_x86_64_tls_transition (struct bfd_link_info *info, bfd *abfd, case R_X86_64_TLSDESC_CALL: case R_X86_64_GOTTPOFF: case R_X86_64_CODE_4_GOTTPOFF: + case R_X86_64_CODE_6_GOTTPOFF: if (bfd_link_executable (info)) { if (h == NULL) @@ -1464,6 +1506,8 @@ elf_x86_64_tls_transition (struct bfd_link_info *info, bfd *abfd, /* Return TRUE if there is no transition. */ if (from_type == to_type || (from_type == R_X86_64_CODE_4_GOTTPOFF + && to_type == R_X86_64_GOTTPOFF) + || (from_type == R_X86_64_CODE_6_GOTTPOFF && to_type == R_X86_64_GOTTPOFF)) return true; @@ -2177,6 +2221,7 @@ elf_x86_64_scan_relocs (bfd *abfd, struct bfd_link_info *info, case R_X86_64_GOTTPOFF: case R_X86_64_CODE_4_GOTTPOFF: + case R_X86_64_CODE_6_GOTTPOFF: if (!bfd_link_executable (info)) info->flags |= DF_STATIC_TLS; /* Fall through */ @@ -2214,6 +2259,7 @@ elf_x86_64_scan_relocs (bfd *abfd, struct bfd_link_info *info, break; case R_X86_64_GOTTPOFF: case R_X86_64_CODE_4_GOTTPOFF: + case R_X86_64_CODE_6_GOTTPOFF: tls_type = GOT_TLS_IE; break; case R_X86_64_GOTPC32_TLSDESC: @@ -2503,6 +2549,26 @@ elf_x86_64_scan_relocs (bfd *abfd, struct bfd_link_info *info, } break; + case R_X86_64_CODE_5_GOTPCRELX: + case R_X86_64_CODE_5_GOTTPOFF: + case R_X86_64_CODE_5_GOTPC32_TLSDESC: + case R_X86_64_CODE_6_GOTPCRELX: + case R_X86_64_CODE_6_GOTPC32_TLSDESC: + { + /* These relocations are added only for completeness and + aren't be used. */ + if (h) + name = h->root.root.string; + else + name = bfd_elf_sym_name (abfd, symtab_hdr, isym, + NULL); + _bfd_error_handler + /* xgettext:c-format */ + (_("%pB: unsupported relocation %s against symbol `%s'"), + abfd, x86_64_elf_howto_table[r_type].name, name); + } + break; + /* This relocation describes the C++ object vtable hierarchy. Reconstruct it for later use during GC. */ case R_X86_64_GNU_VTINHERIT: @@ -3570,6 +3636,7 @@ elf_x86_64_relocate_section (bfd *output_bfd, case R_X86_64_TLSDESC_CALL: case R_X86_64_GOTTPOFF: case R_X86_64_CODE_4_GOTTPOFF: + case R_X86_64_CODE_6_GOTTPOFF: tls_type = GOT_UNKNOWN; if (h == NULL && local_got_offsets) tls_type = elf_x86_local_got_tls_type (input_bfd) [r_symndx]; @@ -3920,6 +3987,50 @@ elf_x86_64_relocate_section (bfd *output_bfd, contents + roff); continue; } + else if (r_type == R_X86_64_CODE_6_GOTTPOFF) + { + /* IE->LE transition: + Originally it is + add %reg1, foo@gottpoff(%rip), %reg2 + or + add foo@gottpoff(%rip), %reg1, %reg2 + We change it into: + add $foo@tpoff, %reg1, %reg2 + */ + unsigned int reg, byte1; + unsigned int updated_byte1; + + if (roff < 6) + goto corrupt_input; + + /* Move the R bits to the B bits in EVEX payload + byte 1. */ + byte1 = bfd_get_8 (input_bfd, contents + roff - 5); + updated_byte1 = byte1; + + /* Set the R bits since they is inverted. */ + updated_byte1 |= 1 << 7 | 1 << 4; + + /* Update the B bits from the R bits. */ + if ((byte1 & (1 << 7)) == 0) + updated_byte1 &= ~(1 << 5); + if ((byte1 & (1 << 4)) == 0) + updated_byte1 |= 1 << 3; + + reg = bfd_get_8 (input_bfd, contents + roff - 1); + reg >>= 3; + + bfd_put_8 (output_bfd, updated_byte1, + contents + roff - 5); + bfd_put_8 (output_bfd, 0x81, + contents + roff - 2); + bfd_put_8 (output_bfd, 0xc0 | reg, + contents + roff - 1); + bfd_put_32 (output_bfd, + elf_x86_64_tpoff (info, relocation), + contents + roff); + continue; + } else BFD_ASSERT (false); } diff --git a/bfd/libbfd.h b/bfd/libbfd.h index ebd4f2414..40bbe6a38 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -1463,6 +1463,12 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_X86_64_CODE_4_GOTPCRELX", "BFD_RELOC_X86_64_CODE_4_GOTTPOFF", "BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC", + "BFD_RELOC_X86_64_CODE_5_GOTPCRELX", + "BFD_RELOC_X86_64_CODE_5_GOTTPOFF", + "BFD_RELOC_X86_64_CODE_5_GOTPC32_TLSDESC", + "BFD_RELOC_X86_64_CODE_6_GOTPCRELX", + "BFD_RELOC_X86_64_CODE_6_GOTTPOFF", + "BFD_RELOC_X86_64_CODE_6_GOTPC32_TLSDESC", "BFD_RELOC_NS32K_IMM_8", "BFD_RELOC_NS32K_IMM_16", "BFD_RELOC_NS32K_IMM_32", diff --git a/bfd/po/bfd.pot b/bfd/po/bfd.pot index 0a05b63df..a8eddc272 100644 --- a/bfd/po/bfd.pot +++ b/bfd/po/bfd.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: https://sourceware.org/bugzilla/\n" -"POT-Creation-Date: 2024-01-29 14:43+0000\n" +"POT-Creation-Date: 2024-01-29 15:59+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/bfd/reloc.c b/bfd/reloc.c index e74cbd75e..7583b7fd5 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -2481,6 +2481,18 @@ ENUMX BFD_RELOC_X86_64_CODE_4_GOTTPOFF ENUMX BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC +ENUMX + BFD_RELOC_X86_64_CODE_5_GOTPCRELX +ENUMX + BFD_RELOC_X86_64_CODE_5_GOTTPOFF +ENUMX + BFD_RELOC_X86_64_CODE_5_GOTPC32_TLSDESC +ENUMX + BFD_RELOC_X86_64_CODE_6_GOTPCRELX +ENUMX + BFD_RELOC_X86_64_CODE_6_GOTTPOFF +ENUMX + BFD_RELOC_X86_64_CODE_6_GOTPC32_TLSDESC ENUMDOC x86-64/elf relocations. diff --git a/bfd/version.h b/bfd/version.h index 1cac0616e..2c4718f6f 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -16,7 +16,7 @@ In releases, the date is not included in either version strings or sonames. */ -#define BFD_VERSION_DATE 20240129 +#define BFD_VERSION_DATE 20240221 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@ diff --git a/bfd/version.m4 b/bfd/version.m4 index c7def01a1..19045f7f8 100644 --- a/bfd/version.m4 +++ b/bfd/version.m4 @@ -1 +1 @@ -m4_define([BFD_VERSION], [2.42]) +m4_define([BFD_VERSION], [2.42.0]) diff --git a/binutils/README-how-to-make-a-release b/binutils/README-how-to-make-a-release index bdda9e48d..674cba2f5 100644 --- a/binutils/README-how-to-make-a-release +++ b/binutils/README-how-to-make-a-release @@ -340,7 +340,7 @@ How to create the release. make install-gas install-gold install-ld install-binutils install-gprofng # Needed for step 29... - make html pdf html-libctf pdf-libctf html-libsframe pdf-libsframe + make html pdf html-libctf pdf-libctf html-libsframe pdf-libsframe# popd @@ -349,7 +349,7 @@ How to create the release. enter a tag message such as: "Official GNU Binutils 2.4x release" git tag -a -u - git tag -a binutils-2_42 -u DD9E3C4F <=== Be careful to get the tag right + git tag -a binutils-2_42 -u DD9E3C4F -m "Official GNU Binutils 2.4x release" <=== Be careful to get the tag right NB/ If you do sign the binaries make sure to use a key that has been published with the FSF. diff --git a/binutils/config.in b/binutils/config.in index a9a9f71b3..ee148c756 100644 --- a/binutils/config.in +++ b/binutils/config.in @@ -7,6 +7,9 @@ #endif #define __CONFIG_H__ 1 +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + /* Should ar and ranlib use -D behavior by default? */ #undef DEFAULT_AR_DETERMINISTIC @@ -256,6 +259,18 @@ /* Version number of package */ #undef VERSION +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER diff --git a/binutils/configure b/binutils/configure index 94a0d4a17..a10927353 100755 --- a/binutils/configure +++ b/binutils/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for binutils 2.42. +# Generated by GNU Autoconf 2.69 for binutils 2.42.0. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='binutils' PACKAGE_TARNAME='binutils' -PACKAGE_VERSION='2.42' -PACKAGE_STRING='binutils 2.42' +PACKAGE_VERSION='2.42.0' +PACKAGE_STRING='binutils 2.42.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1407,7 +1407,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures binutils 2.42 to adapt to many kinds of systems. +\`configure' configures binutils 2.42.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1478,7 +1478,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of binutils 2.42:";; + short | recursive ) echo "Configuration of binutils 2.42.0:";; esac cat <<\_ACEOF @@ -1640,7 +1640,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -binutils configure 2.42 +binutils configure 2.42.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2108,7 +2108,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by binutils $as_me 2.42, which was +It was created by binutils $as_me 2.42.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3091,7 +3091,7 @@ fi # Define the identity of the package. PACKAGE='binutils' - VERSION='2.42' + VERSION='2.42.0' cat >>confdefs.h <<_ACEOF @@ -4725,6 +4725,231 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 @@ -10858,7 +11083,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10861 "configure" +#line 11086 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10964,7 +11189,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10967 "configure" +#line 11192 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -16532,6 +16757,7 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi + if test -z "${ENABLE_LIBCTF_TRUE}" && test -z "${ENABLE_LIBCTF_FALSE}"; then as_fn_error $? "conditional \"ENABLE_LIBCTF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -16941,7 +17167,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by binutils $as_me 2.42, which was +This file was extended by binutils $as_me 2.42.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -17007,7 +17233,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -binutils config.status 2.42 +binutils config.status 2.42.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/binutils/configure.ac b/binutils/configure.ac index b03e36c9e..dac72c1bd 100644 --- a/binutils/configure.ac +++ b/binutils/configure.ac @@ -31,6 +31,8 @@ AC_PROG_CC AC_GNU_SOURCE AC_USE_SYSTEM_EXTENSIONS +AC_C_BIGENDIAN + LT_INIT ACX_LARGEFILE diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi index e0028ee01..50cc4707e 100644 --- a/binutils/doc/binutils.texi +++ b/binutils/doc/binutils.texi @@ -2662,11 +2662,12 @@ rather than @code{li}. All of the @option{-m} arguments for @option{e300}, @option{e500}, @option{e500mc}, @option{e500mc64}, @option{e500x2}, @option{e5500}, @option{e6500}, @option{efs}, @option{power4}, @option{power5}, @option{power6}, @option{power7}, -@option{power8}, @option{power9}, @option{power10}, @option{ppc}, -@option{ppc32}, @option{ppc64}, @option{ppc64bridge}, @option{ppcps}, -@option{pwr}, @option{pwr2}, @option{pwr4}, @option{pwr5}, @option{pwr5x}, -@option{pwr6}, @option{pwr7}, @option{pwr8}, @option{pwr9}, @option{pwr10}, -@option{pwrx}, @option{titan}, @option{vle}, and @option{future}. +@option{power8}, @option{power9}, @option{power10}, @option{power11}, +@option{ppc}, @option{ppc32}, @option{ppc64}, @option{ppc64bridge}, +@option{ppcps}, @option{pwr}, @option{pwr2}, @option{pwr4}, @option{pwr5}, +@option{pwr5x}, @option{pwr6}, @option{pwr7}, @option{pwr8}, @option{pwr9}, +@option{pwr10}, @option{pwr11}, @option{pwrx}, @option{titan}, @option{vle}, +and @option{future}. @option{32} and @option{64} modify the default or a prior CPU selection, disabling and enabling 64-bit insns respectively. In addition, @option{altivec}, @option{any}, @option{lsp}, @option{htm}, diff --git a/binutils/winduni.c b/binutils/winduni.c index 5b6597649..f19de4f8c 100644 --- a/binutils/winduni.c +++ b/binutils/winduni.c @@ -771,7 +771,13 @@ wind_MultiByteToWideChar (rc_uint_type cp, const char *mb, if (!mb || !iconv_name) return 0; - iconv_t cd = iconv_open ("UTF-16LE", iconv_name); + iconv_t cd = iconv_open ( +#if WORDS_BIGENDIAN + "UTF-16BE", +#else + "UTF-16LE", +#endif + iconv_name); while (1) { @@ -844,7 +850,13 @@ wind_WideCharToMultiByte (rc_uint_type cp, const unichar *u, char *mb, rc_uint_t if (!u || !iconv_name) return 0; - iconv_t cd = iconv_open (iconv_name, "UTF-16LE"); + iconv_t cd = iconv_open (iconv_name, +#if WORDS_BIGENDIAN + "UTF-16BE" +#else + "UTF-16LE" +#endif + ); while (1) { diff --git a/elfcpp/x86_64.h b/elfcpp/x86_64.h index 135f339fc..5d254ce48 100644 --- a/elfcpp/x86_64.h +++ b/elfcpp/x86_64.h @@ -110,6 +110,30 @@ enum // descriptor in GOT if the // instruction starts at 4 bytes // before the relocation offset. + R_X86_64_CODE_5_GOTPCRELX = 46, // 32 bit signed PC relative offset to + // GOT if the instruction starts at 5 + // bytes before the relocation offset, + // relaxable. + R_X86_64_CODE_5_GOTTPOFF = 47, // 32 bit signed PC relative offset to + // GOT entry for IE symbol if the + // instruction starts at 5 bytes before + // the relocation offset. + R_X86_64_CODE_5_GOTPC32_TLSDESC = 48, // 32-bit PC relative to TLS + // descriptor in GOT if the + // instruction starts at 5 bytes + // before the relocation offset. + R_X86_64_CODE_6_GOTPCRELX = 49, // 32 bit signed PC relative offset to + // GOT if the instruction starts at 6 + // bytes before the relocation offset, + // relaxable. + R_X86_64_CODE_6_GOTTPOFF = 50, // 32 bit signed PC relative offset to + // GOT entry for IE symbol if the + // instruction starts at 6 bytes before + // the relocation offset. + R_X86_64_CODE_6_GOTPC32_TLSDESC = 51, // 32-bit PC relative to TLS + // descriptor in GOT if the + // instruction starts at 6 bytes + // before the relocation offset. // GNU vtable garbage collection extensions. R_X86_64_GNU_VTINHERIT = 250, R_X86_64_GNU_VTENTRY = 251 diff --git a/gas/NEWS b/gas/NEWS index f19fd471c..67d806cbf 100644 --- a/gas/NEWS +++ b/gas/NEWS @@ -2,6 +2,8 @@ Changes in 2.42: +* Added support for AMD znver5 processor (available from GNU Binutils 2.42 release). + * Add support for the AArch64 Scalable Vector Extension version 2.1 (SVE2.1). * Add support for the AArch64 Scalable Matrix Extension version 2.1 (SME2.1). diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 51166ef3f..769a02fc6 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -3641,6 +3641,7 @@ tc_i386_fix_adjustable (fixS *fixP) || fixP->fx_r_type == BFD_RELOC_X86_64_DTPOFF64 || fixP->fx_r_type == BFD_RELOC_X86_64_GOTTPOFF || fixP->fx_r_type == BFD_RELOC_X86_64_CODE_4_GOTTPOFF + || fixP->fx_r_type == BFD_RELOC_X86_64_CODE_6_GOTTPOFF || fixP->fx_r_type == BFD_RELOC_X86_64_TPOFF32 || fixP->fx_r_type == BFD_RELOC_X86_64_TPOFF64 || fixP->fx_r_type == BFD_RELOC_X86_64_GOTOFF64 @@ -6761,10 +6762,19 @@ md_assemble (char *line) for (j = i.imm_operands; j < i.operands; ++j) switch (i.reloc[j]) { + case BFD_RELOC_X86_64_GOTTPOFF: + if (i.tm.mnem_off == MN_add + && i.tm.opcode_space == SPACE_EVEXMAP4 + && i.mem_operands == 1 + && i.base_reg + && i.base_reg->reg_num == RegIP + && i.tm.operand_types[0].bitfield.class == Reg + && i.tm.operand_types[2].bitfield.class == Reg) + /* Allow APX: add %reg1, foo@gottpoff(%rip), %reg2. */ + break; + /* Fall through. */ case BFD_RELOC_386_TLS_GOTIE: case BFD_RELOC_386_TLS_LE_32: - case BFD_RELOC_X86_64_GOTTPOFF: - case BFD_RELOC_X86_64_CODE_4_GOTTPOFF: case BFD_RELOC_X86_64_TLSLD: as_bad (_("TLS relocation cannot be used with `%s'"), insn_name (&i.tm)); return; @@ -11759,8 +11769,8 @@ output_insn (const struct last_insn *last_insn) { j = encoding_length (insn_start_frag, insn_start_off, frag_more (0)); if (j > 15) - as_warn (_("instruction length of %u bytes exceeds the limit of 15"), - j); + as_bad (_("instruction length of %u bytes exceeds the limit of 15"), + j); else if (fragP) { /* NB: Don't add prefix with GOTPC relocation since @@ -11990,6 +12000,7 @@ output_disp (fragS *insn_start_frag, offsetT insn_start_off) case BFD_RELOC_X86_64_TLSLD: case BFD_RELOC_X86_64_GOTTPOFF: case BFD_RELOC_X86_64_CODE_4_GOTTPOFF: + case BFD_RELOC_X86_64_CODE_6_GOTTPOFF: case BFD_RELOC_X86_64_GOTPC32_TLSDESC: case BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC: case BFD_RELOC_X86_64_TLSDESC_CALL: @@ -12006,9 +12017,30 @@ output_disp (fragS *insn_start_frag, offsetT insn_start_off) && !i.prefix[ADDR_PREFIX]) fixP->fx_signed = 1; - /* Set fx_tcbit3 for REX2 prefix. */ - if (is_apx_rex2_encoding ()) - fixP->fx_tcbit3 = 1; + if (reloc_type == BFD_RELOC_X86_64_GOTTPOFF + && i.tm.opcode_space == SPACE_EVEXMAP4) + { + /* Only "add %reg1, foo@gottpoff(%rip), %reg2" is + allowed in md_assemble. Set fx_tcbit2 for EVEX + prefix. */ + fixP->fx_tcbit2 = 1; + continue; + } + + if (i.base_reg && i.base_reg->reg_num == RegIP) + { + if (reloc_type == BFD_RELOC_X86_64_GOTPC32_TLSDESC) + { + /* Set fx_tcbit for REX2 prefix. */ + if (is_apx_rex2_encoding ()) + fixP->fx_tcbit = 1; + continue; + } + } + /* In 64-bit, i386_validate_fix updates only (%rip) + relocations. */ + else if (object_64bit) + continue; /* Check for "call/jmp *mem", "mov mem, %reg", "test %reg, mem" and "binop mem, %reg" where binop @@ -12033,10 +12065,22 @@ output_disp (fragS *insn_start_frag, offsetT insn_start_off) { if (object_64bit) { - fixP->fx_tcbit = i.rex != 0; - if (i.base_reg - && (i.base_reg->reg_num == RegIP)) - fixP->fx_tcbit2 = 1; + if (reloc_type == BFD_RELOC_X86_64_GOTTPOFF) + { + /* Set fx_tcbit for REX2 prefix. */ + if (is_apx_rex2_encoding ()) + fixP->fx_tcbit = 1; + } + else + { + /* Set fx_tcbit3 for REX2 prefix. */ + if (is_apx_rex2_encoding ()) + fixP->fx_tcbit3 = 1; + else if (i.rex) + fixP->fx_tcbit2 = 1; + else + fixP->fx_tcbit = 1; + } } else fixP->fx_tcbit2 = 1; @@ -15513,6 +15557,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) case BFD_RELOC_X86_64_TLSLD: case BFD_RELOC_X86_64_GOTTPOFF: case BFD_RELOC_X86_64_CODE_4_GOTTPOFF: + case BFD_RELOC_X86_64_CODE_6_GOTTPOFF: case BFD_RELOC_X86_64_GOTPC32_TLSDESC: case BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC: value = 0; /* Fully resolved at runtime. No addend. */ @@ -16753,7 +16798,7 @@ md_show_usage (FILE *stream) -muse-unaligned-vector-move\n\ encode aligned vector move as unaligned vector move\n")); fprintf (stream, _("\ - -msse-check=[none|error|warning] (default: warning)\n\ + -msse-check=[none|error|warning] (default: none)\n\ check SSE instructions\n")); fprintf (stream, _("\ -moperand-check=[none|error|warning] (default: warning)\n\ @@ -17093,13 +17138,27 @@ i386_validate_fix (fixS *fixp) && (!S_IS_DEFINED (fixp->fx_addsy) || S_IS_EXTERNAL (fixp->fx_addsy)); - if (fixp->fx_tcbit3) + /* BFD_RELOC_X86_64_GOTTPOFF: + 1. fx_tcbit -> BFD_RELOC_X86_64_CODE_4_GOTTPOFF + 2. fx_tcbit2 -> BFD_RELOC_X86_64_CODE_6_GOTTPOFF + BFD_RELOC_X86_64_GOTPC32_TLSDESC: + 1. fx_tcbit -> BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC + BFD_RELOC_32_PCREL: + 1. fx_tcbit -> BFD_RELOC_X86_64_GOTPCRELX + 2. fx_tcbit2 -> BFD_RELOC_X86_64_REX_GOTPCRELX + 3. fx_tcbit3 -> BFD_RELOC_X86_64_CODE_4_GOTPCRELX + 4. else -> BFD_RELOC_X86_64_GOTPCREL + */ + if (fixp->fx_r_type == BFD_RELOC_X86_64_GOTTPOFF) { - if (fixp->fx_r_type == BFD_RELOC_X86_64_GOTTPOFF) + if (fixp->fx_tcbit) fixp->fx_r_type = BFD_RELOC_X86_64_CODE_4_GOTTPOFF; - else if (fixp->fx_r_type == BFD_RELOC_X86_64_GOTPC32_TLSDESC) - fixp->fx_r_type = BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC; + else if (fixp->fx_tcbit2) + fixp->fx_r_type = BFD_RELOC_X86_64_CODE_6_GOTTPOFF; } + else if (fixp->fx_r_type == BFD_RELOC_X86_64_GOTPC32_TLSDESC + && fixp->fx_tcbit) + fixp->fx_r_type = BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC; #endif if (fixp->fx_subsy) @@ -17111,15 +17170,12 @@ i386_validate_fix (fixS *fixp) if (!object_64bit) abort (); #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) - if (fixp->fx_tcbit2) - { - if (fixp->fx_tcbit3) - fixp->fx_r_type = BFD_RELOC_X86_64_CODE_4_GOTPCRELX; - else - fixp->fx_r_type = (fixp->fx_tcbit - ? BFD_RELOC_X86_64_REX_GOTPCRELX - : BFD_RELOC_X86_64_GOTPCRELX); - } + if (fixp->fx_tcbit) + fixp->fx_r_type = BFD_RELOC_X86_64_GOTPCRELX; + else if (fixp->fx_tcbit2) + fixp->fx_r_type = BFD_RELOC_X86_64_REX_GOTPCRELX; + else if (fixp->fx_tcbit3) + fixp->fx_r_type = BFD_RELOC_X86_64_CODE_4_GOTPCRELX; else #endif fixp->fx_r_type = BFD_RELOC_X86_64_GOTPCREL; @@ -17245,6 +17301,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) case BFD_RELOC_X86_64_DTPOFF64: case BFD_RELOC_X86_64_GOTTPOFF: case BFD_RELOC_X86_64_CODE_4_GOTTPOFF: + case BFD_RELOC_X86_64_CODE_6_GOTTPOFF: case BFD_RELOC_X86_64_TPOFF32: case BFD_RELOC_X86_64_TPOFF64: case BFD_RELOC_X86_64_GOTOFF64: @@ -17389,6 +17446,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) case BFD_RELOC_X86_64_TLSLD: case BFD_RELOC_X86_64_GOTTPOFF: case BFD_RELOC_X86_64_CODE_4_GOTTPOFF: + case BFD_RELOC_X86_64_CODE_6_GOTTPOFF: case BFD_RELOC_X86_64_GOTPC32_TLSDESC: case BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC: case BFD_RELOC_X86_64_TLSDESC_CALL: diff --git a/gas/config/tc-loongarch.c b/gas/config/tc-loongarch.c index af4426bff..d52e5d2e4 100644 --- a/gas/config/tc-loongarch.c +++ b/gas/config/tc-loongarch.c @@ -1353,6 +1353,9 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) case BFD_RELOC_LARCH_TLS_DESC_LO12: case BFD_RELOC_LARCH_TLS_DESC64_LO20: case BFD_RELOC_LARCH_TLS_DESC64_HI12: + case BFD_RELOC_LARCH_TLS_LE_ADD_R: + case BFD_RELOC_LARCH_TLS_LE_HI20_R: + case BFD_RELOC_LARCH_TLS_LE_LO12_R: /* Add tls lo (got_lo reloc type). */ if (fixP->fx_addsy == NULL) as_bad_where (fixP->fx_file, fixP->fx_line, diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 2e92d14ca..8c00d01f6 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -1392,6 +1392,8 @@ PowerPC options:\n")); fprintf (stream, _("\ -mpower10, -mpwr10 generate code for Power10 architecture\n")); fprintf (stream, _("\ +-mpower11, -mpwr11 generate code for Power11 architecture\n")); + fprintf (stream, _("\ -mlibresoc generate code for Libre-SOC architecture\n")); fprintf (stream, _("\ -mfuture generate code for 'future' architecture\n")); diff --git a/gas/configure b/gas/configure index 0bcb1611f..5f8c84935 100755 --- a/gas/configure +++ b/gas/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for gas 2.42. +# Generated by GNU Autoconf 2.69 for gas 2.42.0. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='gas' PACKAGE_TARNAME='gas' -PACKAGE_VERSION='2.42' -PACKAGE_STRING='gas 2.42' +PACKAGE_VERSION='2.42.0' +PACKAGE_STRING='gas 2.42.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1392,7 +1392,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures gas 2.42 to adapt to many kinds of systems. +\`configure' configures gas 2.42.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1463,7 +1463,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of gas 2.42:";; + short | recursive ) echo "Configuration of gas 2.42.0:";; esac cat <<\_ACEOF @@ -1619,7 +1619,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -gas configure 2.42 +gas configure 2.42.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2030,7 +2030,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by gas $as_me 2.42, which was +It was created by gas $as_me 2.42.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3010,7 +3010,7 @@ fi # Define the identity of the package. PACKAGE='gas' - VERSION='2.42' + VERSION='2.42.0' cat >>confdefs.h <<_ACEOF @@ -16857,7 +16857,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by gas $as_me 2.42, which was +This file was extended by gas $as_me 2.42.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16923,7 +16923,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -gas config.status 2.42 +gas config.status 2.42.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/gas/doc/c-ppc.texi b/gas/doc/c-ppc.texi index 428492f5f..c8cabdebf 100644 --- a/gas/doc/c-ppc.texi +++ b/gas/doc/c-ppc.texi @@ -156,6 +156,9 @@ Generate code for Power9 architecture. @item -mpower10, -mpwr10 Generate code for Power10 architecture. +@item -mpower11, -mpwr11 +Generate code for Power11 architecture. + @item -mfuture Generate code for 'future' architecture. diff --git a/gas/testsuite/gas/i386/oversized16.l b/gas/testsuite/gas/i386/oversized16.l index 3bf7e1d80..e0fc7619b 100644 --- a/gas/testsuite/gas/i386/oversized16.l +++ b/gas/testsuite/gas/i386/oversized16.l @@ -1,9 +1,9 @@ .*: Assembler messages: -.*:6: Warning: instruction length.* -.*:7: Warning: instruction length.* -.*:8: Warning: instruction length.* -.*:10: Warning: instruction length.* -.*:11: Warning: instruction length.* +.*:6: Error: instruction length.* +.*:7: Error: instruction length.* +.*:8: Error: instruction length.* +.*:10: Error: instruction length.* +.*:11: Error: instruction length.* GAS LISTING .* @@ -12,29 +12,29 @@ GAS LISTING .* [ ]*3[ ]+\.code16 [ ]*4[ ]+ [ ]*5[ ]+long16: -[ ]*6[ ]+0000 26678FEA[ ]+lwpins eax, es:\[eax\*8\], 0x11223344 -\*\*\*\* Warning: instruction length of 16 bytes exceeds the limit of 15 +[ ]*6[ ]+\?\?\?\? 26678FEA[ ]+lwpins eax, es:\[eax\*8\], 0x11223344 +\*\*\*\* Error: instruction length of 16 bytes exceeds the limit of 15 [ ]*6[ ]+781204C5[ ]* [ ]*6[ ]+00000000[ ]* [ ]*6[ ]+44332211[ ]* -[ ]*7[ ]+0010 26678FEA[ ]+lwpval eax, es:\[eax\*4\], 0x11223344 -\*\*\*\* Warning: instruction length of 16 bytes exceeds the limit of 15 +[ ]*7[ ]+\?\?\?\? 26678FEA[ ]+lwpval eax, es:\[eax\*4\], 0x11223344 +\*\*\*\* Error: instruction length of 16 bytes exceeds the limit of 15 [ ]*7[ ]+78120C85[ ]* [ ]*7[ ]+00000000[ ]* [ ]*7[ ]+44332211[ ]* -[ ]*8[ ]+0020 26678FEA[ ]+bextr eax, es:\[eax\*2\], 0x11223344 -\*\*\*\* Warning: instruction length of 16 bytes exceeds the limit of 15 +[ ]*8[ ]+\?\?\?\? 26678FEA[ ]+bextr eax, es:\[eax\*2\], 0x11223344 +\*\*\*\* Error: instruction length of 16 bytes exceeds the limit of 15 [ ]*8[ ]+78100445[ ]* [ ]*8[ ]+00000000[ ]* [ ]*8[ ]+44332211[ ]* [ ]*9[ ]+ -[ ]*10[ ]+0030 266766F2[ ]+xacquire lock add dword ptr es:\[eax\*2\], 0x11223344 -\*\*\*\* Warning: instruction length of 16 bytes exceeds the limit of 15 +[ ]*10[ ]+\?\?\?\? 266766F2[ ]+xacquire lock add dword ptr es:\[eax\*2\], 0x11223344 +\*\*\*\* Error: instruction length of 16 bytes exceeds the limit of 15 [ ]*10[ ]+F0810445[ ]* [ ]*10[ ]+00000000[ ]* [ ]*10[ ]+44332211[ ]* -[ ]*11[ ]+0040 266766F3[ ]+xrelease lock sub dword ptr es:\[eax\*2\], 0x11223344 -\*\*\*\* Warning: instruction length of 16 bytes exceeds the limit of 15 +[ ]*11[ ]+\?\?\?\? 266766F3[ ]+xrelease lock sub dword ptr es:\[eax\*2\], 0x11223344 +\*\*\*\* Error: instruction length of 16 bytes exceeds the limit of 15 [ ]*11[ ]+F0812C45[ ]* [ ]*11[ ]+00000000[ ]* [ ]*11[ ]+44332211[ ]* diff --git a/gas/testsuite/gas/i386/oversized64.l b/gas/testsuite/gas/i386/oversized64.l index dc63fb5ae..ac32c4d81 100644 --- a/gas/testsuite/gas/i386/oversized64.l +++ b/gas/testsuite/gas/i386/oversized64.l @@ -1,9 +1,9 @@ .*: Assembler messages: -.*:5: Warning: instruction length.* -.*:6: Warning: instruction length.* -.*:7: Warning: instruction length.* -.*:9: Warning: instruction length.* -.*:10: Warning: instruction length.* +.*:5: Error: instruction length.* +.*:6: Error: instruction length.* +.*:7: Error: instruction length.* +.*:9: Error: instruction length.* +.*:10: Error: instruction length.* GAS LISTING .* @@ -11,29 +11,29 @@ GAS LISTING .* [ ]*2[ ]+\.intel_syntax noprefix [ ]*3[ ]+ [ ]*4[ ]+long64: -[ ]*5[ ]+0000 64678FEA[ ]+lwpins rax, fs:\[eax\*8\], 0x11223344 -\*\*\*\* Warning: instruction length of 16 bytes exceeds the limit of 15 +[ ]*5[ ]+\?\?\?\? 64678FEA[ ]+lwpins rax, fs:\[eax\*8\], 0x11223344 +\*\*\*\* Error: instruction length of 16 bytes exceeds the limit of 15 [ ]*5[ ]+F81204C5[ ]* [ ]*5[ ]+00000000[ ]* [ ]*5[ ]+44332211[ ]* -[ ]*6[ ]+0010 64678FEA[ ]+lwpval eax, fs:\[eax\*4\], 0x11223344 -\*\*\*\* Warning: instruction length of 16 bytes exceeds the limit of 15 +[ ]*6[ ]+\?\?\?\? 64678FEA[ ]+lwpval eax, fs:\[eax\*4\], 0x11223344 +\*\*\*\* Error: instruction length of 16 bytes exceeds the limit of 15 [ ]*6[ ]+78120C85[ ]* [ ]*6[ ]+00000000[ ]* [ ]*6[ ]+44332211[ ]* -[ ]*7[ ]+0020 64678FEA[ ]+bextr rax, fs:\[eax\*2\], 0x11223344 -\*\*\*\* Warning: instruction length of 16 bytes exceeds the limit of 15 +[ ]*7[ ]+\?\?\?\? 64678FEA[ ]+bextr rax, fs:\[eax\*2\], 0x11223344 +\*\*\*\* Error: instruction length of 16 bytes exceeds the limit of 15 [ ]*7[ ]+F8100445[ ]* [ ]*7[ ]+00000000[ ]* [ ]*7[ ]+44332211[ ]* [ ]*8[ ]+ -[ ]*9[ ]+0030 6567F2F0[ ]+xacquire lock add qword ptr gs:\[eax\*8\], 0x11223344 -\*\*\*\* Warning: instruction length of 16 bytes exceeds the limit of 15 +[ ]*9[ ]+\?\?\?\? 6567F2F0[ ]+xacquire lock add qword ptr gs:\[eax\*8\], 0x11223344 +\*\*\*\* Error: instruction length of 16 bytes exceeds the limit of 15 [ ]*9[ ]+488104C5[ ]* [ ]*9[ ]+00000000[ ]* [ ]*9[ ]+44332211[ ]* -[ ]*10[ ]+0040 6567F3F0[ ]+xrelease lock sub qword ptr gs:\[eax\*8\], 0x11223344 -\*\*\*\* Warning: instruction length of 16 bytes exceeds the limit of 15 +[ ]*10[ ]+\?\?\?\? 6567F3F0[ ]+xrelease lock sub qword ptr gs:\[eax\*8\], 0x11223344 +\*\*\*\* Error: instruction length of 16 bytes exceeds the limit of 15 [ ]*10[ ]+48812CC5[ ]* [ ]*10[ ]+00000000[ ]* [ ]*10[ ]+44332211[ ]* diff --git a/gas/testsuite/gas/i386/x86-64-apx-inval.l b/gas/testsuite/gas/i386/x86-64-apx-inval.l new file mode 100644 index 000000000..6c1a346fc --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-apx-inval.l @@ -0,0 +1,3 @@ +.*: Assembler messages: +.*:3: Error: instruction length of 16 bytes exceeds the limit of 15 +.*:4: Error: instruction length of 16 bytes exceeds the limit of 15 diff --git a/gas/testsuite/gas/i386/x86-64-apx-inval.s b/gas/testsuite/gas/i386/x86-64-apx-inval.s new file mode 100644 index 000000000..bb57817bc --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-apx-inval.s @@ -0,0 +1,4 @@ +# Check illegal 64bit APX_F instructions + .text + addq $0xe0, %fs:0, %rdx + xorq $0xe0, foo(%eax,%edx), %rdx diff --git a/gas/testsuite/gas/i386/x86-64-gottpoff.d b/gas/testsuite/gas/i386/x86-64-gottpoff.d index d42abccc6..f2c039abe 100644 --- a/gas/testsuite/gas/i386/x86-64-gottpoff.d +++ b/gas/testsuite/gas/i386/x86-64-gottpoff.d @@ -16,4 +16,8 @@ Disassembly of section .text: +[a-f0-9]+: 48 8b 05 00 00 00 00 mov 0x0\(%rip\),%rax # 2c <_start\+0x2c> 28: R_X86_64_GOTTPOFF foo-0x4 +[a-f0-9]+: d5 48 03 05 00 00 00 00 add 0x0\(%rip\),%r16 # 34 <_start\+0x34> 30: R_X86_64_CODE_4_GOTTPOFF foo-0x4 +[a-f0-9]+: d5 48 8b 25 00 00 00 00 mov 0x0\(%rip\),%r20 # 3c <_start\+0x3c> 38: R_X86_64_CODE_4_GOTTPOFF foo-0x4 + +[a-f0-9]+: 62 74 fc 10 01 05 00 00 00 00 add %r8,0x0\(%rip\),%r16 # 46 <_start\+0x46> 42: R_X86_64_CODE_6_GOTTPOFF foo-0x4 + +[a-f0-9]+: 62 f4 9c 18 03 05 00 00 00 00 add 0x0\(%rip\),%rax,%r12 # 50 <_start\+0x50> 4c: R_X86_64_CODE_6_GOTTPOFF foo-0x4 + +[a-f0-9]+: 62 74 fc 10 01 05 00 00 00 00 add %r8,0x0\(%rip\),%r16 # 5a <_start\+0x5a> 56: R_X86_64_CODE_6_GOTTPOFF foo-0x4 + +[a-f0-9]+: 62 f4 9c 18 03 05 00 00 00 00 add 0x0\(%rip\),%rax,%r12 # 64 <_start\+0x64> 60: R_X86_64_CODE_6_GOTTPOFF foo-0x4 #pass diff --git a/gas/testsuite/gas/i386/x86-64-gottpoff.s b/gas/testsuite/gas/i386/x86-64-gottpoff.s index 6f8f9d148..0335ec5de 100644 --- a/gas/testsuite/gas/i386/x86-64-gottpoff.s +++ b/gas/testsuite/gas/i386/x86-64-gottpoff.s @@ -13,3 +13,13 @@ _start: addq r16, QWORD PTR [rip + foo@GOTTPOFF] movq r20, QWORD PTR [rip + foo@GOTTPOFF] + + .att_syntax prefix + + addq %r8, foo@GOTTPOFF(%rip), %r16 + addq foo@GOTTPOFF(%rip), %rax, %r12 + + .intel_syntax noprefix + + addq r16, QWORD PTR [rip + foo@GOTTPOFF], r8 + addq r12, rax, QWORD PTR [rip + foo@GOTTPOFF] diff --git a/gas/testsuite/gas/i386/x86-64.exp b/gas/testsuite/gas/i386/x86-64.exp index 6932ba97a..b77e8c100 100644 --- a/gas/testsuite/gas/i386/x86-64.exp +++ b/gas/testsuite/gas/i386/x86-64.exp @@ -371,6 +371,7 @@ run_dump_test "x86-64-avx512f-rcigrne-intel" run_dump_test "x86-64-avx512f-rcigrne" run_dump_test "x86-64-avx512f-rcigru-intel" run_dump_test "x86-64-avx512f-rcigru" +run_list_test "x86-64-apx-inval" run_list_test "x86-64-apx-egpr-inval" run_dump_test "x86-64-apx-evex-promoted-bad" run_list_test "x86-64-apx-egpr-promote-inval" "-al" diff --git a/gas/testsuite/gas/loongarch/tls_le_r_sym_type.d b/gas/testsuite/gas/loongarch/tls_le_r_sym_type.d new file mode 100644 index 000000000..43bcd7897 --- /dev/null +++ b/gas/testsuite/gas/loongarch/tls_le_r_sym_type.d @@ -0,0 +1,3 @@ +#readelf: -s +#... +.*TLS[ \t]+GLOBAL[ \t]+DEFAULT[ \t]+UND[ \t]+x diff --git a/gas/testsuite/gas/loongarch/tls_le_r_sym_type.s b/gas/testsuite/gas/loongarch/tls_le_r_sym_type.s new file mode 100644 index 000000000..3ccedae92 --- /dev/null +++ b/gas/testsuite/gas/loongarch/tls_le_r_sym_type.s @@ -0,0 +1,6 @@ +f: + lu12i.w $a0, %le_hi20_r(x) + add.d $a0, $a0, $tp, %le_add_r(x) + li.w $a1, 1 + st.w $a1, $a0, %le_lo12_r(x) + ret diff --git a/gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.l b/gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.l new file mode 100644 index 000000000..ab6b50d47 --- /dev/null +++ b/gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.l @@ -0,0 +1,38 @@ +.*: Assembler messages: +.*:20: Error: untraceable control flow for func 'foo' +GAS LISTING .* + + + 1 # Testcase with a variety of "change of flow instructions" + 2 # + 3 # This test does not have much going on wrt synthesis of CFI; + 4 # it just aims to ensure x8_64 -> ginsn decoding behaves + 5 # gracefully for these "change of flow instructions" + 6 .text + 7 .globl foo + 8 .type foo, @function + 8 ginsn: SYM FUNC_BEGIN + 9 foo: + 9 ginsn: SYM foo + 10 \?\?\?\? 4801D0 addq %rdx, %rax + 10 ginsn: ADD %r1, %r0, %r0 + 11 \?\?\?\? E200 loop foo + 11 ginsn: JCC + 12 \?\?\?\? 3EFFE0 notrack jmp \*%rax + 12 ginsn: JMP %r0, + 13 \?\?\?\? 41FFD0 call \*%r8 + 13 ginsn: CALL + 14 \?\?\?\? 67E305 jecxz .L179 + 14 ginsn: JCC + 15 \?\?\?\? FF6730 jmp \*48\(%rdi\) + 15 ginsn: JMP %r5, + 16 \?\?\?\? 7000 jo .L179 + 16 ginsn: JCC + 17 .L179: + 17 ginsn: SYM .L179 + 18 \?\?\?\? C3 ret + 18 ginsn: RET + 19 .LFE0: + 19 ginsn: SYM .LFE0 + 20 .size foo, .-foo + 20 ginsn: SYM FUNC_END diff --git a/gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.s b/gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.s new file mode 100644 index 000000000..0a63910e0 --- /dev/null +++ b/gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.s @@ -0,0 +1,20 @@ +# Testcase with a variety of "change of flow instructions" +# +# This test does not have much going on wrt synthesis of CFI; +# it just aims to ensure x8_64 -> ginsn decoding behaves +# gracefully for these "change of flow instructions" + .text + .globl foo + .type foo, @function +foo: + addq %rdx, %rax + loop foo + notrack jmp *%rax + call *%r8 + jecxz .L179 + jmp *48(%rdi) + jo .L179 +.L179: + ret +.LFE0: + .size foo, .-foo diff --git a/gold/testsuite/x86_64_ie_to_le.s b/gold/testsuite/x86_64_ie_to_le.s index c57520688..bd0643dc8 100644 --- a/gold/testsuite/x86_64_ie_to_le.s +++ b/gold/testsuite/x86_64_ie_to_le.s @@ -7,6 +7,8 @@ _start: movq foo@gottpoff(%rip), %rax addq foo@gottpoff(%rip), %r16 movq foo@gottpoff(%rip), %r20 + addq %r30, foo@gottpoff(%rip), %r8 + addq foo@gottpoff(%rip), %rax, %r20 .size _start, .-_start .section .tdata,"awT",@progbits .align 4 diff --git a/gold/testsuite/x86_64_ie_to_le.sh b/gold/testsuite/x86_64_ie_to_le.sh index 9d2e082f3..5308712dd 100755 --- a/gold/testsuite/x86_64_ie_to_le.sh +++ b/gold/testsuite/x86_64_ie_to_le.sh @@ -27,3 +27,5 @@ grep -q "add[ \t]\+\$0x[a-f0-9]\+,%r12" x86_64_ie_to_le.stdout grep -q "mov[ \t]\+\$0x[a-f0-9]\+,%rax" x86_64_ie_to_le.stdout grep -q "add[ \t]\+\$0x[a-f0-9]\+,%r16" x86_64_ie_to_le.stdout grep -q "mov[ \t]\+\$0x[a-f0-9]\+,%r20" x86_64_ie_to_le.stdout +grep -q "add[ \t]\+\$0x[a-f0-9]\+,%r30,%r8" x86_64_ie_to_le.stdout +grep -q "add[ \t]\+\$0x[a-f0-9]\+,%rax,%r20" x86_64_ie_to_le.stdout diff --git a/gold/x86_64.cc b/gold/x86_64.cc index 58e191a05..f77430bfb 100644 --- a/gold/x86_64.cc +++ b/gold/x86_64.cc @@ -2920,6 +2920,11 @@ Target_x86_64::optimize_tls_reloc(bool is_final, int r_type, // Another Local-Dynamic reloc. return tls::TLSOPT_TO_LE; + case elfcpp::R_X86_64_CODE_6_GOTTPOFF: + if (r_offset <= 6 || *(reloc_view - 6) != 0x62) + return tls::TLSOPT_NONE; + goto handle_gottpoff; + case elfcpp::R_X86_64_CODE_4_GOTTPOFF: if (r_offset <= 4 || *(reloc_view - 4) != 0xd5) return tls::TLSOPT_NONE; @@ -2929,6 +2934,7 @@ Target_x86_64::optimize_tls_reloc(bool is_final, int r_type, // from the GOT. If we know that we are linking against the // local symbol, we can switch to Local-Exec, which links the // thread offset into the instruction. +handle_gottpoff: if (is_final) return tls::TLSOPT_TO_LE; return tls::TLSOPT_NONE; @@ -2997,6 +3003,7 @@ Target_x86_64::Scan::get_reference_flags(unsigned int r_type) case elfcpp::R_X86_64_DTPOFF64: case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec case elfcpp::R_X86_64_CODE_4_GOTTPOFF: + case elfcpp::R_X86_64_CODE_6_GOTTPOFF: case elfcpp::R_X86_64_TPOFF32: // Local-exec return Symbol::TLS_REF; @@ -3362,6 +3369,7 @@ need_got: // These are initial tls relocs, which are expected when linking case elfcpp::R_X86_64_CODE_4_GOTPC32_TLSDESC: case elfcpp::R_X86_64_CODE_4_GOTTPOFF: + case elfcpp::R_X86_64_CODE_6_GOTTPOFF: { section_size_type stype; reloc_view = object->section_contents(data_shndx, &stype, true); @@ -3464,6 +3472,7 @@ need_got: case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec case elfcpp::R_X86_64_CODE_4_GOTTPOFF: + case elfcpp::R_X86_64_CODE_6_GOTTPOFF: layout->set_has_static_tls(); if (optimized_type == tls::TLSOPT_NONE) { @@ -3902,6 +3911,7 @@ Target_x86_64::Scan::global(Symbol_table* symtab, // These are initial tls relocs, which are expected for global() case elfcpp::R_X86_64_CODE_4_GOTPC32_TLSDESC: case elfcpp::R_X86_64_CODE_4_GOTTPOFF: + case elfcpp::R_X86_64_CODE_6_GOTTPOFF: { section_size_type stype; reloc_view = object->section_contents(data_shndx, &stype, true); @@ -3920,7 +3930,8 @@ Target_x86_64::Scan::global(Symbol_table* symtab, // when building an executable. const bool is_final = (gsym->final_value_is_known() || ((r_type == elfcpp::R_X86_64_GOTTPOFF || - r_type == elfcpp::R_X86_64_CODE_4_GOTTPOFF) && + r_type == elfcpp::R_X86_64_CODE_4_GOTTPOFF|| + r_type == elfcpp::R_X86_64_CODE_6_GOTTPOFF) && gsym->is_undefined() && parameters->options().output_is_executable())); size_t r_offset = reloc.get_r_offset(); @@ -4006,6 +4017,7 @@ Target_x86_64::Scan::global(Symbol_table* symtab, case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec case elfcpp::R_X86_64_CODE_4_GOTTPOFF: + case elfcpp::R_X86_64_CODE_6_GOTTPOFF: layout->set_has_static_tls(); if (optimized_type == tls::TLSOPT_NONE) { @@ -4608,6 +4620,7 @@ Target_x86_64::Relocate::relocate( case elfcpp::R_X86_64_DTPOFF64: case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec case elfcpp::R_X86_64_CODE_4_GOTTPOFF: + case elfcpp::R_X86_64_CODE_6_GOTTPOFF: case elfcpp::R_X86_64_TPOFF32: // Local-exec this->relocate_tls(relinfo, target, relnum, rela, r_type, gsym, psymval, view, address, view_size); @@ -4894,6 +4907,7 @@ Target_x86_64::Relocate::relocate_tls( case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec case elfcpp::R_X86_64_CODE_4_GOTTPOFF: + case elfcpp::R_X86_64_CODE_6_GOTTPOFF: if (gsym != NULL && gsym->is_undefined() && parameters->options().output_is_executable()) @@ -5308,11 +5322,19 @@ Target_x86_64::Relocate::tls_ie_to_le( // movq foo@gottpoff(%rip),%reg ==> movq $YY,%reg // addq foo@gottpoff(%rip),%reg ==> addq $YY,%reg + // addq %reg1,foo@gottpoff(%rip),%reg2 ==> addq $YY,%reg1,%reg2 + // addq foo@gottpoff(%rip),%reg1,%reg2 ==> addq $YY,%reg1,%reg2 - tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, -3); + int off1; + if (r_type == elfcpp::R_X86_64_CODE_6_GOTTPOFF) + off1 = -5; + else + off1 = -3; + + tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, off1); tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, 4); - unsigned char op1 = view[-3]; + unsigned char op1 = view[off1]; unsigned char op2 = view[-2]; unsigned char op3 = view[-1]; unsigned char reg = op3 >> 3; @@ -5350,7 +5372,7 @@ Target_x86_64::Relocate::tls_ie_to_le( view[-1] = 0x80 | reg | (reg << 3); } } - else + else if (r_type == elfcpp::R_X86_64_CODE_4_GOTTPOFF) { if (op2 == 0x8b) op2 = 0xc7; @@ -5362,6 +5384,23 @@ Target_x86_64::Relocate::tls_ie_to_le( view[-2] = op2; view[-1] = 0xc0 | reg; } + else + { + unsigned char updated_op1 = op1; + + // Set the R bits since they is inverted. + updated_op1 |= 1 << 7 | 1 << 4; + + // Update the B bits from the R bits. + if ((op1 & (1 << 7)) == 0) + updated_op1 &= ~(1 << 5); + if ((op1 & (1 << 4)) == 0) + updated_op1 |= 1 << 3; + + view[-5] = updated_op1; + view[-2] = 0x81; + view[-1] = 0xc0 | reg; + } if (tls_segment != NULL) value -= tls_segment->memsz(); diff --git a/gprof/configure b/gprof/configure index f2eef579a..2d62b6fbb 100755 --- a/gprof/configure +++ b/gprof/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for gprof 2.42. +# Generated by GNU Autoconf 2.69 for gprof 2.42.0. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='gprof' PACKAGE_TARNAME='gprof' -PACKAGE_VERSION='2.42' -PACKAGE_STRING='gprof 2.42' +PACKAGE_VERSION='2.42.0' +PACKAGE_STRING='gprof 2.42.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1349,7 +1349,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures gprof 2.42 to adapt to many kinds of systems. +\`configure' configures gprof 2.42.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1420,7 +1420,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of gprof 2.42:";; + short | recursive ) echo "Configuration of gprof 2.42.0:";; esac cat <<\_ACEOF @@ -1539,7 +1539,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -gprof configure 2.42 +gprof configure 2.42.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1904,7 +1904,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by gprof $as_me 2.42, which was +It was created by gprof $as_me 2.42.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2884,7 +2884,7 @@ fi # Define the identity of the package. PACKAGE='gprof' - VERSION='2.42' + VERSION='2.42.0' cat >>confdefs.h <<_ACEOF @@ -14505,7 +14505,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by gprof $as_me 2.42, which was +This file was extended by gprof $as_me 2.42.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14571,7 +14571,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -gprof config.status 2.42 +gprof config.status 2.42.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/include/elf/x86-64.h b/include/elf/x86-64.h index 33a824620..ea5036a8b 100644 --- a/include/elf/x86-64.h +++ b/include/elf/x86-64.h @@ -92,6 +92,26 @@ START_RELOC_NUMBERS (elf_x86_64_reloc_type) /* 32 bit signed pc relative offset to TLS descriptor in the GOT if instruction starts at 4 bytes before the relocation offset. */ RELOC_NUMBER (R_X86_64_CODE_4_GOTPC32_TLSDESC, 45) + /* Load from 32 bit signed pc relative offset to GOT entry if the + instruction starts at 5 bytes before the relocation offset, + relaxable. */ + RELOC_NUMBER (R_X86_64_CODE_5_GOTPCRELX, 46) + /* 32 bit signed pc relative offset to TLS descriptor in the GOT if + instruction starts at 5 bytes before the relocation offset. */ + RELOC_NUMBER (R_X86_64_CODE_5_GOTPC32_TLSDESC, 47) + /* PC relative offset to IE GOT entry if the instruction starts at + 5 bytes before the relocation offset. */ + RELOC_NUMBER (R_X86_64_CODE_5_GOTTPOFF, 48) + /* Load from 32 bit signed pc relative offset to GOT entry if the + instruction starts at 6 bytes before the relocation offset, + relaxable. */ + RELOC_NUMBER (R_X86_64_CODE_6_GOTPCRELX, 49) + /* PC relative offset to IE GOT entry if the instruction starts at + 6 bytes before the relocation offset. */ + RELOC_NUMBER (R_X86_64_CODE_6_GOTTPOFF, 50) + /* 32 bit signed pc relative offset to TLS descriptor in the GOT if + instruction starts at 6 bytes before the relocation offset. */ + RELOC_NUMBER (R_X86_64_CODE_6_GOTPC32_TLSDESC, 51) RELOC_NUMBER (R_X86_64_GNU_VTINHERIT, 250) /* GNU C++ hack */ RELOC_NUMBER (R_X86_64_GNU_VTENTRY, 251) /* GNU C++ hack */ END_RELOC_NUMBERS (R_X86_64_max) diff --git a/ld/configure b/ld/configure index ba1e5e2a2..6f8a05c3b 100755 --- a/ld/configure +++ b/ld/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ld 2.42. +# Generated by GNU Autoconf 2.69 for ld 2.42.0. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='ld' PACKAGE_TARNAME='ld' -PACKAGE_VERSION='2.42' -PACKAGE_STRING='ld 2.42' +PACKAGE_VERSION='2.42.0' +PACKAGE_STRING='ld 2.42.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1436,7 +1436,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ld 2.42 to adapt to many kinds of systems. +\`configure' configures ld 2.42.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1507,7 +1507,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ld 2.42:";; + short | recursive ) echo "Configuration of ld 2.42.0:";; esac cat <<\_ACEOF @@ -1687,7 +1687,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ld configure 2.42 +ld configure 2.42.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2402,7 +2402,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ld $as_me 2.42, which was +It was created by ld $as_me 2.42.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3386,7 +3386,7 @@ fi # Define the identity of the package. PACKAGE='ld' - VERSION='2.42' + VERSION='2.42.0' cat >>confdefs.h <<_ACEOF @@ -20071,7 +20071,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ld $as_me 2.42, which was +This file was extended by ld $as_me 2.42.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20137,7 +20137,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ld config.status 2.42 +ld config.status 2.42.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/ld/scripttempl/avr.sc b/ld/scripttempl/avr.sc index 3b18897f3..329d57e28 100644 --- a/ld/scripttempl/avr.sc +++ b/ld/scripttempl/avr.sc @@ -358,8 +358,8 @@ EOF if test -z "${HAVE_FLMAP}" && test -n "${RELOCATING}"; then cat < # -> R_X86_64_TPOFF64 sG2 +[0-9a-f]+: 00 * + +[0-9a-f]+: 62 f4 fc 10 01 ([0-9a-f]{2} ){2}[ ]+add %rax,0x[0-9a-f]+\(%rip\),%r16 +# [0-9a-f]+ +# -> R_X86_64_TPOFF64 sG2 + +[0-9a-f]+: ([0-9a-f]{2} ){3} * + +[0-9a-f]+: 62 f4 fc 10 03 ([0-9a-f]{2} ){2}[ ]+add 0x[0-9a-f]+\(%rip\),%rax,%r16 +# [0-9a-f]+ +# -> R_X86_64_TPOFF64 sG2 + +[0-9a-f]+: ([0-9a-f]{2} ){3} * # IE -> LE against global var defined in exec +[0-9a-f]+: d5 18 81 c1 60 ff ff[ ]+add \$0xf+60,%r17 # sg1 +[0-9a-f]+: ff * + +[0-9a-f]+: 62 d4 f4 10 81 ([0-9a-f]{2} ){2}[ ]+add \$0x[0-9a-f]+,%r8,%r17 +# sg1 + +[0-9a-f]+: ff ff ff * + +[0-9a-f]+: 62 d4 f4 10 81 ([0-9a-f]{2} ){2}[ ]+add \$0x[0-9a-f]+,%r8,%r17 +# sg1 + +[0-9a-f]+: ff ff ff * # IE -> LE against local var +[0-9a-f]+: d5 18 81 c2 80 ff ff[ ]+add \$0xf+80,%r18 # sl1 +[0-9a-f]+: ff * + +[0-9a-f]+: 62 d4 fc 18 81 ([0-9a-f]{2} ){2}[ ]+add \$0x[0-9a-f]+,%r8,%rax +# sl1 + +[0-9a-f]+: ff ff ff * + +[0-9a-f]+: 62 d4 fc 18 81 ([0-9a-f]{2} ){2}[ ]+add \$0x[0-9a-f]+,%r8,%rax +# sl1 + +[0-9a-f]+: ff ff ff * # IE -> LE against hidden var +[0-9a-f]+: d5 18 81 c3 a0 ff ff[ ]+add \$0xf+a0,%r19 # sh1 +[0-9a-f]+: ff * + +[0-9a-f]+: 62 fc bc 18 81 ([0-9a-f]{2} ){2}[ ]+add \$0x[0-9a-f]+,%r19,%r8 +# sh1 + +[0-9a-f]+: ff ff ff * + +[0-9a-f]+: 62 fc bc 18 81 ([0-9a-f]{2} ){2}[ ]+add \$0x[0-9a-f]+,%r19,%r8 +# sh1 + +[0-9a-f]+: ff ff ff * # Direct access through %fs # IE against global var +[0-9a-f]+: d5 48 8b 25 ([0-9a-f]{2} ){3}[ ]+mov 0x[0-9a-f]+\(%rip\),%r20 +# [0-9a-f]+ diff --git a/ld/testsuite/ld-x86-64/tlsbindesc.rd b/ld/testsuite/ld-x86-64/tlsbindesc.rd index daaea7a53..59325b04e 100644 --- a/ld/testsuite/ld-x86-64/tlsbindesc.rd +++ b/ld/testsuite/ld-x86-64/tlsbindesc.rd @@ -15,12 +15,12 @@ Section Headers: +\[[ 0-9]+\] .dynsym +.* +\[[ 0-9]+\] .dynstr +.* +\[[ 0-9]+\] .rela.dyn +.* - +\[[ 0-9]+\] .text +PROGBITS +0+401000 0+1000 0+25d 00 +AX +0 +0 +4096 - +\[[ 0-9]+\] .tdata +PROGBITS +0+60125d 0+125d 0+60 00 WAT +0 +0 +1 - +\[[ 0-9]+\] .tbss +NOBITS +0+6012bd 0+12bd 0+40 00 WAT +0 +0 +1 - +\[[ 0-9]+\] .dynamic +DYNAMIC +0+6012c0 0+12c0 0+100 10 +WA +4 +0 +8 - +\[[ 0-9]+\] .got +PROGBITS +0+6013c0 0+13c0 0+20 08 +WA +0 +0 +8 - +\[[ 0-9]+\] .got.plt +PROGBITS +0+6013e0 0+13e0 0+18 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .text +PROGBITS +0+401000 0+1000 0+2ad 00 +AX +0 +0 +4096 + +\[[ 0-9]+\] .tdata +PROGBITS +0+6012ad 0+12ad 0+60 00 WAT +0 +0 +1 + +\[[ 0-9]+\] .tbss +NOBITS +0+60130d 0+130d 0+40 00 WAT +0 +0 +1 + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+601310 0+1310 0+100 10 +WA +4 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+601410 0+1410 0+20 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .got.plt +PROGBITS +0+601430 0+1430 0+18 08 +WA +0 +0 +8 +\[[ 0-9]+\] .symtab +.* +\[[ 0-9]+\] .strtab +.* +\[[ 0-9]+\] .shstrtab +.* @@ -28,7 +28,7 @@ Key to Flags: #... Elf file type is EXEC \(Executable file\) -Entry point 0x401165 +Entry point 0x4011b5 There are [0-9]+ program headers, starting at offset [0-9]+ Program Headers: @@ -36,10 +36,10 @@ Program Headers: +PHDR.* +INTERP.* .*Requesting program interpreter.* - +LOAD +0x0+ 0x0+400000 0x0+400000 0x0+125d 0x0+125d R E 0x200000 - +LOAD +0x0+125d 0x0+60125d 0x0+60125d 0x0+19b 0x0+19b RW +0x200000 - +DYNAMIC +0x0+12c0 0x0+6012c0 0x0+6012c0 0x0+100 0x0+100 RW +0x8 - +TLS +0x0+125d 0x0+60125d 0x0+60125d 0x0+60 0x0+a0 R +0x1 + +LOAD +0x0+ 0x0+400000 0x0+400000 0x0+12ad 0x0+12ad R E 0x200000 + +LOAD +0x0+12ad 0x0+6012ad 0x0+6012ad 0x0+19b 0x0+19b RW +0x200000 + +DYNAMIC +0x0+1310 0x0+601310 0x0+601310 0x0+100 0x0+100 RW +0x8 + +TLS +0x0+12ad 0x0+6012ad 0x0+6012ad 0x0+60 0x0+a0 R +0x1 Section to Segment mapping: +Segment Sections... @@ -52,10 +52,10 @@ Program Headers: Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 4 entries: +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend -0+6013c0 +0+100000012 R_X86_64_TPOFF64 +0+ sG5 \+ 0 -0+6013c8 +0+200000012 R_X86_64_TPOFF64 +0+ sG2 \+ 0 -0+6013d0 +0+300000012 R_X86_64_TPOFF64 +0+ sG6 \+ 0 -0+6013d8 +0+400000012 R_X86_64_TPOFF64 +0+ sG1 \+ 0 +0+601410 +0+100000012 R_X86_64_TPOFF64 +0+ sG5 \+ 0 +0+601418 +0+200000012 R_X86_64_TPOFF64 +0+ sG2 \+ 0 +0+601420 +0+300000012 R_X86_64_TPOFF64 +0+ sG6 \+ 0 +0+601428 +0+400000012 R_X86_64_TPOFF64 +0+ sG1 \+ 0 Symbol table '\.dynsym' contains [0-9]+ entries: +Num: +Value +Size +Type +Bind +Vis +Ndx +Name @@ -88,8 +88,8 @@ Symbol table '\.symtab' contains [0-9]+ entries: +[0-9]+: 0+9c +0 +TLS +LOCAL +DEFAULT +8 bl8 .* FILE +LOCAL +DEFAULT +ABS +[0-9]+: 0+a0 +0 +TLS +LOCAL +DEFAULT +7 _TLS_MODULE_BASE_ - +[0-9]+: 0+6012c0 +0 +OBJECT +LOCAL +DEFAULT +9 _DYNAMIC - +[0-9]+: 0+6013e0 +0 +OBJECT +LOCAL +DEFAULT +11 _GLOBAL_OFFSET_TABLE_ + +[0-9]+: 0+601310 +0 +OBJECT +LOCAL +DEFAULT +9 _DYNAMIC + +[0-9]+: 0+601430 +0 +OBJECT +LOCAL +DEFAULT +11 _GLOBAL_OFFSET_TABLE_ +[0-9]+: 0+1c +0 +TLS +GLOBAL +DEFAULT +7 sg8 +[0-9]+: 0+7c +0 +TLS +GLOBAL +DEFAULT +8 bg8 +[0-9]+: 0+74 +0 +TLS +GLOBAL +DEFAULT +8 bg6 @@ -104,7 +104,7 @@ Symbol table '\.symtab' contains [0-9]+ entries: +[0-9]+: 0+58 +0 +TLS +GLOBAL +HIDDEN +7 sh7 +[0-9]+: 0+5c +0 +TLS +GLOBAL +HIDDEN +7 sh8 +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +7 sg1 - +[0-9]+: 0+401165 +0 +FUNC +GLOBAL +DEFAULT +6 _start + +[0-9]+: 0+4011b5 +0 +FUNC +GLOBAL +DEFAULT +6 _start +[0-9]+: 0+4c +0 +TLS +GLOBAL +HIDDEN +7 sh4 +[0-9]+: 0+78 +0 +TLS +GLOBAL +DEFAULT +8 bg7 +[0-9]+: 0+50 +0 +TLS +GLOBAL +HIDDEN +7 sh5 diff --git a/ld/testsuite/ld-x86-64/tlsbindesc.s b/ld/testsuite/ld-x86-64/tlsbindesc.s index b80e5f192..4747fc1bc 100644 --- a/ld/testsuite/ld-x86-64/tlsbindesc.s +++ b/ld/testsuite/ld-x86-64/tlsbindesc.s @@ -129,15 +129,23 @@ fn2: /* IE against global var */ addq sG2@gottpoff(%rip), %r16 + addq %rax, sG2@gottpoff(%rip), %r16 + addq sG2@gottpoff(%rip), %rax, %r16 /* IE -> LE against global var defined in exec */ addq sg1@gottpoff(%rip), %r17 + addq %r8, sg1@gottpoff(%rip), %r17 + addq sg1@gottpoff(%rip), %r8, %r17 /* IE -> LE against local var */ addq sl1@gottpoff(%rip), %r18 + addq %r8, sl1@gottpoff(%rip), %rax + addq sl1@gottpoff(%rip), %r8, %rax /* IE -> LE against hidden var */ addq sh1@gottpoff(%rip), %r19 + addq %r19, sh1@gottpoff(%rip), %r8 + addq sh1@gottpoff(%rip), %r19, %r8 /* Direct access through %fs */ diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp index a1a0422ce..e370f393a 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp @@ -2263,7 +2263,7 @@ if { [check_compiler_available] } { run_cc_link_tests [list \ [list \ "Build mark-plt-1.so" \ - "-shared -Wl,-z,mark-plt,-z,pack-relative-relocs" \ + "-shared -Wl,--no-as-needed,-z,mark-plt,-z,pack-relative-relocs" \ "-fPIC" \ { mark-plt-1.s } \ {{readelf {-W --version-info} mark-plt-1a.rd} \ diff --git a/opcodes/configure b/opcodes/configure index 239f4a989..1660c3266 100755 --- a/opcodes/configure +++ b/opcodes/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for opcodes 2.42. +# Generated by GNU Autoconf 2.69 for opcodes 2.42.0. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='opcodes' PACKAGE_TARNAME='opcodes' -PACKAGE_VERSION='2.42' -PACKAGE_STRING='opcodes 2.42' +PACKAGE_VERSION='2.42.0' +PACKAGE_STRING='opcodes 2.42.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1371,7 +1371,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures opcodes 2.42 to adapt to many kinds of systems. +\`configure' configures opcodes 2.42.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1442,7 +1442,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of opcodes 2.42:";; + short | recursive ) echo "Configuration of opcodes 2.42.0:";; esac cat <<\_ACEOF @@ -1564,7 +1564,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -opcodes configure 2.42 +opcodes configure 2.42.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2158,7 +2158,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by opcodes $as_me 2.42, which was +It was created by opcodes $as_me 2.42.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3138,7 +3138,7 @@ fi # Define the identity of the package. PACKAGE='opcodes' - VERSION='2.42' + VERSION='2.42.0' cat >>confdefs.h <<_ACEOF @@ -15128,7 +15128,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by opcodes $as_me 2.42, which was +This file was extended by opcodes $as_me 2.42.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15194,7 +15194,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -opcodes config.status 2.42 +opcodes config.status 2.42.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/opcodes/i386-opc.tbl b/opcodes/i386-opc.tbl index 6c9079327..759c43733 100644 --- a/opcodes/i386-opc.tbl +++ b/opcodes/i386-opc.tbl @@ -1792,8 +1792,8 @@ vroundp, 0x6608 | , AVX, Modrm|Vex|Space0F3A|VexWIG|CheckOperandSize vrounds, 0x660a | , AVX, Modrm|VexLIG|Space0F3A|VexVVVV|VexWIG|NoSuf, { Imm8, |Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } // These are really clones of VRNDSCALE{P,S}{S,D}, with broadcast, masking, SAE, // 512-bit operand size, and register sources dropped. -vroundp, 0x6608 | , APX_F, Modrm|Space0F3A||Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8, Xmmword|Ymmword|Unspecified|BaseIndex, RegXMM|RegYMM } -vrounds, 0x660a | , APX_F, Modrm|EVexLIG|Space0F3A|VexVVVV||Disp8MemShift|NoSuf, { Imm8, |Unspecified|BaseIndex, RegXMM, RegXMM } +vroundp, 0x6608 | , APX_F&AVX512VL, Modrm|Space0F3A||Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8, Xmmword|Ymmword|Unspecified|BaseIndex, RegXMM|RegYMM } +vrounds, 0x660a | , APX_F&AVX512F, Modrm|EVexLIG|Space0F3A|VexVVVV||Disp8MemShift|NoSuf, { Imm8, |Unspecified|BaseIndex, RegXMM, RegXMM } vrsqrtps, 0x52, AVX, Modrm|Vex|Space0F|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM } vrsqrtss, 0xf352, AVX, Modrm|Vex=3|Space0F|VexVVVV|VexWIG|NoSuf, { Dword|Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } vshufp, 0xc6, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } diff --git a/opcodes/i386-tbl.h b/opcodes/i386-tbl.h index 72d5b9fbc..169320dde 100644 --- a/opcodes/i386-tbl.h +++ b/opcodes/i386-tbl.h @@ -25296,7 +25296,7 @@ static const insn_template i386_optab[] = { 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 5, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0 }, - { { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } }, + { { 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0 } }, { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, @@ -25320,7 +25320,7 @@ static const insn_template i386_optab[] = { 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 5, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0 }, - { { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } }, + { { 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0 } }, { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, @@ -25346,7 +25346,7 @@ static const insn_template i386_optab[] = { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 4, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0 }, - { { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } }, + { { 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0 } }, { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, @@ -25374,7 +25374,7 @@ static const insn_template i386_optab[] = { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 0, 0, 4, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0 }, - { { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0 } }, + { { 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0 } }, { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c index a71874fa6..573fd3c41 100644 --- a/opcodes/ppc-dis.c +++ b/opcodes/ppc-dis.c @@ -208,6 +208,11 @@ struct ppc_mopt ppc_opts[] = { | PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9 | PPC_OPCODE_POWER10 | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX), 0 }, + { "power11", (PPC_OPCODE_PPC | PPC_OPCODE_ISEL | PPC_OPCODE_64 + | PPC_OPCODE_POWER4 | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 + | PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9 + | PPC_OPCODE_POWER10 | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX), + 0 }, { "libresoc",(PPC_OPCODE_PPC | PPC_OPCODE_ISEL | PPC_OPCODE_64 | PPC_OPCODE_POWER4 | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9 @@ -267,6 +272,11 @@ struct ppc_mopt ppc_opts[] = { | PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9 | PPC_OPCODE_POWER10 | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX), 0 }, + { "pwr11", (PPC_OPCODE_PPC | PPC_OPCODE_ISEL | PPC_OPCODE_64 + | PPC_OPCODE_POWER4 | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 + | PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9 + | PPC_OPCODE_POWER10 | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX), + 0 }, { "pwrx", PPC_OPCODE_POWER | PPC_OPCODE_POWER2, 0 }, { "raw", PPC_OPCODE_PPC, @@ -396,7 +406,7 @@ powerpc_init_dialect (struct disassemble_info *info) break; default: if (info->arch == bfd_arch_powerpc) - dialect = ppc_parse_cpu (dialect, &sticky, "power10") | PPC_OPCODE_ANY; + dialect = ppc_parse_cpu (dialect, &sticky, "power11") | PPC_OPCODE_ANY; else dialect = ppc_parse_cpu (dialect, &sticky, "pwr"); break; -- 2.30.2