Commit Graph

114184 Commits

Author SHA1 Message Date
Tom de Vries
81f5b5156f [gdb/testsuite] Fix gdb.server/file-transfer.exp for remote host
Fix test-case gdb.server/file-transfer.exp for remote host using
gdb_remote_download and host_standard_output_file.

Tested on x86_64-linux.
2023-03-28 17:48:35 +02:00
Tom de Vries
9121a23fa7 [gdb/testsuite] Fix local-remote-host-native.exp for gdb.server tests
When running test-case gdb.server/stop-reply-no-thread-multi.exp with
host+target board local-remote-host-native, I run into a time-out:
...
(gdb) PASS: gdb.server/stop-reply-no-thread-multi.exp: target-non-stop=off: \
  to_disable=: disconnect
builtin_spawn /usr/bin/ssh -t -l vries 127.0.0.1 gdbserver --once \
  localhost:2346 stop-reply-no-thread-multi^M
Process stop-reply-no-thread-multi created; pid = 32600^M
Listening on port 2346^M
set remote threads-packet off^M
FAIL: gdb.server/stop-reply-no-thread-multi.exp: target-non-stop=off: \
  to_disable=: set remote threads-packet off (timeout)
...

This is due to this line in ${board}_spawn:
...
    set board_info($board,fileid) $spawn_id
...

We have the following series of events:
- gdb is spawned, setting fileid
- a few gdb commands (set height etc) are send using fileid, arrive at gdb and
  are successful
- gdbserver is spawned, overwriting fileid
- the next gdb command is sent using fileid, so it's send
  to gdbserver instead of gdb, and we run into the timeout.

There is some notion of current gdb, tracked in both gdb_spawn_id and fileid
of the host board (see switch_gdb_spawn_id).  And because the host and target
board are the same, spawning something on the target overwrites the fileid on
host, and consequently the current gdb.

Fix this by only setting fileid when spawning gdb.

Tested on x86_64-linux.

