Commit Graph

119255 Commits

Author SHA1 Message Date
Indu Bhagat
61f82dcb03 opcodes: aarch64: add flags to denote subclasses of uncond branches
Use the two new subclass flags: F_BRANCH_CALL, F_BRANCH_RET, to indicate
call to and return from subroutine respectively.

opcodes/
	* aarch64-tbl.h: Use the new F_BRANCH_* flags.
2024-07-18 20:54:14 -07:00
Indu Bhagat
7ecbb85893 opcodes: aarch64: add flags to denote subclasses of arithmetic insns
Use the three new subclass flags: F_ARITH_ADD, F_ARITH_SUB,
F_ARITH_MOV, to indicate add, sub and mov ops respectively.

These flags for subclasses will later be used for SCFI purposes to
create appropriate ginsns.  At this time, only those iclasses relevant
to SCFI have the new subclass flags specified.

For addg and subg insns, F_SUBCLASS_OTHER is more suitable because these
operations do more than just simple add or sub.

opcodes/
    * aarch64-tbl.h: Use the new F_ARITH_* flags.
2024-07-18 20:54:14 -07:00
Indu Bhagat
0cb8f3f0c5 opcodes: aarch64: add flags to denote subclasses of ldst insns
The existing iclass information tells us the general shape and purpose
of the instructions.  In some cases, however, we need to further disect
the iclass on the basis of other finer-grain information.  E.g., for the
purpose of SCFI, we need to know whether a given insn with iclass
of ldst_* is a load or a store.

At the moment, specify subclasses for only those iclasses relevant to
SCFI: ldst_imm9, ldst_pos, ldstpair_indexed, ldstpair_off and
ldstnapair_offs.

Some insns are best tagged with F_SUBCLASS_OTHER rather than F_LDST_LOAD
or F_LDST_STORE:
  - stg* ops (as they store tag only),
  - prfm,
  - ldpsw, ldrsw (32-bit loads with signed extended value.  Not useful
    for restore operations in context of SCFI.)
  - Use F_SUBCLASS_OTHER for all QL_LDST_R8 and QL_LDST_R16 operands.
    Also use F_SUBLASS_OTHER for strb/ldrb, strh/ldrh opcodes.
    These are not full loads and stores and cannot be allowed for
    register save / restore for the purpose of SCFI.

opcodes/
    * aarch64-tbl.h: Use the new F_LDST_* flags.
2024-07-18 20:54:14 -07:00
Indu Bhagat
04521e258e include: opcodes: aarch64: define new subclasses
The existing iclass information tells us the general shape and purpose
of the instructions.  In some cases, however, we need to further disect
the iclass on the basis of other finer-grain information.  E.g., for the
purpose of SCFI, we need to know whether a given insn with iclass of
ldst_* is a load or a store.  Similarly, whether a particular arithmetic
insn is an add or sub or mov, etc.

This patch defines new flags to demarcate the insns.  Also provide an
access function for subclass lookup.

Later, we will enforce (in aarch64-gen.c) that if an iclass has at least
one instruction with a non-zero subclass, all instructions of the iclass
must have a non-zero subclass information.  If none of the defined
subclasses are applicable (or not required for SCFI purposes),
F_SUBCLASS_OTHER can be used for such instructions.

include/
        * opcode/aarch64.h (F_SUBCLASS): New flag.
        (F_SUBCLASS_OTHER): Likewise.
        (F_LDST_LOAD): Likewise.
        (F_LDST_STORE): Likewise.
        (F_ARITH_ADD): Likewise.
        (F_ARITH_SUB): Likewise.
        (F_ARITH_MOV): Likewise.
        (F_BRANCH_CALL): Likewise.
        (F_BRANCH_RET): Likewise.
	(F_DP_TAG_ONLY): Likewise.
        (aarch64_opcode_subclass_p): New definition.
2024-07-18 20:54:14 -07:00
Indu Bhagat
af4eb9e20a gas: scfi: make scfi_state_restore_reg function more precise
When the SCFI machinery detects that a register has been restored from
stack, it makes some state changes in the SCFI state object.

