diff options
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/Makefile.in | 1 | ||||
-rw-r--r-- | bfd/aclocal.m4 | 1 | ||||
-rwxr-xr-x | bfd/configure | 60 | ||||
-rw-r--r-- | bfd/configure.ac | 8 | ||||
-rw-r--r-- | bfd/cpu-riscv.c | 1 | ||||
-rw-r--r-- | bfd/cpu-riscv.h | 1 | ||||
-rw-r--r-- | bfd/elf.c | 33 | ||||
-rw-r--r-- | bfd/elfxx-riscv.c | 41 | ||||
-rw-r--r-- | bfd/version.h | 2 |
9 files changed, 66 insertions, 82 deletions
diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 1543af7..8a670ad 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -113,7 +113,6 @@ target_triplet = @target@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ - $(top_srcdir)/../config/bfd64.m4 \ $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/gettext-sister.m4 \ $(top_srcdir)/../config/gettext.m4 \ diff --git a/bfd/aclocal.m4 b/bfd/aclocal.m4 index 8364b5d..4d1b7ba 100644 --- a/bfd/aclocal.m4 +++ b/bfd/aclocal.m4 @@ -1168,7 +1168,6 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([../config/acx.m4]) -m4_include([../config/bfd64.m4]) m4_include([../config/depstand.m4]) m4_include([../config/gettext-sister.m4]) m4_include([../config/gettext.m4]) diff --git a/bfd/configure b/bfd/configure index ca7f66f..f69df12 100755 --- a/bfd/configure +++ b/bfd/configure @@ -702,8 +702,6 @@ REPORT_BUGS_TEXI REPORT_BUGS_TO PKGVERSION DEBUGDIR -ENABLE_BFD_64_BIT_FALSE -ENABLE_BFD_64_BIT_TRUE PLUGINS_FALSE PLUGINS_TRUE LARGEFILE_CPPFLAGS @@ -11155,7 +11153,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11158 "configure" +#line 11156 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11261,7 +11259,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11264 "configure" +#line 11262 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11930,56 +11928,6 @@ else enable_64_bit_bfd=no fi - -if test "x$enable_64_bit_bfd" = "xno"; then : - # The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 -$as_echo_n "checking size of void *... " >&6; } -if ${ac_cv_sizeof_void_p+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_void_p" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (void *) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_void_p=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 -$as_echo "$ac_cv_sizeof_void_p" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_VOID_P $ac_cv_sizeof_void_p -_ACEOF - - - if test "x$ac_cv_sizeof_void_p" = "x8"; then : - enable_64_bit_bfd=yes -fi - -fi - - if test "x$enable_64_bit_bfd" = "xyes"; then - ENABLE_BFD_64_BIT_TRUE= - ENABLE_BFD_64_BIT_FALSE='#' -else - ENABLE_BFD_64_BIT_TRUE='#' - ENABLE_BFD_64_BIT_FALSE= -fi - - if test $enable_64_bit_bfd = yes ; then want64=true else @@ -17677,10 +17625,6 @@ if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then as_fn_error $? "conditional \"PLUGINS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${ENABLE_BFD_64_BIT_TRUE}" && test -z "${ENABLE_BFD_64_BIT_FALSE}"; then - as_fn_error $? "conditional \"ENABLE_BFD_64_BIT\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/bfd/configure.ac b/bfd/configure.ac index 90fad54..e9942d2 100644 --- a/bfd/configure.ac +++ b/bfd/configure.ac @@ -81,7 +81,13 @@ if test x$ac_checking != x ; then AC_DEFINE(ENABLE_CHECKING, 1, [Define if you want run-time sanity checks.]) fi -BFD_64_BIT +AC_ARG_ENABLE(64-bit-bfd, + AS_HELP_STRING([--enable-64-bit-bfd], + [64-bit support (on hosts with narrower word sizes)]), + [AS_CASE([$enableval], + [yes|no], [], + [*], [AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option)])], + [enable_64_bit_bfd=no]) if test $enable_64_bit_bfd = yes ; then want64=true else diff --git a/bfd/cpu-riscv.c b/bfd/cpu-riscv.c index ea25e78..67ee601 100644 --- a/bfd/cpu-riscv.c +++ b/bfd/cpu-riscv.c @@ -118,6 +118,7 @@ const struct riscv_spec riscv_priv_specs[] = {"1.10", PRIV_SPEC_CLASS_1P10}, {"1.11", PRIV_SPEC_CLASS_1P11}, {"1.12", PRIV_SPEC_CLASS_1P12}, + {"1.13", PRIV_SPEC_CLASS_1P13}, }; /* Get the corresponding CSR version class by giving privilege diff --git a/bfd/cpu-riscv.h b/bfd/cpu-riscv.h index 93a3f52..b07fcf8 100644 --- a/bfd/cpu-riscv.h +++ b/bfd/cpu-riscv.h @@ -33,6 +33,7 @@ enum riscv_spec_class PRIV_SPEC_CLASS_1P10, PRIV_SPEC_CLASS_1P11, PRIV_SPEC_CLASS_1P12, + PRIV_SPEC_CLASS_1P13, PRIV_SPEC_CLASS_DRAFT, }; @@ -6292,27 +6292,28 @@ assign_file_positions_for_load_sections (bfd *abfd, } else { - if (p->p_type == PT_LOAD) - { - this_hdr->sh_offset = sec->filepos = off; - if (this_hdr->sh_type != SHT_NOBITS) - off += this_hdr->sh_size; - } - else if (this_hdr->sh_type == SHT_NOBITS - && (this_hdr->sh_flags & SHF_TLS) != 0 - && this_hdr->sh_offset == 0) + if (this_hdr->sh_type == SHT_NOBITS + && (this_hdr->sh_flags & SHF_TLS) != 0 + && this_hdr->sh_offset == 0) { - /* This is a .tbss section that didn't get a PT_LOAD. - (See _bfd_elf_map_sections_to_segments "Create a - final PT_LOAD".) Set sh_offset to the value it - would have if we had created a zero p_filesz and - p_memsz PT_LOAD header for the section. This - also makes the PT_TLS header have the same - p_offset value. */ + /* Set sh_offset for .tbss sections to their nominal + offset after aligning. They are not loaded from + disk so the value doesn't really matter, except + when the .tbss section is the first one in a + PT_TLS segment. In that case it sets the + p_offset for the PT_TLS segment, which according + to the ELF gABI ought to satisfy + p_offset % p_align == p_vaddr % p_align. */ bfd_vma adjust = vma_page_aligned_bias (this_hdr->sh_addr, off, align); this_hdr->sh_offset = sec->filepos = off + adjust; } + else if (p->p_type == PT_LOAD) + { + this_hdr->sh_offset = sec->filepos = off; + if (this_hdr->sh_type != SHT_NOBITS) + off += this_hdr->sh_size; + } if (this_hdr->sh_type != SHT_NOBITS) { diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c index ec25491..9364442 100644 --- a/bfd/elfxx-riscv.c +++ b/bfd/elfxx-riscv.c @@ -1148,7 +1148,8 @@ riscv_elf_ignore_reloc (bfd *abfd ATTRIBUTE_UNUSED, /* Always add implicit extensions for the SUBSET. */ static bool -check_implicit_always (riscv_subset_t *subset ATTRIBUTE_UNUSED) +check_implicit_always (riscv_parse_subset_t *rps ATTRIBUTE_UNUSED, + const riscv_subset_t *subset ATTRIBUTE_UNUSED) { return true; } @@ -1156,20 +1157,34 @@ check_implicit_always (riscv_subset_t *subset ATTRIBUTE_UNUSED) /* Add implicit extensions only when the version of SUBSET less than 2.1. */ static bool -check_implicit_for_i (riscv_subset_t *subset) +check_implicit_for_i (riscv_parse_subset_t *rps ATTRIBUTE_UNUSED, + const riscv_subset_t *subset ATTRIBUTE_UNUSED) { return (subset->major_version < 2 || (subset->major_version == 2 && subset->minor_version < 1)); } +/* Add the IMPLICIT only when the 'f' extension is also available + and XLEN is 32. */ + +static bool +check_implicit_for_zcf (riscv_parse_subset_t *rps, + const riscv_subset_t *subset ATTRIBUTE_UNUSED) +{ + riscv_subset_t *tmp = NULL; + return *rps->xlen == 32 + && riscv_lookup_subset (rps->subset_list, "f", &tmp); +} + /* Record all implicit information for the subsets. */ struct riscv_implicit_subset { const char *ext; const char *implicit_exts; /* A function to determine if we need to add the implicit subsets. */ - bool (*check_func) (riscv_subset_t *); + bool (*check_func) (riscv_parse_subset_t *, + const riscv_subset_t *); }; /* Please added in order since this table is only run once time. */ static struct riscv_implicit_subset riscv_implicit_subsets[] = @@ -1213,6 +1228,8 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] = {"zvl128b", "+zvl64b", check_implicit_always}, {"zvl64b", "+zvl32b", check_implicit_always}, + {"zce", "+zca,+zcb,+zcmp,+zcmt", check_implicit_always}, + {"zce", "+zcf", check_implicit_for_zcf}, {"zcb", "+zca", check_implicit_always}, {"zcd", "+d,+zca", check_implicit_always}, {"zcf", "+f,+zca", check_implicit_always}, @@ -1223,6 +1240,8 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] = {"zicfilp", "+zicsr", check_implicit_always}, {"zicfiss", "+zimop,+zicsr", check_implicit_always}, + {"sha", "+h,+ssstateen,+shcounterenw,+shvstvala,+shtvala,+shvstvecd,+shvsatpa,+shgatpa", check_implicit_always}, + {"shcounterenw", "+h", check_implicit_always}, {"shgatpa", "+h", check_implicit_always}, {"shtvala", "+h", check_implicit_always}, @@ -1437,6 +1456,7 @@ static struct riscv_supported_ext riscv_supported_std_z_ext[] = {"ztso", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 }, {"zca", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 }, {"zcb", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 }, + {"zce", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 }, {"zcf", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 }, {"zcd", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 }, {"zcmop", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 }, @@ -1447,6 +1467,7 @@ static struct riscv_supported_ext riscv_supported_std_z_ext[] = static struct riscv_supported_ext riscv_supported_std_s_ext[] = { + {"sha", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 }, {"shcounterenw", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 }, {"shgatpa", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 }, {"shtvala", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 }, @@ -1523,6 +1544,10 @@ static struct riscv_supported_ext riscv_supported_vendor_x_ext[] = {"xsfvqmaccqoq", ISA_SPEC_CLASS_DRAFT, 1, 0, 0}, {"xsfvqmaccdod", ISA_SPEC_CLASS_DRAFT, 1, 0, 0}, {"xsfvfnrclipxfqf", ISA_SPEC_CLASS_DRAFT, 1, 0, 0}, + {"xmipscbop", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 }, + {"xmipscmov", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 }, + {"xmipsexectl", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 }, + {"xmipslsp", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 }, {NULL, 0, 0, 0, 0} }; @@ -2076,7 +2101,7 @@ riscv_parse_add_implicit_subsets (riscv_parse_subset_t *rps) { riscv_subset_t *subset = NULL; if (riscv_lookup_subset (rps->subset_list, t->ext, &subset) - && t->check_func (subset)) + && t->check_func (rps, subset)) riscv_update_subset1 (rps, subset, t->implicit_exts); } } @@ -2863,6 +2888,14 @@ riscv_multi_subset_supports (riscv_parse_subset_t *rps, return riscv_subset_supports (rps, "xsfvqmaccdod"); case INSN_CLASS_XSFVFNRCLIPXFQF: return riscv_subset_supports (rps, "xsfvfnrclipxfqf"); + case INSN_CLASS_XMIPSCBOP: + return riscv_subset_supports (rps, "xmipscbop"); + case INSN_CLASS_XMIPSCMOV: + return riscv_subset_supports (rps, "xmipscmov"); + case INSN_CLASS_XMIPSEXECTL: + return riscv_subset_supports (rps, "xmipsexectl"); + case INSN_CLASS_XMIPSLSP: + return riscv_subset_supports (rps, "xmipslsp"); default: rps->error_handler (_("internal: unreachable INSN_CLASS_*")); diff --git a/bfd/version.h b/bfd/version.h index 177404d..f09f00b 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 20250423 +#define BFD_VERSION_DATE 20250511 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@ |