Commit Graph

121411 Commits

Author SHA1 Message Date
Alan Modra
46b9f07dfe PR 32721, internal error in tc-i386.c:parse_register
pr30117 showed one of the assertions added by 4d1bb7955a was too
strict.  oss-fuzz also found the second assertion to be too strict,
with this testcase distilled from 7k of garbage source:

 A=%eax%%!
 Y=A
 Z=A
 or $6,Z

	PR 32721
	* config/tc-i386.c (parse_register): Move "know" into
	condition.  Simplify.
2025-02-20 12:02:10 +10:30
Tom Tromey
d08ab84d89 Hoist language-finding in expand_symtabs_matching
Right now, cooked_index_functions::expand_symtabs_matching computes
the language for each component of a split name, using the language of
the corresponding entry.

Instead, I think that we want to do all the comparisons using the
final entry's language.  I don't think there's a way to trigger bad
behavior here right now, but with another series I'm working on, we
end up with some entries whose language can't reliably be determined;
and in this case using the final entry's language avoids issues.

I suspect we could also dispense with the per-segment name-matcher
lookup as well.
2025-02-19 18:11:24 -07:00
Tom Tromey
c91f9c8c0a Move producer checks to dwarf2_cu
This changes the various producer-checking functions to be methods on
dwarf2_cu.  It adds a few new caching members as well -- every one
that could reasonably be done this way has been converted, with the
only exception being a gdbarch hook.

Note the new asserts in the accessors.  Without the earlier
prepare_one_comp_unit change, these could trigger in some modes.
2025-02-19 17:58:04 -07:00
Tom Tromey
f1462b65ff Make prepare_one_comp_unit a method of cutu_reader
This changes prepare_one_comp_unit to be a private method of
cutu_reader.  This should make it somewhat simpler to reason about.
2025-02-19 17:58:04 -07:00
Tom Tromey
0aa72b65f7 Clean up calls to prepare_one_comp_unit
Currently, prepare_one_comp_unit is called somewhat haphazardly: it is
mostly called when a CU is read, but some places manage to instantiate
a cutu_reader* without calling it, and some code (e.g.,
read_file_scope) calls it without really needing to.

Aside from contributing to the general confusion around CU reading,
this doesn't really cause problems in the current tree.  However, it
is possible for the DWARF reader to check the CU's producer before it
is ever set -- which is certainly unintended.
2025-02-19 17:58:02 -07:00
Tom Tromey
2e8e54fc54 Move producer_is_realview to producer.c
This moves the producer_is_realview to producer.c.
2025-02-19 17:57:15 -07:00
Tom Tromey
e17e25351f Clean up DW_TAG_namelist handling in new_symbol
In dwarf2/read.c:new_symbol, DW_TAG_namelist is listed in the same
part of the "switch" as other tags.  However, it effectively shares no
code with these.  This patch splits it into its own case.

Longer term I think new_symbol should be split up drastically.
2025-02-19 17:55:26 -07:00
GDB Administrator
02fd6e5459 Automatic date update in version.in 2025-02-20 00:00:21 +00:00
Georg-Johann Lay
1d68c42f29 gas/config/tc-avr.c: Fix an indentation glitch.
gas/
	* config/tc-avr.c (md_assemble): Fix indentation.
2025-02-19 21:03:09 +01:00
Lancelot Six
6ded2b8692 gdb/mi: Fix segfault when attaching a rocm process with MI
When using the MI interpreter, if someone was to attach to a ROCm
process which has active GPU waves, GDB would issue a segfault as
follows:

    attach 1994813
    &"attach 1994813\n"
    ~"Attaching to process 1994813\n"
    =thread-group-started,id="i1",pid="1994813"
    =thread-created,id="1",group-id="i1"
    =thread-created,id="2",group-id="i1"
    ~"[New LWP 1994828]\n"
    *running,thread-id="2"
    =thread-created,id="3",group-id="i1"
    ~"[New LWP 1994825]\n"
    *running,thread-id="3"
    =thread-created,id="4",group-id="i1"
    ~"[New LWP 1994823]\n"
    *running,thread-id="4"
    ^done
    =library-loaded,...
    [...]
    ~"[Thread debugging using libthread_db enabled]\n"
    ~"Using host libthread_db library \"/lib/x86_64-linux-gnu/libthread_db.so.1\".\n"
    =thread-created,id="5",group-id="i1"
    &"\n\n"
    &"Fatal signal: "
    &"Segmentation fault"
    &"\n"
    &"----- Backtrace -----\n"
    &"Backtrace unavailable\n"
    &"---------------------\n"
    &"A fatal error internal to GDB has been detected, further\ndebugging is not possible.  GDB will now terminate.\n\n"
    &"This is a bug, please report it."
    &"  For instructions, see:\n"
    &"<https://github.com/ROCm-Developer-Tools/ROCgdb/issues>"
    &"."
    &"\n\n"
    Segmentation fault

