aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-01-06x86: drop NoAVX from POPCNTJan Beulich2-2/+2
With the introduction of CpuPOPCNT the NoAVX attribute has become meaningless for POPCNT.
2022-01-06x86: drop some "comm" template parametersJan Beulich2-90/+90
As already indicated in a remark when introducing these templates, the "commutative" attribute is ignored for legacy encoding templates. Hence it is possible to shorten a number of templates by specifying C directly rather than through a template parameter. I think this helps readability a bit.
2022-01-06x86: templatize FMA insn templatesJan Beulich2-1016/+830
The operand ordering portion of the mnemonics repeats, causing a flurry of almost identical templates. Abstract this out.
2022-01-06x86-64: restrict PC32 -> PLT32 conversionJan Beulich2-3/+7
Neither non-64-bit code nor uses with a non-zero offset from a symbol should be converted to PLT32, as an eventual PLT entry would not express what was requested.
2022-01-06gdb: Fix copyright year in gdb/testsuite/gdb.base/inferior-clone.expLancelot SIX1-1/+1
I just realized that I forgot to update the year before pushing the patch that created this file. Since it landed after the global copyright year update have been done, this file’s copyright year is updated. This patch fixes that. Change-Id: I280f7d86e02d38425f7afdcf19a1c3500d51c23f
2022-01-06sim: ppc: migrate to standard uintXX_t typesMike Frysinger37-1343/+1332
Drop the sim-specific unsignedXX types and move to the standard uintXX_t types that C11 provides.
2022-01-06sim: common: migrate to standard uintXX_t typesMike Frysinger22-432/+425
Drop the sim-specific unsignedXX types and move to the standard uintXX_t types that C11 provides.
2022-01-06sim: igen: migrate to standard uintXX_t typesMike Frysinger6-27/+9
Move off the custom local 64-bit types and to the standard uintXX_t types that C11 provides.
2022-01-06sim: mips: migrate to standard uintXX_t typesMike Frysinger17-1083/+1083
Move off the sim-specific unsignedXX types and to the standard uintXX_t types that C11 provides.
2022-01-06sim: cris: migrate to standard uintXX_t typesMike Frysinger7-80/+80
Move off the sim-specific unsignedXX types and to the standard uintXX_t types that C11 provides.
2022-01-06sim: iq2000: migrate to standard uintXX_t typesMike Frysinger1-4/+4
Move off the sim-specific unsignedXX types and to the standard uintXX_t types that C11 provides.
2022-01-06sim: synacor: migrate to standard uintXX_t typesMike Frysinger2-27/+27
Move off the sim-specific unsignedXX types and to the standard uintXX_t types that C11 provides.
2022-01-06sim: msp430: migrate to standard uintXX_t typesMike Frysinger2-15/+15
Move off the sim-specific unsignedXX types and to the standard uintXX_t types that C11 provides.
2022-01-06sim: riscv: migrate to standard uintXX_t typesMike Frysinger1-28/+28
Move off the sim-specific unsignedXX types and to the standard uintXX_t types that C11 provides.
2022-01-06sim: bfin: migrate to standard uintXX_t typesMike Frysinger1-2/+2
Move off the sim-specific unsignedXX types and to the standard uintXX_t types that C11 provides.
2022-01-06sim: testsuite: migrate to standard uintXX_t typesMike Frysinger4-19/+19
This old code setup its own uintXX types, but since we require C11 now, we can assume the standard uintXX_t types exist and use them.
2022-01-06sim: erc32: migrate to standard uintXX_t typesMike Frysinger7-312/+305
This old port setup its own uintXX types, but since we require C11 now, we can assume the standard uintXX_t types exist and use them.
2022-01-06sim: mn10300: migrate to standard uintXX_t typesMike Frysinger11-505/+498
This old port setup its own uintXX types, but since we require C11 now, we can assume the standard uintXX_t types exist and use them.
2022-01-06sim: v850: migrate to standard uintXX_t typesMike Frysinger5-111/+105
This old port setup its own uintXX types, but since we require C11 now, we can assume the standard uintXX_t types exist and use them.
2022-01-06sim: m68hc11: migrate to standard uintXX_t typesMike Frysinger13-273/+265
This old port setup its own uintXX types, but since we require C11 now, we can assume the standard uintXX_t types exist and use them. Also migrate off the sim-specific unsignedXX types.
2022-01-06sim: d10v: migrate to standard uintXX_t typesMike Frysinger4-273/+265
This old port setup its own uintXX types, but since we require C11 now, we can assume the standard uintXX_t types exist and use them. Also migrate off the sim-specific unsignedXX types.
2022-01-06sim: cr16: migrate to standard uintXX_t typesMike Frysinger3-630/+621
This old port setup its own uintXX types, but since we require C11 now, we can assume the standard uintXX_t types exist and use them. Also migrate off the sim-specific unsignedXX types.
2022-01-06Automatic date update in version.inGDB Administrator1-1/+1
2022-01-05x86: Add elf_x86_allocate_local_got_infoH.J. Lu3-34/+30
Add elf_x86_allocate_local_got_info to allocate x86 GOT info for local symbols. * elf32-i386.c (elf_i386_check_relocs): Call elf_x86_allocate_local_got_info. * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise. * elfxx-x86.h (elf_x86_allocate_local_got_info): New.
2022-01-05opcodes: Make i386-dis.c thread-safeVladimir Mezentsev1-1738/+1774
Improve thread safety in print_insn_i386_att, print_insn_i386_intel and print_insn_i386 by removing the use of static variables. Tested on x86_64-pc-linux-gnu. 2022-01-04 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> * i386-dis.c: Make print_insn_i386_att, print_insn_i386_intel and print_insn_i386 thread-safe
2022-01-05doc: Replace =frame-interp with =frames-interpH.J. Lu1-1/+1
The actual objdump and readelf option name is =frames-interp, not =frames-interp. PR binutils/28747 * doc/debug.options.texi: Replace =frame-interp with =frames-interp.
2022-01-05Change riscv_return_value to use RETURN_VALUE_ABI_PRESERVES_ADDRESSTom Tromey1-1/+1
Internally, AdaCore has a test that is equivalent to (really a direct translation of) gdb.base/gnu_vector.exp. On 32-bit RISC-V, the "return" part of this test fails. Joel tracked this down to riscv_return_value returning RETURN_VALUE_ABI_RETURNS_ADDRESS. Using RETURN_VALUE_ABI_PRESERVES_ADDRESS is more correct here, and fixes the bug. I tested this for both 32- and 64-bit RISC-V using the AdaCore internal test suite, and Andrew Burgess tested it using gnu_vector.exp.
2022-01-05Filtered output cleanup in expression dumpingTom Tromey1-13/+13
Most of the expression-dumping code uses filtered output, but a few functions did not. This patch cleans up these instance. Note that this won't cause any behavior change, because the only calls to dump_prefix_expression pass in gdb_stdlog. However, in the long run it's easier to audit the code if the number of uses of _unfiltered is reduced.
2022-01-05Use filtered output in terminal_info implementationsTom Tromey2-8/+8
This changes one terminal_info implementation, and default_terminal_info, to use filtered output. Other implementations of this method already use filtered output. I can't compile go32-nat.c, so this is a 'best effort' patch.
2022-01-05Use filtered output in gnu-nat.c commandsTom Tromey1-49/+53
gnu-nat.c has a number of ordinary commands that should use filtered output. In a few cases, I changed the output to use gdb_stderr as well. I can't compile this file, so this patch is split out as a "best effort".
2022-01-05Use filtered output in *-tdep commandsTom Tromey5-23/+23
Various targets introduce their own commands, which then use unfiltered output. It's better to use filtered output by default, so this patch fixes the instances I found.
2022-01-05Use filtered output in btrace-related commandsTom Tromey2-86/+86
This changes btrace.c and record-btrace.c to use filtered output in the commands implemented there.
2022-01-05Use filtered output in some dumping commandsTom Tromey5-61/+61
There are several commands that may optionally send their output to a file -- they take an optional filename argument and open a file. This patch changes these commands to use filtered output. The rationale here is that, when printing to gdb_stdout, filtering is appropriate -- it is, and should be, the default for all commands. And, when writing to a file, paging will not happen anyway (it only happens when the stream==gdb_stdout), so using the _filtered form will not change anything.
2022-01-05Use filtered output in kill commandTom Tromey1-4/+3
This changes the kill command to use filtered output. I split this one into its own patch because, out of an abundance of caution, I changed the function to call bfd_cache_close_all a bit earlier, in case pagination caused an exception.
2022-01-05Use filtered output in ordinary commandsTom Tromey18-89/+89
Many otherwise ordinary commands choose to use unfiltered output rather than filtered. I don't think there's any reason for this, so this changes many such commands to use filtered output instead. Note that complete_command is not touched due to a comment there explaining why unfiltered output is believed to be used.
2022-01-05Use filtered output in language_infoTom Tromey1-1/+1
Change language_info to use filtered output. This is ok because the sole caller uses filtered output elsewhere, and because this function calls show_language_command, which also uses filtered output.
2022-01-05Use filtered output in files_info implementationsTom Tromey5-15/+15
This changes the implementations of the target files_info method to use filtered output. This makes sense because the sole caller of this method is an ordinary command (info_program_command). This patch changes this command to use filtered output as well.
2022-01-05Use filtered output in target-descriptions.cTom Tromey1-76/+76
target-descriptions.c uses unfiltered output. However, if you happen to invoke this command interactively, it's probably better for it to use filtering. For non-interactive use, this doesn't matter.
2022-01-05Use filtered output for gdbarch dumpTom Tromey10-357/+357
This changes gdbarch dumping to use filtered output. This seems a bit better to me, both on the principle that this is an ordinary command, and because the output can be voluminous, so it may be nice to stop in the middle.
2022-01-05Implement putstr and putstrn in ui_fileTom Tromey10-139/+158
In my tour of the ui_file subsystem, I found that fputstr and fputstrn can be simplified. The _filtered forms are never used (and IMO unlikely to ever be used) and so can be removed. And, the interface can be simplified by removing a callback function and moving the implementation directly to ui_file. A new self-test is included. Previously, I think nothing was testing this code. Regression tested on x86-64 Fedora 34.
2022-01-05Change how versioned symbols are recordedTom Tromey1-35/+34
A change to BFD caused a gdb regression when using the Ada "catch exception" feature. The bug is visible when a shared library throws an exception that is caught in the main executable. This was discussed here: https://sourceware.org/pipermail/binutils/2021-July/117538.html This patch implements Alan's proposed fix, namely to use VERSYM_HIDDEN rather than the name when deciding to install a version-less symbol. The internal test case is identical to the catch_ex_std.exp that is in-tree, so I haven't added a new test. I could not make that one fail on x86-64 Linux, though. It's possible that maybe I'd have to update the system linker first, but I didn't want to try that. Regression tested on x86-64 Fedora 32.
2022-01-05Fix inferior_thread attribute in new_thread eventHannes Domani2-2/+4
Commit 72ee03ff58 fixed a use-after-move bug in add_thread_object, but it changed the inferior_thread attribute to contain the inferior instead of the actual thread. This now uses the thread_obj in its new location instead. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28429
2022-01-05Simplify execute_control_commands_to_stringTom Tromey1-23/+7
execute_control_commands_to_string can be rewritten in terms of execute_fn_to_string, which consolidates some knowledge about which streams to redirect. Regression tested on x86-64 Fedora 34.
2022-01-05Do not print anything when self-backtrace unavailableTom Tromey2-2/+11
Right now, gdb's self-backtrace feature will still print something when a backtrace is unavailable: sig_write (_("----- Backtrace -----\n")); [...] sig_write (_("Backtrace unavailable\n")); sig_write ("---------------------\n"); However, if GDB_PRINT_INTERNAL_BACKTRACE is undefined, it seems better to me to print nothing at all. This patch implements this change. It also makes a couple of other small changes in this same module: it adds a header guard to bt-utils.h, and it protects the definitions of gdb_internal_backtrace_1 with a check of GDB_PRINT_INTERNAL_BACKTRACE.
2022-01-05Fix pager regressionTom Tromey2-0/+11
The patch to fix paging with redirection caused a regression in the internal AdaCore test suite. The problem occurs when running an MI command from the CLI using interpreter-exec, when paging is enabled. This scenario isn't covered by the current test suite, so this patch includes a new test. The problem is that, in this situation, MI does: fputs_unfiltered (strcmp (context->command, "target-select") == 0 ? "^connected" : "^done", mi->raw_stdout); Here raw_stdout is a stdio_file wrapping stdout, so the pager thinks that it is ok to buffer the output. However, in this setup, it isn't ok, and flushing the wrap buffer doesn't really work properly. Also, MI next does: mi_out_put (uiout, mi->raw_stdout); ... but this uses ui_file::write, which also doesn't flush the wrap buffer. I think all this will be fixed by the pager rewrite series I'm working on. However, in the meantime, adding the old gdb_stdout check back to the pager fixes this problem. Regression tested on x86-64 Fedora 34.
2022-01-05elf: Set p_align to the minimum page size if possibleH.J. Lu18-12/+162
Currently, on 32-bit and 64-bit ARM, it seems that ld generates p_align values of 0x10000 even if no section alignment is greater than 0x1000. The issue is more general and probably affects other targets with multiple page sizes. While file layout absolutely must take 64K page size into account, that does not have to be reflected in the p_align value. If running on a 64K kernel, the file will be loaded at a 64K page boundary by necessity. On a 4K kernel, 64K alignment is not needed. The glibc loader has been fixed to honor p_align: https://sourceware.org/bugzilla/show_bug.cgi?id=28676 similar to kernel: commit ce81bb256a224259ab686742a6284930cbe4f1fa Author: Chris Kennelly <ckennelly@google.com> Date: Thu Oct 15 20:12:32 2020 -0700 fs/binfmt_elf: use PT_LOAD p_align values for suitable start address This means that on 4K kernels, we will start to do extra work for 64K p_align, but this pointless for pretty much all binaries (whose section alignment rarely exceeds 16). The minimum page size is used, instead of the maximum section alignment due to this glibc bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28688 It has been fixed in glibc 2.35. But linker output must work on existing glibc binaries. 1. Set p_align to the minimum page size while laying out segments aligning to the maximum page size or section alignment. The run-time loader can align segments to the minimum page size or above, depending on system page size. 2. If -z max-page-size=NNN is used, p_align will be set to the maximum page size or the largest section alignment. 3. If a section requires alignment higher than the minimum page size, don't set p_align to the minimum page size. 4. If a section requires alignment higher than the maximum page size, set p_align to the section alignment. 5. For objcopy, when the minimum page size != the maximum page size, p_align may be set to the minimum page size while segments are aligned to the maximum page size. In this case, the input p_align will be ignored and the maximum page size will be used to align the ouput segments. 6. Update linker to disallow the common page size > the maximum page size. 7. Update linker to avoid the common page size > the maximum page size. 8. Adjust pru_irq_map-1.d to expect p_align == sh_addralign: Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .text PROGBITS 20000000 00007c 000004 00 AX 0 0 4 ... Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0x000074 0x00000000 0x00000000 0x00008 0x00008 RW 0x1 LOAD 0x00007c 0x20000000 0x20000000 0x00004 0x00004 R E 0x4 vs. Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .text PROGBITS 20000000 00007c 000004 00 AX 0 0 4 ... Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0x000074 0x00000000 0x00000000 0x00008 0x00008 RW 0x1 LOAD 0x00007c 0x20000000 0x20000000 0x00004 0x00004 R E 0x1 To enable this linker optimization, the backend should define ELF_P_ALIGN to ELF_MINPAGESIZE. bfd/ PR ld/28689 PR ld/28695 * elf-bfd.h (elf_backend_data): Add p_align. * elf.c (assign_file_positions_for_load_sections): Set p_align to the default p_align value while laying out segments aligning to maximum page size or section alignment. (elf_is_p_align_valid): New function. (copy_elf_program_header): Call elf_is_p_align_valid to determine if p_align is valid. * elfxx-target.h (ELF_P_ALIGN): New. Default to 0. (elfNN_bed): Add ELF_P_ALIGN. * elfxx-x86.h (ELF_P_ALIGN): New. Set to ELF_MINPAGESIZE. include/ PR ld/28689 PR ld/28695 * bfdlink.h (bfd_link_info): Add maxpagesize_is_set. ld/ PR ld/28689 PR ld/28695 * emultempl/elf.em (gld${EMULATION_NAME}_handle_option): Set link_info.maxpagesize_is_set for -z max-page-size=NNN. * ldelf.c (ldelf_after_parse): Disallow link_info.commonpagesize > link_info.maxpagesize. * testsuite/ld-elf/elf.exp: Pass -z max-page-size=0x4000 to linker to build mbind2a and mbind2b. * testsuite/ld-elf/header.d: Add -z common-page-size=0x100. * testsuite/ld-elf/linux-x86.exp: Add PR ld/28689 tests. * testsuite/ld-elf/p_align-1.c: New file. * testsuite/ld-elf/page-size-1.d: New test. * testsuite/ld-elf/pr26936.d: Add -z common-page-size=0x1000. * testsuite/ld-elf/seg.d: Likewise. * testsuite/ld-scripts/rgn-at5.d: Likewise. * testsuite/ld-pru/pru_irq_map-1.d: Append 1 to name. Adjust expected PT_LOAD segment alignment. * testsuite/ld-pru/pru_irq_map-2.d: Append 2 to name. * testsuite/ld-scripts/pr23571.d: Add -z max-page-size=0x1000.
2022-01-05Adjust quoted-sym-names testAlan Modra2-6/+6
Some targets restrict symbol addresses in .text to instruction boundaries. * testsuite/gas/all/quoted-sym-names.s: Define syms in .data. * testsuite/gas/all/quoted-sym-names.d: Adjust to suit.
2022-01-05infinite recursion detected in gold testcaseAlan Modra1-4/+6
gold/testsuite/icf_test.cc:32:5: error: infinite recursion detected [-Werror=infinite-recursion] 32 | int kept_func() | ^~~~~~~~~ * testsuite/icf_test.cc: Avoid infinite recursion error.
2022-01-05Automatic date update in version.inGDB Administrator1-1/+1
2022-01-04ld/x86: Update -z report-relative-relocH.J. Lu3-21/+11
Use 0x%v, instead of bfd_sprintf_vma, to report relative relocations. Change linker relative relocations report from tmpdir/dump: R_X86_64_IRELATIVE (offset: 0x0000000000002000, info: 0x0000000000000025, addend: 0x0000000000001007) against 'ifunc' for section '.data.rel.ro.local' in tmpdir/report-reloc-1.o to tmpdir/dump: R_X86_64_IRELATIVE (offset: 0x2000, info: 0x25, addend: 0x1007) against 'ifunc' for section '.data.rel.ro.local' in tmpdir/report-reloc-1.o bfd/ * elfxx-x86.c (_bfd_x86_elf_link_report_relative_reloc): Use 0x%v instead of bfd_sprintf_vma. ld/ * testsuite/ld-i386/report-reloc-1.l: Updated. * testsuite/ld-x86-64/report-reloc-1.l: Likewise.