Prior to the patch, scfi_state_restore_reg () was setting a value of
(reg, CFI_IN_REG) for (base, state) respectively.  This was causing
issues in the cmp_scfi_state () function:
  - The default state of all (callee-saved) regs at the beginning of
    function is set to (0, CFI_UNDEFINED).
  - If a register is saved and restored on some control path, the state
    of reg is (reg, CFI_IN_REG) on that path.
  - On another control path where the register was perhaps not
    used (or saved/restored on stack) remains (0, CFI_UNDEFINED).
  - The two states should be treated equal, however, at the point in
    program after the register has been restored.

Fix this by resetting the state to (0, CFI_UNDEFINED) in
scfi_state_restore_reg ().

A testcase (scfi-cfg-4.s) for this is added in a subsequent commit.

gas/
        * scfi.c (scfi_state_restore_reg): Reset to 0, CFI_UNDEFINED
	for base, state.
2024-07-18 20:54:13 -07:00
GDB Administrator
8dcdc91182 Automatic date update in version.in 2024-07-19 00:00:19 +00:00
Matthieu Longo
05974f2467 gas: minor reformatting in command line help and doc
- help message: add a comma between the short and long option
- as doc:
  - brief summary of how to invoke gas: separate [-w] [-x] on a new line as those
  two options have nothing to do with the warning options.
  - reordering of the warning options to have the same order as the listing.
  - no-warn option description: change an "and" to a "or", as it is either the short
  or long option to use, but not both at the same time.
- remove trailing whitespaces.
2024-07-18 17:02:27 +01:00
Andrew Burgess
22836ca885 gdb: check for multiple matching build-id files
Within the debug-file-directory GDB looks for the existence of a
.build-id directory.

Within the .build-id directory GDB looks for files with the form:

  .build-id/ff/4b4142d62b399499844924d53e33d4028380db.debug

which contain the debug information for the objfile with the build-id
ff4b4142d62b399499844924d53e33d4028380db.

There appear to be two strategies for populating the .build-id
directory.  Ubuntu takes the approach of placing the actual debug
information in this directory, so
4b4142d62b399499844924d53e33d4028380db.debug is an actual file
containing the debug information.

Fedora, RHEL, and SUSE take a slightly different approach, placing the
debug information elsewhere, and then creating symlinks in the
.build-id directory back to the original debug information file.  The
actual debug information is arranged in a mirror of the filesystem
within the debug directory, as an example, if the debug-file-directory
is /usr/lib/debug, then the debug information for /bin/foo can be
found in /usr/lib/debug/bin/foo.debug.

Where this gets interesting is that in some cases a package will
install a single binary with multiple names, in this case a single
binary will be install with either hard-links, or symlinks providing
the alternative names.

The debug information for these multiple binaries will then be placed
into the /usr/lib/debug/ tree, and again, links are created so a
single file can provide debug information for each of the names that
binary presents as.  An example file system might look like this (the
[link] could be symlinks, but are more likely hard-links):

  /bin/
    foo
    bar -> foo	[ HARD LINK ]
    baz -> foo	[ HARD LINK ]
  /usr/
    lib/
      debug/
        bin/
	  foo.debug
	  bar.debug -> foo.debug	[ HARD LINK ]
	  baz.debug -> foo.debug	[ HARD LINK ]

In the .build-id tree though we have a problem.  Do we have a single
entry that links to one of the .debug files?  This would work; a user
debugging any of the binaries will find the debug information based on
the build-id, and will get the correct information, after all the
.debug files are identical (same file linked together).  But there is
one problem with this approach.

Sometimes, for *reasons* it's possible that one or more the linked
binaries might get removed, along with its associated debug
information.  I'm honestly not 100% certain under what circumstances
this can happen, but what I observe is that sometime a single name for
a binary, and its corresponding .debug entry, can be missing.  If this
happens to be the entry that the .build-id link is pointing at, then
we have a problem.  The user can no longer find the debug information
based on the .build-id link.

The solution that Fedora, RHEL, & SUSE have adopted is to add multiple
entries in the .build-id tree, with each entry pointing to a different
name within the debug/ tree, a sequence number is added to the
build-id to distinguish the multiple entries.  Thus, we might end up
with a layout like this:

  /bin/
    foo
    bar -> foo	[ HARD LINK ]
    baz -> foo	[ HARD LINK ]
  /usr/
    lib/
      debug/
        bin/
	  foo.debug
	  bar.debug -> foo.debug	[ HARD LINK ]
	  baz.debug -> foo.debug	[ HARD LINK ]
      .build-id/
        a3/
          4b4142d62b399499844924d53e33d4028380db.debug -> ../../debug/bin/foo.debug	[ SYMLINK ]
          4b4142d62b399499844924d53e33d4028380db.1.debug -> ../../debug/bin/bar.debug	[ SYMLINK ]
          4b4142d62b399499844924d53e33d4028380db.2.debug -> ../../debug/bin/baz.debug	[ SYMLINK ]