The issue comes from using a non-initialized pointer in mi_on_resume_1:

    if (!mi->running_result_record_printed && mi->mi_proceeded)
      {
        gdb_printf (mi->raw_stdout, "%s^running\n",
                    mi->current_token ? mi->current_token : "");
      }

In this instance, "mi->current_token" has an uninitialized value.  This is a
regression introduced by:

    commit def2803789
    Date:   Wed Sep 6 11:02:00 2023 -0400

        gdb/mi: make current_token a field of mi_interp

Before this patch, current_token was a global implicitly 0-initialized.  Since
it is now a class field, it is not 0-initialized by default anymore.  This
patch changes this.

Change-Id: I3f00b080318a70405d881ff0abe02b2c5cb1f9d8
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Approved-By: Tom Tromey <tom@tromey.com>
2025-02-19 16:52:25 +00:00
Simon Marchi
b0c676f456 gdb/dwarf: add logging for CU expansion
I was trying to get an understanding of which CUs were expanded when,
and how much time it was taking.  I wrote this patch to add some logging
related to that, and I think it would be useful to have upstream, to
better understand performance problems related to over-eager CU
expansion, for example.

 - add DWARF_READ_SCOPED_DEBUG_START_END
 - use it in process_queue, to wrap the related expansion messages
   together
 - add a message in maybe_queue_comp_unit when enqueuing a comp unit
 - add timing information to messages in process_queue, indicating how
   much time it took to expand a given symtab
 - count the number of expansions done in a single call to process_queue

    [dwarf-read] process_queue: start: Expanding one or more symtabs of objfile /home/smarchi/build/binutils-gdb/gdb/testsuite/outputs/gdb.dwarf2/dw-form-ref-addr-with-type-units/dw-form-ref-addr-with-type-units ...
      [dwarf-read] process_queue: Expanding symtab of CU at offset 0xc
      [dwarf-read] maybe_queue_comp_unit: Queuing CU for expansion: section offset = 0x38b, queue size = 2
      [dwarf-read] process_queue: Done expanding CU at offset 0xc, took 0.001s
      [dwarf-read] process_queue: Expanding symtab of CU at offset 0x38b
      [dwarf-read] process_queue: Done expanding CU at offset 0x38b, took 0.000s
      [dwarf-read] process_queue: Done expanding 2 symtabs.
    [dwarf-read] process_queue: end: Expanding one or more symtabs of objfile /home/smarchi/build/binutils-gdb/gdb/testsuite/outputs/gdb.dwarf2/dw-form-ref-addr-with-type-units/dw-form-ref-addr-with-type-units ...

Change-Id: I5237d50e0c1d06be33ea83a9120b5fe1cf7ab8c2
Approved-By: Tom Tromey <tom@tromey.com>
2025-02-19 11:17:21 -05:00
Simon Marchi
8af6d60eb9 gdb/dwarf: set is_debug_types in signatured_type constructor
This makes it more obvious that all created signatured_type objects have
this flag set.

Also, remove an unnecessary assignment in create_cus_hash_table: when
constructing the dwarf2_per_cu_data object, is_debug_types is already
initialized to 0/false.

Change-Id: I6d28b17ac77edc040172254f6970d05ebc4a47f4
Approved-By: Tom Tromey <tom@tromey.com>
2025-02-19 11:14:41 -05:00
Simon Marchi
c44ab627b0 gdb/dwarf: pass section to dwarf2_per_cu_data constructor
Same as the previous patch, but for the containing section.

Change-Id: I469147cce21525d61b3cf6edd9a9f4b12027c176
Approved-By: Tom Tromey <tom@tromey.com>
2025-02-19 11:14:41 -05:00
Simon Marchi
a47e2297fc gdb/dwarf: pass section offset to dwarf2_per_cu_data constructor
Similar to the previous patch, but for the offset within the containing
section.

