Skip to content
Snippets Groups Projects
  1. Apr 22, 2021
  2. Apr 21, 2021
  3. Apr 01, 2021
  4. 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
  5. Mar 17, 2021
  6. Mar 16, 2021
  7. Feb 21, 2021
  8. 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
  9. Feb 19, 2021
  10. Feb 02, 2021
  11. 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
  12. Jan 05, 2021
  13. Jan 04, 2021
  14. Dec 23, 2020
  15. 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
  16. 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
  17. Nov 26, 2020
  18. 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
  19. Nov 14, 2020
  20. 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
  21. Nov 12, 2020
  22. 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
  23. Nov 10, 2020
  24. 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
  25. Oct 07, 2020
  26. 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
  27. Sep 25, 2020
  28. 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
  29. Sep 09, 2020
  30. Sep 08, 2020
    • Felix Willgerodt's avatar
      floatformat.h: Add bfloat16 support. · 87603e56
      Felix Willgerodt authored
      This change is motivated by a patchset that adds bfloat16 debugging
      support for new avx512 instructions to GDB. The gdb thread can be found
      here: https://sourceware.org/pipermail/gdb-patches/2020-July/170820.html
      
      include:
      2020-08-17  Felix Willgerodt  <felix.willgerodt@intel.com>
      
      	* floatformat.h (floatformat_bfloat16_big): New.
      	(floatformat_bfloat16_little): New.
      
      libiberty:
      2020-08-17  Felix Willgerodt  <felix.willgerodt@intel.com>
      
      	* floatformat.c (floatformat_bfloat16_big): New.
      	(floatformat_bfloat16_little): New.
      87603e56
    • Alan Modra's avatar
      ubsan: d-demangle.c:214 signed integer overflow · fff56ce4
      Alan Modra authored
      Running the libiberty testsuite
      ./test-demangle < libiberty/testsuite/d-demangle-expected
      libiberty/d-demangle.c:214:14: runtime error: signed integer overflow: 922337203 * 10 cannot be represented in type 'long int'
      
      On looking at silencing ubsan, I found a real bug in dlang_number.
      For a 32-bit long, some overflows won't be detected.  For example,
      21474836480.  Why?  Well 214748364 * 10 is 0x7FFFFFF8 (no overflow so
      far).  Adding 8 gives 0x80000000 (which does overflow but there is no
      test for that overflow in the code).  Then multiplying 0x80000000 * 10
      = 0x500000000 = 0 won't be caught by the multiplication overflow test.
      The same holds for a 64-bit long using similarly crafted digit
      sequences.
      
      	* d-demangle.c: Include limits.h.
      	(ULONG_MAX, UINT_MAX): Provide fall-back definition.
      	(dlang_number): Simplify and correct overflow test.  Only
      	write *ret on returning non-NULL.  Make "ret" an unsigned long*.
      	Only succeed for result of [0,UINT_MAX].
      	(dlang_decode_backref): Simplify and correct overflow test.
      	Only write *ret on returning non-NULL.  Only succeed for
      	result [1,MAX_LONG].
      	(dlang_backref): Remove now unnecessary range check.
      	(dlang_symbol_name_p): Likewise.
      	(string_need): Take a size_t n arg, and use size_t tem.
      	(string_append): Use size_t n.
      	(string_appendn, string_prependn): Take a size_t n arg.
      	(TEMPLATE_LENGTH_UNKNOWN): Define as -1UL.
      	(dlang_lname, dlang_parse_template): Take an unsigned long len
      	arg.
      	(dlang_symbol_backref, dlang_identifier, dlang_parse_integer),
      	(dlang_parse_integer, dlang_parse_string),
      	(dlang_parse_arrayliteral, dlang_parse_assocarray),
      	(dlang_parse_structlit, dlang_parse_tuple),
      	(dlang_template_symbol_param, dlang_template_args): Use
      	unsigned long variables.
      	* testsuite/d-demangle-expected: Add new tests.
      fff56ce4
  31. Aug 27, 2020
  32. Aug 26, 2020
    • Iain Buclaw's avatar
      libiberty: Add support for `in' and `in ref' storage classes. · 387d0773
      Iain Buclaw authored
      The storage class `in' is now a first-class citizen with its own mangle
      symbol, of which also permits `in ref'.  Previously, `in' was an alias
      to `const [scope]', which is a type constructor.
      
      The mangle symbol repurposed for this is `I', which was originally used
      by identifier types.  However, while TypeIdentifier is part of the
      grammar, it must be resolved to some other entity during the semantic
      passes, and so shouldn't appear anywhere in the mangled name.
      
      Old tests that are now no longer valid have been removed.
      
      libiberty/ChangeLog:
      
      	* d-demangle.c (dlang_function_args): Handle 'in' and 'in ref'
      	parameter storage classes.
      	(dlang_type): Remove identifier type.
      	* testsuite/d-demangle-expected: Update tests.
      387d0773
  33. Aug 04, 2020
  34. Aug 03, 2020
    • Richard Biener's avatar
      lto/96385 - avoid unused global UNDEFs in debug objects · b32c5d0b
      Richard Biener authored
      Unused global UNDEFs can have side-effects in some circumstances so
      the following patch avoids them by treating them the same as other
      to be discarded DEFs - make them local.
      
      2020-08-03  Richard Biener  <rguenther@suse.de>
      
      	PR lto/96385
      libiberty/
      	* simple-object-elf.c
      	(simple_object_elf_copy_lto_debug_sections): Localize global
      	UNDEFs and reuse the prevailing name.
      b32c5d0b
Loading