Skip to content
Snippets Groups Projects
  1. May 07, 2021
  2. May 06, 2021
    • Tom Tromey's avatar
      libiberty: add htab_eq_string · 77380c68
      Tom Tromey authored
      The libiberty hash table includes a helper function for strings, but
      no equality function.  Consequently, this equality function has been
      reimplemented a number of times in both the gcc and binutils-gdb
      source trees.  This patch adds the function to the libiberty hash
      table, as a step toward the goal of removing all the copies.
      
      One change to gcc is included here.  Normally I would have put this in
      the next patch, but gensupport.c used the most natural name for its
      reimplementation of this function, and this can't coexist with the
      extern function in libiberty.
      
      include
      
      	* hashtab.h (htab_eq_string): Declare.
      
      libiberty
      
      	* hashtab.c (htab_eq_string): New function.
      
      gcc
      
      	* gensupport.c (htab_eq_string): Remove.
      
      
      77380c68
  3. May 05, 2021
  4. May 04, 2021
    • Eric Botcazou's avatar
      Fix libiberty link failures in LTO mode for MinGW · f418bc3c
      Eric Botcazou authored
      The test for the presence of variables (really symbols) does not work
      when you add -Ox -flto to CFLAGS:
      
        for v in $vars; do
          AC_MSG_CHECKING([for $v])
          AC_CACHE_VAL(libiberty_cv_var_$v,
            [AC_LINK_IFELSE([AC_LANG_PROGRAM([[int *p;]],[[extern int $v [];
                                               p = $v;]])],
                            [eval "libiberty_cv_var_$v=yes"],
                            [eval "libiberty_cv_var_$v=no"])])
          if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then
            AC_MSG_RESULT(yes)
            AC_DEFINE_UNQUOTED($n)
          else
            AC_MSG_RESULT(no)
          fi
        done
      
      because the assignment to 'p' is optimized away by LTO.  This is visible
      on MinGW platforms in the form of a link failure for sys_siglist.
      
      There is another link failures for stpcpy: the symbol is both referenced
      by libiberty's pex-win32.c and provided by libiberty's stpcpy.c, so it
      needs to have a linkage to be resolved in LTO mode.
      
      libiberty/
      	* configure.ac: Make test for variables more robust.
      	* configure: Regenerate.
      gcc/
      	* builtins.c (builtin_with_linkage_p): Return true for stp[n]cpy.
      	* symtab.c (symtab_node::output_to_lto_symbol_table_p): Tidy up.
      f418bc3c
    • GCC Administrator's avatar
      Daily bump. · e690396d
      GCC Administrator authored
      e690396d
  5. May 03, 2021
    • H.J. Lu's avatar
      GCC_CET_HOST_FLAGS: Check if host supports multi-byte NOPs · fd7eb4bc
      H.J. Lu authored
      Sync with binutils for PR binutils/27397.  Check if host supports
      multi-byte NOPs before enabling CET on host.
      
      config/
      
      	PR bootstrap/99703
      	* cet.m4 (GCC_CET_HOST_FLAGS): Check if host supports multi-byte
      	NOPs.
      
      libiberty/
      
      	PR bootstrap/99703
      	* configure: Regenerated.
      fd7eb4bc
  6. Apr 22, 2021
  7. Apr 21, 2021
  8. Apr 01, 2021
  9. Mar 31, 2021
    • Patrick Palka's avatar
      c++: Adjust mangling of __alignof__ [PR88115] · a3bf6ce7
      Patrick Palka authored
      r11-4926 made __alignof__ get mangled differently from alignof,
      encoding __alignof__ as a vendor extended operator.  But this
      mangling is problematic for the reasons mentioned in
      https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88115#c6.
      
      This patch changes our mangling of __alignof__ to instead use the
      new "vendor extended expression" syntax that's proposed in
      https://github.com/itanium-cxx-abi/cxx-abi/issues/112.  Clang does
      the same thing already, so after this patch Clang and GCC agree
      about the mangling of __alignof__(type) and __alignof__(expr).
      
      gcc/cp/ChangeLog:
      
      	PR c++/88115
      	* mangle.c (write_expression): Adjust the mangling of
      	__alignof__.
      
      include/ChangeLog:
      
      	PR c++/88115
      	* demangle.h (enum demangle_component_type): Add
      	DEMANGLE_COMPONENT_VENDOR_EXPR.
      
      libiberty/ChangeLog:
      
      	PR c++/88115
      	* cp-demangle.c (d_dump, d_make_comp, d_expression_1)
      	(d_count_templates_scopes): Handle DEMANGLE_COMPONENT_VENDOR_EXPR.
      	(d_print_comp_inner): Likewise.
      	<case DEMANGLE_COMPONENT_EXTENDED_OPERATOR>: Revert r11-4926
      	change.
      	<case DEMANGLE_COMPONENT_UNARY>: Likewise.
      	* testsuite/demangle-expected: Adjust __alignof__ tests.
      
      gcc/testsuite/ChangeLog:
      
      	PR c++/88115
      	* g++.dg/cpp0x/alignof7.C: Adjust expected mangling.
      a3bf6ce7
  10. Mar 17, 2021
  11. Mar 16, 2021
  12. Feb 21, 2021
  13. Feb 20, 2021
    • Mike Frysinger's avatar
      libiberty: autogenerate aclocal.m4 · 470beb92
      Mike Frysinger authored
      Move custom macros to acinclude.m4 so we can autogenerate aclocal.m4
      with aclocal.  This matches every other project in the tree.
      
      libiberty/ChangeLog:
      
      	* Makefile.in (ACLOCAL, ACLOCAL_AMFLAGS, $(srcdir)/aclocal.m4): Define.
      	(configure_deps): Rename to ...
      	(aclocal_deps): ... this.  Replace aclocal.m4 with acinclude.m4.
      	($(srcdir)/configure): Replace $(configure_deps) with
      	$(srcdir)/aclocal.m4.
      	* aclocal.m4: Move libiberty macros to acinclude.m4, then regenerate.
      	* acinclude.m4: New file.
      	* configure: Regenerate.
      470beb92
    • GCC Administrator's avatar
      Daily bump. · 50352c6c
      GCC Administrator authored
      50352c6c
  14. Feb 19, 2021
  15. Feb 02, 2021
  16. Feb 01, 2021
    • Martin Sebor's avatar
      Avoid -Wstringop-truncation. · 445d6db6
      Martin Sebor authored
      libiberty/ChangeLog:
      
      	* dyn-string.c (dyn_string_insert_cstr): Use memcpy instead of strncpy
      	to avoid -Wstringop-truncation.
      445d6db6
  17. Jan 05, 2021
  18. Jan 04, 2021
  19. Dec 23, 2020
  20. Dec 22, 2020
    • Jason Merrill's avatar
      c++: Fix demangling of <unresolved-name> · 58fb912c
      Jason Merrill authored
      The ABI for unresolved scoped names on the RHS of . and -> used to be
      
        sr <type> <unqualified-id>
      
      That changed years ago to something more complex, but G++ was never updated.
      This change was particularly incompatible for simple qualified-ids like
      A::x, which were previously mangled as sr1A1x, and now sr1AE1x.
      
      This obviously makes life hard for demanglers, which can't know whether to
      consume that E or not.  To work around this, we now try demangling with the
      newer ABI, and if that fails and we saw an "sr", try again with the older
      ABI.
      
      libiberty/ChangeLog:
      
      	PR c++/67343
      	* cp-demangle.h (struct d_info): Add unresolved_name_state.
      	* cp-demangle.c (d_prefix): Add subst parm.
      	(d_nested_name): Pass it.
      	(d_unresolved_name): Split out from...
      	(d_expression_1): ...here.
      	(d_demangle_callback): Maybe retry with old sr mangling.
      	* testsuite/demangle-expected: Add test.
      58fb912c
    • GCC Administrator's avatar
      Daily bump. · 1a5e728a
      GCC Administrator authored
      1a5e728a
  21. Dec 21, 2020
    • Jason Merrill's avatar
      c++: Fix demangling of qualified-id after '.' · 8cd42d3c
      Jason Merrill authored
      The demangler was assuming that only an unqualified-id could appear after
      . or ->.
      
      libiberty/ChangeLog:
      
      	* cp-demangle.c (d_expression_1): Recognize qualified-id
      	on RHS of dt/pt.
      	* testsuite/demangle-expected: Add test.
      8cd42d3c
    • Jason Merrill's avatar
      c++: Fix demangling of x.operator type · 71690493
      Jason Merrill authored
      d_operator_name decides whether "cv" indicates a cast or a conversion
      operator based on is_expression.  "on" specifies that we want the conversion
      operator.
      
      libiberty/ChangeLog:
      
      	* cp-demangle.c (d_unqualified_name): Clear is_expression.
      	* testsuite/demangle-expected: Add tests.
      71690493
  22. Nov 26, 2020
  23. Nov 25, 2020
    • Matthew Malcomson's avatar
      libsanitizer: Add option to bootstrap using HWASAN · 170e618e
      Matthew Malcomson authored
      This is an analogous option to --bootstrap-asan to configure.  It allows
      bootstrapping GCC using HWASAN.
      
      For the same reasons as for ASAN we have to avoid using the HWASAN
      sanitizer when compiling libiberty and the lto-plugin.
      
      Also add a function to query whether -fsanitize=hwaddress has been
      passed.
      
      ChangeLog:
      
      	* configure: Regenerate.
      	* configure.ac: Add --bootstrap-hwasan option.
      
      config/ChangeLog:
      
      	* bootstrap-hwasan.mk: New file.
      
      gcc/ChangeLog:
      
      	* doc/install.texi: Document new option.
      
      libiberty/ChangeLog:
      
      	* configure: Regenerate.
      	* configure.ac: Avoid using sanitizer.
      
      lto-plugin/ChangeLog:
      
      	* Makefile.am: Avoid using sanitizer.
      	* Makefile.in: Regenerate.
      170e618e
  24. Nov 14, 2020
  25. Nov 13, 2020
    • Eduard-Mihai Burtescu's avatar
      libiberty: Support the new ("v0") mangling scheme in rust-demangle · 84096498
      Eduard-Mihai Burtescu authored
      This is the libiberty (mainly for binutils/gdb) counterpart of
      https://github.com/alexcrichton/rustc-demangle/pull/23.
      
      Relevant links for the new Rust mangling scheme (aka "v0"):
      * Rust RFC: https://github.com/rust-lang/rfcs/pull/2603
      * tracking issue: https://github.com/rust-lang/rust/issues/60705
      * implementation: https://github.com/rust-lang/rust/pull/57967
      
      This implementation includes full support for UTF-8 identifiers
      via punycode, so I've included a testcase for that as well.
      
      libiberty/ChangeLog:
      	* rust-demangle.c (struct rust_demangler): Add
      	skipping_printing and bound_lifetime_depth fields.
      	(eat): Add (v0-only).
      	(parse_integer_62): Add (v0-only).
      	(parse_opt_integer_62): Add (v0-only).
      	(parse_disambiguator): Add (v0-only).
      	(struct rust_mangled_ident): Add punycode{,_len} fields.
      	(parse_ident): Support v0 identifiers.
      	(print_str): Respect skipping_printing.
      	(print_uint64): Add (v0-only).
      	(print_uint64_hex): Add (v0-only).
      	(print_ident): Respect skipping_printing,
      	Support v0 identifiers.
      	(print_lifetime_from_index): Add (v0-only).
      	(demangle_binder): Add (v0-only).
      	(demangle_path): Add (v0-only).
      	(demangle_generic_arg): Add (v0-only).
      	(demangle_type): Add (v0-only).
      	(demangle_path_maybe_open_generics): Add (v0-only).
      	(demangle_dyn_trait): Add (v0-only).
      	(demangle_const): Add (v0-only).
      	(demangle_const_uint): Add (v0-only).
      	(basic_type): Add (v0-only).
      	(rust_demangle_callback): Support v0 symbols.
      	* testsuite/rust-demangle-expected: Add v0 testcases.
      84096498
    • Seija Kijin's avatar
      Make strstr.c in libiberty ANSI compliant · 16b00dc6
      Seija Kijin authored
      libiberty/
      
      	* strstr.c (strstr): Make implementation ANSI/POSIX compliant.
      16b00dc6
  26. Nov 12, 2020
  27. Nov 11, 2020
    • Patrick Palka's avatar
      c++: Change the mangling of __alignof__ [PR88115] · b1c9b3c3
      Patrick Palka authored
      This patch changes the mangling of __alignof__ to v111__alignof__,
      making its mangling distinct from that of alignof(type) and
      alignof(expr).
      
      How we mangle ALIGNOF_EXPR now depends on its ALIGNOF_EXPR_STD_P flag,
      which after the previous patch gets consistently set for alignof(type)
      as well as alignof(expr).
      
      gcc/c-family/ChangeLog:
      
      	PR c++/88115
      	* c-opts.c (c_common_post_options): Update latest_abi_version.
      
      gcc/ChangeLog:
      
      	PR c++/88115
      	* common.opt (-fabi-version): Document =15.
      	* doc/invoke.texi (C++ Dialect Options): Likewise.
      
      gcc/cp/ChangeLog:
      
      	PR c++/88115
      	* mangle.c (write_expression): Mangle __alignof_ differently
      	from alignof when the ABI version is at least 15.
      
      libiberty/ChangeLog:
      
      	PR c++/88115
      	* cp-demangle.c (d_print_comp_inner)
      	<case DEMANGLE_COMPONENT_EXTENDED_OPERATOR>: Don't print the
      	"operator " prefix for __alignof__.
      	<case DEMANGLE_COMPONENT_UNARY>: Always print parens around the
      	operand of __alignof__.
      	* testsuite/demangle-expected: Test demangling for __alignof__.
      
      gcc/testsuite/ChangeLog:
      
      	PR c++/88115
      	* g++.dg/abi/macro0.C: Adjust.
      	* g++.dg/cpp0x/alignof7.C: New test.
      	* g++.dg/cpp0x/alignof8.C: New test.
      b1c9b3c3
  28. Nov 10, 2020
  29. Nov 09, 2020
    • Christophe Lyon's avatar
      libiberty/pex-win32.c: Initialize orig_err · 946b73c1
      Christophe Lyon authored
      Initializing orig_err avoids a warning: "may be used uninitialized".
      See 97108.
      
      2020-09-14  Torbjörn SVENSSON <torbjorn.svensson@st.com>
      	Christophe Lyon  <christophe.lyon@linaro.org>
      
      	libiberty/
      	* pex-win32.c (pex_win32_exec_child): Initialize orig_err.
      946b73c1
  30. Oct 07, 2020
  31. Oct 06, 2020
    • Martin Liska's avatar
      lto: fix LTO debug sections copying. · 190c04ba
      Martin Liska authored
      readelf -S prints:
      
      There are 81999 section headers, starting at offset 0x1f488060:
      
      Section Headers:
        [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
        [ 0]                   NULL            0000000000000000 000000 01404f 00     81998   0  0
        [ 1] .group            GROUP           0000000000000000 000040 000008 04     81995 105027  4
      ...
        [81995] .symtab           SYMTAB          0000000000000000 d5d9298 2db310 18     81997 105026  8
        [81996] .symtab_shndx     SYMTAB SECTION INDICES 0000000000000000 d8b45a8 079dd8 04     81995   0  4
        [81997] .strtab           STRTAB          0000000000000000 d92e380 80460c 00      0   0  1
      ...
      
      Looking at the documentation:
      Table 7–15 ELF sh_link and sh_info Interpretation
      
      sh_type - sh_link
      SHT_SYMTAB - The section header index of the associated string table.
      SHT_SYMTAB_SHNDX - The section header index of the associated symbol table.
      
      As seen, sh_link of a SHT_SYMTAB always points to a .strtab and readelf
      confirms that.
      
      So we need to use reverse mapping taken from
        [81996] .symtab_shndx     SYMTAB SECTION INDICES 0000000000000000 d8b45a8 079dd8 04     81995   0  4
      
      where sh_link points to 81995.
      
      libiberty/ChangeLog:
      
      	PR lto/97290
      	* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
      	Use sh_link of a .symtab_shndx section.
      190c04ba
  32. Sep 25, 2020
  33. Sep 24, 2020
    • Mark Wielaard's avatar
      libiberty: Add get_DW_UT_name and update include/dwarf2.{def,h} · 942ab9e9
      Mark Wielaard authored
      This adds a get_DW_UT_name function to dwarfnames using dwarf2.def
      for use in binutils readelf to show the unit types in a DWARF5 header.
      
      Also remove DW_CIE_VERSION which was already removed in binutils/gdb
      and is not used in gcc.
      
      include/ChangeLog:
      
      	* dwarf2.def: Add DWARF5 Unit type header encoding macros
      	DW_UT_FIRST, DW_UT and DW_UT_END.
      	* dwarf2.h (enum dwarf_unit_type): Removed and define using
      	DW_UT_FIRST, DW_UT and DW_UT_END macros.
      	(DW_CIE_VERSION): Removed.
      	(get_DW_UT_name): New function declaration.
      
      libiberty/ChangeLog:
      
      	* dwarfnames.c (get_DW_UT_name): Define using DW_UT_FIRST, DW_UT
      	and DW_UT_END.
      942ab9e9
  34. Sep 09, 2020
Loading