Change-Id: I1d76e1f88002bca924e0b12fd78c7ea49d36c0ec
Approved-By: Tom Tromey <tom@tromey.com>
2025-02-19 11:14:41 -05:00
Simon Marchi
e3f9a1e14a gdb/dwarf: pass dwarf2_per_bfd to dwarf2_per_cu_data constructor
Pass a dwarf2_per_bfd to the constructor of dwarf2_per_cu_data and set
the per_bfd field there.  All "real" instantiations of
dwarf2_per_cu_data must have a valid, non-nullptr dwarf2_per_bfd
backlink, this makes it a bit more obvious.  The instantiations of
dwarf2_per_cu_data that receive a nullptr dwarf2_per_bfd are the ones
used to do hash map lookups and the ones used in selftests.

Remove an unnecessary assignment of per_bfd in
fill_in_sig_entry_from_dwo_entry: the per_bfd field is already set when
the signatured_type object is constructor (before that, it was set in
allocate_signatured_type).

Change-Id: Ifeebe55fdb1bc2de4de9c852033fafe8abdfde8a
Approved-By: Tom Tromey <tom@tromey.com>
2025-02-19 11:14:41 -05:00
Simon Marchi
863a3131b8 gdb/dwarf: change some functions from "per objfile" to "per bfd"
I noticed that the following functions accept a "dwarf2_per_objfile",
but they can actually accept a less specific "dwarf2_per_bfd".  This
makes it more obvious that the work they do is per BFD and not per
objfile.

 - add_type_unit
 - lookup_dwo_file_slot
 - create_dwo_unit_in_dwp_v1
 - create_dwp_v2_or_v5_section
 - create_dwo_unit_in_dwp_v2
 - create_dwo_unit_in_dwp_v5
 - lookup_dwo_unit_in_dwp

Change-Id: I200cd77850ce0ffa29fc1b9d924056fdce2559f8
Approved-By: Tom Tromey <tom@tromey.com>
2025-02-19 11:14:41 -05:00
Simon Marchi
890d1d385f gdb/dwarf: std::unordered_{set,map} -> gdb::unordered_{set,map} throughout
No behavior changes expected.

Change-Id: I16ff6c67058362c65cc8edb05d1948e48be6b2e1
Approved-By: Tom Tromey <tom@tromey.com>
2025-02-19 11:14:41 -05:00
Qwinci
df50675d4e gdb/remote: don't error if qGetTIBAddr is unsupported
This change makes it possible to debug PE executables run in e.g. Qemu
without needing to set osabi to none, it breaks backtrace
and commands like finish if frame pointers are not present but SEH unwind info is.

Approved-By: Tom Tromey <tom@tromey.com>
2025-02-19 08:58:27 -07:00
Hui Li
405836704b gdb: LoongArch: Extend the maximum number of hardware watchpoints
The maximum number of load/store watchpoints and fetch instruction
watchpoints is 14 each according to LoongArch Reference Manual [1],
so extend the maximum number of hardware watchpoints from 8 to 14.

