aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-06-13gdbsupport: make gdb::parallel_for_each's n parameter a template parameterSimon Marchi3-9/+7
This value will likely never change at runtime, so we might as well make it a template parameter. This has the "advantage" of being able to remove the unnecessary param from gdb::sequential_for_each. Change-Id: Ia172ab8e08964e30d4e3378a95ccfa782abce674 Approved-By: Tom Tromey <tom@tromey.com>
2025-06-13gdb: re-work parallel-for-selftests.cSimon Marchi1-81/+56
I find this file difficult to work with and modify, due to how it uses the preprocessor to include itself, to generate variations of the test functions. Change it to something a bit more C++-y, with a test function that accepts a callback to invoke the foreach function under test. Change-Id: Ibf1e2907380a88a4f8e4b4b88df2b0dfd0e9b6c8
2025-06-13gdb/dwarf: make cooked_index_flag's to_string handle IS_SYNTHESIZEDSimon Marchi1-0/+1
Change-Id: Iaac252aa2abbe169153e79b84f956cda172c69d1
2025-06-13x86: don't constrain %axl/%cxlJan Beulich9-39/+21
They can be used like their %al/%cl counterparts everywhere else; there's no apparent reason why they shouldn't be usable as accumulator / shift count respectively. Enforcing such a restriction only makes writing heavily macro-ized code more cumbersome.
2025-06-13x86: swap operands in OUT-with-immediate templateJan Beulich3-36/+38
In a number of places we assume that immediates come first in the set of operands. It is mere luck that so far OUT, having operands the other way around, wasn't negatively impacted by this. Leverage this to have a few loops start from the first non-immediate operand (or in one case to stop there). Note, however, that process_immext() inserts an immediate last, so especially all output_*() functions cannot be changed in the same way.
2025-06-13elf: Return false if output_section is NULLH.J. Lu1-1/+5
Return false if output_section is NULL so that on input https://sourceware.org/bugzilla/attachment.cgi?id=16131 objcopy generates objcopy: /tmp/objcopy-poc(OrcError.cpp.o): invalid entry (0x22000000) in group [3] objcopy: /tmp/objcopy-poc(OrcError.cpp.o): invalid entry (0x21000000) in group [3] objcopy: /tmp/objcopy-poc(OrcError.cpp.o)(.text._ZNK12_GLOBAL__N_116OrcErrorCategory7messageB5cxx11Ei): relocation 29 has invalid symbol index 1160982879 objcopy: /tmp/stv73zYw/OrcError.cpp.o[.text._ZN4llvm3orc8orcErrorENS0_12OrcErrorCodeE]: bad value instead of objcopy: /tmp/objcopy-poc(OrcError.cpp.o): invalid entry (0x22000000) in group [3] objcopy: /tmp/objcopy-poc(OrcError.cpp.o): invalid entry (0x21000000) in group [3] objcopy: /tmp/objcopy-poc(OrcError.cpp.o)(.text._ZNK12_GLOBAL__N_116OrcErrorCategory7messageB5cxx11Ei): relocation 29 has invalid symbol index 1160982879 Segmentation fault (core dumped) PR binutils/33075 * elf.c (elf_map_symbols): Return false if output_section is NULL. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-06-13x86: refine UD<n> kind-of-insnsJan Beulich4-279/+312
While documentation of these continues to be lacking sufficient detail, it is becoming increasingly clear that in 66f1eba0b7e8 ("x86: correct UDn") I went too far with requiring operands, to populate a ModR/M byte. AMD hardware appears to always behave as indicated as "may" in PM 3.36, which for all practical purposes means there's no ModR/M byte. The SDM (rev 087) indicates that such behavior can occur on older hardware for UD0. Re-add an operand-less UD1 form (as well as its UD2B alias), while newly adding such a form also for UD0. Because of the ambiguity, there's no good/easy way of handling both possibilities in the disassembler, which hence remains unaltered. Further, from all information I'm able to gather, the 0F opcode space was only introduced with the i286; bump the minimal hardware requirement for all UD<n> accordingly.
2025-06-13gas: switch convert_to_bignum() to taking just an expressionJan Beulich1-7/+9
Both callers, despite spelling things differently, now pass the same input for its 2nd parameter. Therefore, as was supposed to be the case anyway, this 2nd parameter isn't needed anymore - the function can calculate "sign" all by itself from the incoming expression. Instead make the function return the resulting value, for emit_expr_with_reloc() to consume for setting its "extra_digit" local variable.
2025-06-13gas: also maintain signed-ness for O_big expressionsJan Beulich6-8/+36
Interestingly emit_leb128_expr() already assumes X_unsigned is properly set for O_big. Adjust its conversion-to-bignum to respect the incoming flag, and have convert_to_bignum() correctly set it on output. It further can't be quite right that convert_to_bignum() depends on anything other than the incoming expression. Therefore adjust emit_expr_with_reloc() to be in line with the other invocation. This also requires an adjustment for SH, which really should have been part of 762acf217c40 ("gas: maintain O_constant signedness in more cases").
2025-06-13bfd: populate delay import directory in PE headerJeremy Drake1-1/+49
Previously, the delay import table was constructed but its rva and size were never put into the PE optional header. Signed-off-by: Jeremy Drake <sourceware-bugzilla@jdrake.com>
2025-06-13dlltool: respect use-nul-prefixed-import-tables option for delaylibJeremy Drake1-8/+13
Noticed the extra zeros while inspecting the output. Signed-off-by: Jeremy Drake <sourceware-bugzilla@jdrake.com>
2025-06-13ld,dlltool: move read-only delayimp data into .rdataJeremy Drake3-8/+12
This allows the delay IAT to be in its own section with nothing else, as required by IMAGE_GUARD_DELAYLOAD_IAT_IN_ITS_OWN_SECTION, documented at https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#load-configuration-layout Signed-off-by: Jeremy Drake <sourceware-bugzilla@jdrake.com>
2025-06-13bfd,ld,dlltool: Emit delay-load import data into its own sectionLIU Hao16-8/+158
A delay-import symbol (of a function) is resolved when a call to it is made. The delay loader may overwrite the `__imp_` pointer to the actual function after it has been resolved, which requires the pointer itself be in a writeable section. Previously it was placed in the ordinary Import Address Table (IAT), which is emitted into the `.idata` section, which had been changed to read-only in db00f6c3aceabbf03acdb69e74b59b2d2b043cd7, which caused segmentation faults when functions from delay-import library were called. This is PR 32675. This commit makes DLLTOOL emit delay-import IAT into `.didat`, as specified by Microsoft. Most of the code is copied from `.idata`, except that this section is writeable. As a side-effect of this, PR 14339 is also fixed. Using this DEF: ``` ; ws2_32.def LIBRARY "WS2_32.DLL" EXPORTS WSAGetLastError ``` and this C program: ``` // delay.c #define WIN32_LEAN_AND_MEAN 1 #include <windows.h> #include <stdio.h> ///////////////////////////////////////////////////////// // User code ///////////////////////////////////////////////////////// DWORD WINAPI WSAGetLastError(void); extern PVOID __imp_WSAGetLastError; int main(void) { fprintf(stderr, "before delay load, __imp_WSAGetLastError = %p\n", __imp_WSAGetLastError); SetLastError(123); fprintf(stderr, "WSAGetLastError() = %d\n", WSAGetLastError()); fprintf(stderr, "after delay load, __imp_WSAGetLastError = %p\n", __imp_WSAGetLastError); __imp_WSAGetLastError = (PVOID) 1234567; fprintf(stderr, "after plain write, __imp_WSAGetLastError = %p\n", __imp_WSAGetLastError); } ///////////////////////////////////////////////////////// // Overridden `__delayLoadHelper2` facility ///////////////////////////////////////////////////////// extern char __ImageBase[]; PVOID WINAPI ResolveDelayLoadedAPI(PVOID ParentModuleBase, LPCVOID DelayloadDescriptor, PVOID FailureDllHook, PVOID FailureSystemHook, FARPROC* ThunkAddress, ULONG Flags); FARPROC WINAPI DelayLoadFailureHook(LPCSTR name, LPCSTR function); FARPROC WINAPI __delayLoadHelper2(LPCVOID pidd, FARPROC* ppfnIATEntry) { return ResolveDelayLoadedAPI(&__ImageBase, pidd, NULL, (PVOID) DelayLoadFailureHook, ppfnIATEntry, 0); } ``` This program used to crash: ``` $ dlltool -nn -d ws2_32.def -y delay_ws2_32.a $ gcc -g delay.c delay_ws2_32.a -o delay.exe $ ./delay.exe before delay load, __imp_WSAGetLastError = 00007FF6937215C6 Segmentation fault ``` After this commit, it loads and calls `WSAGetLastError()` properly, and `__imp_WSAGetLastError` is writeable: ``` $ dlltool -nn -d ws2_32.def -y delay_ws2_32.a $ gcc -g delay.c delay_ws2_32.a -o delay.exe $ ./delay.exe before delay load, __imp_WSAGetLastError = 00007FF76E2215C6 WSAGetLastError() = 123 after delay load, __imp_WSAGetLastError = 00007FFF191FA720 after plain write, __imp_WSAGetLastError = 000000000012D687 ``` Reference: https://learn.microsoft.com/en-us/windows/win32/secbp/pe-metadata#import-handling Co-authored-by: Jeremy Drake <sourceware-bugzilla@jdrake.com> Signed-off-by: LIU Hao <lh_mouse@126.com> Signed-off-by: Jeremy Drake <sourceware-bugzilla@jdrake.com>
2025-06-13Automatic date update in version.inGDB Administrator1-1/+1
2025-06-12Minor grammar fix in DAP commentTom Tromey1-1/+1
I noticed a minor grammer issue in a comment in DAP.
2025-06-12gdb, linespec: avoid multiple locations with same PCKlaus Gerlicher3-0/+14
Setting a BP on a line like this would incorrectly yield two BP locations: 01 void two () { {int var = 0;} } (gdb) break 1 Breakpoint 1 at 0x1164: main.cpp:1. (2 locations) (gdb) info breakpoints Num Type Disp Enb Address What 1 breakpoint keep y <MULTIPLE> 1.1 y 0x0000000000001164 in two() at main.cpp:1 1.2 y 0x0000000000001164 in two() at main.cpp:1 In this case decode_digits_ordinary () returns two SALs, exactly matching the requested line. One for the entry PC and one for the prologue end PC. This was tested with GCC, CLANG and ICPX. Subsequent code tries to skip the prologue on these PCs, which in turn makes them the same. To fix this, ignore SALs with the same PC and program space when adding to the list of SALs. This will then properly set only one location: (gdb) break 1 Breakpoint 1 at 0x1164: file main.cpp, line 1 (gdb) info breakpoints Num Type Disp Enb Address What 1 breakpoint keep y 0x0000000000001164 in two() at main.cpp:1 Approved-By: Simon Marchi <simon.marchi@efficios.com>
2025-06-12gdb: convert linux-namespaces debug to the new(er) debug schemeAndrew Burgess2-39/+41
Convert 'set debug linux-namespaces' to the new(er) debug scheme. As part of this change I converted the mnsh_debug_print_message function, which previously printed its output, to instead return a std::string, this string is then printed using linux_namespaces_debug_printf. The mnsh_debug_print_message function is only used as part of the debug output. I also updated one place in the code where debug_linux_namespaces, the debug control variable, which is a boolean, was assigned an integer. When debug is turned on then clearly the output is now different, but in all other cases, there should be no user visible change in GDB after this commit. Approved-By: Tom Tromey <tom@tromey.com>
2025-06-12aarch64: Add support for FEAT_FPRCVTRichard Ball12-3412/+3941
FEAT_FPRCVT introduces new versions of previous instructions. The instructions are used to convert between floating points and Integers. These new versions take as operands SIMD&FP registers for both the source and destination register. FEAT_FPRCVT also enables the use of some existing AdvSIMD instructions in streaming mode. However, no changes are needed in gas to support this.
2025-06-12Automatic date update in version.inGDB Administrator1-1/+1
2025-06-11gdb: fix size of z80 "add ii,rr" and "ld (ii+d),n" instructionsAaron Griffith1-3/+3
The tables in z80-tdep.c previously either gave these instructions the wrong size, or failed to recognize them by using the wrong masks, or both. The fixed instructions alongside their representation in octal are: * add ii,rr: [0335] 00r1 (where r & 1 == 1) [0375] 00r1 * ld (ii+d,n): [0335] 0066 <d> <n> [0375] 0066 <d> <n> Prefix bytes inside [] do not count towards instruction length in these tables. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33066 Approved-By: Tom Tromey <tom@tromey.com>
2025-06-11GDB: doc: Improve AArch64 subsubsection titles and index entries in gdb.texinfoThiago Jung Bauermann1-14/+15
Remove period from subsubsection titles in the AArch64 configuration-specific subsection, and expand acronyms. Regarding @cindex entries, remove periods and standardise their order and the position of "AArch64" to make it easier to find them by using the index-searching commands of Info readers that offer TAB completion. Approved-By: Eli Zaretskii <eliz@gnu.org>
2025-06-11Arm tests: reduce objdump's output and improve some matching patternsMatthieu Longo4-29/+14
Linker scripts can change the sections order in the output. Some matching patterns in tests try to detect the end of a section by detecting the beginning of the next one. However, they mistakenly enforce the name of the next section without any need. This caused the tests to break due to minor changes to the linker scripts. This patch adds '-j <interesting-section>' to the arguments of objdump to dump only relevant information for the tests. This removed the issue related to the ordering of the sections. The matching patterns were also made stricter to match better the expected output.
2025-06-11gdb testsuite: Introduce allow_multi_inferior_tests and use it throughoutPedro Alves25-45/+116
The Windows port does not support multi-process debugging. Testcases that want to exercise multi-process currently FAIL and some hit cascading timeouts. Add a new allow_multi_inferior_tests procedure, meant to be used with require, and sprinkle it throughout testcases as needed. Approved-by: Kevin Buettner <kevinb@redhat.com> Change-Id: I4a10d8f04f9fa10f4b751f140ad0a6d31fbd9dfb
2025-06-11gdb testsuite: Introduce allow_fork_tests and use it throughoutPedro Alves37-29/+78
Cygwin debugging does not support follow fork. There is currently no interface between the debugger and the Cygwin runtime to be able to intercept forks and execs. Consequently, testcases that try to exercise fork/exec all FAIL, and several hit long cascading timeouts. Add a new allow_fork_tests procedure, meant to be used with require, and sprinkle it throughout testcases that exercise fork. Note that some tests currently are skipped on targets other than Linux, with something like: # Until "set follow-fork-mode" and "catch vfork" are implemented on # other targets... # if {![istarget "*-linux*"]} { continue } However, some BSD ports also support fork debugging nowadays, and the testcases were never adjusted... That is why the new allow_fork_tests procedure doesn't look for linux. With this patch, on Cygwin, I get this: $ make check TESTS="*/*fork*.exp" ... === gdb Summary === # of expected passes 6 # of untested testcases 1 # of unsupported tests 31 Reviewed-By: Keith Seitz <keiths@redhat.com> Change-Id: I0c5e8c574d1f61b28d370c22a0b0b6bc3efaf978
2025-06-11gdb.multi/attach-no-multi-process.exp: Detect no remote non-stopPedro Alves2-2/+5
Running gdb.multi/attach-no-multi-process.exp on Cygwin, where GDBserver does not support non-stop mode, I see: FAIL: gdb.multi/attach-no-multi-process.exp: target_non_stop=off: info threads FAIL: gdb.multi/attach-no-multi-process.exp: target_non_stop=on: attach to the program via remote (timeout) FAIL: gdb.multi/attach-no-multi-process.exp: target_non_stop=on: info threads (timeout) Let's ignore the first "info threads" fail. The timeouts look like this: builtin_spawn /home/alves/gdb-cache-cygwin/gdb/../gdbserver/gdbserver --once --multi localhost:2346 Listening on port 2346 target extended-remote localhost:2346 Remote debugging using localhost:2346 Non-stop mode requested, but remote does not support non-stop (gdb) gdb_do_cache: can_spawn_for_attach ( ) builtin_spawn /home/alves/gdb/build-cygwin-testsuite/outputs/gdb.multi/attach-no-multi-process/attach-no-multi-process attach 14540 FAIL: gdb.multi/attach-no-multi-process.exp: target_non_stop=on: attach to the program via remote (timeout) info threads FAIL: gdb.multi/attach-no-multi-process.exp: target_non_stop=on: info threads (timeout) Note the "Non-stop mode requested, but remote does not support non-stop" line. The intro to gdb_target_cmd_ext says: # gdb_target_cmd_ext # Send gdb the "target" command. Returns 0 on success, 1 on failure, 2 on # unsupported. That's perfect here, we can just use gdb_target_cmd_ext instead of gdb_target_cmd, and check for 2 (unsupported). That's what this patch does. However gdb_target_cmd_ext incorrectly returns 1 instead of 2 for the case where the remote target says it does not support non-stop. That is also fixed by this patch. With this, we no longer get those timeout fails. We get instead: target extended-remote localhost:2346 Remote debugging using localhost:2346 Non-stop mode requested, but remote does not support non-stop (gdb) UNSUPPORTED: gdb.multi/attach-no-multi-process.exp: target_non_stop=on: non-stop RSP Approved-by: Kevin Buettner <kevinb@redhat.com> Change-Id: I1ab3162f74200c6c02a17a0600b102d2d12db236
2025-06-11Convert gdb.base/watchpoint-hw-attach.exp to spawn_wait_for_attachPedro Alves1-15/+6
On Cygwin, starting an inferior under GDB, and detaching it, quitting GDB, and then closing the shell, like so: (gdb) start (gdb) detach (gdb) quit # close shell ... hangs the parent shell of GDB (not GDB!) until the inferior process that was detached (as it is still using the same terminal GDB was using) exits too. This leads to odd failures in gdb.base/watchpoint-hw-attach.exp like so: detach Detaching from program: .../outputs/gdb.base/watchpoint-hw-attach/watchpoint-hw-attach, process 16580 [Inferior 1 (process 16580) detached] (gdb) FAIL: gdb.base/watchpoint-hw-attach.exp: detach Fix this by converting the testcase to spawn the inferior outside GDB, with spawn_wait_for_attach. With this patch, the testcase passes cleanly on Cygwin, for me. Approved-By: Tom Tromey <tom@tromey.com> Change-Id: I8e3884073a510d6fd2fff611e1d26fc808adc4fa
2025-06-11ld: arm32: fix segfault when linking foreign BFDs [PR32870]dongjianqiang (A)1-0/+3
PR ld/32870 The linker may occasionally need to process a BFD that is from a non-Arm architecture. There will not be any Arm-specific tdata in that case, so skip such BFDs when looking for iplt information as the necessary tdata will not be present.
2025-06-11Fix Solaris buildTom Tromey2-15/+13
Commit 58984e4a ("Use gdb::function_view in iterate_over_threads") broke the Solaris build. This patch attempts to fix it, changing find_signalled_thread to have the correct signature, and correcting a couple of problems in sol_thread_target::get_ada_task_ptid. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33073
2025-06-11ld/PE: special-case relocation types only for COFF inputsJan Beulich1-4/+5
In 72cd2c709779 ("ld/PE: no base relocs for section (relative) ones") I made a pre-existing problem quite a bit worse: When looking at a relocation's (numerical) howto->type, that value is meaningful only if the object was of corresponding COFF type. ELF objects in particular have their own enumeration. As it stands, specifically the not entirely unusual R_X86_64_32 and R_X86_64_32S did no longer have relocations emitted for them, due to matching R_AMD64_SECTION and R_AMD64_SECREL in value respectively.
2025-06-11arm: ignore inapplicable .arch=no...Jan Beulich1-2/+6
Unlike for command line options, where a base architecture needs to be provided explicitly, the .arch directive doesn't have such a requirement. Therefore it is odd that disabling of an inapplicable extension isn't silently ignored; claiming "not allowed for the current base architecture" is at best misleading. Alter the error path to emit a more "soft" diagnostic in that case instead.
2025-06-11AArch64 variant PCS tests: remove RWX permissions on segmentsMatthieu Longo4-114/+124
The symbols of variant PCS functions require special handling. The variant PCS tests check both the relocation information and the markings in the symbol table. Those tests dump a lot of addresses, so a custom linker script, variant_pcs.ld was used to control reliably the addresses of the sections. However, the linker script does not provide information enough to the linker to assess the right set of permisssions on segments (i.e. Read/Write/Execute). This insufficiency caused the linker to bundle all the sections in a same segment with the union of all the required permissions, i.e. RWX. A segment with such lax permissions constitutes a security hole, so the linker emits the following warning message: <ELF file> has a LOAD segment with RWX permissions. This warning message is noisy in the tests, and has no reason to exist. This issue can be addressed in two ways: - either by providing the right set of permissions on a section so that the linker assigns them to a segment with compatible permissions. - or by providing alignment constraints so that the linker can move the sections automatically to a new segment and set the right permission for non-executable data. The second option seems to be the preferred approach, even if not explicitly recommended. Examples of linker scripts for AArch64 are available at [1]. This patch reorganizes the linker script to eliminate RWX segments by changing the order of the sections and their offset. The tests needed to be amended to match the new addresses. [1]: https://developer.arm.com/documentation/dui0474/m/gnu-ld-script-support-in -armlink/default-gnu-ld-scripts-used-by-armlink/default-ld-script-when -building-an-executable?lang=en
2025-06-11AArch64 BTI/PAC PLT tests: remove RWX permissions on segmentsMatthieu Longo18-59/+86
The bti-far.ld and bti-plt.ld scripts don't provide information enough to the linker to assess the right set of permisssions on segments (i.e. Read/Write/Execute). This insufficiency caused the linker to bundle all the sections in a same segment with the union of all the required permissions, i.e. RWX. A segment with such lax permissions constitutes a security hole, so the linker emits the following warning message: <ELF file> has a LOAD segment with RWX permissions. This warning message is noisy in the tests, and has no reason to exist. This issue can be addressed in two ways: - either by providing the right set of permissions on a section so that the linker assigns them to a segment with compatible permissions. - or by providing alignment constraints so that the linker can move the sections automatically to a new segment and set the right permission for non-executable data. The second option seems to be the preferred approach, even if not explicitly recommended. Examples of linker scripts for AArch64 are available at [1]. The fixes in bti-far.ld and bti-plt.ld are the same, except that bti-far.ld also contains a ".far" section, to make sure that it generates the trampolines correctly. [1]: https://developer.arm.com/documentation/dui0474/m/gnu-ld-script-support-in -armlink/default-gnu-ld-scripts-used-by-armlink/default-ld-script-when -building-an-executable?lang=en
2025-06-11AArch64 tests: remove RWX permissions on segmentsMatthieu Longo6-56/+61
aarch64.ld is the linker script used by most of the relocation tests in AArch64 testsuite. The script does not provide information enough to the linker to assess the right set of permisssions on segments (i.e. Read/Write/Execute). This insufficiency caused the linker to bundle all the sections in a same segment with the union of all the required permissions, i.e. RWX. A segment with such lax permissions constitutes a security hole, so the linker emits the following warning message: <ELF file> has a LOAD segment with RWX permissions. This warning message is noisy in the tests, and has no reason to exist. This issue can be addressed in two ways: - either by providing the right set of permissions on a section so that the linker assigns them to a segment with compatible permissions. - or by providing alignment constraints so that the linker can move the sections automatically to a new segment and set the right permission for non-executable data. The second option seems to be the preferred approach, even if not explicitly recommended. Examples of linker scripts for AArch64 are available at [1]. [1]: https://developer.arm.com/documentation/dui0474/m/gnu-ld-script-support-in -armlink/default-gnu-ld-scripts-used-by-armlink/default-ld-script-when -building-an-executable?lang=en
2025-06-11aarch64: Add system registers for 2024 MPAM extensionYury Khrustalev8-0/+67
This patch adds support for new system registers introduced in the 2024 MPAM extension (Memory Partitioning and Monitoring): Available in Armv9.3-A: MPAMBW0_EL1, MPAMBW1_EL1, MPAMBW1_EL12, MPAMBW2_EL2, MPAMBW3_EL3, MPAMBWCAP_EL2, MPAMBWIDR_EL1 Available in Armv9.3-A with SME: MPAMBWSM_EL1 The details can be found in [1]. [1]: https://developer.arm.com/documentation/ddi0601/latest
2025-06-11aarch64: Add definitions for missing architecture bitsYury Khrustalev1-4/+16
Complete macros for feature bits for v9.1-A, v9.2-A, v9.3-A, and v9.4-A.
2025-06-11Automatic date update in version.inGDB Administrator1-1/+1
2025-06-11gas md_apply_fix value castsAlan Modra11-22/+20
These are all innocuous but unneeded. pdp11 and ppc are only formatting.
2025-06-11gas md_apply_fix bad castsAlan Modra3-3/+3
ns32k and z8k cast a valueT pointer to a long pointer when loading md_apply_fix's value. That's quite wrong if the types have different sizes, as they may eg. on a 32-bit host with 64-bit bfd support. sparc also loads the value via a cast pointer, but at least in that case the cast is to the same size pointer. None of these casts are needed. Get rid of them.
2025-06-11loongarch gcc-4.5 build fixesAlan Modra3-18/+33
Yet another case of missing fields in struct initialisation, which I've replaced with a memset, and some complaints about identifiers shadowing global declarations. Fixing the shadowing in loongarch-parse.y is easy. This one isn't so easy: gas/expr.c: In function 'expr': gas/expr.c:1891:12: error: declaration of 'is_unsigned' shadows a global declaration include/opcode/loongarch.h:224:14: error: shadowed declaration is here opcode/loongarch.h declares lots of stuff that shouldn't be made available to generic gas code, so I've removed that header from tc-loongarch.h and moved the parts of TC_FORCE_RELOCATION_SUB_LOCAL and TC_FORCE_RELOCATION_SUB_LOCAL that need LARCH_opts to functions in tc-loongarch.c * config/loongarch-parse.y (loongarch_parse_expr): Rename param to avoid shadowing. * config/tc-loongarch.c (loongarch_assemble_INSNs): Use memset rather than struct initialisation. (loongarch_force_relocation_sub_local): New function. (loongarch_force_relocation_sub_same): Likewise. * config/tc-loongarch.h: Don't include opcode/loongarch.h. (loongarch_force_relocation_sub_local): Declare, and.. (TC_FORCE_RELOCATION_SUB_LOCAL): ..use here. (loongarch_force_relocation_sub_same): Declare, and.. (TC_FORCE_RELOCATION_SUB_SAME): ..use here.
2025-06-11kvx gcc-4.5 build fixesAlan Modra3-5/+5
More missing struct initialisers, for expressionS vars that in this case don't need to be initialised. Also an error: redefinition of typedef 'symbolS'. OK, so don't use a typedef.
2025-06-11csky gcc-4.5 build fixAlan Modra1-26/+50
gcc-4.5 warns about missing csky_cpus struct initialisers. Fix that by providing everything in the init macros and the zero sentinel, rather than just a single {0} as allowed by C99.
2025-06-11gas m68hc11 use standard qsort predicate signatureAlan Modra1-4/+4
Avoid a function cast when using cmp_opcode with qsort.
2025-06-11Re: Further rs_code_align support refinementAlan Modra1-9/+9
Don't write the repeating nop pattern if it won't be used for alpha handle_align too.
2025-06-11gas: xtensa build failure with --enable-64-bit-bfdAlan Modra1-7/+13
A 32-bit host with --enable-64-bit-bfd --target=xtensa-lx106-elf give: gas/config/tc-xtensa.c: In function ‘xg_get_best_chain_entry’: gas/config/tc-xtensa.c:7689:11: error: absolute value function ‘labs’ given an argument of type ‘offsetT’ {aka ‘long long int’} but has parameter of type ‘long int’ which may cause truncation of value [-Werror=absolute-value] 7689 | if (labs (off) >= J_RANGE - J_MARGIN) | ^~~~ Let's not use labs. Unlike labs vma_abs deliberately returns an unsigned value, and does the negation in an unsigned type so that signed overflow can't happen. * config/tc-xtensa.c (vma_abs): New function. (xg_get_best_chain_entry, xg_get_fulcrum, xg_find_best_trampoline), (xg_is_relaxable_fixup): Use in place of labs.
2025-06-11dlltool invalid freeAlan Modra1-1/+1
This is a followup to commt 619f863c55ca "dlltool memory leaks". The name passed to def_name is freed, so if missing we can't just use "". strdup it. * defparse.y (opt_name): xstrdup empty string.
2025-06-10AArch64, Arm and TIC6x tests: fix typo in linker scriptsMatthieu Longo11-12/+12
The linker scripts for AArch64 and TIC6x were probably originally copied from Arm testsuite, and contain the same typo in the name of the attributes section. This patch fixes the typo across all the testsuites.
2025-06-10gdb/dwarf2: remove erroneous comment in open_and_init_dwo_fileSimon Marchi1-5/+0
When writing commit 28f15782adab ("gdb/dwarf: read multiple .debug_info.dwo sections"), I initially thought that the gcc behavior of producing multiple .debug_info.dwo sections was a bug (it is not). I updated the commit message, but it looks like this comment stayed. Remove it, since it can be misleading. Change-Id: I027712d44b778e836f41afbfafab993da02726ef Approved-By: Tom Tromey <tom@tromey.com>
2025-06-10RISC-V: Add Smrnmi extension imply relation.Jiawei3-0/+3
This patch adds the dependency of Smrnmi extension on Zicsr extension. bfd/ChangeLog: * elfxx-riscv.c: New imply. gas/ChangeLog: * testsuite/gas/riscv/imply.d: New test check. * testsuite/gas/riscv/imply.s: New imply test. Signed-off-by: Jiawei <jiawei@iscas.ac.cn>
2025-06-10RISC-V: Add support for svvptc extension.Dongyan Chen3-1/+3
This implements the svvptc extensons, version 1.0[1]. [1] https://github.com/riscv/riscv-svvptc bfd/ChangeLog: * elfxx-riscv.c: New extension. gas/ChangeLog: * NEWS: Updated. * testsuite/gas/riscv/march-help.l: Ditto.
2025-06-10Automatic date update in version.inGDB Administrator1-1/+1