binutils-gdb.git
14 months agolibsframe: add library versioning
Indu Bhagat [Tue, 27 Jun 2023 18:52:43 +0000 (11:52 -0700)]
libsframe: add library versioning

lisbframe was first released with Bintuils 2.40.  As the library
evolves, some changes will break the ABI.  Add library versioning for
users to manage these changes.

For the next release of the library (libsframe.so.1), incompatible ABI
changes are planned. These will include:
 - Deprecation of some APIs, like sframe_get_funcdesc_with_addr (), and
 - Change in the contract of some APIs (e.g., return type, behavior).

In libtool-version, set the current to 1 to prepare for the upcoming
release.  Reset revision and age to 0.

Add libtool-version file to EXTRA_DIST.

libsframe/
* Makefile.am: Use libtool versioning.
* Makefile.in: Regenerated.
* libtool-version: New file.

14 months ago RISC-V: Support Zicond extension
Philipp Tomsich [Tue, 27 Jun 2023 13:22:49 +0000 (07:22 -0600)]
RISC-V: Support Zicond extension

    This implements the Zicond (conditional integer operations) extension,
    as of version 1.0-rc2.

    The Zicond extension acts as a building block for branchless sequences
    including conditional-arithmetic, conditional-logic and
    conditional-select/move.
    The following instructions constitute Zicond:
      - czero.eqz rd, rs1, rs2  =>  rd = (rs2 == 0) ? 0 : rs1
      - czero.nez rd, rs1, rs2  =>  rd = (rs2 != 0) ? 0 : rs1

    See
      https://github.com/riscv/riscv-zicond/releases/download/v1.0-rc2/riscv-zicond-v1.0-rc2.pdf
    for the proposed specification and usage details.

    bfd/ChangeLog:

            * elfxx-riscv.c (riscv_multi_subset_supports): Recognize
            INSN_CLASS_ZICOND.
            (riscv_multi_subset_supports_ext): Recognize INSN_CLASS_ZICOND.

    gas/ChangeLog:

            * testsuite/gas/riscv/zicond.d: New test.
            * testsuite/gas/riscv/zicond.s: New test.

    include/ChangeLog:

            * opcode/riscv-opc.h (MATCH_CZERO_EQZ): Define.
            (MASK_CZERO_EQZ): Define.
            (MATCH_CZERO_NEZ): Define,
            (MASK_CZERO_NEZ): Define.
            (DECLARE_INSN): Add czero.eqz and czero.nez.
            * opcode/riscv.h (enum riscv_insn_class): Add
            INSN_CLASS_ZICOND.

    opcodes/ChangeLog:

            * riscv-opc.c: Add czero.eqz and czero.nez.

Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
14 months agoAdd note about adding ChangeLog.git to src-release.sh
Nick Clifton [Tue, 27 Jun 2023 09:15:51 +0000 (10:15 +0100)]
Add note about adding ChangeLog.git to src-release.sh

14 months agogprofng: Update intel url
Cui, Lili [Tue, 27 Jun 2023 07:58:12 +0000 (07:58 +0000)]
gprofng: Update intel url

Since the old software.intel.com has been removed, update a new one.

gprofng/ChangeLog
2023-06-27  Lili Cui  <lili.cui@intel.com>

* gp-display-html/gp-display-html.in: Update intel url.

14 months agoAutomatic date update in version.in
GDB Administrator [Tue, 27 Jun 2023 00:00:23 +0000 (00:00 +0000)]
Automatic date update in version.in

14 months agoFix gas tests for aarch64-pe
Nick Clifton [Mon, 26 Jun 2023 16:37:19 +0000 (17:37 +0100)]
Fix gas tests for aarch64-pe

14 months agoSynchromize libiberty sources with master version in gcc repository
Nick Clifton [Mon, 26 Jun 2023 14:47:15 +0000 (15:47 +0100)]
Synchromize libiberty sources with master version in gcc repository

14 months agoSync config.guess and config.sub with upstream master versions.
Nick Clifton [Mon, 26 Jun 2023 13:11:30 +0000 (14:11 +0100)]
Sync config.guess and config.sub with upstream master versions.

14 months agoUpdated French translation for the gprof sub-directory
Nick Clifton [Mon, 26 Jun 2023 12:24:19 +0000 (13:24 +0100)]
Updated French translation for the gprof sub-directory