With current master GDB, debug information will only ever be looked up
via the 4b4142d62b399499844924d53e33d4028380db.debug link.  But if
'foo' and its corresponding 'foo.debug' are ever removed, then master
GDB will fail to find the debug information.

Ubuntu seems to have a much better approach for debug information
handling; they place the debug information directly into the .build-id
tree, so there only ever needs to be a single entry for any one
build-id.  I wonder if/how they handle the case where multiple names
might share a single .debug file, if one of those names is then
uninstalled, how do they know the .debug file should be retained or
not ... but I assume that problem either doesn't exist or has been
solved.

Anyway, for a while Fedora has carried a patch that handles the
build-id sequence number logic.  What's presented here is inspired by
the Fedora patch, but has some changes to fix some issues.

I'm aware that this is a patch that applies to only some (probably a
minority) of distros.  However, the logic is contained to only a
single function in build-id.c, and isn't too complex, so I'm hoping
that there wont be too many objections.

For distros that don't have build-id sequence numbers there should be
no impact.  The sequence number approach still leaves the first file
without a sequence number, and this is the first file that GDB (after
this patch) checks for.  The new logic only kicks in if the
non-sequence numbered first file exists, but is a symlink to a non
existent file; in this case GDB checks for the sequence numbered files
instead.

Tests are included.

There is a small fix needed for gdb.base/sysroot-debug-lookup.exp,
after this commit GDB now treats a target: sysroot where the target
file system is local to GDB the same as if the sysroot had no target:
prefix.  The consequence of this is that GDB now resolves a symlink
back to the real filename in the sysroot-debug-lookup.exp test where
it didn't previously.  As this behaviour is inline with the case where
there is no target: prefix I think this is fine.
2024-07-18 13:24:20 +01:00
Andrew Burgess
6d45af96ea gdbserver: add gdbserver support for vFile::stat packet
After the previous two commits, this commit adds support for the
vFile::stat packet to gdbserver.  This is pretty similar to the
handling for vFile::fstat, but instead calls 'lstat'.

There's still no users of target_fileio_stat in GDB, that will come in
a later commit.
2024-07-18 13:24:20 +01:00
Andrew Burgess
3055e3d2f1 gdb: add GDB side target_ops::fileio_stat implementation
This commit adds the GDB side of target_ops::fileio_stat.  There's an
implementation for inf_child_target, which just calls 'lstat', and
there's an implementation for remote_target, which sends a new
vFile:stat packet.

The new packet is documented.

There's still no users of target_fileio_stat as I have not yet added
support for vFile::stat to gdbserver.  If these packets are currently
sent to gdbserver then they will be reported as not supported and the
ENOSYS error code will be returned.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
2024-07-18 13:24:20 +01:00
Andrew Burgess
08a115cc1c gdb: add target_fileio_stat, but no implementations yet
In a later commit I want target_fileio_stat, that is a call that
operates on a filename rather than an open file descriptor as
target_fileio_fstat does.

This commit adds the initial framework for target_fileio_stat, I've
added the top level target function and the virtual target_ops methods
in the target_ops base class.

At this point no actual targets override target_ops::fileio_stat, so
any attempts to call this function will return ENOSYS error code.
2024-07-18 13:24:20 +01:00
Cui, Lili
3ca6c047a4 X86: Update gas/NEWS for Intel APX.
gas/ChangeLog:

        * NEWS: Added "APX_F is fully supportted" to gas/NEWS.
2024-07-18 16:00:06 +08:00
GDB Administrator
7c0de4c1e0 Automatic date update in version.in 2024-07-18 00:00:17 +00:00
Tom de Vries
0ed152c5c6 [gdb/testsuite] Fix gdb.arch/arm-pseudo-unwind.exp with unix/mthumb
When running test-case gdb.arch/arm-pseudo-unwind.exp with target board
unix/mthumb, we run into:
...
(gdb) continue^M
Continuing.^M
^M
Program received signal SIGILL, Illegal instruction.^M
0x00400f38 in ?? ()^M
(gdb) FAIL: $exp: continue to breakpoint: continue to callee
...