Now gdb.server/*.exp passes for host+target board local-remote-host-native,
except for file-transfer.exp.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29734
2023-03-28 17:48:34 +02:00
Enze Li
357bff173e gdb: use dynamic year in update-freebsd.sh
When running update-freebsd.sh on FreeBSD, I see the following
modification in freebsd.xml,

-<!-- Copyright (C) 2009-2023 Free Software Foundation, Inc.
+<!-- Copyright (C) 2009-2020 Free Software Foundation, Inc.

It means that each time, when we running the update-freebsd.sh on
FreeBSD, we have to correct the year of copyright manually. So fix this
issue by using dynamic year.

Tested by regenerating freebsd.xml on FreeBSD/amd64.

Reviewed-By: John Baldwin <jhb@FreeBSD.org>
Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-03-28 22:02:19 +08:00
Tom de Vries
134ec14b15 [gdb/testsuite] Fix gdb.server/non-existing-program.exp with remote-gdbserver-on-localhost
With test-case gdb.server/non-existing-program.exp and native, I have reliably:
...
(gdb) builtin_spawn gdbserver stdio non-existing-program^M
stdin/stdout redirected^M
/bin/bash: line 0: exec: non-existing-program: not found^M
During startup program exited with code 127.^M
Exiting^M
PASS: gdb.server/non-existing-program.exp: gdbserver exits cleanly
...

But with target board remote-gdbserver-on-localhost I sometimes have:
...
(gdb) builtin_spawn /usr/bin/ssh -t -l remote-target localhost gdbserver \
  stdio non-existing-program^M
stdin/stdout redirected^M
/bin/bash: line 0: exec: non-existing-program: not found^M
During startup program exited with code 127.^M
Exiting^M
Connection to localhost closed.^M^M
PASS: gdb.server/non-existing-program.exp: gdbserver exits cleanly
...
and sometimes the exact same output, but a FAIL instead.

Fix this by replacing "Exiting\r\n$" with "Exiting\r\n" in the regexps.

Tested on x86_64-linux.
2023-03-28 14:18:44 +02:00
Alan Modra
c61b7b7b8e Avoid undefined behaviour in m68hc11 md_begin
Given p = A where p is a pointer to some type and A is an array of
that type, then the expression p - 1 + 1 evokes undefined behaviour
according to the C standard.

gcc-13 -fsanitize=address,undefined complains about this, but not
where the undefined behaviour actually occurs at tc-m68hc11.c:646.
Instead you get an error: "tc-m68hc11.c:708:20: runtime error: store
to address 0x62600000016c with insufficient space for an object of
type 'int'".  Which is a lie.  There most definitely is space there.
Oh well, diagnostics are sometimes hard to get right.  The UB is easy
to avoid.

	PR 30279
	* config/tc-m68hc11.c (md_begin): Avoid undefined pointer
	decrement.  Remove unnecessary cast.
2023-03-28 21:04:30 +10:30
Tom de Vries
d7f0f10189 [gdb/testsuite] Allow gdb.rust/expr.exp without rust compiler
Proc allow_rust_tests returns 0 when there's no rust compiler, but that gives
the wrong answer for gdb.rust/expr.exp, which doesn't require it.

Fix this by using can_compile rust in the test-cases that need it, and just
returning 1 in allow_rust_tests.

Tested on x86_64-linux.
2023-03-28 10:22:48 +02:00
Tom de Vries
29dd2d27b2 [gdb/testsuite] Add can_compile rust
If I deinstall the rust compiler, I get:
...
gdb compile failed, default_target_compile: Can't find rustc --color never.
UNTESTED: gdb.rust/watch.exp: failed to prepare
...

Fix this by adding can_compile rust, and using it in allow_rust_tests, such
that we have instead:
...
UNSUPPORTED: gdb.rust/watch.exp: require failed: allow_rust_tests
...

Since the rest of the code in allow_rust_tests is also about availability of
the rust compiler, move it to can_compile.

Tested on x86_64-linux.
2023-03-28 10:22:48 +02:00
Tom de Vries
7ec0e36e9f [gdb/testsuite] Unsupport gdb.rust for remote host
With test-case gdb.rust/watch.exp and remote host I run into:
...
Executing on host: gcc   watch.rs  -g  -lm   -o watch    (timeout = 300)
  ...
ld:watch.rs: file format not recognized; treating as linker script
ld:watch.rs:1: syntax error
  ...
UNTESTED: gdb.rust/watch.exp: failed to prepare
...

The problem is that find_rustc returns "" for remote host, so we fall back to gcc, which fails.

Fix this by returning 0 in allow_rust_tests for remote host.

Tested on x86_64-linux.
2023-03-28 10:22:48 +02:00
Alan Modra
d75137c755 ubsan: elfnn-aarch64.c:4595:19: runtime error: load of value 190
which is not a valid value for type '_Bool'

	* elfnn-aarch64.c (stub_hash_newfunc): Clear all fields past root.
2023-03-28 12:10:28 +10:30
GDB Administrator
5d15dc7658 Automatic date update in version.in 2023-03-28 00:00:13 +00:00
Tom de Vries
7e28879b3d [gdb/testsuite] Fix gnat_runtime_has_debug_info for remote host
Fix gnat_runtime_has_debug_info for remote host by checking for
allow_ada_tests.

This fixes an error for test-case gdb.testsuite/gdb-caching-proc.exp and
remote host.

Tested on x86_64-linux.
2023-03-27 23:11:41 +02:00
John Baldwin
5b9e851408 fbsd-nat: Use correct constant for target_waitstatus::sig.
Use GDB_SIGNAL_TRAP instead of SIGTRAP.  This is a no-op since the
value of SIGTRAP on FreeBSD matches the value of GDB_SIGNAL_TRAP, but
it is more correct.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-03-27 12:51:02 -07:00
John Baldwin
b48c2f0409 fbsd-nat: Avoid a direct write to target_waitstatus::kind.
This is in #ifdef'd code for a workaround for FreeBSD versions older
than 11.1 which is why it wasn't caught earlier.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-03-27 12:51:02 -07:00
John Baldwin
bf505746af fbsd-nat: Add missing spaces.
No functional change, just style fixes.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-03-27 12:51:02 -07:00
Vladimir Mezentsev
66f76c545b gprofng: 30089 [display text] Invalid number of threads
The real problem is that libcollector doesn't interpose thread_create@GLIBC_2.34
We interpose a lot of libC functions (dlopen, fork, pthread_create, etc.).
Some of these functions have versions. For example, dlopen@GLIBC_2.34,
dlopen@GLIBC_2.17, dlopen@GLIBC_2.2.5, etc.
We have to interpose each of the functions because we don't know
which version of libC will be used during profiling.
Historically, we have used three versions of scripts (mapfile.aarch64-Linux,
mapfile.amd64-Linux, mapfile.intel-Linux).
Three are not needed. One is enough

The fixes below include:
 - merged all version symbols into one version script.
 - added new version symbols which are defined in latest versions of libC.
 - removed unused defines and duplicated code.
 - added the DCL_FUNC_VER macro to define the version symbols.

Tested on x86_64 and aarch64 (OL8/OL9). No regression.

gprofng/ChangeLog
2023-03-23  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	PR gprofng/30089
	* libcollector/Makefile.am: Use libgprofng.ver instead of mapfile.*
	* libcollector/configure.ac: Delete GPROFNG_VARIANT.
	* src/collector_module.h: Move the SYMVER_ATTRIBUTE macro to collector.h
	* libcollector/collector.h: Add macros (SYMVER_ATTRIBUTE, DCL_FUNC_VER).
	Remove unused defines.
	* libcollector/dispatcher.c: Interpose functions from libC.
	Clean up the old code.
	* libcollector/iotrace.c: Likewise.
	* libcollector/libcol_util.c: Likewise.
	* libcollector/linetrace.c: Likewise.
	* libcollector/mmaptrace.c: Likewise.
	* libcollector/synctrace.c: Likewise.
	* libcollector/libgprofng.ver: New file.
	* libcollector/Makefile.in: Rebuild.
	* libcollector/configure: Rebuild.
	* libcollector/mapfile.aarch64-Linux: Removed.
	* libcollector/mapfile.amd64-Linux: Removed.
	* libcollector/mapfile.intel-Linux: Removed.
	* libcollector/mapfile.sparc-Linux: Removed.
	* libcollector/mapfile.sparcv9-Linux: Removed.
2023-03-27 11:47:52 -07:00
Pedro Alves
57573e54af linux-nat: introduce pending_status_str
I noticed that some debug log output printing an lwp's pending status
wasn't considering lp->waitstatus.  This fixes it, by introducing a
new pending_status_str function.

Also fix the comment in gdb/linux-nat.h describing
lwp_info::waitstatus and details the description of lwp_info::status
while at it.

Change-Id: I66e5c7a363d30a925b093b195d72925ce5b6b980
Approved-By: Andrew Burgess <aburgess@redhat.com>
2023-03-27 19:02:04 +01:00
Pedro Alves
58c010877e displaced step: pass down target_waitstatus instead of gdb_signal
This commit tweaks displaced_step_finish & friends to pass down a
target_waitstatus instead of a gdb_signal.  This is needed because a
patch later in the step-over-{thread-exit,clone] series will want to
make displaced_step_buffers::finish handle
TARGET_WAITKIND_THREAD_EXITED.  It also helps with the
TARGET_WAITKIND_THREAD_CLONED patch later in that same series.

It's also a bit more logical this way, as we don't have to pass down
signals when the thread didn't actually stop for a signal.  So we can
also think of it as a clean up.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27338
Change-Id: I4c5d338647b028071bc498c4e47063795a2db4c0
Approved-By: Andrew Burgess <aburgess@redhat.com>
2023-03-27 17:17:20 +01:00
Tom de Vries
1e77fa23a0 [gdb/testsuite] Fix gdb.stabs/exclfwd.exp for remote host
Fix test-case gdb.stabs/exclfwd.exp for remote host using include_file.

Tested on x86_64-linux.
2023-03-27 18:06:19 +02:00
Tom de Vries
bc246dae0c [gdb/testsuite] Fix gdb.stabs/weird.exp for remote host
Fix test-case gdb.stabs/weird.exp for remote host by not using an absolute
destfile argument to gdb_remote_download, which doesn't work well with remotedir.
2023-03-27 18:06:19 +02:00
Tom de Vries
8ee5cc9fc0 [gdb/testsuite] Fix gdb.gdb/unittest.exp for remote host
Fix test-case gdb.gdb/unittest.exp for remote host, by:
- disabling the completion tests if readline is not used, and
- not using with_gdb_cwd $dir for remote host (because it does
  not support changing to ".").

Tested on x86_64-linux.
2023-03-27 17:40:06 +02:00
Tom de Vries
b0af93ad2b [gdb/testsuite] Skip do_self_tests on remote host
In do_self_tests we try to find out the location of the gdb to debug, which
will then be copied and renamed to xgdb.

In principle, the host board specifies the location of GDB, on host.

With remote host, we could upload that gdb from host to build/target, but we
would miss the data directory (which is listed as the reason to skip
do_self_tests for remote target).

We could fix that by instead taking the gdb from build instead, but that
wouldn't work with installed testing.

It seems easier to just skip this on remote host.

It could be made to work for the "[is_remote host] && [is_remote target]
&& host == target" scenario (see board local-remote-host-native.exp), but
that doesn't seem worth the effort.

Tested on x86_64-linux.
2023-03-27 17:40:06 +02:00
Tom Tromey
72a8f76323 Change symbol::line to unsigned int
A user here at AdaCore noticed that, when debugging a certain program,
a stack frame reported line 34358, where it should have been line
99894.

After debugging a bit, I discovered:

(top) p (99894 & ~65536)
$60 = 34358

That line, symbol::line is too narrow.

This patch widens the member and changes all the uses that currently
use the narrower type.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-03-27 08:37:14 -06:00
Tom Tromey
7005080802 Fix 128-bit integer bug in Ada
While working on 128-bit integer support, I found one spot in Ada that
needed a fix as well.
2023-03-27 08:20:29 -06:00
Tom Tromey
303a881f87 Use gdb_gmp for scalar arithmetic
This changes gdb to use scalar arithmetic for expression evaluation.

I suspect this patch is not truly complete, as there may be code paths
that still don't correctly handle 128-bit integers.  However, many
things do work now.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30190
2023-03-27 08:20:29 -06:00
Tom Tromey
d784fa8fb2 Use value_true in value_equal and value_less
Both value_equal and value_less use value_as_long to check a
presumably boolean result of calling value_binop.  However,
value_binop in this case actually returns an int as wide as its
arguments, and this approach can then fail for integers wider than
LONGEST.  Instead, rewrite this in a form that works for any size
integer.
2023-03-27 08:20:29 -06:00
Tom Tromey
eb52a49702 Simplify binop_promote
binop_promote currently only handles integer sizes up to
builtin_long_long.  However, this may not handle 128-bit types.
Simplify this code, unify the C and non-C (but not OpenCL, as I don't
know how to test this) cases, and handle 128-bit integers as well.

This still doesn't exactly follow C or C++ rules.  This could be
implemented, but if so, I think it makes more sense as a C-specific
expression node.
2023-03-27 08:20:29 -06:00
Tom Tromey
4db6e7aa6a Add value_as_mpz and value_from_mpz
This adds the two new functions, value_as_mpz and value_from_mpz,
useful for manipulation values via gdb_mpz.
2023-03-27 08:20:29 -06:00
Tom Tromey
1c805ba063 Add truncation mode to gdb_mpz
This renames gdb_mpz::safe_export to export_bits, and adds a new flag
to export a truncated value.  This is needed by value arithmetic.
2023-03-27 08:20:29 -06:00
Tom Tromey
c7c3708ac7 Avoid a copy in gdb_mpz::safe_export
Currently, gdb_mpz::safe_export will always make a copy of *this.
However, this copy isn't always needed.  This patch makes this code
slightly more efficient, by avoiding the copy when possible.
2023-03-27 08:20:29 -06:00
Tom Tromey
c225d6b804 Add many operators to gdb_mpz
This adds many operator overloads and other useful methods to gdb_mpz.
This is preparation for using this class for scalar arithmetic in gdb
expression evaluation.
2023-03-27 08:20:28 -06:00
Tom Tromey
b6c55de76b Populate seen_names hash in cooked_index_shard::do_finalize
Hannes pointed out that cooked_index_shard::do_finalize never
populates the seen_names hash table.  This patch adds the necessary
store.  This reduces memory use a little for "gdb gdb":

(before) Space used: 28909568 (+0 for this command)
(after)  Space used: 28884992 (+0 for this command)

What this means, btw, is that in gdb there are not many symbols that
are both mentioned in many CUs and that also require name
canonicalization.  It's possible this would differ in other programs.
2023-03-27 08:18:55 -06:00
Tom de Vries
2215170485 [gdb/testsuite] Fix gdb.asm/asm-source.exp for remote host
Fix test-case gdb.asm/asm-source.exp for remote host using
host_standard_output_file and gdb_remote_download.

Tested on x86_64-linux.
2023-03-27 14:33:15 +02:00
Tom de Vries
b54e6df085 [gdb/testsuite] Fix gdb.dwarf2/imported-unit-bp-c.exp for remote host
Fix test-case gdb.dwarf2/imported-unit-bp-c.exp on remote by removing a
downloaded source file.

Tested on x86_64-linux.
2023-03-27 13:58:10 +02:00
Tom de Vries
b279380145 [gdb/testsuite] Unsupport gdb.dwarf2/gdb-add-index-symlink.exp for remote host
Declare test-case gdb.dwarf2/gdb-add-index-symlink.exp unsupported for remote
host, because the current implementation of gdb_ensure_index doesn't support it.

Tested on x86_64-linux.
2023-03-27 13:58:10 +02:00
Tom de Vries
623f8c6b88 [gdb/testsuite] Fix gdb.dwarf2/gdb-index-cxx.exp for remote host
Fix test-case gdb.dwarf2/gdb-index-cxx.exp for remote host using
host_standard_output_file.

Tested on x86_64-linux.
2023-03-27 13:58:10 +02:00
Tom de Vries
468f212c57 [gdb/testsuite] Fix gdb.dwarf2/enqueued-cu-base-addr.exp for remote host
Fix test-case gdb.dwarf2/enqueued-cu-base-addr.exp for remote host by using
$testfile instead $binfile.

Tested on x86_64-linux.
2023-03-27 13:58:10 +02:00
Tom de Vries
a653ec1f36 [gdb/testsuite] Fix gdb.dwarf2/gdb-index.exp on remote host
Fix test-case gdb.dwarf2/gdb-index.exp on remote host using
gdb_remote_download and host_standard_output_file.

Also declare the test-case unsupported with readnow.

Tested on x86_64-linux.
2023-03-27 13:58:10 +02:00
Tom de Vries
8eef5130ee [gdb/testsuite] Fix gdb.dwarf2/per-bfd-sharing.exp for remote host
Fix test-case gdb.dwarf2/per-bfd-sharing.exp for remote host using
gdb_remote_download.

Likewise in a few other test-cases.

Tested on x86_64-linux.
2023-03-27 13:58:10 +02:00
Tom de Vries
0ecbda2f31 [gdb/testsuite] Fix quoting issue in gdb.base/index-cache.exp
For test-case gdb.base/index-cache.exp and remote host, this:
...
lassign [remote_exec host sh "-c \"rm $cache_dir/*.gdb-index\""] ret
...
gives us:
...
Executing on host: sh -c rm /tmp/tmp.m3L7m2AVkL/*.gdb-index    (timeout = 300)
builtin_spawn -ignore SIGHUP sh -c rm /tmp/tmp.m3L7m2AVkL/*.gdb-index^M
rm: missing operand^M
Try 'rm --help' for more information.^M
FAIL: gdb.dwarf2/per-bfd-sharing.exp: couldn't remove files in temporary cache dir
...

Fix this using quote_for_host.  Likewise in gdb.dwarf2/per-bfd-sharing.exp.

Tested on x86_64-linux.
2023-03-27 13:58:09 +02:00
Tom de Vries
d0498b325e [gdb/testsuite] Fix quoting issues in gdb.dwarf2 for remote host
A few test-cases in gdb.dwarf2 use something like:
...
  additional_flags=\"-DFOO=BAR + 10\"
...
which doesn't work on remote host.

Fix this by introducing a new proc quote_for_host that also works for remote
host, such that we have:
...
  additional_flags=[quote_for_host -DFOO=BAR + 10]
...

Tested on x86_64-linux.
2023-03-27 13:58:09 +02:00
Tom de Vries
845d99df89 [gdb/testsuite] Fix have_index for remote host
Proc have_index is mostly used with $binfile, which gives problems
for remote host.

Fix this by using "file tail" on the proc argument.

Tested on x86_64-linux.
2023-03-27 13:58:09 +02:00
Tom de Vries
88fc1be26a [gdb/testsuite] Add missing include_file in gdb.dwarf/*.exp 2023-03-27 13:58:09 +02:00
Tom de Vries
2b3f4c0616 [gdb/testsuite] Add test-case gdb.dlang/dlang-start-2.exp
For test-case gdb.dlang/dlang-start.exp, I run into:
...
UNSUPPORTED: gdb.dlang/dlang-start.exp: require failed: can_compile d
...

My distro has no support for gdc, but I'd like to have the test-case
running and passing, so let's rewrite the test-case using dwarf assembly
and add it alongside (rather than replacing it, because it's good to use
actual compiler output if we have it available).

My distro does have a package providing dmd, so let's mimic that debug info in
the dwarf assembly.  This gives us:
...
(gdb) start ^M
Temporary breakpoint 1 at 0x4004ab^M
Starting program: dlang-start-2 ^M
^M
Temporary breakpoint 1, 0x00000000004004ab in _Dmain ()^M
...

The "_Dmain ()" should probably be "D main", I've filed PR30276 about that.

Also add a "show language" to check that we automatically set the language
correctly to D.

Note that the dwarf assembly also describes main, otherwise the test-case
doesn't function as regression test for commit 47fe57c928 ("Fix "start" for
D, Rust, etc").

Tested on x86_64-linux.
2023-03-27 13:47:51 +02:00
Alan Modra
943527750e Tidy tc-ppc.c XCOFF auxent access
It's better not to drill down into u.auxent but instead use a pointer
to the combined_entry_type.  That way the fix_scnlen field is
available, and no one looking at the codes needs to wonder whether
coffsymbol (symbol_get_bfdsym (sym))->native[i + 1] is the same
auxent.

	* config/tc-ppc.c (ppc_frob_symbol): Tidy XCOFF auxent access.
	(ppc_adjust_symtab): Likewise.
2023-03-27 21:58:47 +10:30
Alan Modra
f00a29e30b Remove coff_pointerize_aux table_end param
I'm fairly certain the table_end checks are redundant now.  This
patch reverts commit 334d4ced42.

	* coffgen.c (coff_pointerize_aux): Remove table_end parameter.
	(coff_get_normalized_symtab): Adjust to suit.
2023-03-27 21:58:46 +10:30
Alan Modra
a2c7ca15a5 Use stdint types in coff internal_auxent
long is a poor choice of type to store 32-bit values read from
objects files by H_GET_32.  H_GET_32 doesn't sign extend so tests like
that in gdb/coffread.c for "negative" values won't work if long is
larger than 32 bits.  If long is 32-bit then code needs to be careful
to not accidentally index negative array elements.  (I'd rather see a
segfault on an unmapped 4G array index than silently reading bogus
data.)  long is also a poor choice for x_sect.s_scnlen, which might
have 64-bit values.  It's better to use unsigned exact width types to
avoid surprises.

I decided to change the field names too, which makes most of this
patch simply renaming.  Besides that there are a few places where
casts are no longer needed, and where printf format strings or tests
need adjusting.

include/
	* coff/internal.h (union internal_auxent): Use unsigned stdint
	types.  Rename l fields to u32 and u64 as appropriate.
bfd/
	* coff-bfd.c,
	* coff-rs6000.c,
	* coff64-rs6000.c,
	* coffcode.h,
	* coffgen.c,
	* cofflink.c,
	* coffswap.h,
	* peXXigen.c,
	* xcofflink.c: Adjust to suit internal_auxent changes.
binutils/
	* rdcoff.c: Adjust to suit internal_auxent changes.
gas/
	* config/obj-coff.h,
	* config/tc-ppc.c: Adjust to suit internal_auxent changes.
gdb/
	* coffread.c,
	* xcoffread.c: Adjust to suit internal_auxent changes.
ld/
	* pe-dll.c: Adjust to suit internal_auxent changes.
2023-03-27 21:58:46 +10:30
Alan Modra
3bb1480e2a Set proper union selector tag
* coff-bfd.c (bfd_coff_get_auxent): After converting sym pointer
	to an index, reset the union tag.
2023-03-27 21:58:46 +10:30
Alan Modra
695c322803 coffgrok access of u.auxent.x_sym.x_tagndx.p
u.auxent.x_sym.x_tagndx is a union.  The p field is only valid when
fix_tag is set.  This patch fixes code in coffgrok.c that accessed the
field without first checking fix_tag, and removes a whole lot of code
validating bogus pointers to prevent segfaults (which no longer
happen, I checked the referenced PR 17512 testcases).  The patch also
documents this in the fix_tag comment, makes is_sym a bitfield, and
sorts the selecter fields a little.

bfd/
	* coffcode.h (combined_entry_type): Make is_sym a bitfield.
	Sort and comment on union selectors.
	* libcoff.h: Regenerate.
binutils/
	* coffgrok.c (do_type): Make aux a combined_entry_type.  Test
	fix_tag before accessing u.auxent.x_sym.x_tagndx.p.  Remove
	now unnecessary pointer bounds checking.
2023-03-27 21:58:46 +10:30
Alan Modra
92479281c4 Duplicate DW_AT_call_file leak
When given two or more DW_AT_call_file for a given function we
currently leak the concat memory.

	* dwarf2.c (scan_unit_for_symbols): Don't leak on duplicate
	DW_AT_call_file.
2023-03-27 21:58:46 +10:30
Alan Modra
58c4c6a0bf XCOFF sanity check
* coffcode.h (coff_pointerize_aux_hook): Sanity check
	x_csect.x_scnlen against raw_syment_count.
2023-03-27 21:58:46 +10:30