14 months agoAutomatic date update in version.in
GDB Administrator [Mon, 26 Jun 2023 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in

14 months agoLoongArch: Support referring to FCSRs as $fcsrX
Feiyang Chen [Fri, 16 Jun 2023 03:16:10 +0000 (11:16 +0800)]
LoongArch: Support referring to FCSRs as $fcsrX

Previously, FCSRs were referred to as $rX, which seemed strange.
We refer to FCSRs as $fcsrX, which ensures compatibility with LLVM
IAS as well.

gas/ChangeLog:

        * config/tc-loongarch.c:
        (loongarch_fc_normal_name): New definition.
        (loongarch_fc_numeric_name): New definition.
        (loongarch_single_float_opcodes): Modify `movgr2fcsr` and
        `movfcsr2gr`.
        testsuite/gas/loongarch/float_op.d: Likewise.
        testsuite/gas/loongarch/float_op.s: Likewise.

include/ChangeLog:

        * opcode/loongarch.h:
        (loongarch_fc_normal_name): New extern.
        (loongarch_fc_numeric_name): New extern.

opcodes/ChangeLog:

        * opcodes/loongarch-dis.c (loongarch_after_parse_args): Support
        referring to FCSRs as $fcsrX.
        * opcodes/loongarch-opc.c (loongarch_args_parser_can_match_arg_helper):
        Likewise.

Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn>
14 months agoAutomatic date update in version.in
GDB Administrator [Sun, 25 Jun 2023 00:00:09 +0000 (00:00 +0000)]
Automatic date update in version.in

14 months agoAutomatic date update in version.in
GDB Administrator [Sat, 24 Jun 2023 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in

14 months agogdb/testsuite: Avoid infinite loop in gdb.reverse/step-reverse.exp
Thiago Jung Bauermann [Wed, 31 May 2023 19:46:29 +0000 (21:46 +0200)]
gdb/testsuite: Avoid infinite loop in gdb.reverse/step-reverse.exp

This testcase sometimes gets stuck in a loop for hours when running in our
CI.  The problem is that due to an issue unrelated to reverse debugging the
inferior exits early, and because of the overly generic ".*" pattern the
testcase keeps sending the "next" command without noticing that the
inferior is gone.

gdb_test_multiple has a pattern to detect that "The program is not being
run.", but since it is placed after the patterns from the caller it won't
be triggered.  It also has a timeout pattern but because it is triggered
between successful matches, each time the test matches the '-re -wrap ".*"'
this counts as a successful match and the timeout is reset.

Since the test binary is compiled with debug information, fix by changing
one of the generic patterns to match entering the main function and the
other one to match the source code line number that is shown by GDB right
after the "step" command.

Also, as a precaution add a maximum number of times the "next" command will
be sent.

Co-Authored-By: Tom de Vries <tdevries@suse.de>
Reviewed-By: Bruno Larsen <blarsen@redhat.com>
Approved-By: Tom de Vries <tdevries@suse.de>
14 months ago[GOLD] PowerPC64 huge branch dynamic relocs
Alan Modra [Fri, 23 Jun 2023 01:07:53 +0000 (10:37 +0930)]
[GOLD] PowerPC64 huge branch dynamic relocs

PowerPC64 gold and ld.bfd implement an indirect branch trampoline,
used when the destination of a branch exceeds a bounce through another
"b" instruction.  When generating PIEs or shared libraries, the
addresses need dynamic relocations.  This was implemented in gold
using a dedicated relocation section, but this means the relative
relocations for these addresses are not sorted properly with other
dynamic relative relocations: gold doesn't support merging relocation
sections, then sorting.  Instead we need to use a single .rela.dyn
section.

This is done by increasing the size of rela_dyn_ during do_relax to
account for needed dynamic relocations, delaying adding the actual
relocations until the end of relaxation once the layout has
stabilised.

* powerpc.cc (Target_powerpc): Add rela_dyn_size_;
(update_current_size): New function.
(Target_powerpc::do_relax): Capture the size of rela_dyn_ at
the start of relaxation.  Artifically increase its size during
relaxation to account for needed indirect branches, and add
those relocations at the end.
(Output_data_brlt_powerpc::rel_, reset_brlt_sizes),
(finalize_brlt_sizes, add_reloc, set_current_size): Delete.
(Target_powerpc::make_brlt_section): Don't make reloc section.

14 months ago[GOLD] Support setting DT_RELACOUNT late
Alan Modra [Fri, 23 Jun 2023 00:08:13 +0000 (09:38 +0930)]
[GOLD] Support setting DT_RELACOUNT late

PowerPC gold adds relative dynamic relocs in do_relax.  These aren't
accounted for in the value set in add_target_dynamic_tags, which is
called before do_relax.  Provide a way of setting DT_RELCOUNT and
DT_RELACOUNT at the point where .dynamic is written.

* layout.cc (Layout::add_target_dynamic_tags): Add custom_relcount
parameter.  Emit DT_RELCOUNT/RELACOUNT as a custom target handled
dynamic tag if set.
* layout.h(Layout::add_target_dynamic_tags): Update prototype.
* aarch64.cc (Target_aarch64::do_finalize_sections): Adjust
add_target_dynamic_tags call.
* arm.cc (Target_arm::do_finalize_sections): Likewise.
* i386.cc (Target_i386::do_finalize_sections): Likewise.
* mips.cc (Target_mips::do_finalize_sections): Likewise.
* s390.cc (Target_s390::do_finalize_sections): Likewise.
* sparc.cc (Target_sparc::do_finalize_sections): Likewise.
* tilegx.cc (Target_tilegx::do_finalize_sections): Likewise.
* x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
* powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
(Target_powerpc::do_dynamic_tag_custom_value): New function.

14 months ago[GOLD] powerpc DT_RELACOUNT
Alan Modra [Thu, 22 Jun 2023 23:18:38 +0000 (08:48 +0930)]
[GOLD] powerpc DT_RELACOUNT

DT_RELACOUNT was calculated incorrectly, and relative relocs not
sorted as they should be to the start of .rela.dyn, due to adding one
particular class of dynamic reloc using the wrong "add" method.

* powerpc.cc (Target_powerpc::Scan::global): Add relative
dyn relocs for ADDR64 and similar using add_global_relative.

14 months agolto test fails with -fno-inline in CFLAGS
Alan Modra [Fri, 23 Jun 2023 02:06:13 +0000 (11:36 +0930)]
lto test fails with -fno-inline in CFLAGS

Putting -fno-inline in CFLAGS results in these failures.
FAIL: Build liblto-17b.so 1
FAIL: PR ld/12365
FAIL: PR ld/13183

* ld-plugin/lto.exp: Add -finline to compiler flags in some tests.

14 months agoFix off-by-one error
Tom Tromey [Fri, 23 Jun 2023 02:34:56 +0000 (20:34 -0600)]
Fix off-by-one error

Simon pointed out that commit a2bbca9fa5e ("Use std::vector<bool> for
agent_expr::reg_mask") caused a regression in libstdc++ debug mode.
This was due to an off-by-one error in a vector resize.  This patch
fixes the problem.

14 months agoAutomatic date update in version.in
GDB Administrator [Fri, 23 Jun 2023 00:00:10 +0000 (00:00 +0000)]
Automatic date update in version.in

14 months agogdb/testsuite: fix gdb.python/py-unwind.exp with python >= 3.11
Ilya Leoshkevich [Wed, 21 Jun 2023 21:55:42 +0000 (23:55 +0200)]
gdb/testsuite: fix gdb.python/py-unwind.exp with python >= 3.11

Python 3.11 changed the AttributeError message - see commit
0cb765b2cec9 ("bpo-46730: Add more info to @property AttributeError
messages (GH-31311)").  Add the new message to the expectations.

Approved-By: Tom Tromey <tom@tromey.com>
Link: https://sourceware.org/pipermail/gdb-patches/2023-June/200433.html
14 months agoRevert "x86: Don't check if AVX512 template requires AVX512VL"
H.J. Lu [Thu, 22 Jun 2023 19:37:51 +0000 (12:37 -0700)]
Revert "x86: Don't check if AVX512 template requires AVX512VL"

This reverts commit c7face14225296a2f5d3ebeb8ace88c166d80c3e.

14 months ago[gdb/testsuite] Clean or check standard_output_file dir in gdb_init
Tom de Vries [Thu, 22 Jun 2023 17:15:23 +0000 (19:15 +0200)]
[gdb/testsuite] Clean or check standard_output_file dir in gdb_init

In commit e2adba909e7 ("[gdb/testsuite] Clean up before compilation in
gdb.ada/call-no-debug.exp") I added some code in the test-case to remove some
files at the start of the test-case:
...
remote_file host delete [standard_output_file prog.o]
remote_file host delete [standard_output_file prog.ali]
...

Then in commit b7b77500dc5 ("[gdb/testsuite] Clean standard_output_file dir in
gdb_init") I tried to do this more structurally, by cleaning up the entire
standard_output_file directory, for all test-cases.

This caused a regression when using "make check -j 2", due to the cleanup
removing the active gdb.log, so I reverted the commit.

Try again, this time handling the two cases separately.

If the standard_output_file directory contains an active gdb.log, check that
the directory contains no files other than gdb.log and gdb.sum.  This puts
the reponsibility for the cleanup at the callers in gdb/testsuite/Makefile.in
which use --outdir.

If the standard_output_file directory doesn't contain an active gdb.log, clean
it by removing the entire directory.

An exception is made for performance tests, where cleaning up the
standard_output_file dir is the wrong thing to do, because an invocation with
GDB_PERFTEST_MODE == run is intended to reuse binaries left there by an
earlier invocation with GDB_PERFTEST_MODE == compile.

Tested on x86_64-linux.

Suggested-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Tom Tromey <tom@tromey.com>
Tested-By: Luis Machado <luis.machado@arm.com>
14 months agoImplement DAP "hover" context
Tom Tromey [Thu, 1 Jun 2023 17:54:17 +0000 (11:54 -0600)]
Implement DAP "hover" context

A DAP client can request that an expression be evaluated in "hover"
context, meaning that it should not cause side effects.  In gdb, this
can be implemented by temporarily setting a few "may-" parameters to
"off".

In order to make this work, I had to also change "may-write-registers"
so that it can be changed while the program is running.  I don't think
there was any reason for this prohibition in the first place.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30476

14 months agoImplement DAP logging breakpoints
Tom Tromey [Wed, 31 May 2023 17:21:09 +0000 (11:21 -0600)]
Implement DAP logging breakpoints

DAP allows a source breakpoint to specify a log message.  When this is
done, the breakpoint acts more like gdb's dprintf: it logs a message
but does not cause a stop.

I looked into implement this using dprintf with the new %V printf
format.  However, my initial attempt at this did not work, because
when the inferior is continued, the dprintf output is captured by the
gdb.execute call.  Maybe this could be fixed by having all
inferior-continuation commands use the "&" form; the main benefit of
this would be that expressions are only parsed a single time.

14 months agoHandle supportsVariablePaging in DAP
Tom Tromey [Fri, 26 May 2023 19:35:52 +0000 (13:35 -0600)]
Handle supportsVariablePaging in DAP

A bug report about the supportsVariablePaging capability in DAP
resulted in a clarification: when this capability is not present, DAP
implementations should ignore the paging parameters to the "variables"
request.  This patch implements this clarification.

14 months agoImplement type checking for DAP breakpoint requests
Tom Tromey [Thu, 25 May 2023 18:25:43 +0000 (12:25 -0600)]
Implement type checking for DAP breakpoint requests

I realized that with a small refactoring, it is possible to type-check
the parameters to the various DAP breakpoint requests.  This would
have caught the earlier bug involving hitCondition.

14 months agoHandle exceptions when creating DAP breakpoints
Tom Tromey [Thu, 25 May 2023 17:24:39 +0000 (11:24 -0600)]
Handle exceptions when creating DAP breakpoints

When creating a DAP breakpoint, a failure should be returned by
setting "verified" to False.  gdb didn't properly implement this, and
there was a FIXME comment to this effect.  This patch fixes the
problem.

14 months agoReuse breakpoints more frequently in DAP
Tom Tromey [Wed, 24 May 2023 20:22:55 +0000 (14:22 -0600)]
Reuse breakpoints more frequently in DAP

The DAP breakpoint code tries to reuse a breakpoint when possible.
Currently it uses the condition and the hit condition (aka ignore
count) when making this determination.  However, these attributes are
just going to be reset anyway, so this patch changes the code to
exclude these from the reuse decision.

14 months agoFix type of DAP hitCondition
Tom Tromey [Wed, 24 May 2023 20:24:13 +0000 (14:24 -0600)]
Fix type of DAP hitCondition

DAP specifies a breakpoint's hitCondition as a string, meaning it is
an expression to be evaluated.  However, gdb implemented this as if it
were an integer instead.  This patch fixes this oversight.

14 months agogdb/DAP Few bug fixes & Evaluate Array Watch vars
Simon Farre [Mon, 19 Jun 2023 23:27:28 +0000 (01:27 +0200)]
gdb/DAP Few bug fixes & Evaluate Array Watch vars

v2.

EvaluateResult does not need a name, just as what Tom pointed out in
previous review. It's only the *children* that need to be made sure that
their names are valid. An identifier for a variable, can't ever have an
integer as a name, anyhow (not as far as I am aware, no programming
languages allow for that).

Removed the f-strings and use str() instead as pointed out that
f-strings might not be supported fully.

v1.

This patch fixes a few bugs.

First of all, name of VariableReferences must always be of string type.
This patch makes sure that this is the case by formatting the name. If
(when) the name is an integer, this will cause clients to fail or throw
errors.

Fixes a bug in NoOpArrayPrinter that calculated children to be N, but
only ever retrieves N-1 children, which makes Python at some time later
(during fetch_children -> fetch_one_child(N) ) raise an exception (out
of list index) which makes the entire request go bad.

The result[self.result_name] also f-strings the printer.to_string()
value, because this can potentially be a LazyString (which is a Python
object, not a string) and is not serializable by json.dumps.

Approved-By: Tom Tromey <tom@tromey.com>
14 months agoAutomatic date update in version.in
GDB Administrator [Thu, 22 Jun 2023 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in

14 months agox86: Free the symbol buffer and the relocation buffer after use
H.J. Lu [Tue, 20 Jun 2023 22:10:11 +0000 (15:10 -0700)]
x86: Free the symbol buffer and the relocation buffer after use

When --no-keep-memory is used, the symbol buffer and the relocation
buffer aren't cached.  When packing relative relocations, we may
allocate a new symbol buffer and a new relocation buffer for each
eligible section in an object file.  If there are many sections,
memory may be exhausted.  In this case, we should free the symbol
buffer and the relocation buffer after use.  If symbol buffer entries
are used to track relative relocations against local symbols for later
use, the symbol buffer should be cached.

PR ld/30566
* elfxx-x86.c (elf_x86_relative_reloc_record_add): Add an
argument to inform caller if the symbol buffer should be kept.
(_bfd_x86_elf_link_relax_section): Call
_bfd_elf_link_info_read_relocs instead of
_bfd_elf_link_read_relocs.  Free the symbol buffer and the
relocation buffer after use.  Cache the symbol buffer if it
is used.

14 months agoAdd missing backslash to update-gnulib.sh
Tom Tromey [Wed, 31 May 2023 12:27:16 +0000 (06:27 -0600)]
Add missing backslash to update-gnulib.sh

A user on irc noticed a missing backslash on one line in
update-gnulib.sh.  This patch adds it.

Re-running update-gnulib.sh causes a few copyright notices to change.
Presumably these are from upstream gnulib and shouldn't be touched by
our yearly update.  I've updated the script to account for this, but I
did not want to try testing it...

14 months ago[gdb/testsuite] Add have_host_locale
Tom de Vries [Wed, 21 Jun 2023 14:29:04 +0000 (16:29 +0200)]
[gdb/testsuite] Add have_host_locale

With test-case gdb.tui/pr30056.exp, I run into:
...
sh: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8)^M
...
and then subsequently into:
...
WARNING: timeout in accept_gdb_output
FAIL: gdb.tui/pr30056.exp: Control-C
...

This is on a CentOS 7 distro for powerpc64le.

Either it has no C.UTF-8 support, or it's not installed:
...
$ locale -a | grep ^C
C
$
...

Fix this by:
- adding a new proc have_host_locale, and
- using it in all test-cases using setenv LC_ALL.

Tested on powerpc64le-linux and x86_64-linux.

14 months ago[gdb/testsuite] Fix gdb.tui/wrap-line.exp
Tom de Vries [Wed, 21 Jun 2023 14:16:50 +0000 (16:16 +0200)]
[gdb/testsuite] Fix gdb.tui/wrap-line.exp

PR testsuite/30458 reports the following FAIL:
...
PASS: gdb.tui/wrap-line.exp: width-auto-detected: cli: wrap
^CQuit
(gdb) WARNING: timeout in accept_gdb_output
Screen Dump (size 50 columns x 24 rows, cursor at column 6, row 3):
    0 Quit
    1 (gdb) 7890123456789012345678901234567890123456789
    2 W^CQuit
    3 (gdb)
  ...
FAIL: gdb.tui/wrap-line.exp: width-auto-detected: cli: prompt after wrap
...

The problem is that the regexp doesn't account for the ^C:
...
    gdb_assert { [Term::wait_for "^WQuit"] } "prompt after wrap"
...

The ^C occurs occasionally.  This is something we'd like to fix.  It's
reported as a readline problem here (
https://lists.gnu.org/archive/html/bug-readline/2023-06/msg00000.html ).

For now, fix this by updating the regexp, and likewise in another place in the
test-case where we use ^C.

Tested on x86_64-linux.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30458

14 months agoPR30536, ppc64el gold linker produces unusable clang-16 binary
Alan Modra [Wed, 21 Jun 2023 13:14:09 +0000 (22:44 +0930)]
PR30536, ppc64el gold linker produces unusable clang-16 binary

In commit 0961e631575b, the fix for PR30217, make_lplt_section and
make_brlt_section were changed to use rela_dyn_ rather than their own
separate dynamic reloc sections.  This fails miserably whenever brlt_
is needed for long branches, due to needing to iterate sizing and thus
reset brlt_ sizes.

PR 30536
PR 30217
* powerpc.cc (Target_powerpc::make_brlt_section): Don't use
rela_dyn_.

14 months ago[gdb/testsuite] Reimplement Term::command_no_prompt_prefix
Tom de Vries [Wed, 21 Jun 2023 13:31:37 +0000 (15:31 +0200)]
[gdb/testsuite] Reimplement Term::command_no_prompt_prefix

Say we run test-case gdb.tui/basic.exp.  It calls Term::enter_tui, which does:
...
command_no_prompt_prefix "tui enable"
...

The proc command_no_prompt_prefix is documented as:
...
    # As proc command, but don't wait for an initial prompt.  This is used for
    # initial terminal commands, where there's no prompt yet.
...

Indeed, before the "tui enable" command, the tuiterm is empty, so there is no
prompt and just before switching to TUI we have in the tuiterm:
...
tui enable
...

The reason that there is no prompt, is that:
- in order for tuiterm to show something, its input processing procs need to
  be called, and
- the initial gdb prompt, and subsequent prompts generated by gdb_test-style
  procs, are all consumed by those procs instead.

This is in principle not a problem, but the absence of a prompt makes a
tuiterm session look less like a session on an actual xterm.

Add a new proc gen_prompt, that:
- generates a prompt using echo
- consumes the response before the prompt using gdb_expect
- consumes the prompt using Term::wait_for "".

This allows us to reimplement Term::command_no_prompt_prefix using
Term::command, and just before switching to TUI we have in the tuiterm:
...
(gdb) tui enable
...

Tested on x86_64-linux.

14 months ago[gdb/testsuite] Make Term::wait_for "" match only a prompt
Tom de Vries [Wed, 21 Jun 2023 13:31:37 +0000 (15:31 +0200)]
[gdb/testsuite] Make Term::wait_for "" match only a prompt

The semantics of Term::wait_for is:
...
    # Accept some output from gdb and update the screen.  WAIT_FOR is
    # a regexp matching the line to wait for.  Return 0 on timeout, 1
    # on success.
    proc wait_for {wait_for} {
...

Note that besides the regexp, also a subsequent gdb prompt is matched.

I recently used wait_for "" in a few test-cases, thinking that this would
match just a prompt, but in fact that's not the case.

Fix this in wait_for, and add a corresponding test in gdb.tui/tuiterm-2.exp.

Tested on x86_64-linux.

14 months agoPrune linker warnings about an executable stack being created with the -z execstack...
Nick Clifton [Wed, 21 Jun 2023 11:10:03 +0000 (12:10 +0100)]
Prune linker warnings about an executable stack being created with the -z execstack option.

  * testsuite/lib/binutils-common.exp (prune_warnings_extra): Prune warnings about -z execstack creating an executable stack.

14 months agoFor test for PR 29072 when the linker is configured with --enable-default-execstack=no.
Nick Clifton [Wed, 21 Jun 2023 10:47:19 +0000 (11:47 +0100)]
For test for PR 29072 when the linker is configured with --enable-default-execstack=no.

  PR 29072
  * testsuite/ld-elf/elf.exp (target_defaults_to_execstack): Always return false for linkers configured with the --enable-default-execstack=no option.

14 months agogdbserver: use target_waitstatus::to_string in 'prepare_resume_reply'
Tankut Baris Aktemur [Wed, 21 Jun 2023 06:47:01 +0000 (08:47 +0200)]
gdbserver: use target_waitstatus::to_string in 'prepare_resume_reply'

Use the to_string method of target_waitstatus in
'prepare_resume_reply' for a more readable log message.

Approved-By: Tom Tromey <tom@tromey.com>
14 months agox86: fix expansion of %XV
Jan Beulich [Wed, 21 Jun 2023 06:32:13 +0000 (08:32 +0200)]
x86: fix expansion of %XV

Only %LV should continue on to S handling; avoid emitting a stray 'l'
(typically) in suffix-always mode.

14 months agoelf32_arm_get_synthetic_symtab memory leak
Alan Modra [Wed, 21 Jun 2023 05:03:59 +0000 (14:33 +0930)]
elf32_arm_get_synthetic_symtab memory leak

ARM get_synthetic_symtab reads .plt and caches that data.  Caching the
data doesn't make a lot of sense since get_synthetic_symtab is only
called once per bfd, and the memory might be put to better use.  It
also leaks on closing the bfd.

* elf32-arm.c (elf32_arm_get_synthetic_symtab): Don't cache
plt contents.  Free plt data before returning.

14 months agomacho-o.c don't leak strtab
Alan Modra [Tue, 20 Jun 2023 23:51:54 +0000 (09:21 +0930)]
macho-o.c don't leak strtab

* mach-o.c (bfd_mach_o_write_symtab_content): Free strtab on
success path.

14 months agoAutomatic date update in version.in
GDB Administrator [Wed, 21 Jun 2023 00:00:16 +0000 (00:00 +0000)]
Automatic date update in version.in

14 months agoUse ARRAY_SIZE in ax-general.c
Tom Tromey [Tue, 20 Jun 2023 17:11:06 +0000 (11:11 -0600)]
Use ARRAY_SIZE in ax-general.c

This changes a couple of spots in ax-general.c to use ARRAY_SIZE.
While making this change, I noticed that one of the bounds checks was
incorrect.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
14 months agoRemove aop_last
Tom Tromey [Tue, 20 Jun 2023 17:09:18 +0000 (11:09 -0600)]
Remove aop_last

aop_last is only used for an assertion.  However, due to the '.def'
construct in the sources, this assert could never plausibly trigger
(the assert predates the use of a .def file here).  This patch removes
the constant and the assert.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
14 months agoMake aop_map 'static'
Tom Tromey [Mon, 19 Jun 2023 20:44:43 +0000 (14:44 -0600)]
Make aop_map 'static'

This changes aop_map to be 'static'.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
14 months agoUse bool for agent_expr::tracing
Tom Tromey [Sat, 17 Jun 2023 18:56:54 +0000 (12:56 -0600)]
Use bool for agent_expr::tracing

This changese agent_expr::tracing to have type bool, allowing inline
initialization and cleaning up the code a little.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
14 months agoSimplify agent_expr constructor
Tom Tromey [Sat, 17 Jun 2023 18:53:58 +0000 (12:53 -0600)]
Simplify agent_expr constructor

This simplifies the agent_expr constructor a bit, and removes the
destructor entirely.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
14 months agoUse std::vector<bool> for agent_expr::reg_mask
Tom Tromey [Sat, 17 Jun 2023 18:52:11 +0000 (12:52 -0600)]
Use std::vector<bool> for agent_expr::reg_mask

agent_expr::reg_mask implements its own packed boolean vector.  This
patch replaces it with a std::vector<bool>, simplifying the code.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
14 months agoUse gdb::byte_vector in agent_expr
Tom Tromey [Sat, 17 Jun 2023 18:43:04 +0000 (12:43 -0600)]
Use gdb::byte_vector in agent_expr

This changes agent_expr to use gdb::byte_vector rather than manually
reimplementing a vector.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
14 months agoRemove mem2hex
Tom Tromey [Mon, 19 Jun 2023 17:53:10 +0000 (11:53 -0600)]
Remove mem2hex

tracepoint.c has a 'mem2hex' function that is functionally equivalent
to bin2hex.  This patch removes the redundancy.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
14 months agox86: Don't check if AVX512 template requires AVX512VL
H.J. Lu [Tue, 20 Jun 2023 16:32:19 +0000 (09:32 -0700)]
x86: Don't check if AVX512 template requires AVX512VL

If the ZMM operand in an AVX12 template also allows XMM or ZMM, this
template must require AVX512VL.  Drop the AVX512VL requirement check
on such AVX512 templates.

* config/tc-i386.c (check_VecOperands): Don't check if AVX512
template requires AVX512VL.

14 months agoUse std::string in do_set_command
Tom Tromey [Mon, 19 Jun 2023 04:06:05 +0000 (22:06 -0600)]
Use std::string in do_set_command

do_set_command manually updates a string, only to copy it to a
std::string and free the working copy.  This patch changes this code
to use std::string for everything, simplifying the code and removing a
copy.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
14 months agoUse byte_vector in remote.c:readahead_cache
Tom Tromey [Sat, 17 Jun 2023 19:36:40 +0000 (13:36 -0600)]
Use byte_vector in remote.c:readahead_cache

This patch changes the remote.c readahead_cache to use
gdb::byte_vector.  This simplifies the code by removing manual memory
management.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
14 months agoUse std::string in linux-osdata.c
Tom Tromey [Sat, 17 Jun 2023 19:32:09 +0000 (13:32 -0600)]
Use std::string in linux-osdata.c

I found some code in linux-osdata that manually managed a string.
Replacing this with std::string simplifies it.

Reviewed-by: John Baldwin <jhb@FreeBSD.org>
14 months agoUse unique_xmalloc_ptr for mi_parse::command
Tom Tromey [Fri, 9 Jun 2023 16:35:20 +0000 (10:35 -0600)]
Use unique_xmalloc_ptr for mi_parse::command

This changes mi_parse::command to be a unique_xmalloc_ptr and fixes up
all the uses.  This avoids some manual memory management.  std::string
is not used here due to how the Python API works -- this approach
avoids an extra copy there.

Reviewed-by: Keith Seitz <keiths@redhat.com>
14 months agoUse std::string for MI token
Tom Tromey [Fri, 9 Jun 2023 16:27:18 +0000 (10:27 -0600)]
Use std::string for MI token

This changes the MI "token" to be a std::string, removing some manual
memory management.  It also makes current_token 'const' in order to
support this change.

Reviewed-by: Keith Seitz <keiths@redhat.com>
14 months agoDon't segfault in mips reloc special_functions
Alan Modra [Tue, 20 Jun 2023 00:16:03 +0000 (09:46 +0930)]
Don't segfault in mips reloc special_functions

A symbol defined in a section from a shared library will have a NULL
section->output_section during linking.

* elf32-mips.c (gprel32_with_gp): Don't segfault on NULL
symbol->section->output_section.
* elf64-mips.c (mips_elf64_gprel32_reloc): Likewise.
* elfn32-mips.c (mips_elf_gprel16_reloc): Likewise.
(mips_elf_literal_reloc, mips_elf_gprel32_reloc): Likewise.
(gprel32_with_gp, mips16_gprel_reloc): Likewise.
* elfxx-mips.c (_bfd_mips_elf_gprel16_with_gp): Likewise.
(_bfd_mips_elf_generic_reloc): Likewise.

14 months agoAutomatic date update in version.in
GDB Administrator [Tue, 20 Jun 2023 00:00:13 +0000 (00:00 +0000)]
Automatic date update in version.in

14 months agoRevert "[gdb/testsuite] Clean standard_output_file dir in gdb_init"
Tom de Vries [Mon, 19 Jun 2023 17:09:58 +0000 (19:09 +0200)]
Revert "[gdb/testsuite] Clean standard_output_file dir in gdb_init"

This reverts commit b7b77500dc56e5bc21473dd4f3dde2543d894557.

14 months agoFixes 28ab59607ef40b9571c0702ffba8f6aa6fb1b033
Simon Farre [Mon, 19 Jun 2023 15:13:05 +0000 (17:13 +0200)]
Fixes 28ab59607ef40b9571c0702ffba8f6aa6fb1b033

Python formatting errors fixed, introduced by this commit.

14 months agoFixes f1a614dc8f015743e9fe7fe5f3f019303f8db718
Simon Farre [Mon, 19 Jun 2023 15:03:32 +0000 (17:03 +0200)]
Fixes f1a614dc8f015743e9fe7fe5f3f019303f8db718

Fixes failure reported by buildbot regarding ill-formatted Python code.

14 months agogdb/Python: Added ThreadExitedEvent
Simon Farre [Wed, 20 Apr 2022 08:25:47 +0000 (10:25 +0200)]
gdb/Python: Added ThreadExitedEvent

v6:
Fix comments.
Fix copyright
Remove unnecessary test suite stuff. save_var had to stay, as it mutates
some test suite state that otherwise fails.

v5:
Did what Tom Tromey requested in v4; which can be found here: https://pi.simark.ca/gdb-patches/87pmjm0xar.fsf@tromey.com/

v4:
Doc formatting fixed.

v3:
Eli:
Updated docs & NEWS to reflect new changes. Added
a reference from the .ptid attribute of the ThreadExitedEvent
to the ptid attribute of InferiorThread. To do this,
I've added an anchor to that attribute.

Tom:
Tom requested that I should probably just emit the thread object;
I ran into two issues for this, which I could not resolve in this patch;

1 - The Thread Object (the python type) checks it's own validity
by doing a comparison of it's `thread_info* thread` to nullptr. This
means that any access of it's attributes may (probably, since we are
in "async" land) throw Python exceptions because the thread has been
removed from the thread object. Therefore I've decided in v3 of this
patch to just emit most of the same fields that gdb.InferiorThread has, namely
global_num, name, num and ptid (the 3-attribute tuple provided by
gdb.InferiorThread.ptid).

2 - A python user can hold a global reference to an exiting thread. Thus
in order to have a ThreadExit event that can provide attribute access
reliably (both as a global reference, but also inside the thread exit
handler, as we can never guarantee that it's executed _before_ the
thread_info pointer is removed from the gdbpy thread object),
the `thread_info *` thread pointer must not be null. However, this
comes at the cost of gdb.InferiorThread believing it is "valid" - which means,
that if a user holds takes a global reference to that
exiting event thread object, they can some time later do `t.switch()` at which
point GDB will 'explode' so to speak.

v2:
Fixed white space issues and NULL/nullptr stuff,
as requested by Tom Tromey.

v1:
Currently no event is emitted for a thread exit.

This adds this functionality by emitting a new gdb.ThreadExitedEvent.

It currently provides four attributes:
- global_num: The GDB assigned global thread number
- num: the per-inferior thread number
- name: name of the thread or none if not set
- ptid: the PTID of the thread, a 3-attribute tuple, identical to
InferiorThread.ptid attribute

Added info to docs & the NEWS file as well.

Added test to test suite.

Fixed formatting.

Feedback wanted and appreciated.

14 months agogdb/dap - Getting thread names
Simon Farre [Mon, 12 Jun 2023 19:32:46 +0000 (21:32 +0200)]
gdb/dap - Getting thread names

Renamed thread_name according to convention (_ first)

When testing firefox tests, it is apparent that
_get_threads returns threads with name field = None.

I had initially thought that this was due to Firefox setting the names
using /proc/pid/task/tid/comm, by writing directly to the proc fs the
names, but apparently GDB seems to catch this, because I re-wrote
the basic-dap.exp/c to do this specifically and it saw the changes.

So I couldn't determine right now, what operation of name change that
GDB does not pick up, but with this patch, GDB will pick up the thread
names for an applications that set the name of a thread in ways that
aren't obvious.

14 months agoFix illegal memory access implementing relocs in a fuzzed x86_64 object file.
Nick Clifton [Mon, 19 Jun 2023 11:09:11 +0000 (12:09 +0100)]
Fix illegal memory access implementing relocs in a fuzzed x86_64 object file.

  PR 30560
  * elf64-x86-64.c (elf_x86_64_relocate_section): Add more checks for a valid relocation offset.

14 months ago[gdb/testsuite] Add shared_gnat_runtime_has_debug_info
Tom de Vries [Mon, 19 Jun 2023 09:47:29 +0000 (11:47 +0200)]
[gdb/testsuite] Add shared_gnat_runtime_has_debug_info

Test-case gdb.ada/catch_ex_std.exp passes for me with package
libada7-debuginfo installed, but after removing it I get:
...
(gdb) catch exception some_kind_of_error^M
Your Ada runtime appears to be missing some debugging information.^M
Cannot insert Ada exception catchpoint in this configuration.^M
(gdb) FAIL: gdb.ada/catch_ex_std.exp: catch exception some_kind_of_error
...

The test-case contains a require gnat_runtime_has_debug_info to deal with
this, but the problem is that this checks the static gnat runtime, while this
test-case uses the shared one.

Fix this by introducing shared_gnat_runtime_has_debug_info, and requiring that
one instead.

Tested on x86_64-linux.

PR testsuite/30094
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30094

14 months ago[gdb/tui] Simplify tui_update_variables
Tom de Vries [Mon, 19 Jun 2023 09:15:56 +0000 (11:15 +0200)]
[gdb/tui] Simplify tui_update_variables

Simplify tui_update_variables by using template function
assign_return_if_changed.

Tested on x86_64-linux.

14 months ago[gdb] Add template functions assign_return/set_if_changed
Tom de Vries [Mon, 19 Jun 2023 09:15:56 +0000 (11:15 +0200)]
[gdb] Add template functions assign_return/set_if_changed

Add template functions assign_return_if_changed and assign_set_if_changed in
gdb/utils.h:
...
template<typename T> void assign_set_if_changed (T &lval, const T &val, bool &changed)
{ ... }
template<typename T> bool assign_return_if_changed (T &lval, const T &val)
{ ... }
...

This allows us to rewrite code like this:
...
  if (tui_border_attrs != entry->value)
    {
      tui_border_attrs = entry->value;
      need_redraw = true;
    }
...
into this:
...
  need_redraw |= assign_return_if_changed<int> (tui_border_attrs, entry->value);
...
or:
...
  assign_set_if_changed<int> (tui_border_attrs, entry->value, need_redraw);
...

The names are a composition of the functionality.  The functions:
- assign VAL to LVAL, and either
- return true if the assignment changed LVAL, or
- set CHANGED to true if the assignment changed LVAL.

Tested on x86_64-linux.

14 months agoriscv: Use run-time endianess for floating point literals
Andreas Schwab [Tue, 13 Jun 2023 12:49:38 +0000 (14:49 +0200)]
riscv: Use run-time endianess for floating point literals

gas/
PR binutils/30551
* config/tc-riscv.c (md_atof): Use target_big_endian instead of
TARGET_BYTES_BIG_ENDIAN.
* testsuite/gas/riscv/float-be.d: New file.
* testsuite/gas/riscv/float-le.d: New file.
* testsuite/gas/riscv/float.s: New file.

14 months agoAutomatic date update in version.in
GDB Administrator [Mon, 19 Jun 2023 00:00:12 +0000 (00:00 +0000)]
Automatic date update in version.in

14 months ago[gdb/testsuite] Clean standard_output_file dir in gdb_init
Tom de Vries [Sun, 18 Jun 2023 09:05:31 +0000 (11:05 +0200)]
[gdb/testsuite] Clean standard_output_file dir in gdb_init

In commit e2adba909e7 ("[gdb/testsuite] Clean up before compilation in
gdb.ada/call-no-debug.exp") I added some code in the test-case to remove some
files at the start of the test-case:
...
remote_file host delete [standard_output_file prog.o]
remote_file host delete [standard_output_file prog.ali]
...

Replace this with cleaning up the entire directory instead, for all
test-cases.

Tested on x86_64-linux.

Suggested-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Tom Tromey <tom@tromey.com>
14 months agoAutomatic date update in version.in
GDB Administrator [Sun, 18 Jun 2023 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in

14 months ago[gdb/testsuite] Remove f-string in gdb.python/py-unwind.py
Tom de Vries [Sat, 17 Jun 2023 10:28:58 +0000 (12:28 +0200)]
[gdb/testsuite] Remove f-string in gdb.python/py-unwind.py

on openSUSE Leap 42.3, with python 3.4, I run into a
"SyntaxError: invalid syntax" due to usage of an f-string in test-case
gdb.python/py-unwind.py.

Fix this by using string concatenation using '+' instead.

Tested on x86_64-linux.

14 months ago[gdb/testsuite] Add nopie in a few test-cases
Tom de Vries [Sat, 17 Jun 2023 10:28:58 +0000 (12:28 +0200)]
[gdb/testsuite] Add nopie in a few test-cases

When running test-case gdb.arch/i386-disp-step.exp with target board
unix/-m32/-fPIE/-pie we run into:
...
gdb compile failed, ld: i386-disp-step0.o: warning: relocation in read-only section `.text'
ld: warning: creating DT_TEXTREL in a PIE
...

Fix this by adding nopie in the compilation flags.

Likewise in a few other test-cases.

Tested on x86_64-linux.

14 months ago[gdb/testsuite] Use require in gdb.dwarf2/implptr.exp
Tom de Vries [Sat, 17 Jun 2023 10:28:58 +0000 (12:28 +0200)]
[gdb/testsuite] Use require in gdb.dwarf2/implptr.exp

In test-case gdb.dwarf2/implptr.exp I noticed:
...
} elseif {![is_x86_like_target]} {
    # This test can only be run on x86 targets.
    unsupported "needs x86-like target"
    return 0
}
...

Use instead "require is_x86_like_target".

Tested on x86_64-linux.

14 months agoAutomatic date update in version.in
GDB Administrator [Sat, 17 Jun 2023 00:00:11 +0000 (00:00 +0000)]
Automatic date update in version.in

14 months ago[gdb/testsuite] Clean up before compilation in gdb.ada/call-no-debug.exp
Tom de Vries [Fri, 16 Jun 2023 11:32:43 +0000 (13:32 +0200)]
[gdb/testsuite] Clean up before compilation in gdb.ada/call-no-debug.exp

Running test-case gdb.ada/call-no-debug.exp with target board unix/-m64 works
fine, but if we run it again with target board unix-m32, we run into:
...
gnatlink prog.ali -m32 -g -o prog^M
ld: i386:x86-64 architecture of input file `b~prog.o' is incompatible with \
  i386 output^M
...

This is due to compiling with no-force.

The test-case:
- first compiles pck.adb into pck.o (without debug info), and
- then compiles prog.adb and pck.o into prog (with debug info).

Using no-force in the second compilation make sure that pck.adb is not
compiled again, with debug info.

But it also means it will pick up intermediate files related to prog.adb from
a previous compilation.

Fix this by removing prog.o and prog.ali before compilation.

Tested on x86_64-linux.

14 months ago[gdb/testsuite] Use %progbits in gdb.arch/thumb*.S
Tom de Vries [Fri, 16 Jun 2023 10:56:32 +0000 (12:56 +0200)]
[gdb/testsuite] Use %progbits in gdb.arch/thumb*.S

In commit 0f2cd53cf4f ("[gdb/testsuite] Handle missing .note.GNU-stack") I
updated a gdb.arch/arm*.S test-case to use %progbits rather than @progbits,
but failed to do so for gdb.arch/thumb*.S.  Fix this oversight.

Tested on arm-linux-gnueabihf.

14 months agoLoongArch: Fix ld "undefined reference" error with --enable-shared
mengqinggang [Tue, 13 Jun 2023 08:07:12 +0000 (16:07 +0800)]
LoongArch: Fix ld "undefined reference" error with --enable-shared

  Because _bfd_read_unsigned_leb128 is hidden visibility, so it can't
  be referenced out of shared object.

  The new function loongarch_get_uleb128_length just used to call
  _bfd_read_unsigned_leb128.

bfd/ChangeLog:

* elfxx-loongarch.c (loongarch_get_uleb128_length): New function.
* elfxx-loongarch.h (loongarch_get_uleb128_length): New function.

gas/ChangeLog:

* config/tc-loongarch.c (md_apply_fix): Use
loongarch_get_uleb128_length.

14 months agogdb: update IRC reference from Freenode to Libera.Chat
Andrew Burgess [Fri, 16 Jun 2023 09:12:24 +0000 (10:12 +0100)]
gdb: update IRC reference from Freenode to Libera.Chat

It's been some time since the switch from Freenode to Libera.Chat,
however, there's still a reference to Freenode in the 'gdb --help'
output.  Lets update that.

14 months agox86: shrink Masking insn attribute to a single bit (boolean)
Jan Beulich [Fri, 16 Jun 2023 07:23:26 +0000 (09:23 +0200)]
x86: shrink Masking insn attribute to a single bit (boolean)

The logic can actually be expressed with less code that way, utilizing
that there are common patterns of when which form of masking is
permitted. This then also eliminates the large set of open-codings of
BOTH_MASKING in the opcode table.

14 months agoCorrect ld-elf/eh5 test for hppa64
Alan Modra [Fri, 16 Jun 2023 03:16:49 +0000 (12:46 +0930)]
Correct ld-elf/eh5 test for hppa64

Commit 3c0afdb78988 regressed this test for hppa64, because the test
had been enabled for hppa64 in the time between the mips changes and
their reversion.  This patch isn't just a simple reapply, I recreated
the testsuite change by hand for hppa64: Two lines in eh5.d might need
further changes for mips.

14 months agoAutomatic date update in version.in
GDB Administrator [Fri, 16 Jun 2023 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in

14 months agobinutils/NEWS: Mention Sony Allegrex MIPS CPU support
Maciej W. Rozycki [Thu, 15 Jun 2023 14:17:38 +0000 (15:17 +0100)]
binutils/NEWS: Mention Sony Allegrex MIPS CPU support

Mention the addition of Sony Allegrex processor support to the MIPS port.

binutils/
* NEWS: Mention Sony Allegrex MIPS CPU support.

14 months agoMIPS/GAS/testsuite: Fix `-modd-spreg'/`-mno-odd-spreg' test invocations
Maciej W. Rozycki [Thu, 15 Jun 2023 03:45:03 +0000 (04:45 +0100)]
MIPS/GAS/testsuite: Fix `-modd-spreg'/`-mno-odd-spreg' test invocations

Reformat `-modd-spreg'/`-mno-odd-spreg' test invocations in mips.exp to
fit in 79 columns

gas/
* testsuite/gas/mips/mips.exp: Reformat
`-modd-spreg'/`-mno-odd-spreg' test invocations.

14 months agoAdd additional missing Allegrex CPU instructions
David Guillen Fandos [Thu, 15 Jun 2023 03:45:03 +0000 (04:45 +0100)]
Add additional missing Allegrex CPU instructions

Allegrex supports some MIPS32 and MIPS32r2 instructions (albeit with
some encoding differences) such as bit manipulation (ins/ext) and MLA
(madd/msub).  It also features some new instructions like wsbw and
min/max or device-specific ones such as mfic.

Signed-off-by: David Guillen Fandos <david@davidgf.net>
14 months agoAdd rotation instructions to MIPS Allegrex CPU
David Guillen Fandos [Thu, 15 Jun 2023 03:45:03 +0000 (04:45 +0100)]
Add rotation instructions to MIPS Allegrex CPU

The Allegrex CPU supports bit rotation instructions as described in the
MIPS32 release 2 CPU (even though it is a MIPS-2 based CPU).

Signed-off-by: David Guillen Fandos <david@davidgf.net>
14 months agoAdd MIPS Allegrex CPU as a MIPS2-based CPU
David Guillen Fandos [Thu, 15 Jun 2023 03:45:03 +0000 (04:45 +0100)]
Add MIPS Allegrex CPU as a MIPS2-based CPU

The Allegrex CPU was created by Sony Interactive Entertainment to power
their portable console, the PlayStation Portable.
The pspdev organization maintains all sorts of tools to create software
for said device including documentation.

Signed-off-by: David Guillen Fandos <david@davidgf.net>
14 months agoGAS/doc: Correct Tag_GNU_MIPS_ABI_MSA attribute description
Maciej W. Rozycki [Thu, 15 Jun 2023 03:45:03 +0000 (04:45 +0100)]
GAS/doc: Correct Tag_GNU_MIPS_ABI_MSA attribute description

Rewrite the paragraph to match the style of Tag_GNU_MIPS_ABI_FP text
immediately above, correcting grammar and formatting at the same time.

gas/
* doc/as.texi (MIPS Attributes): Correct Tag_GNU_MIPS_ABI_MSA
attribute description.

14 months agoRevert "MIPS: gas: alter 64 or 32 for mipsisa triples if march is implicit"
Maciej W. Rozycki [Thu, 15 Jun 2023 03:45:03 +0000 (04:45 +0100)]
Revert "MIPS: gas: alter 64 or 32 for mipsisa triples if march is implicit"

This reverts commit 094025a30bb2da19df3990e0c0ff8167af823aa1.  It was
applied unapproved.

14 months agoRevert "MIPS: default r6 if vendor is img"
Maciej W. Rozycki [Thu, 15 Jun 2023 03:45:03 +0000 (04:45 +0100)]
Revert "MIPS: default r6 if vendor is img"

This reverts commit be0d391f22fe6009c3be907753975a984cbbcc23.  It was
applied unapproved.

14 months agoRevert "MIPS: fix r6 testsuites"
Maciej W. Rozycki [Thu, 15 Jun 2023 03:45:03 +0000 (04:45 +0100)]
Revert "MIPS: fix r6 testsuites"

This reverts commit ffc528aed56b9e2c171137da28690a9bb6861b0b.  It was
applied unapproved.

14 months agoRevert "MIPS: fix -gnuabi64 testsuite"
Maciej W. Rozycki [Thu, 15 Jun 2023 03:45:03 +0000 (04:45 +0100)]
Revert "MIPS: fix -gnuabi64 testsuite"

This reverts commit cb81e84c72933a7fad10b75b7e270d92d8d65251.  It was
applied unapproved.

14 months agoRevert "MIPS: fix some ld testcases with compiler"
Maciej W. Rozycki [Thu, 15 Jun 2023 03:45:03 +0000 (04:45 +0100)]
Revert "MIPS: fix some ld testcases with compiler"

This reverts commit a0631c1501c113c04891c9a24a9ff5276257f28d.  It was
applied unapproved.

14 months agoRevert "MIPS: add MT ASE support for micromips32"
Maciej W. Rozycki [Thu, 15 Jun 2023 03:45:03 +0000 (04:45 +0100)]
Revert "MIPS: add MT ASE support for micromips32"

This reverts commit acce83dacff0ce43677410c67aaae32817afe991.  It was
applied unapproved.

14 months agoRevert "MIPS: sync oprand char usage between mips and micromips"
Maciej W. Rozycki [Thu, 15 Jun 2023 03:45:03 +0000 (04:45 +0100)]
Revert "MIPS: sync oprand char usage between mips and micromips"

This reverts commit 5b207b919483f67311a73dfc1de8897ecfd8e776.  It was
applied unapproved.

14 months agoRe: Add some expected failures for bfin linker tests
Alan Modra [Thu, 15 Jun 2023 02:15:03 +0000 (11:45 +0930)]
Re: Add some expected failures for bfin linker tests

After commit 7ade0f1582c4 I was seeing bfin-elf +XPASS: weak symbols,
and on looking into the bfin targets a little, discovered we have two
bfin-linux targets.  One, bfin-uclinux, is like bfin-elf in that
ld -m elf32bfin is the default, and the other, bfin-linux-uclibc where
ld -m elf32bfinfd is the default.  So putting bfin-*-*linux* in test
xfails or elsewhere is wrong.  We want bfin-*-linux* instead to just
select the fdpic bfin target.

This patch corrects wrong bfin target triples in the ld testsuite,
not just the recent change but others I'd added to xfails too.
It also fixes the bfin-linux-uclibc ld-elf/64ksec fail