The test-case attempts to force arm-pseudo-unwind.c to be compiled in arm mode
using additional_flags=-marm, but that's overridden by using target board
unix/mthumb.

This causes function main to be in thumb mode, and consequently function
caller (which is called from main) is is executed as if it's in thumb mode,
while it's actually in arm mode.

Fix this by adding an intermediate function caller_trampoline in
arm-pseudo-unwind.c, and hardcoding it to arm mode using
__attribute__((target("arm"))).

Likewise for test-case gdb.arch/arm-pseudo-unwind-legacy.exp.

Tested on arm-linux.

Approved-By: Luis Machado <luis.machado@arm.com>
2024-07-17 17:04:02 +02:00
Indu Bhagat
dfeb912e16 gas: scfi: testsuite: refresh the README
Update some stale text in the README.  Add few more notes to guide
future maintenance of the testsuite.

gas/testsuite/
	* gas/scfi/README: Update text.
2024-07-16 23:34:43 -07:00
GDB Administrator
d898e0855b Automatic date update in version.in 2024-07-17 00:00:18 +00:00
Simon Marchi
d9deb60b2e gdb, gdbserver, gdbsupport: use [[noreturn]] instead of ATTRIBUTE_NORETURN
C++ 11 has a built-in attribute for this, no need to use a compat macro.

Change-Id: I90e4220d26e8f3949d91761f8a13cd9c37da3875
Reviewed-by: Lancelot Six <lancelot.six@amd.com>
2024-07-16 18:30:45 -04:00
Simon Marchi
9153eb8a7f gdb: fix indentation in remote.c
Change-Id: If344acdf703fdd3892f73f75fc891d5473808b79
2024-07-16 14:05:14 -04:00
Simon Marchi
a7a430a68c gdb: add ATTRIBUTE_NORETURN to remote_unpush_target
My IDE (well, clangd) suggested this.  It doesn't hurt to have it.

Change-Id: If6001983c17dbed3dceebac3078c8deb12c04d6b
2024-07-16 14:03:27 -04:00
Tom de Vries
b6a5604da0 [gdb/testsuite] Simplify gdb.base/complex-parts.exp
I noticed a lot of escaping in test-case gdb.base/complex-parts.exp.

Make the test-case more readable by using:
- string_to_regexp, and
- {} instead of "".

Tested on x86_64-linux and aarch64-linux.
2024-07-16 17:22:04 +02:00
GDB Administrator
a81f4e591f Automatic date update in version.in 2024-07-16 00:00:18 +00:00
Simon Marchi
58a775a606 gdb: pass program space to overlay_invalidate_all
Make the current program space bubble up one level.

Change-Id: I5ac1e3290ad266730465cd60aa3672d45ffa6475
2024-07-15 14:40:14 -04:00
Simon Marchi
8991986e24 gdb: pass program space to objfile::make
Make the current program space reference bubble up one level.

Change-Id: Iee8b11c853c76e539c991c4785737c69e6a1925c
Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
2024-07-15 14:34:12 -04:00
Simon Marchi
da877546db gdb: pass program space to objfile::objfile
Make the current program space reference bubble up one level.

Change-Id: I81e45e89e0cfd87c308f801d49ae811a941348b7
Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
2024-07-15 14:34:12 -04:00
Simon Marchi
d1e4438fa1 gdb: pass program space to entry_point_address
Make the current program space reference bubble up one level.

Change-Id: Ifc9b8186abaefb10caf99f79ae09e526fa65c882
Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
2024-07-15 14:34:12 -04:00
Simon Marchi
b7513ebd18 gdb: pass program space to entry_point_address_query
Make the current program space bubble up one level.

Change-Id: Ic3ad0869ca1afe41854f605a6f7eb092fca29ff8
Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
2024-07-15 14:34:12 -04:00
Simon Marchi
da2732476d gdb: pass program space to objfiles_changed
Make the current program space reference bubble up one level.

Change-Id: I9b33c9e0d22c171eb1bb59ce480621b02c7b7bf7
Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
2024-07-15 14:34:12 -04:00
Simon Marchi
3bae94c0fb gdb: pass program space to get_current_source_symtab_and_line
Make the current program space reference bubble up one level.

