]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
2 years agoAutomatic date update in version.in
GDB Administrator [Mon, 22 Aug 2022 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Sun, 21 Aug 2022 00:05:27 +0000 (00:05 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Sat, 20 Aug 2022 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Fri, 19 Aug 2022 00:00:59 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Thu, 18 Aug 2022 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Wed, 17 Aug 2022 00:01:16 +0000 (00:01 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Tue, 16 Aug 2022 00:01:06 +0000 (00:01 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Mon, 15 Aug 2022 00:00:47 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Sun, 14 Aug 2022 00:00:47 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Sat, 13 Aug 2022 00:00:32 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Fri, 12 Aug 2022 00:00:53 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoPR29466, APP/NO_APP with .linefile
Alan Modra [Thu, 11 Aug 2022 00:21:03 +0000 (09:51 +0930)] 
PR29466, APP/NO_APP with .linefile

Commit 53f2b36a54b9 exposed a bug in sb_scrub_and_add_sb that could
result in losing input.  If scrubbing results in expansion past the
holding capacity of do_scrub_chars output buffer, then do_scrub_chars
stashes the extra input for the next call.  That call never came
because sb_scrub_and_add_sb wrongly decided it was done.  Fix that by
allowing sb_scrub_and_add_sb to see whether there is pending input.
Also allow a little extra space so that in most cases we won't need
to resize the output buffer.

sb_scrub_and_add_sb also limited output to the size of the input,
rather than the actual output buffer size.  Fixing that resulted in a
fail of gas/testsuite/macros/dot with an extra warning: "end of file
not at end of a line; newline inserted".  OK, so the macro in dot.s
really does finish without end-of-line.  Apparently the macro
expansion code relied on do_scrub_chars returning early.  So fix that
too by adding a newline if needed in macro_expand_body.

PR 29466
* app.c (do_scrub_pending): New function.
* as.h: Declare it.
* input-scrub.c (input_scrub_include_sb): Add extra space for
two .linefile directives.
* sb.c (sb_scrub_and_add_sb): Take into account pending input.
Allow output to max.
* macro.c (macro_expand_body): Add terminating newline.
* testsuite/config/default.exp (SIZE, SIZEFLAGS): Define.
* testsuite/gas/macros/app5.d,
* testsuite/gas/macros/app5.s: New test.
* testsuite/gas/macros/macros.exp: Run it.

(cherry picked from commit 4d74aab7aa562fe79d4669cdad0c32610531cbc0)

2 years agoAutomatic date update in version.in
GDB Administrator [Thu, 11 Aug 2022 00:00:56 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoPR29462, internal error in relocate, at powerpc.cc:10796
Alan Modra [Wed, 10 Aug 2022 01:08:52 +0000 (10:38 +0930)] 
PR29462, internal error in relocate, at powerpc.cc:10796

Prior to the inline plt call support (commit 08be322439), the only
local syms with plt entries were local ifunc symbols.  There shouldn't
be stubs for other local symbols so don't look for them.  The patch
also fixes minor bugs in get_reference_flags; Many relocs are valid
only for ppc64 and a couple only for ppc32.

PR 29462
* powerpc.cc (Target_powerpc::Relocate::relocate): Rename
use_plt_offset to pltcal_to_direct, invert logic.  For relocs
not used with inline plt sequences against local symbols, only
look for stubs when the symbol is an ifunc.
(Target_powerpc::Scan::get_reference_flags): Correct reloc
handling for relocs not valid for both 32-bit and 64-bit.

(cherry picked from commit 6158b25f77db11712b84e6a4609898f2615ac749)

2 years agogas/Dwarf: properly skip zero-size functions
Jan Beulich [Wed, 10 Aug 2022 08:34:22 +0000 (10:34 +0200)] 
gas/Dwarf: properly skip zero-size functions

PR gas/29451

While out_debug_abbrev() properly skips such functions, out_debug_info()
mistakenly didn't. It needs to calculate the high_pc expression ahead of
time, in order to skip emitting any data for the function if the value
is zero.

The one case which would still leave a zero-size entry is when
symbol_get_obj(symp)->size ends up evaluating to zero. I hope we can
expect that to not be the case, otherwise we'd need to have a way to
post-process .debug_info contents between resolving expressions and
actually writing the data out to the file. Even then it wouldn't be
entirely obvious in which way to alter the data.

(cherry picked from commit d7abcbcea5ddd40a3bf28758b62f35933c59f996)

2 years agoAutomatic date update in version.in
GDB Administrator [Wed, 10 Aug 2022 00:00:48 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Tue, 9 Aug 2022 00:01:01 +0000 (00:01 +0000)] 
Automatic date update in version.in

2 years agold: fix NEWS typos
Martin Liska [Mon, 8 Aug 2022 11:22:26 +0000 (13:22 +0200)] 
ld: fix NEWS typos

ld/ChangeLog:

* NEWS: Fix 2 typos.

2 years agoAutomatic date update in version.in
GDB Administrator [Mon, 8 Aug 2022 00:00:34 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Sun, 7 Aug 2022 00:00:49 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Sat, 6 Aug 2022 00:00:40 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoreset development to true. update version number
Nick Clifton [Fri, 5 Aug 2022 13:02:43 +0000 (14:02 +0100)] 
reset development to true.  update version number

2 years agoRestore accidentally deleted version.texi file binutils-2_39
Nick Clifton [Fri, 5 Aug 2022 10:29:10 +0000 (11:29 +0100)] 
Restore accidentally deleted version.texi file

2 years agorestore allocfail.sh
Nick Clifton [Fri, 5 Aug 2022 10:27:52 +0000 (11:27 +0100)] 
restore allocfail.sh

2 years agoThis is the 2.39 release
Nick Clifton [Fri, 5 Aug 2022 10:26:37 +0000 (11:26 +0100)] 
This is the 2.39 release

2 years agoThis is the 2.39 release
Nick Clifton [Fri, 5 Aug 2022 10:07:32 +0000 (11:07 +0100)] 
This is the 2.39 release

2 years agoAutomatic date update in version.in
GDB Administrator [Fri, 5 Aug 2022 00:00:49 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Thu, 4 Aug 2022 00:00:45 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agogprofng: fix bug 29410 - Argument " 0." isn't numeric in numeric gt (>)
Ruud van der Pas [Tue, 2 Aug 2022 17:13:48 +0000 (10:13 -0700)] 
gprofng: fix bug 29410 - Argument " 0." isn't numeric in numeric gt (>)

gprofng/Changelog:
2022-08-02  Ruud van der Pas  <ruud.vanderpas@oracle.com>

PR gprofng/29410
* gp-display-html/gp-display-html.in: Remove non-breaking spaces.

2 years agoAutomatic date update in version.in
GDB Administrator [Wed, 3 Aug 2022 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agold: aarch64: Update test linker scripts relocs.ld and relocs-ilp32.ld
Matthew Malcomson [Tue, 2 Aug 2022 11:12:26 +0000 (12:12 +0100)] 
ld: aarch64: Update test linker scripts relocs.ld and relocs-ilp32.ld

The updates are to ensure that the .data section exists.  This means
that we always have a data section.  That means that we don't create a
RWX segment and avoid the corresponding warning.

We get this warning when testing aarch64-none-elf with -mcmodel=tiny.
N.b. this changes quite a few testcases from fail to pass.

2 years agoAutomatic date update in version.in
GDB Administrator [Tue, 2 Aug 2022 00:00:48 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agolibctf: Avoid use of uninitialised variables
Alan Modra [Sun, 31 Jul 2022 13:21:55 +0000 (22:51 +0930)] 
libctf: Avoid use of uninitialised variables

* ctf-link.c (ctf_link_add_ctf_internal): Don't free uninitialised
pointers.

(cherry picked from commit 9ea6fffe1ebec9bd1929c708e044b765eabea258)

3 years agoPR29348, BFD_VMA_FMT wrong
Alan Modra [Sun, 31 Jul 2022 09:55:32 +0000 (19:25 +0930)] 
PR29348, BFD_VMA_FMT wrong

There is a problem with my commit 0e3c1eebb2, which replaced
bfd_uint64_t with uint64_t: Some hosts typedef int64_t to long long
even when long is the same size as long long.  That confuses the code
choosing one of "l", "ll", or "I64" for BFD_VMA_FMT, and results in
warnings.

Write a direct configure test for the printf int64_t style instead.
This removes the last use of BFD_HOST_64BIT_LONG, so delete that.
Note that the changes to configure.com are pure guesswork.

PR 29348
* bfd-in.h (BFD_HOST_64BIT_LONG): Don't define.
(BFD_VMA_FMT): Define using BFD_INT64_FMT when 64-bit.
(bfd_vma, bfd_signed_vma): Move comments to 64-bit typedefs.
* configure.ac (BFD_HOST_64BIT_LONG): Delete.
(BFD_INT64_FMT): New config test.
* configure.com: Update similarly.
* Makefile.in: Regenerate.
* bfd-in2.h: Regenerate.
* configure: Regenerate.

(cherry picked from commit 1a5178fe284547ef2abd8ae66588c9999d61c524)

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 1 Aug 2022 00:00:46 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 31 Jul 2022 00:00:35 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 30 Jul 2022 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoStop the linker from complaining about unrecognized DW_FORM_rnglistx and DW_FORM_locl...
Nick Clifton [Fri, 29 Jul 2022 12:00:09 +0000 (13:00 +0100)] 
Stop the linker from complaining about unrecognized DW_FORM_rnglistx and DW_FORM_loclistx attribute formats.

PR 29424
* dwarf2.c (read_attribute_value): Handle DW_FORM_rnglistx and
DW_FORM_loclistx.

3 years agold: Extend ac_default_ld_warn_rwx_segments to all SPARC targets [PR29411]
Rainer Orth [Fri, 29 Jul 2022 07:04:59 +0000 (09:04 +0200)] 
ld: Extend ac_default_ld_warn_rwx_segments to all SPARC targets [PR29411]

As discussed in PR ld/29411, the ld warning

[...] has a LOAD segment with RWX permissions

needs to be disabled on all SPARC targets, not just Solaris/SPARC: the
.plt section is required to be RWX by the 32-bit SPARC ELF psABI and the
64-bit SPARC Compliance Definition 2.4.1.  Given that ld only supports
SPARC ELF targets, this patch implements this.

Tested on sparc64-unknown-linux-gnu and sparc-sun-solaris2.11.

2022-07-28  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

ld:
PR ld/29411
* configure.tgt (ac_default_ld_warn_rwx_segments): Extend to all
sparc targets.  Expand comment.

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 29 Jul 2022 00:00:47 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 28 Jul 2022 00:00:53 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 27 Jul 2022 00:01:35 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agogprofng: check for the makeinfo version
Vladimir Mezentsev [Tue, 26 Jul 2022 06:57:46 +0000 (23:57 -0700)] 
gprofng: check for the makeinfo version

gprofng/ChangeLog
2022-07-25  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

PR gprofng/29368
* configure.ac: Check for the makeinfo version.
* configure: Rebuild.

3 years agoStop the linker from complaining about RWX segments on sparc-solaris targets.
Nick Clifton [Tue, 26 Jul 2022 13:31:13 +0000 (14:31 +0100)] 
Stop the linker from complaining about RWX segments on sparc-solaris targets.

PR 29411
* configure.tgt (ac_default_ld_warn_rwx_segments): Disable for
sparc-solaris configurations.

3 years agoPowerPC32 ld test fails with --enable-targets=all
Alan Modra [Tue, 26 Jul 2022 12:31:39 +0000 (22:01 +0930)] 
PowerPC32 ld test fails with --enable-targets=all

Three pppc32 ld tests fail when spu support is included in the linker
due to this snippet in ld/emulparams/elf32ppc.sh.

if grep -q 'ld_elf32_spu_emulation' ldemul-list.h; then
  DATA_START_SYMBOLS="${RELOCATING+*crt1.o(.data .data.* .gnu.linkonce.d.*)
    PROVIDE (__spe_handle = .);
    *(.data.spehandle)
    . += 4 * (DEFINED (__spe_handle) || . != 0);}"
fi

* testsuite/ld-powerpc/tlsexe32.r: Pass with .data section present.
* testsuite/ld-powerpc/tlsexe32no.r: Likewise.
* testsuite/ld-powerpc/tlsso32.r: Likewise.

(cherry picked from commit c138af95731c630a78329fd86076992f82099957)

3 years agoUpdated translations for various sub-directories
Nick Clifton [Tue, 26 Jul 2022 12:11:59 +0000 (13:11 +0100)] 
Updated translations for various sub-directories

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 26 Jul 2022 00:00:32 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agogprofng: fix bug 29356 - Execution fails if gprofng is not included in PATH
Ruud van der Pas [Fri, 22 Jul 2022 13:15:12 +0000 (06:15 -0700)] 
gprofng: fix bug 29356 - Execution fails if gprofng is not included in PATH

gprofng/Changelog:
2022-07-22  Ruud van der Pas  <ruud.vanderpas@oracle.com>

PR gprofng/29356
* gp-display-html/gp-display-html.in: fixed a problem to execute
gp-display-text in case gprofng is not included in the search
path.

3 years agogprofng: fix bug 29392 - Unexpected line format in summary file
Ruud van der Pas [Fri, 22 Jul 2022 12:59:17 +0000 (05:59 -0700)] 
gprofng: fix bug 29392 - Unexpected line format in summary file

gprofng/Changelog:
2022-07-22  Ruud van der Pas  <ruud.vanderpas@oracle.com>

PR gprofng/29392
* gp-display-html/gp-display-html.in: modified a regex, plus the
code to handle the results; renamed a variable to improve the
consistency in naming.

3 years agogprofng: fix bug 29353 - Fix a lay-out issue in the html disassembly files
Ruud van der Pas [Fri, 22 Jul 2022 13:21:49 +0000 (06:21 -0700)] 
gprofng: fix bug 29353 - Fix a lay-out issue in the html disassembly files

gprofng/Changelog:
2022-07-22  Ruud van der Pas  <ruud.vanderpas@oracle.com>

PR gprofng/29353
* gp-display-html/gp-display-html.in: fixed a problem in the
generation of html for the disassembly where instructions
without arguments were not handled correctly.

3 years agogprofng: fix bug 29352 - Fix the message Hexadecimal number > 0xffffffff non-portable
Ruud van der Pas [Fri, 22 Jul 2022 13:27:41 +0000 (06:27 -0700)] 
gprofng: fix bug 29352 - Fix the message Hexadecimal number > 0xffffffff non-portable

gprofng/Changelog:
2022-07-22  Ruud van der Pas  <ruud.vanderpas@oracle.com>

PR gprofng/29352
* gp-display-html/gp-display-html.in: the hex subroutine from
the bigint module is now used.

3 years agogprofng: fix bug 29351 - Move dynamic loading of modules to a later stage
Ruud van der Pas [Fri, 22 Jul 2022 13:32:51 +0000 (06:32 -0700)] 
gprofng: fix bug 29351 - Move dynamic loading of modules to a later stage

gprofng/Changelog:
2022-07-22  Ruud van der Pas  <ruud.vanderpas@oracle.com>

PR gprofng/29351
* gp-display-html/gp-display-html.in: the dynamic loading of
modules occurred too early, resulting in the generation of the
man page to fail in case a module is missing; the loading part is
now done somewhat later in the execution to avoid this problem.

3 years agox86: Disallow invalid relocations against protected symbols
H.J. Lu [Tue, 19 Jul 2022 01:24:26 +0000 (18:24 -0700)] 
x86: Disallow invalid relocations against protected symbols

Since glibc 2.36 will issue warnings for copy relocation against
protected symbols and non-canonical reference to canonical protected
functions, change the linker to always disallow such relocations.

bfd/

* elf32-i386.c (elf_i386_scan_relocs): Remove check for
elf_has_indirect_extern_access.
* elf64-x86-64.c (elf_x86_64_scan_relocs): Likewise.
(elf_x86_64_relocate_section): Remove check for
elf_has_no_copy_on_protected.
* elfxx-x86.c (elf_x86_allocate_dynrelocs): Check for building
executable instead of elf_has_no_copy_on_protected.
(_bfd_x86_elf_adjust_dynamic_symbol): Disallow copy relocation
against non-copyable protected symbol.
* elfxx-x86.h (SYMBOL_NO_COPYRELOC): Remove check for
elf_has_no_copy_on_protected.

ld/

* testsuite/ld-i386/i386.exp: Expect linker error for PR ld/17709
test.
* testsuite/ld-i386/pr17709.rd: Removed.
* testsuite/ld-i386/pr17709.err: New file.
* testsuite/ld-x86-64/pr17709.rd: Removed.
* testsuite/ld-x86-64/pr17709.err: New file.
* testsuite/ld-x86-64/pr28875-func.err: Updated.
* testsuite/ld-x86-64/x86-64.exp: Expect linker error for PR
ld/17709 test.  Add tests for function pointer against protected
function.

(cherry picked from commit f638657759f5b9b4eb31a1aa6b9fe6e6fb01f4a0)

3 years agox86: Make protected symbols local for -shared
Fangrui Song [Sat, 25 Jun 2022 17:44:26 +0000 (10:44 -0700)] 
x86: Make protected symbols local for -shared

Call _bfd_elf_symbol_refs_local_p with local_protected==true.  This has
2 noticeable effects for -shared:

* GOT-generating relocations referencing a protected data symbol no
  longer lead to a GLOB_DAT (similar to a hidden symbol).
* Direct access relocations (e.g. R_X86_64_PC32) no longer has the
  confusing diagnostic below.

    __attribute__((visibility("protected"))) void *foo() {
      return (void *)foo;
    }

    // gcc -fpic -shared -fuse-ld=bfd
    relocation R_X86_64_PC32 against protected symbol `foo' can not be used when making a shared object

The new behavior matches arm, aarch64 (commit
83c325007c5599fa9b60b8d5f7b84842160e1d1b), and powerpc ports, and other
linkers: gold and ld.lld.

Note: if some code tries to use direct access relocations to take the
address of foo, the pointer equality will break, but the error should be
reported on the executable link, not on the innocent shared object link.
glibc 2.36 will give a warning at relocation resolving time.

With this change, `#define elf_backend_extern_protected_data 1` is no
longer effective.  Just remove it.

Remove the test "Run protected-func-1 without PIE" since -fno-pic
address taken operation in the executable doesn't work with protected
symbol in a shared object by default.  Similarly, remove
protected-data-1a and protected-data-1b.  protected-data-1b can be made
working by removing HAVE_LD_PIE_COPYRELOC from GCC
(https://sourceware.org/pipermail/gcc-patches/2022-June/596678.html).

(cherry picked from commit d19a265487eda186b6977d9d15648cda9fad3298)

3 years agoRe: PowerPC64 .branch_lt address
Alan Modra [Sun, 24 Jul 2022 23:55:49 +0000 (09:25 +0930)] 
Re: PowerPC64 .branch_lt address

On seeing PR29369 my suspicion was naturally on a recent powerpc64
change, commit 0ab80031430e.  Without a reproducer, I spent time
wondering what could have gone wrong, and while I doubt this patch
would have fixed the PR, there are some improvements that can be made
to cater for user silliness.

I also noticed that when -z relro -z now sections are created out of
order, with .got before .plt in the section headers but .got is laid
out at a higher address.  That's due to the address expression for
.branch_lt referencing SIZEOF(.got) and so calling init_os (which
creates a bfd section) for .got before the .plt section is created.
Fix that by ignoring SIZEOF in exp_init_os.  Unlike ADDR and LOADADDR
which need to reference section vma and lma respectively, SIZEOF can
and does cope with a missing bfd section by returning zero for its
size, which of course is correct.

PR 29369
* ldlang.c (exp_init_os): Don't create a bfd section for SIZEOF.
* emulparams/elf64ppc.sh (OTHER_RELRO_SECTIONS_2): Revise
.branch_lt address to take into account possible user sections
with alignment larger than 8 bytes.

(cherry picked from commit 5d471bd907be60e9858b22cdf4fd10ddc0f6ee1a)

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 25 Jul 2022 00:00:45 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 24 Jul 2022 00:00:50 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 23 Jul 2022 00:00:58 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoi386: Don't allow GOTOFF relocation against IFUNC symbol for PIC
H.J. Lu [Thu, 21 Jul 2022 17:35:58 +0000 (10:35 -0700)] 
i386: Don't allow GOTOFF relocation against IFUNC symbol for PIC

We can't use the PLT entry as the function address for PIC since the PIC
register may not be set up properly for indirect call.

bfd/

PR ld/27998
* elf32-i386.c (elf_i386_relocate_section): Don't allow GOTOFF
relocation against IFUNC symbol for PIC.

ld/

PR ld/27998
* testsuite/ld-i386/pr27998a.d: Replace -shared with -e bar.
* testsuite/ld-i386/pr27998b.d: Expect a linker error.
* testsuite/ld-ifunc/ifunc-2-i386-now.d: Updated.
* testsuite/ld-ifunc/ifunc-2-local-i386-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-i386.s: Replace @GOTOFF with @GOT.
* testsuite/ld-ifunc/ifunc-2-local-i386.s: Likewise.

(cherry picked from commit 8f29211c3f0a6335c17e0a90396c146facf6dba4)

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 22 Jul 2022 00:00:46 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoPowerPC: Create new MMA instruction masks and use them
Peter Bergner [Wed, 20 Jul 2022 23:16:05 +0000 (18:16 -0500)] 
PowerPC: Create new MMA instruction masks and use them

The MMA instructions use XX3_MASK|3<<21 as an instruction mask, but that
misses the RC bit/bit 31, so if we disassemble a .long that represents an
MMA instruction except that it also has bit 31 set, we will erroneously
disassemble it to that MMA instruction.  We create new masks defines that
contain bit 31 so that doesn't happen anymore.

opcodes/
* ppc-opc.c (XACC_MASK, XX3ACC_MASK): New defines.
(P_GER_MASK, xxmfacc, xxmtacc, xxsetaccz, xvi8ger4pp, xvi8ger4,
xvf16ger2pp, xvf16ger2, xvf32gerpp, xvf32ger, xvi4ger8pp, xvi4ger8,
xvi16ger2spp, xvi16ger2s, xvbf16ger2pp, xvbf16ger2, xvf64gerpp,
xvf64ger, xvi16ger2, xvf16ger2np, xvf32gernp, xvi8ger4spp, xvi16ger2pp,
xvbf16ger2np, xvf64gernp, xvf16ger2pn, xvf32gerpn, xvbf16ger2pn,
xvf64gerpn, xvf16ger2nn, xvf32gernn, xvbf16ger2nn, xvf64gernn: Use them.

(cherry picked from commit 0a246853439422e12a0ccb9191be638aab3987eb)

3 years agox86: replace wrong attributes on VCVTDQ2PH{X,Y}
Jan Beulich [Thu, 21 Jul 2022 10:37:07 +0000 (12:37 +0200)] 
x86: replace wrong attributes on VCVTDQ2PH{X,Y}

A standalone (without SAE) StaticRounding attribute is meaningless, and
indeed all other similar insns have ATTSyntax there instead. I can only
assume this was some strange copy-and-paste mistake.

(cherry picked from commit ea09fe92596fbb2a5da4595459bfe8b23789ec8d)

3 years agox86/Intel: correct AVX512F scatter insn element sizes
Jan Beulich [Thu, 21 Jul 2022 10:36:44 +0000 (12:36 +0200)] 
x86/Intel: correct AVX512F scatter insn element sizes

I clearly screwed up in 6ff00b5e12e7 ("x86/Intel: correct permitted
operand sizes for AVX512 scatter/gather") giving all AVX512F scatter
insns Dword element size. Update testcases (also their gather parts),
utilizing that there previously were two identical lines each (for no
apparent reason).

(cherry picked from commit 987e8a90fa6541d57b42fef95fae0a7da5a2c9bc)

3 years agoPR29390, DW_CFA_AARCH64_negate_ra_state vs. DW_CFA_GNU_window_save
Alan Modra [Thu, 21 Jul 2022 06:58:50 +0000 (16:28 +0930)] 
PR29390, DW_CFA_AARCH64_negate_ra_state vs. DW_CFA_GNU_window_save

PR 29390
binutils/
* dwarf.c (is_aarch64, DW_CFA_GNU_window_save_name): New.
(display_debug_frames): Use them.
(init_dwarf_regnames_aarch64): Set is_aarch64.
(init_dwarf_regnames_by_elf_machine_code): Clear is_aarch64.
(init_dwarf_regnames_by_bfd_arch_and_mach): Likewise.
gas/
* testsuite/gas/aarch64/pac_ab_key.d: Adjust expected output.
* testsuite/gas/aarch64/pac_negate_ra_state.d: Likewise.

(cherry picked from commit e4e340a3ff2ccc825f4a40abf947cdf32b3fdbbf)

3 years agoPR29337, readelf CU/TU mixup in .gdb_index
Alan Modra [Thu, 21 Jul 2022 05:24:54 +0000 (14:54 +0930)] 
PR29337, readelf CU/TU mixup in .gdb_index

Commit 244e19c79111 changed a number of variables in display_gdb_index
to count entries rather than words.

PR 29337
* dwarf.c (display_gdb_index): Correct use of cu_list_elements.

(cherry picked from commit e82295b23d0e52b0dadffb8c0d0b99462cd20fa8)

3 years agoPowerPC64: fix build error on 32-bit hosts
Alan Modra [Thu, 21 Jul 2022 04:01:51 +0000 (13:31 +0930)] 
PowerPC64: fix build error on 32-bit hosts

elf64-ppc.c:11673:33: error: format â€˜%lx’ expects argument of type â€˜long unsigned int’, but argument 3 has type â€˜bfd_vma’ {aka â€˜long long unsigned int’} [-Werror=format=]
11673 |   fprintf (stderr, "offset = %#lx:", stub_entry->stub_offset);
      |                              ~~~^    ~~~~~~~~~~~~~~~~~~~~~~~
      |                                 |              |
      |                                 |              bfd_vma {aka long long unsigned int}
      |                                 long unsigned int
      |                              %#llx

* elf64-ppc.c (dump_stub): Use BFD_VMA_FMT.

(cherry picked from commit 590207aa6ece509eabbc7a51aab87e5d9bcfc869)

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 21 Jul 2022 00:01:02 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 20 Jul 2022 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agox86: Properly check invalid relocation against protected symbol
H.J. Lu [Mon, 18 Jul 2022 18:44:32 +0000 (11:44 -0700)] 
x86: Properly check invalid relocation against protected symbol

Only check invalid relocation against protected symbol defined in shared
object.

bfd/

PR ld/29377
* elf32-i386.c (elf_i386_scan_relocs): Only check invalid
relocation against protected symbol defined in shared object.
* elf64-x86-64.c (elf_x86_64_scan_relocs): Likewise.

ld/

PR ld/29377
* testsuite/ld-elf/linux-x86.exp: Run PR ld/29377 tests.
* testsuite/ld-elf/pr29377a.c: New file.
* testsuite/ld-elf/pr29377b.c: Likewise.

(cherry picked from commit bd0736124c20950ac353f01e5029b7cb5d8a7010)

ld: Pass -nostdlib to compiler with -r

Pass -nostdlib to compiler with -r to avoid unnecessary .o file and
libraries.

PR ld/29377
* testsuite/ld-elf/linux-x86.exp: Pass -nostdlib with -r.

(cherry picked from commit 76e4fa70e79ee959c0e11eaacd4cf863291b1ddb)

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 19 Jul 2022 00:01:00 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agogprofng: link libgprofng.so against -lpthread
Vladimir Mezentsev [Fri, 15 Jul 2022 18:46:22 +0000 (11:46 -0700)] 
gprofng: link libgprofng.so against -lpthread

gprofng/ChangeLog
2022-07-15  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

PR gprofng/29364
* src/Makefile.am (libgprofng_la_LIBADD): Add -lpthread.
* src/Makefile.in: Rebuild.

3 years agogprofng: fix regression in build and a race condition in autoreconf
Vladimir Mezentsev [Mon, 18 Jul 2022 16:57:34 +0000 (09:57 -0700)] 
gprofng: fix regression in build and a race condition in autoreconf

gprofng/ChangeLog
2022-07-14  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

PR gprofng/29338
* libcollector/configure.ac (AC_CONFIG_HEADERS): Fix a race condition.
* libcollector/configure: Rebuild.
* libcollector/Makefile.in: Rebuild.
* common/config.h.in: Rebuild.
* common/lib-config.h.in: Created by autoreconf.

3 years agox86: correct VMOVSH attributes
Jan Beulich [Mon, 18 Jul 2022 15:31:57 +0000 (17:31 +0200)] 
x86: correct VMOVSH attributes

Both forms were missing VexW0 (thus allowing Evex.W=1 to be encoded by
suitable means, which would cause #UD). The memory operand form further
was using the wrong Masking value, thus allowing zeroing-masking to be
encoded for the store form (which would again cause #UD).

(cherry picked from commit 7e864bf71d55626dce94df26ebaf11f65b4d7b65)

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 18 Jul 2022 00:01:00 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 17 Jul 2022 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 16 Jul 2022 00:00:42 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 15 Jul 2022 00:01:03 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 14 Jul 2022 00:00:53 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 13 Jul 2022 00:01:04 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoPR29355, ld segfaults with -r/-q and custom-named section .rela*
Alan Modra [Tue, 12 Jul 2022 01:21:52 +0000 (10:51 +0930)] 
PR29355, ld segfaults with -r/-q and custom-named section .rela*

The bug testcase uses an output section named .rel or .rela which has
input .data sections mapped to it.  The input .data section has
relocations.  When counting output relocations SHT_REL and SHT_RELA
section reloc_count is ignored, with the justification that reloc
sections themselves can't have relocations and some backends use
reloc_count in reloc sections.  However, the test wrongly used the
output section type (which normally would match input section type).
Fix that.  Note that it is arguably wrong for ld to leave the output
.rel/.rela section type as SHT_REL/SHT_RELA when non-empty non-reloc
sections are written to it, but I'm not going to change that since it
might be useful to hand-craft relocs in a data section that is then
written to a SHT_REL/SHT_RELA output section.

PR 29355
* elflink.c (bfd_elf_final_link): Use input section type rather
than output section type to determine whether to exclude using
reloc_count from that section.

(cherry picked from commit 35c5dcc666082f0edf6dd559e46b98d0e7986a2e)

3 years agoppc gas: don't leak ppc_hash memory
Alan Modra [Thu, 7 Jul 2022 12:33:15 +0000 (22:03 +0930)] 
ppc gas: don't leak ppc_hash memory

* config/tc-ppc.c (insn_obstack): New.
(insn_calloc): New function.
(ppc_setup_opcodes): Use insn_obstack for ppc_hash.

(cherry picked from commit a887be69963c40ced36e319e5fb14b3de4b6658b)
Without ppc_md_end since the infrastructure to call that late isn't
available on the branch, and without the multiply overflow check.

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 12 Jul 2022 00:01:19 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 11 Jul 2022 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 10 Jul 2022 00:00:34 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 9 Jul 2022 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agolibopcodes/s390: add support for disassembler styling
Andrew Burgess [Tue, 5 Jul 2022 13:17:14 +0000 (14:17 +0100)] 
libopcodes/s390: add support for disassembler styling

This commit adds disassembler style to the libopcodes s390
disassembler.  This conversion was pretty straight forward, I just
converted the fprintf_func calls to fprintf_styled_func calls and
added an appropriate style.

For testing the new styling I just assembled then disassembled the
source files in gas/testsuite/gas/s390 and manually checked that the
styling looked reasonable.

If the user does not request styled output from objdump, then there
should be no change in the disassembler output after this commit.

3 years agoUpdate version number
Nick Clifton [Fri, 8 Jul 2022 10:12:53 +0000 (11:12 +0100)] 
Update version number

3 years agoAdd markers for 2.39 branch
Nick Clifton [Fri, 8 Jul 2022 09:41:07 +0000 (10:41 +0100)] 
Add markers for 2.39 branch

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 8 Jul 2022 00:00:16 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agogprofng: fix regression in testing for not yet installed version
Vladimir Mezentsev [Thu, 7 Jul 2022 20:20:39 +0000 (13:20 -0700)] 
gprofng: fix regression in testing for not yet installed version

gprofng/ChangeLog
2022-07-07  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

* src/Settings.cc (Settings::read_rc): Read environment variable
GPROFNG_SYSCONFDIR.
* testsuite/lib/Makefile.skel: Export GPROFNG_SYSCONFDIR.
* testsuite/gprofng.display/display.exp: Shorten the list of tests.

3 years agogdb: fix {rs6000_nat_target,aix_thread_target}::wait to not use inferior_ptid
Simon Marchi [Wed, 6 Jul 2022 17:39:22 +0000 (13:39 -0400)] 
gdb: fix {rs6000_nat_target,aix_thread_target}::wait to not use inferior_ptid

Trying to run a simple program (empty main) on AIX, I get:

    (gdb) run
    Starting program: /scratch/simark/build/gdb/a.out
    Child process unexpectedly missing: There are no child processes..
    ../../src/binutils-gdb/gdb/inferior.c:304: internal-error: find_inferior_pid: Assertion `pid != 0' failed.
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    ----- Backtrace -----
    0x10ef12a8 gdb_internal_backtrace_1()
            ../../src/binutils-gdb/gdb/bt-utils.c:122
    0x10ef1470 gdb_internal_backtrace()
            ../../src/binutils-gdb/gdb/bt-utils.c:168
    0x1004d368 internal_vproblem(internal_problem*, char const*, int, char const*, char*)
            ../../src/binutils-gdb/gdb/utils.c:396
    0x1004d8a8 internal_verror(char const*, int, char const*, char*)
            ../../src/binutils-gdb/gdb/utils.c:476
    0x1004c424 internal_error(char const*, int, char const*, ...)
            ../../src/binutils-gdb/gdbsupport/errors.cc:55
    0x102ab344 find_inferior_pid(process_stratum_target*, int)
            ../../src/binutils-gdb/gdb/inferior.c:304
    0x102ab4a4 find_inferior_ptid(process_stratum_target*, ptid_t)
            ../../src/binutils-gdb/gdb/inferior.c:318
    0x1061bae8 find_thread_ptid(process_stratum_target*, ptid_t)
            ../../src/binutils-gdb/gdb/thread.c:519
    0x10319e98 handle_inferior_event(execution_control_state*)
            ../../src/binutils-gdb/gdb/infrun.c:5532
    0x10315544 fetch_inferior_event()
            ../../src/binutils-gdb/gdb/infrun.c:4221
    0x10952e34 inferior_event_handler(inferior_event_type)
            ../../src/binutils-gdb/gdb/inf-loop.c:41
    0x1032640c infrun_async_inferior_event_handler(void*)
            ../../src/binutils-gdb/gdb/infrun.c:9548
    0x10673188 check_async_event_handlers()
            ../../src/binutils-gdb/gdb/async-event.c:335
    0x1066fce4 gdb_do_one_event()
            ../../src/binutils-gdb/gdbsupport/event-loop.cc:214
    0x10001a94 start_event_loop()
            ../../src/binutils-gdb/gdb/main.c:411
    0x10001ca0 captured_command_loop()
            ../../src/binutils-gdb/gdb/main.c:471
    0x10003d74 captured_main(void*)
            ../../src/binutils-gdb/gdb/main.c:1329
    0x10003e48 gdb_main(captured_main_args*)
            ../../src/binutils-gdb/gdb/main.c:1344
    0x10000744 main
            ../../src/binutils-gdb/gdb/gdb.c:32
    ---------------------
    ../../src/binutils-gdb/gdb/inferior.c:304: internal-error: find_inferior_pid: Assertion `pid != 0' failed.
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    Quit this debugging session? (y or n)

This is due to some bit-rot in the AIX port, still relying on the entry
value of inferior_ptid in the wait methods.

Problem #1 is in rs6000_nat_target::wait, here:

      /* Ignore terminated detached child processes.  */
      if (!WIFSTOPPED (status) && pid != inferior_ptid.pid ())
pid = -1;

At this point, waitpid has returned an "exited" status for some pid, so
pid is non-zero.  Since inferior_ptid is set to null_ptid on entry, the
pid returned by wait is not equal to `inferior_ptid.pid ()`, so we reset
pid to -1 and go to waiting again.  Since there are not more children to
wait for, waitpid then returns -1 so we get here:

      if (pid == -1)
{
  gdb_printf (gdb_stderr,
      _("Child process unexpectedly missing: %s.\n"),
      safe_strerror (save_errno));

  /* Claim it exited with unknown signal.  */
  ourstatus->set_signalled (GDB_SIGNAL_UNKNOWN);
  return inferior_ptid;
}

We therefore return a "signalled" status with a null_ptid (again,
inferior_ptid is null_ptid).  This confuses infrun, because if the
target returns a "signalled" status, it should be coupled with a ptid
for an inferior that exists.

So, the first step is to fix the snippets above to not use
inferior_ptid.  In the first snippet, use find_inferior_pid to see if
we know the event process.  If there is no inferior with that pid, we
assume it's a detached child process to we ignore the event.  That
should be enough to fix the problem, because it should make it so we
won't go into the second snippet.  But still, fix the second snippet to
return an "ignore" status.  This is copied from inf_ptrace_target::wait,
which is where rs6000_nat_target::wait appears to be copied from in the
first place.

These changes, are not sufficient, as the aix_thread_target, which sits
on top of rs6000_nat_target, also relies on inferior_ptid.
aix_thread_target::wait, by calling pd_update, assumes that
rs6000_nat_target has set inferior_ptid to the appropriate value (the
ptid of the event thread), but that's not the case.  pd_update
returns inferior_ptid - null_ptid - and therefore
aix_thread_target::wait returns null_ptid too, and we still hit the
assert shown above.

Fix this by changing pd_activate, pd_update, sync_threadlists and
get_signaled_thread to all avoid using inferior_ptid.  Instead, they
accept as a parameter the pid of the process we are working on.

With this patch, I am able to run the program to completion:

    (gdb) r
    Starting program: /scratch/simark/build/gdb/a.out
    [Inferior 1 (process 11010794) exited normally]

As well as break on main:

    (gdb) b main
    Breakpoint 1 at 0x1000036c
    (gdb) r
    Starting program: /scratch/simark/build/gdb/a.out

    Breakpoint 1, 0x1000036c in main ()
    (gdb) c
    Continuing.
    [Inferior 1 (process 26083688) exited normally]

Change-Id: I7c2613bbefe487d75fa1a0c0994423471d961ee9

3 years agoFix pedantically invalid DWARF in gdb.trace/unavailable-dwarf-piece.exp
Pedro Alves [Thu, 7 Jul 2022 12:05:50 +0000 (13:05 +0100)] 
Fix pedantically invalid DWARF in gdb.trace/unavailable-dwarf-piece.exp

The DWARF spec says:

  Any debugging information entry representing the declaration of an object,
  module, subprogram or type may have DW_AT_decl_file, DW_AT_decl_line and
  DW_AT_decl_column attributes, each of whose value is an unsigned integer
  ^^^^^^^^
  constant.

Grepping around the DWARF-assembler-based testcases, I noticed that
gdb.trace/unavailable-dwarf-piece.exp emits decl_line with
DW_FORM_sdata, a signed integer form.  This commit tweaks it to use
DW_FORM_udata instead.

Unsurprisingly, this:

  $ make check \
      TESTS="gdb.trace/unavailable-dwarf-piece.exp" \
      RUNTESTFLAGS="--target_board=native-gdbserver"

... still passes cleanly for me after this change.

I've noticed this because current llvm-dwarfdump crashed on an
ROCm-internal DWARF-assembler-based testcase that incorrectly used
signed forms for DW_AT_decl_file/DW_AT_decl_line.

The older llvm-dwarfdump found on Ubuntu 20.04 (LLVM 10) reads the
line numbers with signed forms as "0" instead of crashing.  Here's the
before/after fix for gdb.trace/unavailable-dwarf-piece.exp with that
llvm-dwarfdump version:

  $ diff -up before.txt after.txt
  --- before.txt    2022-07-07 13:21:28.387690334 +0100
  +++ after.txt     2022-07-07 13:21:39.379801092 +0100
  @@ -18,7 +18,7 @@
   DW_AT_name     ("s")
   DW_AT_byte_size        (3)
   DW_AT_decl_file        (0)
  -                DW_AT_decl_line        (0)
  +                DW_AT_decl_line        (1)

   0x0000002f:     DW_TAG_member
     DW_AT_name   ("a")
  @@ -41,7 +41,7 @@
   DW_AT_name     ("t")
   DW_AT_byte_size        (3)
   DW_AT_decl_file        (0)
  -                DW_AT_decl_line        (0)
  +                DW_AT_decl_line        (1)

   0x00000054:     DW_TAG_member
     DW_AT_name   ("a")

Change-Id: I5c866946356da421ff944019d0eca2607b2b738f

3 years agogdb: LoongArch: Fix typos in code comments
Tiezhu Yang [Thu, 7 Jul 2022 09:53:40 +0000 (17:53 +0800)] 
gdb: LoongArch: Fix typos in code comments

"it’s" should be "it's".

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
3 years agoGDB/testsuite: Add coverage for `print -elements' command
Maciej W. Rozycki [Thu, 7 Jul 2022 11:00:18 +0000 (12:00 +0100)] 
GDB/testsuite: Add coverage for `print -elements' command

We currently have no coverage for the `print -elements ...' command (or
`p -elements ...' in the shortened form), so add a couple of test cases
mimicking ones using corresponding `set print elements ...' values.

3 years agogdb: LoongArch: Implement the push_dummy_call gdbarch method
Tiezhu Yang [Thu, 7 Jul 2022 06:33:19 +0000 (14:33 +0800)] 
gdb: LoongArch: Implement the push_dummy_call gdbarch method

According to "Procedure Calling Convention" in "LoongArch ELF ABI
specification" [1], implement the push_dummy_call gdbarch method
as clear as possible.

[1] https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html#_procedure_calling_convention

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
3 years agoRISC-V: Added Zfhmin and Zhinxmin.
Tsukasa OI [Mon, 27 Jun 2022 02:03:43 +0000 (11:03 +0900)] 
RISC-V: Added Zfhmin and Zhinxmin.

This commit adds Zfhmin and Zhinxmin extensions (subsets of Zfh and
Zhinx extensions, respectively).  In the process supporting Zfhmin and
Zhinxmin extension, this commit also changes how instructions are
categorized considering Zfhmin, Zhinx and Zhinxmin extensions.

Detailed changes,

* From INSN_CLASS_ZFH to INSN_CLASS_ZFHMIN:

flh, fsh, fmv.x.h and fmv.h.x.

* From INSN_CLASS_ZFH to INSN_CLASS_ZFH_OR_ZHINX:

fmv.h.

* From INSN_CLASS_ZFH_OR_ZHINX to INSN_CLASS_ZFH_OR_ZHINX:

fneg.h, fabs.h, fsgnj.h, fsgnjn.h, fsgnjx.h,
fadd.h, fsub.h, fmul.h, fdiv.h, fsqrt.h, fmin.h, fmax.h,
fmadd.h, fnmadd.h, fmsub.h, fnmsub.h,
fcvt.w.h, fcvt.wu.h, fcvt.h.w, fcvt.h.wu,
fcvt.l.h, fcvt.lu.h, fcvt.h.l, fcvt.h.lu,
feq.h, flt.h, fle.h, fgt.h, fge.h,
fclass.h.

* From INSN_CLASS_ZFH_OR_ZHINX to INSN_CLASS_ZFHMIN_OR_ZHINXMIN:

fcvt.s.h and fcvt.h.s.

* From INSN_CLASS_D_AND_ZFH_INX to INSN_CLASS_ZFHMIN_AND_D:

fcvt.d.h and fcvt.h.d.

* From INSN_CLASS_Q_AND_ZFH_INX to INSN_CLASS_ZFHMIN_AND_Q:

fcvt.q.h and fcvt.h.q.

bfd/ChangeLog:

* elfxx-riscv.c (riscv_implicit_subsets): Change implicit
subsets.  Zfh->Zicsr is not needed and Zfh->F is replaced with
Zfh->Zfhmin and Zfhmin->F.  Zhinx->Zicsr is not needed and
Zhinx->Zfinx is replaced with Zhinx->Zhinxmin and
Zhinxmin->Zfinx.
(riscv_supported_std_z_ext): Added zfhmin and zhinxmin.
(riscv_multi_subset_supports):  Rewrite handling for new
instruction classes.
(riscv_multi_subset_supports_ext): Updated.
(riscv_parse_check_conflicts): Change error message to include
zfh and zfhmin extensions.

gas/ChangeLog:

* testsuite/gas/riscv/zfhmin-d-insn-class-fail.s: New complex
error handling test.
* testsuite/gas/riscv/zfhmin-d-insn-class-fail-1.d: Likewise.
* testsuite/gas/riscv/zfhmin-d-insn-class-fail-1.l: Likewise.
* testsuite/gas/riscv/zfhmin-d-insn-class-fail-2.d: Likewise.
* testsuite/gas/riscv/zfhmin-d-insn-class-fail-2.l: Likewise.
* testsuite/gas/riscv/zfhmin-d-insn-class-fail-3.d: Likewise.
* testsuite/gas/riscv/zfhmin-d-insn-class-fail-3.l: Likewise.
* testsuite/gas/riscv/zfhmin-d-insn-class-fail-4.d: Likewise.
* testsuite/gas/riscv/zfhmin-d-insn-class-fail-4.l: Likewise.
* testsuite/gas/riscv/zfhmin-d-insn-class-fail-5.d: Likewise.
* testsuite/gas/riscv/zfhmin-d-insn-class-fail-5.l: Likewise.
* testsuite/gas/riscv/zhinx.d: Renamed from fp-zhinx-insns.d
and refactored.
* testsuite/gas/riscv/zhinx.s: Likewise.

include/ChangeLog:

* opcode/riscv.h (enum riscv_insn_class): Removed INSN_CLASS_ZFH,
INSN_CLASS_D_AND_ZFH_INX and INSN_CLASS_Q_AND_ZFH_INX.  Added
INSN_CLASS_ZFHMIN, INSN_CLASS_ZFHMIN_OR_ZHINXMIN,
INSN_CLASS_ZFHMIN_AND_D and INSN_CLASS_ZFHMIN_AND_Q.

opcodes/ChangeLog:

* riscv-opc.c (riscv_opcodes): Change instruction classes for
Zfh and Zfhmin instructions.  Fix `fcvt.h.lu' instruction
(two operand variant) mask.

3 years agogprofng: adjust GPROFNG_VARIANT
Vladimir Mezentsev [Wed, 6 Jul 2022 20:52:57 +0000 (13:52 -0700)] 
gprofng: adjust GPROFNG_VARIANT

GPROFNG_VARIANT depends on compiler options, not on $(host).

gprofng/ChangeLog
2022-07-06  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

PR gprofng/29116
* libcollector/configure.ac: Adjust GPROFNG_VARIANT.
* libcollector/configure: Rebuild.

3 years agoRISC-V: Fix disassembling Zfinx with -M numeric
Tsukasa OI [Mon, 27 Jun 2022 02:03:44 +0000 (11:03 +0900)] 
RISC-V: Fix disassembling Zfinx with -M numeric

This commit fixes floating point operand register names from ABI ones
to dynamically set ones.

gas/ChangeLog:

* testsuite/gas/riscv/zfinx-dis-numeric.s: Test new behavior of
Zfinx extension and -M numeric disassembler option.
* testsuite/gas/riscv/zfinx-dis-numeric.d: Likewise.

opcodes/ChangeLog:

* riscv-dis.c (riscv_disassemble_insn): Use dynamically set GPR
names to disassemble Zfinx instructions.

3 years agoRISC-V: Fix requirement handling on Zhinx+{D,Q}
Tsukasa OI [Fri, 24 Jun 2022 02:59:04 +0000 (11:59 +0900)] 
RISC-V: Fix requirement handling on Zhinx+{D,Q}

This commit fixes how instructions are masked on Zhinx+Z{d,q}inx.
fcvt.h.d and fcvt.d.h require ((D&&Zfh)||(Zdinx&&Zhinx)) and
fcvt.h.q and fcvt.q.h require ((Q&&Zfh)||(Zqinx&&Zhinx)).

bfd/ChangeLog:

* elfxx-riscv.c (riscv_multi_subset_supports): Fix feature gate
on INSN_CLASS_{D,Q}_AND_ZFH_INX.
(riscv_multi_subset_supports_ext): Fix feature gate diagnostics
on INSN_CLASS_{D,Q}_AND_ZFH_INX.

gas/ChangeLog:

* testsuite/gas/riscv/fp-zhinx-insns.d: Add Zqinx to -march
for proper testing.

3 years agoPR29320, 'struct obstack' declared inside parameter list
Alan Modra [Tue, 5 Jul 2022 23:50:09 +0000 (09:20 +0930)] 
PR29320, 'struct obstack' declared inside parameter list

PR 29320
* frags.h: Move declaration of struct obstack..
* as.h: ..to here.