A new struct user_watch_state_v2 was added into uapi in the related
kernel commit 531936dee53e ("LoongArch: Extend the maximum number of
watchpoints") [2], but there may be no struct user_watch_state_v2 in
the system header in time. Modify the struct loongarch_user_watch_state
in GDB which is same with the uapi struct user_watch_state_v2.

As far as I can tell, the only users for this struct in the userspace
are GDB and LLDB, there are no any problems of software compatibility
between the application and kernel according to the analysis.

The compatibility problem has been considered while developing and
testing. When the applications in the userspace get watchpoint state,
the length will be specified which is no bigger than the sizeof struct
user_watch_state or user_watch_state_v2, the actual length is assigned
as the minimal value of the application and kernel in the generic code
of ptrace:

kernel/ptrace.c: ptrace_regset():

	kiov->iov_len = min(kiov->iov_len,
                            (__kernel_size_t) (regset->n * regset->size));

	if (req == PTRACE_GETREGSET)
                return copy_regset_to_user(task, view, regset_no, 0,
                                           kiov->iov_len, kiov->iov_base);
	else
                return copy_regset_from_user(task, view, regset_no, 0,
                                             kiov->iov_len, kiov->iov_base);

For example, there are four kind of combinations, all of them work well.

(1) "older kernel + older app", the actual length is 8+(8+8+4+4)*8=200;
(2) "newer kernel + newer app", the actual length is 8+(8+8+4+4)*14=344;
(3) "older kernel + newer app", the actual length is 8+(8+8+4+4)*8=200;
(4) "newer kernel + older app", the actual length is 8+(8+8+4+4)*8=200.

BTW, LLDB also made this change in the related commit ff79d83caeee
("[LLDB][LoongArch] Extend the maximum number of watchpoints") [3]

[1] https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#control-and-status-registers-related-to-watchpoints
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=531936dee53e
[3] https://github.com/llvm/llvm-project/commit/ff79d83caeee

Signed-off-by: Hui Li <lihui@loongson.cn>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
2025-02-19 22:02:40 +08:00
Alan Modra
cb1861cb8f bintuils/dwarf.c indentation fixes
plus a few other formatting fixes.
2025-02-19 23:11:23 +10:30
Alan Modra
e51fdff7d2 binutils/dwarf.c debug_information leak
It is possible with fuzzed files to have num_debug_info_entries zero
after allocating space for debug_information, leading to multiple
allocations.

	* dwarf.c (process_debug_info): Don't test num_debug_info_entries
	to determine whether debug_information has been allocated,
	test alloc_num_debug_info_entries.
2025-02-19 23:03:11 +10:30
Tankut Baris Aktemur
1dd0c74551 gdbserver, remote: introduce "id_str" in the "qXfer:threads:read" XML
GDB prints the target id of a thread in various places such as the
output of the "info threads" command in the "Target Id" column or when
switching to a thread.  A target can define what to print for a given
ptid by overriding the `pid_to_str` method.

The remote target is a gateway behind which one of many various
targets could be running.  The remote target converts a given ptid to
a string in a uniform way, without consulting the low target at the
server-side.

In this patch we introduce a new attribute in the XML that is sent in
response to the "qXfer:threads:read" RSP packet, so that a low target
at the server side, if it wishes, can specify what to print as the
target id of a thread.

Note that the existing "name" attribute or the "extra" text provided
in the XML are not sufficient for the server-side low target to
achieve the goal.  Those attributes, when present, are simply appended
to the target id by GDB.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Approved-By: Simon Marchi <simon.marchi@efficios.com>
2025-02-19 09:15:44 +01:00
GDB Administrator
4546dae1ff Automatic date update in version.in 2025-02-19 00:00:20 +00:00
Alan Modra
6592258718 PR32715, ld-elf/pr29072 fail with --disable-default-execstack
--disable-default-stack is an alias for --enable-default-execstack=no.
The existing check only looked for the latter config option.

	PR 32715
	* testsuite/ld-elf/elf.exp (target_defaults_to_execstack): Look
	in config.h for result of --enable-default-execstack.
2025-02-19 08:40:38 +10:30
Alan Modra
ba6ad3a18c PR32716, objdump -i memory leak
PR binutils/32716
	* bucomm.c (display_info): Free arg.info.
2025-02-19 08:01:13 +10:30
Alan Modra
28588dc52c PR32703, Null pointer dereference in bfd/linker.c
NULL is a possible return from bfd_section_already_linked_table_lookup
if out-of-memory.

	PR 32703
	* linker.c (_bfd_generic_section_already_linked): Catch
	bfd_section_already_linked_table_lookup failure.
	* coffgen.c (_bfd_coff_section_already_linked): Likewise.
2025-02-18 19:36:18 +10:30
Tankut Baris Aktemur
2b020f5323 testsuite, mi: prevent buffer overflow in get_mi_thread_list
If there is a large number of threads in the input program, the expect
buffer in `get_mi_thread_list` would become full.  Prevent this by
consuming the buffer in small pieces.

Regression-tested using the gdb.mi tests.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2025-02-18 09:13:43 +01:00
Tom de Vries
ec51c7ce9f [gdb/testsuite] Don't start gdb in gdb.base/gstack.exp
In test-case gdb.base/gstack.exp we start a gdb implicitly using
prepare_for_testing.

The gdb is not really used, but its spawn_id (available in variable
gdb_spawn_id) is used in a gdb_test_multiple, which is used to interact with
the gstack process.

Usually, a running gdb is cleaned up at test-case exit in gdb_finish, which
calls gdb_exit, which by default calls gdb_default_exit, which does
'send_gdb "quit\n"'.

However, this sends a quit to the host process expect is currently talking to,
defined by board_info(host,fileid), and after spawning gstack that's gstack, not
gdb.

Fix this by:
- using build_executable instead of prepare_for_testing to not spawn an unused
  gdb, and
- changing the gdb_test_multiple into a gdb_expect, eliminating the implicit use
  of gdb_spawn_id.

Tested on x86_64-linux.

Reviewed-By: Keith Seitz <keiths@redhat.com>

PR testsuite/32709
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32709
2025-02-18 08:47:33 +01:00
Tom de Vries
24a2f1a6b0 [gdb] Fix some typos
Fix typos:
...
overriden -> overridden
reate -> create
...

Tested on x86_64-linux.
I
2025-02-18 07:36:44 +01:00
H.J. Lu
1256b9860f ld: Add tests for PR ld/32690
Without

commit 230a788eb2
Author: Alan Modra <amodra@gmail.com>
Date:   Tue Feb 18 08:54:06 2025 +1030

    PR32690, assertion failure in lang_size_relro_segment

this test triggers the linker error:

.../ld: internal error .../ld/ldlang.c 6618
collect2: error: ld returned 1 exit status

with GCC 10 or above on x86-64.

	PR ld/32690
	* testsuite/ld-elf/elf.exp: Run PR ld/32690 tests.
	* testsuite/ld-elf/pr32690.h: New file.
	* testsuite/ld-elf/pr32690a.c: Likewise.
	* testsuite/ld-elf/pr32690b.c: Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-02-18 12:31:30 +08:00
Alan Modra
3bb7d3ea81 Re: bfd_set_section_alignment errors.
Fix another one for aarch64.
2025-02-18 11:26:55 +10:30
Alan Modra
104443510a Use bfd_link_align_section in a few more places
Some of these aren't relevant to the relro bug.  Some are.  They all
matter if early estimation of section layout needs to be good.

	PR ld/32690
	* elf32-bfin.c (bfin_adjust_dynamic_symbol),
	* elf32-hppa.c (elf32_hppa_late_size_sections),
	* elf32-microblaze.c (microblaze_elf_adjust_dynamic_symbol),
	* elf32-nds32.c (nds32_elf_adjust_dynamic_symbol),
	* elf64-ppc.c (size_global_entry_stubs),
	* elflink.c (_bfd_elf_tls_setup),
	* elfxx-mips.c (mips_elf_add_la25_intro),
	(mips_elf_add_la25_trampoline),
	(_bfd_mips_elf_adjust_dynamic_symbol),
	* elfxx-x86.c (_bfd_x86_elf_late_size_sections): Use
	bfd_link_align_section to ensure correct output section
	alignment.
2025-02-18 11:26:55 +10:30
GDB Administrator
d2fea23a4a Automatic date update in version.in 2025-02-18 00:00:32 +00:00
Alan Modra
5474637657 bfd_set_section_alignment errors
I noticed when making the change from "einfo" to "fatal" that the
alignment error in _bfd_elf_link_create_gnu_property_sec lacked a %P,
and then decided that a bfd_set_section_alignment that can't happen
does not merit a separate error message.  elfxx-x86.c had copied the
same code, so fix that too.  In fact, every bfd_set_section_alignment
call in elfxx-x86.c will always return true absent some future
programming error.  This patch makes those that accompany making a
section lose their "failed to align " error and share the "failed to
create" error.  Those that are changing alignment of a section created
elsewhere now abort on bfd_set_section_alignment returning false.
2025-02-18 09:16:57 +10:30
Alan Modra
d26161914c PR 32603, more ld -w misbehaviour
Commit 8d97c1a53f claimed to replace all einfo calls using %F with
a call to fatal.  It did so only for the ld/ directory.  This patch
adds a "fatal" to linker callbacks, and replaces those calls in bfd/
too.
2025-02-18 09:16:57 +10:30
Alan Modra
230a788eb2 PR32690, assertion failure in lang_size_relro_segment
This introduces a new function which should be used whenever the
linker needs to increase section alignment after mapping input to
output sections.

	PR ld/32690
	* linker.c (bfd_link_align_section): New function.
	* elflink.c (_bfd_elf_adjust_dynamic_copy): Use it.
	* bfd-in2.h: Regenerate.
2025-02-18 09:16:57 +10:30
Simon Marchi
db20cb1197 gdb/dwarf: make maybe_queue_comp_unit return bool
Change-Id: I9a6bf27b72f7efb1cc4cea5345db14969e794bdb
2025-02-17 14:57:06 -05:00
Simon Marchi
9cf88ff5ad gdb/dwarf: remove spurious space
Change-Id: I420280721cb734a2e061743309bf9b25d2179f8f
2025-02-17 14:49:11 -05:00
Simon Marchi
324a22ed37 gdb: remove unused include in symfile-debug.c
This is reported as unused by clangd.

Change-Id: Ida5a93b632cd4477fb91df1ab0edf66f12a28f64
2025-02-17 14:28:54 -05:00
Simon Marchi
531d69412e gdb: remove unused include in objfiles.h
clangd reports this include as unused.

Change-Id: I6a4224d8aa581fea2336da124c89ade09f573af3
2025-02-17 14:28:35 -05:00
Tankut Baris Aktemur
cb82077fef testsuite, mi: fix indentation in get_mi_thread_list
The `get_mi_thread_list` procedure's body is incorrectly indented.
Fix it.

There is one line that was already long.  Consider it an exception and
don't bother breaking it.
2025-02-17 20:05:49 +01:00
GDB Administrator
114396befd Automatic date update in version.in 2025-02-17 00:00:09 +00:00
Andrew Oates
3aaca06b67 gdb: fix color_option_def compile error (clang)
color_option_def was added in commit 6447969d0 ("Add an option with a
color type."), but not used.

The color_option_def constructor passes the wrong number of arguments
to the option_def constructor.  Since color_option_def is a template and
never actually instantiated, GCC does not fail to compile this.  clang
generates an error (see below).

This passes nullptr to the extra_literals_ option_def ctor argument,
which matches what filename_option_def above it does.

clang's generated error:
  ../../gdb/cli/cli-option.h:343:7: error: no matching constructor for initialization of 'option_def'
      : option_def (long_option_, var_color,
        ^           ~~~~~~~~~~~~~~~~~~~~~~~~
  ../../gdb/cli/cli-option.h:50:13: note: candidate constructor not viable: requires 8 arguments, but 7 were provided
    constexpr option_def (const char *name_,
              ^
  ../../gdb/cli/cli-option.h:37:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 7 were provided
  struct option_def
         ^
  ../../gdb/cli/cli-option.h:37:8: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 7 were provided

Approved-By: Tom de Vries <tdevries@suse.de>
2025-02-16 16:16:25 +01:00
GDB Administrator
5b4873b6de Automatic date update in version.in 2025-02-16 00:00:12 +00:00
Alan Modra
ac8a1a52cf score-elf gas SEGV
Commit 3fb6f5457e typoed an array subscript.

	* config/tc-score7.c (s7_gen_reloc): Correct array subscript.
	* testsuite/gas/score/pr32700.d,
	* testsuite/gas/score/pr32700.s: New test.
	* testsuite/gas/score/relax.exp: Run it.
2025-02-16 08:43:10 +10:30
Alan Modra
b75c7a81e0 PR32698, potential null pointer dereference in tekhex.c
PR 32698
	* tekhex.c (find_chunk): Remove unnecessary casts.
	(insert_byte): Check and return status from find_chunk.
	(move_section_contents): Likewise.
	(tekhex_get_section_contents, tekhex_set_arch_mach): Return
	status from move_section_contents.
	(first_phase): Check and return status from first_phase.
2025-02-16 08:43:10 +10:30
Alan Modra
3a69ff93b5 riscv disassembler leak
Commit 3f61a38b5e moved the disassembler subset_list from a static
variable to disassembler private_data.  It is now malloc'd in
riscv_init_disasm_info so should be freed when disassemble_free_target
runs.

	* riscv-dis.c (disassemble_free_riscv): Free subset_list.
2025-02-16 08:43:10 +10:30
Anghelo Carvajal
caaa18f212 MIPS objdump: Add eabi32 and eabi64 ABI options
Extend gpr and fpr register names with names suitable for both EABIs.

Heavily inspired by the EABI documenation written by Eric Christopher,
which can be read at
https://sourceware.org/legacy-ml/binutils/2003-06/msg00436.html

2025-02-15  Anghelo Carvajal  <angheloalf95@gmail.com>

	* mips-dis.c (mips_fpr_names_eabi32): New variable.
	(mips_fpr_names_eabi64): New variable.
	(mips_abi_choices): Add "eabi32" and "eabi64" options.

Signed-off-by: Anghelo Carvajal <angheloalf95@gmail.com>
2025-02-15 01:30:58 +00:00
Maciej W. Rozycki
e8f545e985 MIPS/GAS/testsuite: Reuse n64 GPR disassembly for n32
The MIPS ABI register names are the same between n64 and n32, so remove
duplication and use n64 GPR disassembly output for the n32 test as well.
The tests were developed long before we gained output reuse support.
2025-02-15 01:30:58 +00:00
Maciej W. Rozycki
83eab1060d MIPS/GAS: Fix comment about "img" vendor configurations
Adjust a comment about "img" vendor configurations to comply with the
GNU coding standards.
2025-02-15 01:30:58 +00:00