Change-Id: I6ba6dc4a2cb188720cbb61b84ab5c954aac105c6
Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
2024-07-15 14:34:12 -04:00
Simon Marchi
9c067e2844 gdb: pass program space to have_{full,partial}_symbols
Make the current program space reference bubble up one level.

Change-Id: I19c4fc2ca955f9c828ef426a077b43983865697b
Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
2024-07-15 14:34:12 -04:00
Simon Marchi
cc7541ce5e gdb: bool-ify a few functions in objfiles.{c,h}
Change return types to bool, and make a few stylistic adjustments.

Change-Id: I784c3c33af0394a77c25064b06eb3e128e69222f
Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
2024-07-15 14:34:12 -04:00
Simon Marchi
fbee6a57b2 gdb: pass program space to clear_current_source_symtab_and_line
Make the current program space reference bubble up one level.

Change-Id: I692554474d17e4f4708fd8ad662bf6c0bb964726
Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
2024-07-15 14:34:12 -04:00
Simon Marchi
4113c737bd gdb: make program_space::free_all_objfiles use this
Use `this` instead of `current_program_space`.  Presumably, the method
wants to check the solibs of "this" program space, not the current
global program space (although they are likely always the same at the
moment).

Change-Id: Iaf0534f36bfd47c04c53ed0657da332bdb8fb906
Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
2024-07-15 14:34:12 -04:00
Simon Marchi
b8c9d0de90 gdb: pass program space to no_shared_libraries
Make the current program space reference bubble up one level.  Pass
`current_program_space` everywhere, except in some cases where we can
get the pspace another way, and it's relatively obvious that it's the
same as the current program space.

Change-Id: Id86b79f1e44f92a398f49d137d57457174dfa96d
Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
2024-07-15 14:34:12 -04:00
Simon Marchi
89dc60d957 gdb: split no_shared_libraries, command vs implementation
The `no_shared_libraries` function is currently used to implement the
`nosharedlibrary` command, but it also used internally by other
functions.  This does not make a very good internal API.

Add the `no_shared_libraries_command` function to implement the CLI
command.  Remove the unused parameters from `no_shared_libraries`.

Remove the `from_tty` parameter of `target_pre_inferior`, since it's now
unused.

Change-Id: I4fcba5ee1e0f7d250aab1a7b62b9ea16265fe962
Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
2024-07-15 14:34:12 -04:00
Simon Marchi
98793b838c gdb: pass program space to objfile_purge_solibs
Make the current program space reference bubble up one level.

Change-Id: I08cfa77a0351c9602131ed2a294eabb1f1f59a6e
Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
2024-07-15 14:34:12 -04:00
Simon Marchi
93016848f9 gdb: use objfile::pspace in objfile::unlink
I think it would make sense to use objfile::pspace instead of the
current program space here.  It reduces the risks of calling this
method with the wrong current program space set.

Change-Id: Id4f3644719f232640c83a1c7f4aa92eaa6af6c5c
Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
2024-07-15 14:34:12 -04:00
Simon Marchi
574b77fccb gdb: remove some trivial uses of current_program_space
It is obvious that pspace is the same as current_program_space in these
cases, due to the set_current_program_space call just above.  The rest
of the functions probably care about the current program space though,
so leave the set_cset_current_program_space calls there.

Change-Id: I3c300decbf2c2fe5f25aa7f697ebcb524432394f
2024-07-15 11:07:29 -04:00
Hannes Domani
25c2284095 Fix loading a saved recording
Currently you get this assertion failure if you try to execute the
inferior after loading a saved recording, when no recording was done
earlier in the same gdb session:
```
$ gdb -q c -ex "record restore test.rec"
Reading symbols from c...
[New LWP 26428]
Core was generated by `/tmp/c'.
Restored records from core file /tmp/test.rec.
(gdb) c
Continuing.
../../gdb/inferior.c:293: internal-error: inferior* find_inferior_pid(process_stratum_target*, int): Assertion `pid != 0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
```

The change in step-precsave.exp triggers this bug, since now the
recording is loaded in a new gdb session, where
record_full_resume_ptid was never set.

The fix is to simply set record_full_resume_ptid when resuming a loaded
recording.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31971
Approved-By: Guinevere Larsen <blarsen@redhat.com>
2024-07-15 16:31:20 +02:00
Simon Marchi
134a0a106c gdb: make objfile::pspace private
Rename to m_pspace, add getter.  An objfile's pspace never changes, so
no setter is necessary.

