diff options
39 files changed, 515 insertions, 218 deletions
diff --git a/bfd/archive.c b/bfd/archive.c index c61d4b1..52d3119 100644 --- a/bfd/archive.c +++ b/bfd/archive.c @@ -141,6 +141,9 @@ SUBSECTION #include "hashtab.h" #include "filenames.h" #include "bfdlink.h" +#if BFD_SUPPORTS_PLUGINS +#include "plugin.h" +#endif #ifndef errno extern int errno; @@ -2343,6 +2346,9 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength) long src_count; if (bfd_get_lto_type (current) == lto_slim_ir_object +#if BFD_SUPPORTS_PLUGINS + && !bfd_plugin_target_p (current->xvec) +#endif && report_plugin_err) { report_plugin_err = false; @@ -2400,6 +2406,9 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength) if (bfd_lto_slim_symbol_p (current, syms[src_count]->name) +#if BFD_SUPPORTS_PLUGINS + && !bfd_plugin_target_p (current->xvec) +#endif && report_plugin_err) { report_plugin_err = false; diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index b013ef9..12512a3 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -2131,6 +2131,9 @@ struct bfd /* Set if this is the linker input BFD. */ unsigned int is_linker_input : 1; + /* Set if this is the strip input BFD. */ + unsigned int is_strip_input : 1; + /* If this is an input for a compiler plug-in library. */ ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; @@ -296,6 +296,9 @@ CODE_FRAGMENT . {* Set if this is the linker input BFD. *} . unsigned int is_linker_input : 1; . +. {* Set if this is the strip input BFD. *} +. unsigned int is_strip_input : 1; +. . {* If this is an input for a compiler plug-in library. *} . ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; . @@ -29,12 +29,12 @@ AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE], [AC_REQUIRE([BFD_SYS_PROCFS_H]) AC_MSG_CHECKING([for $1 in sys/procfs.h]) AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1, - [AC_TRY_COMPILE([ + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #define _SYSCALL32 -#include <sys/procfs.h>], - [$1 avar], - bfd_cv_have_sys_procfs_type_$1=yes, - bfd_cv_have_sys_procfs_type_$1=no +#include <sys/procfs.h>]], + [[$1 avar]])], + [bfd_cv_have_sys_procfs_type_$1=yes], + [bfd_cv_have_sys_procfs_type_$1=no] )]) if test $bfd_cv_have_sys_procfs_type_$1 = yes; then AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1, @@ -49,12 +49,12 @@ AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE_MEMBER], [AC_REQUIRE([BFD_SYS_PROCFS_H]) AC_MSG_CHECKING([for $1.$2 in sys/procfs.h]) AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2, - [AC_TRY_COMPILE([ + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #define _SYSCALL32 -#include <sys/procfs.h>], - [$1 avar; void* aref = (void*) &avar.$2], - bfd_cv_have_sys_procfs_type_member_$1_$2=yes, - bfd_cv_have_sys_procfs_type_member_$1_$2=no +#include <sys/procfs.h>]], + [[$1 avar; void* aref = (void*) &avar.$2]])], + [bfd_cv_have_sys_procfs_type_member_$1_$2=yes], + [bfd_cv_have_sys_procfs_type_member_$1_$2=no] )]) if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1, @@ -62,4 +62,3 @@ AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE_MEMBER], fi AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2) ]) - diff --git a/bfd/elflink.c b/bfd/elflink.c index c4f57cf..cdd58b2 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -28,7 +28,6 @@ #include "libiberty.h" #include "objalloc.h" #if BFD_SUPPORTS_PLUGINS -#include "plugin-api.h" #include "plugin.h" #endif diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c index 1ddea2f..8beb3d8 100644 --- a/bfd/elfnn-loongarch.c +++ b/bfd/elfnn-loongarch.c @@ -4903,6 +4903,60 @@ loongarch_relax_delete_or_nop (bfd *abfd, bfd_put (32, abfd, LARCH_NOP, contents + addr); } +/* If some bytes in a symbol is deleted, we need to adjust its size. */ +static void +loongarch_relax_resize_symbol (bfd_size_type *size, bfd_vma orig_value, + splay_tree pdops) +{ + splay_tree_key key = (splay_tree_key)orig_value; + bfd_vma orig_end = orig_value + *size; + splay_tree_node node = splay_tree_predecessor (pdops, key); + + if (node) + { + bfd_vma addr = (bfd_vma)node->key; + struct pending_delete_op *op = (struct pending_delete_op *)node->value; + + /* This shouldn't happen unless people write something really insane like + .reloc ., R_LARCH_ALIGN, 60 + .rept 15 + 1: nop + .endr + .set x, 1b + .size x, . - 1b + But let's just try to make it "work" anyway. */ + if (orig_value < addr + op->size) + { + bfd_size_type n_deleted = op->size - (orig_value - addr); + if (n_deleted >= *size) + { + *size = 0; + return; + } + + *size -= n_deleted; + } + } + + node = splay_tree_lookup (pdops, key); + if (!node) + node = splay_tree_successor (pdops, key); + + for (; node; node = splay_tree_successor (pdops, node->key)) + { + bfd_vma addr = (bfd_vma)node->key; + struct pending_delete_op *op = (struct pending_delete_op *)node->value; + + if (addr >= orig_end) + return; + + if (orig_end < addr + op->size) + *size -= orig_end - addr; + else + *size -= op->size; + } +} + static void loongarch_relax_perform_deletes (bfd *abfd, asection *sec, struct bfd_link_info *link_info) @@ -5001,30 +5055,8 @@ loongarch_relax_perform_deletes (bfd *abfd, asection *sec, sym->st_value = loongarch_calc_relaxed_addr (link_info, orig_value); - /* If the symbol *spans* some deleted bytes, that is its *end* is in - the moved bytes but its *start* isn't, then we must adjust its - size. - - This test needs to use the original value of st_value, otherwise - we might accidentally decrease size when deleting bytes right - before the symbol. */ - bfd_vma sym_end = orig_value + sym->st_size; - if (sym_end <= toaddr) - { - splay_tree_node node = splay_tree_predecessor ( - pdops, (splay_tree_key)orig_value); - for (; node; node = splay_tree_successor (pdops, node->key)) - { - bfd_vma addr = (bfd_vma)node->key; - struct pending_delete_op *op - = (struct pending_delete_op *)node->value; - - if (addr >= sym_end) - break; - if (orig_value <= addr && sym_end > addr) - sym->st_size -= op->size; - } - } + if (orig_value + sym->st_size <= toaddr) + loongarch_relax_resize_symbol (&sym->st_size, orig_value, pdops); } } @@ -5071,29 +5103,13 @@ loongarch_relax_perform_deletes (bfd *abfd, asection *sec, { bfd_vma orig_value = sym_hash->root.u.def.value; - /* As above, adjust the value. */ + /* As above, adjust the value and size. */ if (orig_value <= toaddr) sym_hash->root.u.def.value = loongarch_calc_relaxed_addr (link_info, orig_value); - /* As above, adjust the size if needed. */ - bfd_vma sym_end = orig_value + sym_hash->size; - if (sym_end <= toaddr) - { - splay_tree_node node = splay_tree_predecessor ( - pdops, (splay_tree_key)orig_value); - for (; node; node = splay_tree_successor (pdops, node->key)) - { - bfd_vma addr = (bfd_vma)node->key; - struct pending_delete_op *op - = (struct pending_delete_op *)node->value; - - if (addr >= sym_end) - break; - if (orig_value <= addr && sym_end > addr) - sym_hash->size -= op->size; - } - } + if (orig_value + sym_hash->size <= toaddr) + loongarch_relax_resize_symbol (&sym_hash->size, orig_value, pdops); } } } diff --git a/bfd/format.c b/bfd/format.c index d2bc318..fba8d2a 100644 --- a/bfd/format.c +++ b/bfd/format.c @@ -47,7 +47,6 @@ SUBSECTION #include "bfd.h" #include "libbfd.h" #if BFD_SUPPORTS_PLUGINS -#include "plugin-api.h" #include "plugin.h" #endif @@ -389,6 +388,11 @@ bfd_set_lto_type (bfd *abfd ATTRIBUTE_UNUSED) abfd->object_only_section = sec; break; } + else if (strcmp (sec->name, ".llvm.lto") == 0) + { + type = lto_fat_ir_object; + break; + } else if (lsection.major_version == 0 && startswith (sec->name, ".gnu.lto_.lto.") && bfd_get_section_contents (abfd, sec, &lsection, 0, @@ -453,10 +457,7 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) } if (abfd->format != bfd_unknown) - { - bfd_set_lto_type (abfd); - return abfd->format == format; - } + return abfd->format == format; if (matching != NULL || *bfd_associated_vector != NULL) { @@ -510,7 +511,20 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) cleanup = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd)); - if (cleanup) + /* When called from strip, don't treat archive member nor + standalone fat IR object as an IR object. For archive + member, it will be copied as an unknown object if the + plugin target is in use or it is a slim IR object. For + standalone fat IR object, it will be copied as non-IR + object. */ + if (cleanup +#if BFD_SUPPORTS_PLUGINS + && (!abfd->is_strip_input + || !bfd_plugin_target_p (abfd->xvec) + || (abfd->lto_type != lto_fat_ir_object + && abfd->my_archive == NULL)) +#endif + ) goto ok_ret; /* For a long time the code has dropped through to check all diff --git a/bfd/plugin.c b/bfd/plugin.c index ebdf250..733e7f0 100644 --- a/bfd/plugin.c +++ b/bfd/plugin.c @@ -138,6 +138,14 @@ struct plugin_list_entry const char *plugin_name; }; +struct plugin_data_struct +{ + int nsyms; + const struct ld_plugin_symbol *syms; + int object_only_nsyms; + asymbol **object_only_syms; +}; + static const char *plugin_program_name; void @@ -206,6 +214,9 @@ bfd_plugin_get_symbols_in_object_only (bfd *abfd) bfd_close (nbfd); return; } + + /* Copy LTO type derived from input sections. */ + abfd->lto_type = nbfd->lto_type; } else { @@ -333,9 +344,8 @@ add_symbols (void * handle, const struct ld_plugin_symbol * syms) { bfd *abfd = handle; - struct plugin_data_struct *plugin_data = - bfd_alloc (abfd, sizeof (plugin_data_struct)); - + struct plugin_data_struct *plugin_data = bfd_alloc (abfd, + sizeof (*plugin_data)); if (!plugin_data) return LDPS_ERR; diff --git a/bfd/plugin.h b/bfd/plugin.h index 6acb5fa..d981c51 100644 --- a/bfd/plugin.h +++ b/bfd/plugin.h @@ -21,6 +21,8 @@ #ifndef _PLUGIN_H_ #define _PLUGIN_H_ +struct ld_plugin_input_file; + void bfd_plugin_set_program_name (const char *); int bfd_plugin_open_input (bfd *, struct ld_plugin_input_file *); void bfd_plugin_set_plugin (const char *); @@ -29,13 +31,4 @@ bool bfd_link_plugin_object_p (bfd *); void register_ld_plugin_object_p (bfd_cleanup (*object_p) (bfd *, bool)); void bfd_plugin_close_file_descriptor (bfd *, int); -typedef struct plugin_data_struct -{ - int nsyms; - const struct ld_plugin_symbol *syms; - int object_only_nsyms; - asymbol **object_only_syms; -} -plugin_data_struct; - #endif diff --git a/bfd/version.h b/bfd/version.h index 882d0b0..89f11ee 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 20250805 +#define BFD_VERSION_DATE 20250807 #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/binutils/ar.c b/binutils/ar.c index de41c9e..3cac3f3 100644 --- a/binutils/ar.c +++ b/binutils/ar.c @@ -32,9 +32,9 @@ #include "arsup.h" #include "filenames.h" #include "binemul.h" -#include "plugin-api.h" +#if BFD_SUPPORTS_PLUGINS #include "plugin.h" -#include "ansidecl.h" +#endif #ifdef __GO32___ #define EXT_NAME_LEN 3 /* Bufflen of addition to name if it's MS-DOS. */ diff --git a/binutils/configure.ac b/binutils/configure.ac index a393036..93e8a4b 100644 --- a/binutils/configure.ac +++ b/binutils/configure.ac @@ -201,9 +201,9 @@ GCC_AC_FUNC_MMAP AC_CHECK_FUNCS(fseeko fseeko64 getc_unlocked mkdtemp mkstemp utimensat utimes) AC_MSG_CHECKING([for mbstate_t]) -AC_TRY_COMPILE([#include <wchar.h>], -[mbstate_t teststate;], -have_mbstate_t=yes, have_mbstate_t=no) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <wchar.h>]], +[[mbstate_t teststate;]])], +[have_mbstate_t=yes],[have_mbstate_t=no]) AC_MSG_RESULT($have_mbstate_t) if test x"$have_mbstate_t" = xyes; then AC_DEFINE(HAVE_MBSTATE_T,1,[Define if mbstate_t exists in wchar.h.]) diff --git a/binutils/nm.c b/binutils/nm.c index a5d5631..a7f0e9d 100644 --- a/binutils/nm.c +++ b/binutils/nm.c @@ -36,9 +36,10 @@ #include "libcoff.h" #include "bucomm.h" #include "demanguse.h" -#include "plugin-api.h" -#include "plugin.h" #include "safe-ctype.h" +#if BFD_SUPPORTS_PLUGINS +#include "plugin.h" +#endif #ifndef streq #define streq(a,b) (strcmp ((a),(b)) == 0) @@ -802,6 +803,9 @@ filter_symbols (bfd *abfd, bool is_dynamic, void *minisyms, continue; if (bfd_lto_slim_symbol_p (abfd, sym->name) +#if BFD_SUPPORTS_PLUGINS + && !bfd_plugin_target_p (abfd->xvec) +#endif && report_plugin_err) { report_plugin_err = false; @@ -1484,7 +1488,11 @@ display_rel_file (bfd *abfd, bfd *archive_bfd) /* lto_type is set to lto_non_ir_object when a bfd is loaded with a compiler LTO plugin. */ - if (bfd_get_lto_type (abfd) == lto_slim_ir_object) + if (bfd_get_lto_type (abfd) == lto_slim_ir_object +#if BFD_SUPPORTS_PLUGINS + && !bfd_plugin_target_p (abfd->xvec) +#endif + ) { report_plugin_err = false; non_fatal (_("%s: plugin needed to handle lto object"), diff --git a/binutils/objcopy.c b/binutils/objcopy.c index 8bd523a..654d2b9 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -30,8 +30,9 @@ #include "coff/internal.h" #include "libcoff.h" #include "safe-ctype.h" -#include "plugin-api.h" +#if BFD_SUPPORTS_PLUGINS #include "plugin.h" +#endif /* FIXME: See bfd/peXXigen.c for why we include an architecture specific header in generic PE code. */ @@ -3689,6 +3690,8 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target, bool ok_object; const char *element_name; + this_element->is_strip_input = 1; + element_name = bfd_get_filename (this_element); /* PR binutils/17533: Do not allow directory traversal outside of the current directory tree by archive members. */ @@ -3769,7 +3772,9 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target, #if BFD_SUPPORTS_PLUGINS /* Copy LTO IR file as unknown object. */ - if (bfd_plugin_target_p (this_element->xvec)) + if ((!lto_sections_removed + && this_element->lto_type == lto_slim_ir_object) + || bfd_plugin_target_p (this_element->xvec)) ok_object = false; else #endif @@ -3966,6 +3971,8 @@ copy_file (const char *input_filename, const char *output_filename, int ofd, break; } + ibfd->is_strip_input = 1; + if (bfd_check_format (ibfd, bfd_archive)) { bool force_output_target; @@ -5072,6 +5079,11 @@ strip_main (int argc, char *argv[]) SECTION_CONTEXT_REMOVE) || !!find_section_list (".llvm.lto", false, SECTION_CONTEXT_REMOVE)); + /* NB: Must keep .gnu.debuglto_* sections unless all GCC LTO sections + will be removed to avoid undefined references to symbols in GCC LTO + debug sections. */ + if (!lto_sections_removed) + find_section_list (".gnu.debuglto_*", true, SECTION_CONTEXT_KEEP); #endif i = optind; diff --git a/gas/acinclude.m4 b/gas/acinclude.m4 index bf6dba6..b6345d5 100644 --- a/gas/acinclude.m4 +++ b/gas/acinclude.m4 @@ -2,12 +2,12 @@ dnl GAS_CHECK_DECL_NEEDED(name, typedefname, typedef, headers) AC_DEFUN([GAS_CHECK_DECL_NEEDED],[ AC_MSG_CHECKING(whether declaration is required for $1) AC_CACHE_VAL(gas_cv_decl_needed_$1, -AC_TRY_LINK([$4], -[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[$4]], +[[ typedef $3; $2 x; x = ($2) $1; -], gas_cv_decl_needed_$1=no, gas_cv_decl_needed_$1=yes))dnl +]])],[gas_cv_decl_needed_$1=no], [gas_cv_decl_needed_$1=yes]))dnl AC_MSG_RESULT($gas_cv_decl_needed_$1) if test $gas_cv_decl_needed_$1 = yes; then AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1, @@ -22,9 +22,9 @@ dnl GAS_WORKING_ASSERT AC_DEFUN([GAS_WORKING_ASSERT], [AC_MSG_CHECKING([for working assert macro]) AC_CACHE_VAL(gas_cv_assert_ok, -AC_TRY_LINK([#include <assert.h> +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <assert.h> #include <string.h> -#include <stdio.h>], [ +#include <stdio.h>]], [[ /* check for requoting problems */ static int a, b, c, d; static char *s; @@ -32,7 +32,7 @@ assert (!strcmp(s, "foo bar baz quux")); /* check for newline handling */ assert (a == b || c == d); -], gas_cv_assert_ok=yes, gas_cv_assert_ok=no))dnl +]])],[gas_cv_assert_ok=yes], [gas_cv_assert_ok=no]))dnl AC_MSG_RESULT($gas_cv_assert_ok) test $gas_cv_assert_ok = yes || AC_DEFINE(BROKEN_ASSERT, 1, [assert broken?]) ])dnl @@ -61,12 +61,12 @@ dnl AC_DEFUN([GAS_HAVE_TIME_TYPE_MEMBER], [AC_MSG_CHECKING([for $1.$2 in time.h]) AC_CACHE_VAL(gas_cv_have_time_type_member_$2, - [AC_TRY_COMPILE([ + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #define _BSD_SOURCE 1 -#include <time.h>], - [$1 avar; void* aref = (void*) &avar.$2], - gas_cv_have_time_type_member_$2=yes, - gas_cv_have_time_type_member_$2=no +#include <time.h>]], + [[$1 avar; void* aref = (void*) &avar.$2]])], + [gas_cv_have_time_type_member_$2=yes], + [gas_cv_have_time_type_member_$2=no] )]) if test $gas_cv_have_time_type_member_$2 = yes; then AC_DEFINE([HAVE_]translit($2, [a-z], [A-Z]), 1, @@ -80,12 +80,12 @@ dnl AC_DEFUN([GAS_HAVE_SYS_STAT_TYPE_MEMBER], [AC_MSG_CHECKING([for $1.$2.$3 in sys/stat.h]) AC_CACHE_VAL(gas_cv_have_sys_stat_type_member_$2_$3, - [AC_TRY_COMPILE([ + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #define _BSD_SOURCE 1 -#include <sys/stat.h>], - [$1 avar; void* aref = (void*) &avar.$2.$3], - gas_cv_have_sys_stat_type_member_$2_$3=yes, - gas_cv_have_sys_stat_type_member_$2_$3=no +#include <sys/stat.h>]], + [[$1 avar; void* aref = (void*) &avar.$2.$3]])], + [gas_cv_have_sys_stat_type_member_$2_$3=yes], + [gas_cv_have_sys_stat_type_member_$2_$3=no] )]) if test $gas_cv_have_sys_stat_type_member_$2_$3 = yes; then AC_DEFINE([HAVE_]translit($2, [a-z], [A-Z])[_]translit($3, [a-z], [A-Z]), 1, diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index 2f034af..08526d8 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -960,6 +960,11 @@ arm_linux_software_single_step (struct regcache *regcache) struct gdbarch *gdbarch = regcache->arch (); struct arm_get_next_pcs next_pcs_ctx; + /* If the target does have hardware single step, GDB doesn't have + to bother software single step. */ + if (target_can_do_single_step () == 1) + return {}; + arm_get_next_pcs_ctor (&next_pcs_ctx, &arm_linux_get_next_pcs_ops, gdbarch_byte_order (gdbarch), diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index f795d7b..d704ad1 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -13998,26 +13998,11 @@ insert_single_step_breakpoint (struct gdbarch *gdbarch, update_global_location_list (UGLL_INSERT); } -/* Try to setup for software single stepping. Return true if - target_resume() should use hardware single step. +/* Insert single step breakpoints according to the current state. */ - GDBARCH is the current gdbarch. */ - -bool -maybe_software_singlestep (struct gdbarch *gdbarch) +int +insert_single_step_breakpoints (struct gdbarch *gdbarch) { - if (execution_direction != EXEC_FORWARD) - return true; - - if (target_can_do_single_step () == 1) - { - /* The target definitely has hardware single step. */ - return true; - } - - if (!gdbarch_software_single_step_p (gdbarch)) - return true; - regcache *regcache = get_thread_regcache (inferior_thread ()); std::vector<CORE_ADDR> next_pcs; @@ -14031,10 +14016,10 @@ maybe_software_singlestep (struct gdbarch *gdbarch) for (CORE_ADDR pc : next_pcs) insert_single_step_breakpoint (gdbarch, aspace, pc); - return false; + return 1; } else - return true; + return 0; } /* See breakpoint.h. */ diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index e9201bc..9341112 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -1884,10 +1884,10 @@ extern void insert_single_step_breakpoint (struct gdbarch *, const address_space *, CORE_ADDR); -/* Try to setup for software single stepping. Return true if - target_resume() should use hardware single step. GDBARCH is the - current gdbarch. */ -extern bool maybe_software_singlestep (struct gdbarch *); +/* Insert all software single step breakpoints for the current frame. + Return true if any software single step breakpoints are inserted, + otherwise, return false. */ +extern int insert_single_step_breakpoints (struct gdbarch *); /* Check whether any hardware watchpoints have triggered or not, according to the target, and record it in each watchpoint's diff --git a/gdb/gdbarch-gen.h b/gdb/gdbarch-gen.h index 1e51081..281b97b 100644 --- a/gdb/gdbarch-gen.h +++ b/gdb/gdbarch-gen.h @@ -776,10 +776,16 @@ extern void set_gdbarch_get_memtag (struct gdbarch *gdbarch, gdbarch_get_memtag_ extern CORE_ADDR gdbarch_memtag_granule_size (struct gdbarch *gdbarch); extern void set_gdbarch_memtag_granule_size (struct gdbarch *gdbarch, CORE_ADDR memtag_granule_size); -/* Return a vector of addresses at which the software single step - breakpoints should be inserted. An empty vector means software single - step is not used. +/* FIXME/cagney/2001-01-18: This should be split in two. A target method that + indicates if the target needs software single step. An ISA method to + implement it. + FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the + target can single step. If not, then implement single step using breakpoints. + + Return a vector of addresses on which the software single step + breakpoints should be inserted. NULL means software single step is + not used. Multiple breakpoints may be inserted for some instructions such as conditional branch. However, each implementation must always evaluate the condition and only put the breakpoint at the branch destination if diff --git a/gdb/gdbarch_components.py b/gdb/gdbarch_components.py index 55df102..91c867e 100644 --- a/gdb/gdbarch_components.py +++ b/gdb/gdbarch_components.py @@ -1378,10 +1378,16 @@ For a non-zero value, this represents the number of bytes of memory per tag. Function( comment=""" -Return a vector of addresses at which the software single step -breakpoints should be inserted. An empty vector means software single -step is not used. +FIXME/cagney/2001-01-18: This should be split in two. A target method that +indicates if the target needs software single step. An ISA method to +implement it. +FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the +target can single step. If not, then implement single step using breakpoints. + +Return a vector of addresses on which the software single step +breakpoints should be inserted. NULL means software single step is +not used. Multiple breakpoints may be inserted for some instructions such as conditional branch. However, each implementation must always evaluate the condition and only put the breakpoint at the branch destination if diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index f97c98e..21a5a28 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -8977,41 +8977,12 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->num_core_regs = I386_NUM_GREGS + I387_NUM_REGS; tdep->register_names = i386_register_names; - /* No upper YMM registers. */ - tdep->ymmh_register_names = NULL; - tdep->ymm0h_regnum = -1; - - /* No upper ZMM registers. */ - tdep->zmmh_register_names = NULL; - tdep->zmm0h_regnum = -1; - - /* No high XMM registers. */ - tdep->xmm_avx512_register_names = NULL; - tdep->xmm16_regnum = -1; - - /* No upper YMM16-31 registers. */ - tdep->ymm16h_register_names = NULL; - tdep->ymm16h_regnum = -1; - tdep->num_byte_regs = 8; tdep->num_word_regs = 8; tdep->num_dword_regs = 0; tdep->num_mmx_regs = 8; tdep->num_ymm_regs = 0; - /* No AVX512 registers. */ - tdep->k0_regnum = -1; - tdep->num_zmm_regs = 0; - tdep->num_ymm_avx512_regs = 0; - tdep->num_xmm_avx512_regs = 0; - - /* No PKEYS registers */ - tdep->pkru_regnum = -1; - tdep->num_pkeys_regs = 0; - - /* No segment base registers. */ - tdep->fsbase_regnum = -1; - tdesc_arch_data_up tdesc_data = tdesc_data_alloc (); set_gdbarch_relocate_instruction (gdbarch, i386_relocate_instruction); diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h index e849b33..e4895b1 100644 --- a/gdb/i386-tdep.h +++ b/gdb/i386-tdep.h @@ -69,56 +69,57 @@ struct i386_gdbarch_tdep : gdbarch_tdep_base size_t sizeof_fpregset = 0; /* Register number for %st(0). The register numbers for the other - registers follow from this one. Set this to -1 to indicate the - absence of an FPU. */ - int st0_regnum = 0; + registers follow from this one. Set this to a value >= 0 if FPU is + present. */ + int st0_regnum = -1; /* Number of MMX registers. */ int num_mmx_regs = 0; - /* Register number for %mm0. Set this to -1 to indicate the absence - of MMX support. */ - int mm0_regnum = 0; + /* Register number for %mm0. Set this to a value >= 0 if MMX is + supported. */ + int mm0_regnum = -1; /* Number of pseudo YMM registers. */ int num_ymm_regs = 0; - /* Register number for %ymm0. Set this to -1 to indicate the absence - of pseudo YMM register support. */ - int ymm0_regnum = 0; + /* Register number for %ymm0. Set this to a value >= 0 if pseudo YMM + registers are supported. */ + int ymm0_regnum = -1; /* Number of AVX512 OpMask registers (K-registers) */ int num_k_regs = 0; - /* Register number for %k0. Set this to -1 to indicate the absence - of AVX512 OpMask register support. */ - int k0_regnum = 0; + /* Register number for %k0. Set this to a value >= 0 if AVX512 OpMask + is supported. */ + int k0_regnum = -1; /* Number of pseudo ZMM registers ($zmm0-$zmm31). */ int num_zmm_regs = 0; - /* Register number for %zmm0. Set this to -1 to indicate the absence - of pseudo ZMM register support. */ - int zmm0_regnum = 0; + /* Register number for %zmm0. Set this to a value >= 0 if pseudo ZMM + registers are supported. */ + int zmm0_regnum = -1; /* Number of byte registers. */ int num_byte_regs = 0; - /* Register pseudo number for %al. */ - int al_regnum = 0; + /* Register pseudo number for %al. If supported, set this to a + value >= 0. */ + int al_regnum = -1; /* Number of pseudo word registers. */ int num_word_regs = 0; - /* Register number for %ax. */ - int ax_regnum = 0; + /* Register number for %ax. If supported, set this to a value >= 0. */ + int ax_regnum = -1; /* Number of pseudo dword registers. */ int num_dword_regs = 0; - /* Register number for %eax. Set this to -1 to indicate the absence - of pseudo dword register support. */ - int eax_regnum = 0; + /* Register number for %eax. Set this to a value >= 0 if pseudo dword + registers are supported. */ + int eax_regnum = -1; /* Number of core registers. */ int num_core_regs = 0; @@ -129,14 +130,16 @@ struct i386_gdbarch_tdep : gdbarch_tdep_base /* Number of SSE registers added in AVX512. */ int num_xmm_avx512_regs = 0; - /* Register number of XMM16, the first XMM register added in AVX512. */ - int xmm16_regnum = 0; + /* Register number of XMM16, the first XMM register added in AVX512. + Set this to a value >= 0 if XMM registers are supported. */ + int xmm16_regnum = -1; /* Number of YMM registers added in AVX512. */ int num_ymm_avx512_regs = 0; - /* Register number of YMM16, the first YMM register added in AVX512. */ - int ymm16_regnum = 0; + /* Register number of YMM16, the first YMM register added in AVX512. + Set this to a value >= 0 if YMM registers are supported. */ + int ymm16_regnum = -1; /* Bits of the extended control register 0 (the XFEATURE_ENABLED_MASK register), excluding the x87 bit, which are supported by this GDB. */ @@ -152,23 +155,23 @@ struct i386_gdbarch_tdep : gdbarch_tdep_base /* Register names. */ const char * const *register_names = nullptr; - /* Register number for %ymm0h. Set this to -1 to indicate the absence - of upper YMM register support. */ - int ymm0h_regnum = 0; + /* Register number for %ymm0h. Set this to a value >= 0 if they are + supported. */ + int ymm0h_regnum = -1; /* Upper YMM register names. Only used for tdesc_numbered_register. */ const char * const *ymmh_register_names = nullptr; - /* Register number for %ymm16h. Set this to -1 to indicate the absence - of support for YMM16-31. */ - int ymm16h_regnum = 0; + /* Register number for %ymm16h. Set this to a value >= 0 if they are + supported. */ + int ymm16h_regnum = -1; /* YMM16-31 register names. Only used for tdesc_numbered_register. */ const char * const *ymm16h_register_names = nullptr; - /* Register number for %zmm0h. Set this to -1 to indicate the absence - of ZMM_HI256 register support. */ - int zmm0h_regnum = 0; + /* Register number for %zmm0h. Set this to a value >= 0 if ZMM_HI256 + registers are supported. */ + int zmm0h_regnum = -1; /* OpMask register names. */ const char * const *k_register_names = nullptr; @@ -185,15 +188,16 @@ struct i386_gdbarch_tdep : gdbarch_tdep_base /* Number of PKEYS registers. */ int num_pkeys_regs = 0; - /* Register number for PKRU register. */ - int pkru_regnum = 0; + /* Register number for PKRU register. If supported, set this to a value + >= 0. */ + int pkru_regnum = -1; /* PKEYS register names. */ const char * const *pkeys_register_names = nullptr; - /* Register number for %fsbase. Set this to -1 to indicate the - absence of segment base registers. */ - int fsbase_regnum = 0; + /* Register number for %fsbase. If supported, set this to a value + >= 0. */ + int fsbase_regnum = -1; /* Target description. */ const struct target_desc *tdesc = nullptr; diff --git a/gdb/infrun.c b/gdb/infrun.c index e0e9ffa..9d3e1b7 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -93,6 +93,8 @@ static void insert_step_resume_breakpoint_at_caller (const frame_info_ptr &); static void insert_longjmp_resume_breakpoint (struct gdbarch *, CORE_ADDR); +static bool maybe_software_singlestep (struct gdbarch *gdbarch); + static void resume (gdb_signal sig); static void wait_for_inferior (inferior *inf); @@ -2357,6 +2359,23 @@ set_schedlock_func (const char *args, int from_tty, struct cmd_list_element *c) process. */ bool sched_multi = false; +/* Try to setup for software single stepping. Return true if target_resume() + should use hardware single step. + + GDBARCH the current gdbarch. */ + +static bool +maybe_software_singlestep (struct gdbarch *gdbarch) +{ + bool hw_step = true; + + if (execution_direction == EXEC_FORWARD + && gdbarch_software_single_step_p (gdbarch)) + hw_step = !insert_single_step_breakpoints (gdbarch); + + return hw_step; +} + /* See infrun.h. */ ptid_t diff --git a/gdb/record-full.c b/gdb/record-full.c index 7d4ef87..7e3da27 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -1105,7 +1105,7 @@ record_full_target::resume (ptid_t ptid, int step, enum gdb_signal signal) record_full_resume_step = 1; } else - step = maybe_software_singlestep (gdbarch); + step = !insert_single_step_breakpoints (gdbarch); } } @@ -1277,7 +1277,7 @@ record_full_wait_1 (struct target_ops *ops, }; reinit_frame_cache (); - step = maybe_software_singlestep (gdbarch); + step = !insert_single_step_breakpoints (gdbarch); } if (record_debug) diff --git a/gprof/configure.ac b/gprof/configure.ac index 94486ed..85502ec 100644 --- a/gprof/configure.ac +++ b/gprof/configure.ac @@ -86,6 +86,7 @@ AC_CACHE_CHECK([whether gprof tests can run], fi]) AM_CONDITIONAL(NATIVE, test "$gprof_cv_sys_native" = "yes") -AC_OUTPUT(Makefile testsuite/Makefile po/Makefile.in:po/Make-in) +AC_CONFIG_FILES([Makefile testsuite/Makefile po/Makefile.in:po/Make-in]) +AC_OUTPUT GNU_MAKE_JOBSERVER diff --git a/ld/ldfile.c b/ld/ldfile.c index 75fd360..e642c7f 100644 --- a/ld/ldfile.c +++ b/ld/ldfile.c @@ -36,7 +36,6 @@ #include "filenames.h" #include <fnmatch.h> #if BFD_SUPPORTS_PLUGINS -#include "plugin-api.h" #include "plugin.h" #endif /* BFD_SUPPORTS_PLUGINS */ diff --git a/ld/ldlang.c b/ld/ldlang.c index 6e31c35..fc7a7d2 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -44,14 +44,10 @@ #include "elf-bfd.h" #include "bfdver.h" #include <errno.h> - #if BFD_SUPPORTS_PLUGINS #include "plugin.h" #endif -/* FIXME: Put it here to avoid NAME conflict from ldgram.h. */ -#include "elf-bfd.h" - #ifndef offsetof #define offsetof(TYPE, MEMBER) ((size_t) & (((TYPE*) 0)->MEMBER)) #endif diff --git a/ld/ldmain.c b/ld/ldmain.c index 67c60c3..13b8e3d 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -42,7 +42,6 @@ #include "ldctor.h" #if BFD_SUPPORTS_PLUGINS #include "plugin.h" -#include "plugin-api.h" #endif /* BFD_SUPPORTS_PLUGINS */ /* Somewhere above, sys/stat.h got included. */ diff --git a/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp b/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp index e23cdc8..a33727f 100644 --- a/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp +++ b/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp @@ -48,6 +48,8 @@ if [istarget "loongarch64-*-*"] { run_dump_test "relax-after-alignment" run_dump_test "relax-medium-call" run_dump_test "relax-medium-call-1" + run_dump_test "relax-sym-size-1" + run_dump_test "relax-sym-size-2" run_dump_test "check_got_relax" } diff --git a/ld/testsuite/ld-loongarch-elf/relax-sym-size-1.d b/ld/testsuite/ld-loongarch-elf/relax-sym-size-1.d new file mode 100644 index 0000000..eec989f --- /dev/null +++ b/ld/testsuite/ld-loongarch-elf/relax-sym-size-1.d @@ -0,0 +1,7 @@ +#source: relax-sym-size-1.s +#ld: +#readelf: -s + +#... + *[0-9]+: [0-9a-z]+ +8 .* _start +#... diff --git a/ld/testsuite/ld-loongarch-elf/relax-sym-size-1.s b/ld/testsuite/ld-loongarch-elf/relax-sym-size-1.s new file mode 100644 index 0000000..c70ac71 --- /dev/null +++ b/ld/testsuite/ld-loongarch-elf/relax-sym-size-1.s @@ -0,0 +1,8 @@ +.p2align 2 +bar: + nop +.globl _start +_start: + la.pcrel $a0, bar + ret +.size _start, . - _start diff --git a/ld/testsuite/ld-loongarch-elf/relax-sym-size-2.d b/ld/testsuite/ld-loongarch-elf/relax-sym-size-2.d new file mode 100644 index 0000000..1388099 --- /dev/null +++ b/ld/testsuite/ld-loongarch-elf/relax-sym-size-2.d @@ -0,0 +1,7 @@ +#source: relax-sym-size-2.s +#ld: +#readelf: -s + +#... + *[0-9]+: [0-9a-z]+ +64 .* _start +#... diff --git a/ld/testsuite/ld-loongarch-elf/relax-sym-size-2.s b/ld/testsuite/ld-loongarch-elf/relax-sym-size-2.s new file mode 100644 index 0000000..e02e16b --- /dev/null +++ b/ld/testsuite/ld-loongarch-elf/relax-sym-size-2.s @@ -0,0 +1,19 @@ +bar: + nop +.p2align 6 + +.reloc ., R_LARCH_ALIGN, 60 +.rept 15 + 1: nop +.endr + la.pcrel $a0, bar + ret + +.reloc ., R_LARCH_ALIGN, 60 +.rept 15 + 2: nop +.endr + +.globl _start +.set _start, 1b +.size _start, 2b - 1b diff --git a/ld/testsuite/ld-plugin/lto-binutils.exp b/ld/testsuite/ld-plugin/lto-binutils.exp index 88d3517..de017f0 100644 --- a/ld/testsuite/ld-plugin/lto-binutils.exp +++ b/ld/testsuite/ld-plugin/lto-binutils.exp @@ -355,3 +355,178 @@ run_cc_link_tests [list \ "tmpdir/libstrip-1b-fat-s.a" \ ] \ ] + +proc run_pr33246_test { llvm fat } { + global srcdir + global subdir + global plug_opt + global llvm_plug_opt + global ar + global CLANG_FOR_TARGET + global CC_FOR_TARGET + global NM + global READELF + global strip + + set strip_flags "--strip-debug --enable-deterministic-archives" + + set test pr33246 + set testname "${test}${llvm}${fat} with $strip_flags" + + if { "$llvm" == "-llvm" } { + # Skip native x32 and i?86 targets since system LLVMgold.so may + # not be compatible with native x32 and i?86 targets binutils. + if { [istarget "x86_64-*-linux*-gnux32"] + || [istarget "i?86-*-*"] + || ![info exists CLANG_FOR_TARGET] + || [string match "" $llvm_plug_opt] } then { + untested $testname + return + } + set CC $CLANG_FOR_TARGET + set binutils_plug_opt "$llvm_plug_opt" + } else { + if { ![info exists CC_FOR_TARGET] + || [string match "" $plug_opt] } then { + untested $testname + return + } + set CC $CC_FOR_TARGET + set binutils_plug_opt "$plug_opt" + } + + append strip_flags " $binutils_plug_opt" + + set src $srcdir/$subdir/${test}.c + set obj tmpdir/${test}${llvm}${fat}.o + set archive tmpdir/${test}${llvm}${fat}.a + set CFLAGS "-c -g -O2 -flto" + if { "$fat" == "-fat" } { + append CFLAGS " -ffat-lto-objects" + } else { + append CFLAGS " -fno-fat-lto-objects" + } + + set cmd "$CC $CFLAGS -o $obj $src" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![string match "" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname ($obj)" + return + } + + set cmd "$strip $strip_flags $obj -o ${obj}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![string match "" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $obj)" + return + } + + set cmd "$NM $binutils_plug_opt ${obj}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![regexp "0+ T foo" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $obj)" + return + } + + if { "$fat" == "-fat" } { + set cmd "$READELF -SW ${obj}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if [regexp " \.debug_" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $obj)" + return + } + } else { + set cmd "cmp $obj ${obj}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![string match "" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $obj)" + return + } + } + + pass "$testname (strip $obj)" + + set cmd "$ar $binutils_plug_opt -D -s -r -c $archive $obj" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![string match "" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname ($archive)" + return + } + + set cmd "$strip $strip_flags $archive -o ${archive}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![string match "" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $archive)" + return + } + + set cmd "$NM $binutils_plug_opt ${archive}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![regexp "0+ T foo" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $archive)" + return + } + + if { "$fat" == "-fat" } { + set cmd "$READELF -SW ${archive}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if [regexp " \.debug_" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $archive)" + return + } + } else { + set cmd "cmp $archive ${archive}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![string match "" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $archive)" + return + } + } + + pass "$testname (strip $archive)" +} + +run_pr33246_test "" "" +run_pr33246_test "" "-fat" +run_pr33246_test "-llvm" "" +run_pr33246_test "-llvm" "-fat" diff --git a/ld/testsuite/ld-plugin/pr33246.c b/ld/testsuite/ld-plugin/pr33246.c new file mode 100644 index 0000000..cd0130c --- /dev/null +++ b/ld/testsuite/ld-plugin/pr33246.c @@ -0,0 +1,4 @@ +void +foo (void) +{ +} diff --git a/libctf/configure.ac b/libctf/configure.ac index 40d00e8..62e6225 100644 --- a/libctf/configure.ac +++ b/libctf/configure.ac @@ -98,12 +98,12 @@ LDFLAGS="-L../bfd -L../libiberty $LDFLAGS" intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'` LIBS="-lbfd -liberty $intl $LIBS" AC_CACHE_CHECK([for ELF support in BFD], ac_cv_libctf_bfd_elf, -[AC_TRY_LINK([#include <stdlib.h> +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h> #include <string.h> #include "bfd.h" - #include "elf-bfd.h"], - [(void) bfd_section_from_elf_index (NULL, 0); - return 0;], + #include "elf-bfd.h"]], + [[(void) bfd_section_from_elf_index (NULL, 0); + return 0;]])], [ac_cv_libctf_bfd_elf=yes], [ac_cv_libctf_bfd_elf=no])]) CFLAGS=$OLD_CFLAGS diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 2ae5626..b072d0b 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,14 @@ +2025-08-06 Matthieu Longo <matthieu.longo@arm.com> + + * testsuite/test-doubly-linked-list.c: disable debug logging on + stdout. + +2025-07-09 Matthieu Longo <matthieu.longo@arm.com> + + * Makefile.in: Add new header. + * testsuite/Makefile.in: Add new test. + * testsuite/test-doubly-linked-list.c: New test. + 2025-05-13 Andreas Schwab <schwab@suse.de> * regex.c (regex_compile): Don't write beyond array bounds when diff --git a/libiberty/testsuite/test-doubly-linked-list.c b/libiberty/testsuite/test-doubly-linked-list.c index 1e1fc63..93fe19a 100644 --- a/libiberty/testsuite/test-doubly-linked-list.c +++ b/libiberty/testsuite/test-doubly-linked-list.c @@ -155,19 +155,26 @@ bool check(const char *op, bool success = true; bool res; - l_print (wrapper->first); +#define DUMP_LIST 0 + + if (DUMP_LIST) + l_print (wrapper->first); + res = run_test (expect, wrapper, false); printf ("%s: test-linked-list::%s: check forward conformity\n", res ? "PASS": "FAIL", op); success &= res; - l_reverse_print (wrapper->last); + if (DUMP_LIST) + l_reverse_print (wrapper->last); + res = run_test (expect, wrapper, true); printf ("%s: test-linked-list::%s: check backward conformity\n", res ? "PASS": "FAIL", op); success &= res; - printf("\n"); + if (DUMP_LIST) + printf("\n"); return success; } diff --git a/opcodes/configure.ac b/opcodes/configure.ac index 783ac2a..675f066 100644 --- a/opcodes/configure.ac +++ b/opcodes/configure.ac @@ -101,10 +101,10 @@ AC_CHECK_DECLS([basename, stpcpy]) # Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do # since sigsetjmp might only be defined as a macro. AC_CACHE_CHECK([for sigsetjmp], gdb_cv_func_sigsetjmp, -[AC_TRY_COMPILE([ +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <setjmp.h> -], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);], -bfd_cv_func_sigsetjmp=yes, bfd_cv_func_sigsetjmp=no)]) +]], [[sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);]])], +[bfd_cv_func_sigsetjmp=yes], [bfd_cv_func_sigsetjmp=no])]) if test $bfd_cv_func_sigsetjmp = yes; then AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ]) fi |