Change-Id: If4dfb300cb90dc0fb9776ea704ff92baebb8f626
2024-07-15 13:55:00 +00:00
Szabolcs Nagy
d21176c014 aarch64: Fix --no-apply-dynamic-relocs for RELR
The option only makes sense for RELA relative relocs where the
addend is present, not for RELR relative relocs.

Fixes bug 31924.
2024-07-15 13:42:22 +01:00
Nick Clifton
323b56a7ab Synchronize config.[sub|guess] with the latest versions from the config project. 2024-07-15 10:22:54 +01:00
GDB Administrator
50e33eb079 Automatic date update in version.in 2024-07-15 00:00:09 +00:00
John David Anglin
a48e485c7c hppa: Fix handling of relocations that apply to data
Commit d125f96753 introduced a bug
in handling relocations for data.  The R_PARISC_DIR32 relocation
operates on 32-bit data and not instructions.  The HOWTO table
needs to be used to determine the format of relocations that apply
to data.  The R_PARISC_SEGBASE relocation is another special case
as it only changes segment base.

This was noticed in Debian cmor package build.

2024-07-14  John David Anglin  <danglin@gcc.gnu.org>

bfd/ChangeLog:

	* elf32-hppa.c (final_link_relocate): Use HOWTO table to
	determine reload format for relocations that apply to data.
2024-07-14 07:22:13 -04:00
GDB Administrator
7846287a38 Automatic date update in version.in 2024-07-14 00:00:10 +00:00
Maciej W. Rozycki
e8723b48d9 Revert "MIPS: Use N64 by default for mips*64*-*-linux-gnuabi64"
This reverts commit d49f2dd78b.  It was
applied unapproved.
2024-07-13 06:00:44 +01:00
Maciej W. Rozycki
61022df13c Revert "MIPS/GAS: Omit LI 0 for condition trap"
This reverts commit bfa257b407.  It was
applied unapproved.
2024-07-13 06:00:43 +01:00
Lulu Cai
7478277414 LoongArch: Fix dwarf3 test cases from XPASS to PASS
In the past, the .align directive generated a label that did not match
the regular expression, and we set it to XFAIL.
But now it matches fine so it becomes XPASS. We fix it with PASS.
2024-07-13 10:00:02 +08:00
GDB Administrator
e8fbf31961 Automatic date update in version.in 2024-07-13 00:00:11 +00:00
Sam James
ed8025a576
libiberty: sync with gcc
This imports the following commits from GCC as of r15-1722-g7682d115402743:
	ca2f7c84927f libiberty: Invoke D demangler when --format=auto
	94792057ad4a Fix up duplicated words mostly in comments, part 1
	20e57660e64e libiberty: Fix error return value in pex_unix_exec_child [PR113957].
	52ac4c6be866 [libiberty] remove TBAA violation in iterative_hash, improve code-gen
	53bb7145135c libiberty: Fix up libiberty_vprintf_buffer_size
	65388b28656d c++, demangle: Implement https://github.com/itanium-cxx-abi/cxx-abi/issues/148 non-proposal
2024-07-12 22:47:58 +01:00
Jens Remus
6f8b365b65 s390: Avoid reloc overflows on undefined weak symbols (cont)
This complements and reuses logic from Andreas Krebbel's commit
896a639bab ("s390: Avoid reloc overflows on undefined weak symbols").

Replace relative long addressing instructions of weak symbols, which
will definitely resolve to zero, with either a load address of 0 or a
a trapping insn.

This prevents the PLT32DBL relocation from overflowing in case the
binary will be loaded at 4GB or more.

bfd/
	* elf64-s390.c (elf_s390_relocate_section): Replace
	instructions using undefined weak symbols with relative
	addressing to avoid relocation overflows.

ld/
	* testsuite/ld-s390/s390.exp: Add new test.
	* testsuite/ld-s390/weakundef-2.s: New test.
	* testsuite/ld-s390/weakundef-2.dd: Likewise.

Reported-by: Alexander Gordeev <agordeev@linux.ibm.com>
Suggested-by: Ilya Leoshkevich <iii@linux.ibm.com>
Suggested-by: Andreas Krebbel <krebbel@linux.ibm.com>
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
2024-07-12 16:53:47 +02:00