aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-03-15ld: don't chance overrunning PE .reloc section contentJan Beulich2-3/+4
The allocation of reloc_d doesn't take reloc_s->size into account. There is already padding being emitted up to the allocated size. While reloc_s->size ought to still be zero at this point anyway (and hence the code being deleted would have been just dead), don't risk writing past the actual allocation.
2021-03-15gdb: use make_scoped_restore to restore gdbpy_current_objfileAndrew Burgess9-6/+264
The current mechanism by which the Python gdb.current_objfile is maintained does not allow for nested auto-load events. It is assumed that once an auto-load script has finished loading then the current objfile should be set back to NULL. In a nested situation, we should be restoring the previous value. We already have an RAII class to handle save/restore type behaviour, so lets just switch to use that. The test is a little contrived, but is simple enough, and triggers the bug. The real use case might involve the auto-load script calling functions (either in the just-loaded object file, or in the main executable), which in turn trigger further auto-loads to occur. gdb/ChangeLog: * python/python.c (gdbpy_source_objfile_script): Use make_scoped_restore to restore gdbpy_current_objfile. (gdbpy_execute_objfile_script): Likewise. gdb/testsuite/ChangeLog: * gdb.python/py-auto-load-chaining-f1.c: New file. * gdb.python/py-auto-load-chaining-f1.o-gdb.py: New file. * gdb.python/py-auto-load-chaining-f2.c: New file. * gdb.python/py-auto-load-chaining-f2.o-gdb.py: New file. * gdb.python/py-auto-load-chaining.c: New file. * gdb.python/py-auto-load-chaining.exp: New file.
2021-03-15Automatic date update in version.inGDB Administrator1-1/+1
2021-03-14Use cu_header consistently in read_attribute_valueTom Tromey2-11/+16
read_attribute_value has a local cu_header variable, but then some spots in the function use cu->header instead. It seems better to me to prefer the local everywhere, so this patch makes this change. gdb/ChangeLog 2021-03-14 Tom Tromey <tom@tromey.com> * dwarf2/read.c (read_attribute_value): Use cu_header consistently.
2021-03-14Minor tweak to use die_reader_specs::abfdTom Tromey2-2/+7
For an experiment I'm working on, it would be convenient if die_reader_specs::cu could be NULL. This is fairly involved to implement, but I did notice one spot that could conveniently be updated. While making this trivial change, I also noticed a small, related formatting error. 2021-03-14 Tom Tromey <tom@tromey.com> * dwarf2/read.c (struct die_reader_specs) <abfd>: Fix formatting. (peek_die_abbrev): Use reader.abfd.
2021-03-14Set dwarf2_per_cu_data::m_header_read_inTom Tromey2-0/+7
I noticed that nothing in dwarf2/read.c sets dwarf2_per_cu_data::m_header_read_in. This patch adds the appropriate assignment. gdb/ChangeLog 2021-03-14 Tom Tromey <tom@tromey.com> * dwarf2/read.c (dwarf2_per_cu_data::get_header): Set m_header_read_in.
2021-03-14Automatic date update in version.inGDB Administrator1-1/+1
2021-03-13Constify abbrev_table::lookup_abbrevTom Tromey3-10/+20
This changes abbrev_table::lookup_abbrev to return a pointer to const, then fixes up the affected code. gdb/ChangeLog 2021-03-13 Tom Tromey <tom@tromey.com> * dwarf2/read.c (struct partial_die_info): Update. (peek_die_abbrev, skip_children, skip_one_die, read_full_die_1) (load_partial_dies, partial_die_info::partial_die_info): Update. * dwarf2/abbrev.h (lookup_abbrev): Constify.
2021-03-13Remove Irix 6 workaround from DWARF abbrev readerTom Tromey2-19/+13
abbrev_table::read has a workaround for Irix 6. The last release of Irix was in 2006, and (according to Wikipedia) hardware produced after 2007 cannot run Irix. I think this workaround can safely be retired. gdb/ChangeLog 2021-03-13 Tom Tromey <tom@tromey.com> * dwarf2/abbrev.c (abbrev_table::read): Remove Irix 6 workaround.
2021-03-13sim: rename BUILD_LDFLAGS to LDFLAGS_FOR_BUILDMike Frysinger8-5/+31
The rest of the binutils tree renamed this variable many years ago.
2021-03-13sim: introduce {COMPILE,LINK}_FOR_BUILDMike Frysinger16-49/+111
These use the same pattern as seen in the opcodes/ dir and in automake in general (ish). This helps simplify the boilerplate for building and linking build-time code, and fixes some inconsistency in flag usage. For rules that were compiling+linking in a single step, split them into separate steps so we can apply the correct set of options. This matches automake behavior too.
2021-03-12sim: drop dep on configure-gdbMike Frysinger3-2/+5
I'm not entirely sure why this is here since the sim doesn't use anything from the gdb/ dir directly, and the commit that added it included a bunch more changes and doesn't seem to call out this dep specifically.
2021-03-13Automatic date update in version.inGDB Administrator1-1/+1
2021-03-12Use RAII to set the per-thread SIGSEGV handlerChristian Biesinger4-12/+51
This avoids using a thread-local extern variable, which causes link errors on some platforms, notably Cygwin. But I think this is a better pattern even outside of working around linker bugs because it encapsulates direct access to the variable inside the class, instead of having a global extern variable. The cygwin link error is: cp-support.o: in function `gdb_demangle(char const*, int)': /home/Christian/binutils-gdb/obj/gdb/../../gdb/cp-support.c:1619:(.text+0x6472): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for thread_local_segv_handler' /home/Christian/binutils-gdb/obj/gdb/../../gdb/cp-support.c:1619:(.text+0x648b): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for thread_local_segv_handler' collect2: error: ld returned 1 exit status 2021-03-12 Christian Biesinger <cbiesinger@google.com> PR threads/27239 * cp-support.c: Use scoped_segv_handler_restore. * event-top.c (thread_local_segv_handler): Made static. (scoped_segv_handler_restore::scoped_segv_handler_restore): New function. (scoped_segv_handler_restore::~scoped_segv_handler_restore): New function. * event-top.h (class scoped_segv_handler_restore): New class. (thread_local_segv_handler): Removed.
2021-03-12Add values for NetBSD .note.netbsd.ident notes (PaX).Frederic Cambus2-0/+15
* elf/common.h (NT_NETBSD_PAX, NT_NETBSD_PAX_MPROTECT) (NT_NETBSD_PAX_NOMPROTECT, NT_NETBSD_PAX_GUARD, NT_NETBSD_PAX_NOGUARD) (NT_NETBSD_PAX_ASLR, NT_NETBSD_PAX_NOASLR): Define.
2021-03-12aarch64: Add few missing system registersPrzemyslaw Wirkus8-0/+74
This patch adds few missing system registers to GAS: LORC_EL1, LOREA_EL1, LORN_EL1, LORSA_EL1, ICC_CTLR_EL3, ICC_SRE_ELX, ICH_VTR_EL2. gas/ChangeLog: 2021-03-02 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com> * testsuite/gas/aarch64/illegal-sysreg-7.d: New test. * testsuite/gas/aarch64/illegal-sysreg-7.l: New test. * testsuite/gas/aarch64/illegal-sysreg-7.s: New test. * testsuite/gas/aarch64/sysreg-7.d: New test. * testsuite/gas/aarch64/sysreg-7.s: New test. opcodes/ChangeLog: 2021-03-02 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com> * aarch64-opc.c: Add lorc_el1, lorea_el1, lorn_el1, lorsa_el1, icc_ctlr_el3, icc_sre_elx, ich_vtr_el2 system registers.
2021-03-12riscv --enable-targets=all on 32-bit hostAlan Modra3-12/+18
Attempting to build --enable-targets=all on a 32-bit host results in a number of errors like the following. eelf32lriscv.o: in function `gldelf32lriscv_after_allocation': eelf32lriscv.c:98: undefined reference to `bfd_elf32_riscv_restart_relax_sections' That's due to needing --enable-64-bit-bfd to get the riscv BFD support built. * Makefile.am (ALL_EMULATION_SOURCES): Move riscv files to.. (ALL_64_EMULATION_SOURCES): ..here. * Makefile.in: Regenerate.
2021-03-12gdb/testsuite: resolve remaining duplicate test names in gdb.python/*.expAndrew Burgess7-8/+25
This commit resolves the remaining duplicate test names in the gdb.python/ directory, there's 1 duplicate per test script. In each case I have just extended some test names to make them more descriptive. gdb/testsuite/ChangeLog: * gdb.python/py-bad-printers.exp: Extend test names to make them unique. * gdb.python/py-events.exp: Likewise. * gdb.python/py-finish-breakpoint2.exp: Likewise. * gdb.python/py-frame-inline.exp: Likewise. * gdb.python/py-frame.exp: Likewise. * gdb.python/py-infthread.exp: Likewise.
2021-03-12gdb/testsuite: remove duplicate test from gdb.python/py-value-cc.expAndrew Burgess2-2/+4
While squashing duplicate test names I spotted an actual duplicate test, I suspect a copy & paste error in an earlier patch. I can see no reason why we should need to duplicate this test, so I'm removing one copy of it. gdb/testsuite/ChangeLog: * gdb.python/py-value-cc.exp: Remove a duplicate test.
2021-03-12gdb/testsuite: check the correct Python variable in testAndrew Burgess2-1/+6
While squashing duplicate test names I spotted what looked like a copy & paste error. During this test a Python variable is created, and then we call the type method on that variable. In one case we create a variable and then call the type method on a variable created for a previous test. I can see no reason why this should be what we want, it doesn't line up with the comments in the test script, so I've updated the test. Note, the expected result doesn't change, just the command issued (the test relates to stripping typedefs). gdb/testsuite/ChangeLog: * gdb.python/lib-types.exp: Update the test to check the correct python variable.
2021-03-12gdb/testsuite: make test names unique in gdb.python/py-explore-cc.expAndrew Burgess2-4/+9
Add additional text to some test names to make them unique. In one case, correct the test name (copy & paste error) to make it correctly reflect what the test is doing. gdb/testsuite/ChangeLog: * gdb.python/py-explore-cc.exp: Extend test names to make them unique.
2021-03-12gdb/testsuite: remove a duplicate testAndrew Burgess2-2/+4
I spotted a duplicate test name in this test script. Turns out it's an actual duplicate test. Delete one copy of this test. gdb/testsuite/ChangeLog: * gdb.python/py-lookup-type.exp: Remove duplicate test.
2021-03-12gdb/testsuite: make test names unique in gdb.python/py-symtab.expAndrew Burgess2-2/+9
Extend the names of some tests to make them unique. gdb/testsuite/ChangeLog: * gdb.python/py-symtab.exp: Extend test names to make them unique.
2021-03-12gdb/testsuite: make test names unique in gdb.python/py-prompt.expAndrew Burgess2-39/+51
Use with_test_prefix to make test names unique. gdb/testsuite/ChangeLog: * gdb.python/py-prompt.exp: Add with_test_prefix to make test names unique.
2021-03-12gdb/testsuite: make test names unique in gdb.python/py-block.expAndrew Burgess2-7/+15
Extend some test names to make them unique. gdb/testsuite/ChangeLog: * gdb.python/py-block.exp: Give tests unique names.
2021-03-12gdb/testsuite: make test names unique in gdb.python/py-pp-maint.expAndrew Burgess2-5/+15
Extend the test names with additional text to make them unique. gdb/testsuite/ChangeLog: * gdb.python/py-pp-maint.exp: Extend test names to make them unique.
2021-03-12gdb/testsuite: make test names unique in gdb.python/py-explore.expAndrew Burgess2-28/+35
Add a with_test_prefix to make test names unique. gdb/testsuite/ChangeLog: * gdb.python/py-explore.exp: Add with_test_prefix to make test names unique.
2021-03-12gdb/testsuite: make test names unique in gdb.python/py-finish-breakpoint.expAndrew Burgess2-13/+19
Make test names unique by just adding additional text to the test names. As this is a Python test that repeatedly imports the Python script I've just numbered the test names in this case rather than trying to come up with anything better, hence we have: import python scripts, 1 import python scripts, 2 ... import python scripts, 6 Not great, but hopefully good enough. Everything else has a slightly more descriptive test name. gdb/testsuite/ChangeLog: * gdb.python/py-finish-breakpoint.exp: Make test names unique.
2021-03-12gdb/testsuite: make test names unique in gdb.python/py-strfns.expAndrew Burgess2-1/+8
Wrap some code in `with_test_prefix` to make test names unique. gdb/testsuite/ChangeLog: * gdb.python/py-strfns.exp: Use with_test_prefix to make test names unique.
2021-03-12gdb/testsuite: make test names unique in gdb.python/py-format-string.expAndrew Burgess2-18/+23
Make use of `proc_with_prefix` for every test_* proc in order to make the test names unique within this test file. gdb/testsuite/ChangeLog: * gdb.python/py-format-string.exp: Use proc_with_prefix to make test names unique.
2021-03-12gdb/testsuite: make test names unique in gdb.python/py-mi.expAndrew Burgess2-156/+171
Use with_test_prefix to make the test names unique. gdb/testsuite/ChangeLog: * gdb.python/py-mi.exp: Use with_test_prefix to make test names unique.
2021-03-12aix: implement TLS relocation for gas and ldClément Chigot30-133/+1039
Add support for TLS in XCOFF. Amongst the things done by this commit: - Update XCOFF auxialiary header to match new version and allow TLS sections. - Add TLS sections (.tdata and .tbss) support in gas and ld. - Add support for the TLS relocations in gas and ld. Two different types BFD_RELOC are created for PPC and PPC64 as the size is a pointer, thus distinct in 32 or 64bit. The addresses given by ld to .tdata and .tbss is a bit special. In XCOFF, these addresses are actually offsets from the TLS pointer computed at runtime. AIX assembly and linker does the same. In top of that, the .tdata must be before .data (this is mandatory for AIX loader). Thus, the aix ld script is recomputing "." before .data to restore its original value. There might be a simpler way, but this one is working. Optimisation linked to TLS relocations aren't yet implemented. bfd/ * reloc.c (BFD_RELOC_PPC_TLS_LE, BFD_RELOC_PPC_TLS_IE, BFD_RELOC_PPC_TLS_M, BFD_RELOC_PPC_TLS_ML, BFD_RELOC_PPC64_TLS_GD, BFD_RELOC_PPC64_TLS_LD, BFD_RELOC_PPC64_TLS_LE, BFD_RELOC_PPC64_TLS_IE, BFD_RELOC_PPC64_TLS_M, BFD_RELOC_PPC64_TLS_ML): New relocations. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * coff-rs6000.c (xcoff_calculate_relocation): Call xcoff_reloc_type_tls for TLS relocations. (xcoff_howto_table): Implement TLS relocations. (_bfd_xcoff_reloc_type_lookup): Add cases TLS relocations. (xcoff_reloc_type_tls): New function. * coff64-rs6000.c (xcoff_calculate_relocation): Likewise. (xcoff_howto_table): Likewise. (_bfd_xcoff_reloc_type_lookup): Likewise. * coffcode.h (sec_to_styp_flags): Handle TLS sections. (styp_to_sec_flags): Likewise. (coff_compute_section_file_positions): Avoid file offset optimisation for .data when the previous section is .tdata. (coff_write_object_contents): Handle TLS sections. * coffswap.h (coff_swap_aouthdr_out): Add support for new fields in aouthdr. * libxcoff.h (xcoff_reloc_type_tls): Add prototype. * xcofflink.c (xcoff_link_add_symbols): Handle XMC_UL. (xcoff_need_ldrel_p): Add cases for TLS relocations. (xcoff_create_ldrel): Add l_symndx for TLS sections. gas/ * config/tc-ppc.c (ppc_xcoff_text_section, ppc_xcoff_data_section, (ppc_xcoff_bss_section, ppc_xcoff_tdata_section, (ppc_xcoff_tbss_section): New variables. (ppc_text_subsegment, ppc_text_csects, ppc_data_subgments, (ppc_data_csects): Removed. (ppc_xcoff_section_is_initialized, ppc_init_xcoff_section, ppc_xcoff_parse_cons): New functions. (md_being): Initialize XCOFF sections. (ppc_xcoff_suffix): Add support for TLS relocations (fixup_size, md_apply_fix): Add support for new BFD_RELOC. (ppc_change_csect): Handle XMC_TL, XMC_UL. Correctly, add XMC_BS to .bss section. Handle new XCOFF section variables. (ppc_comm): Likewise. (ppc_toc): Likewise. (ppc_symbol_new_hook): Likewise. (ppc_frob_symbol): Likewise. (ppc_fix_adjustable): Add tbss support. * config/tc-ppc.h (TC_PARSE_CONS_EXPRESSION): New define. (ppc_xcoff_parse_cons): Add prototype. (struct ppc_xcoff_section): New structure. ld/ * emultempl/aix.em: Ensure .tdata section is removed if empty, even with -r flag. * scripttempl/aix.sc: Handle TLS sections. * testsuite/ld-powerpc/aix52.exp: Add new tests. * testsuite/ld-powerpc/aix-tls-reloc-32.d: New test. * testsuite/ld-powerpc/aix-tls-reloc-64.d: New test. * testsuite/ld-powerpc/aix-tls-reloc.ex: New test. * testsuite/ld-powerpc/aix-tls-reloc.s: New test. * testsuite/ld-powerpc/aix-tls-section-32.d: New test. * testsuite/ld-powerpc/aix-tls-section-64.d: New test. * testsuite/ld-powerpc/aix-tls-section.ex: New test. * testsuite/ld-powerpc/aix-tls-section.s: New test. include/ * coff/internal.h (struct internal_aouthdr): Add new fields. * coff/rs6000.h (AOUTHDRÃ): Add new fields. * coff/rs6k64.h (struct external_filehdr): Likewise. * coff/xcoff.h (_TDATA), _TBSS): New defines (RS6K_AOUTHDR_TLS_LE, RS6K_AOUTHDR_RAS, RS6K_AOUTHDR_ALGNTDATA, RS6K_AOUTHDR_SHR_SYMTAB, RS6K_AOUTHDR_FORK_POLICY, RS6K_AOUTHDR_FORK_COR): New defines. (XMC_TU): Removed. (XMC_UL): New define.
2021-03-12aix: implement R_TOCU and R_TOCL relocationsClément Chigot15-31/+376
Implement support for largetoc on XCOFF. R_TOCU and R_TOCL are referenced by the new BFD defines: BFD_RELOC_PPC_TOC16_HI and BFD_RELOC_PPC_TOC16_LO. A new toc storage class is added XMC_TE. In order to correctly handle R_TOCU, the logic behind xcoff_reloc_type_toc is changed to compute the whole TOC offset instead of just the difference between the "link" offset and the "assembly" offset. In gas, add a function to transform addis format used by AIX "addis RT, D(RA)" into the ELF format "addis RT, RA, SI". bfd/ * reloc.c (BFD_RELOC_PPC_TOC16_HI, BFD_RELOC_PPC_TOC16_LO): New relocations. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * coff-rs6000.c (xcoff_calculate_relocation): Call xcoff_reloc_type_toc for R_TOCU and R_TOCL. (xcoff_howto_table): Remove src_mask for TOC relocations. Add R_TOCU and R_TOCL howtos. (_bfd_xcoff_reloc_type_lookup): Add cases for BFD_RELOC_PPC_TOC16_HI and BFD_RELOC_PPC_TOC16_LO. (xcoff_reloc_type_toc): Compute the whole offset. Implement R_TOCU and R_TOCL. * coff64-rs6000.c (xcoff64_calculate_relocation): Likewise. (xcoff64_howto_table): Likewise. (xcoff64_reloc_type_lookup): Likewise. gas/ * config/tc-ppc.c (ppc_xcoff_suffix): New function. (MAP, MAP32, MAP64): New macros for XCOFF. (ppc_xcoff_fixup_addis): New function. (ppc_is_toc_sym): Handle XMC_TE. (fixup_size): Add cases for BFD_RELOC_PPC_TOC16_HI and BFD_RELOC_PPC_TOC16_LO. (md_assemble): Call ppc_xcoff_fixup_addis for XCOFF. (ppc_change_csect): Handle XMC_TE. (ppc_tc): Enable .tc symbols to have only a XMC_TC or XMC_TE storage class. (ppc_symbol_new_hook): Handle XMC_TE. (ppc_frob_symbol): Likewise. (ppc_fix_adjustable): Likewise. (md_apply_fix): Handle BFD_RELOC_PPC_TOC16_HI and BFD_RELOC_PPC_TOC16_LO. ld/ * scripttempl/aix.sc: Add .te to .data section. * testsuite/ld-powerpc/aix52.exp: Add test structure for AIX7+. Add aix-largetoc-1 test. * testsuite/ld-powerpc/aix-largetoc-1-32.d: New test. * testsuite/ld-powerpc/aix-largetoc-1-64.d: New test. * testsuite/ld-powerpc/aix-largetoc-1.ex: New test. * testsuite/ld-powerpc/aix-largetoc-1.s: New test.
2021-03-12aix: correct HOWTO table and add missing relocationsClément Chigot8-239/+400
Since the last time AIX HOWTO table was modified, IBM has now released an official documentation about XCOFF relocations. This commit corrects the wrong ones and add some missing. For now, the "custom" relocations made for xcoff_rtype2howto have been kept. The new relocations are still set as EMPTY_HOWTO because they will be implemented in later commits. In xcoff[64]_ppc_relocate_section, instead of recreating howto from scratch, it's better to use the existing howto from the table and fixing it according to r_size field. bfd/ * coff-rs6000.c (xcoff_calculate_relocation): Correct and add new relocations. (xcoff_howto_table): Likewise. (xcoff_rtype2howto): Increase r_type maximum value. (xcoff_ppc_relocate_section): Reuse predefined HOWTOs instead of create a new one from scratch. Enable only some relocations to have a changing r_size. * coff64-rs6000.c (xcoff64_calculate_relocation): Likewise. (xcoff64_howto_table): Likewise. (xcoff64_rtype2howto): Likewise. (xcoff64_ppc_relocate_section): Likewise. * libxcoff.h (XCOFF_MAX_CALCULATE_RELOCATION): Fix value. binutils/ * od-xcoff.c: Replace RTB by TRL entry. include/ * coff/xcoff.h (R_RTB): Remove. (R_TRL): Fix value.
2021-03-12bfd: move xcoff64_ppc_relocate_section after the HOWTO tableClément Chigot2-188/+194
This will be needed for later commits, as xcoff64_ppc_relocate_section will use the HOWTO table unlike now. * coff64-rs6000.c (xcoff64_ppc_relocate_section): Move.
2021-03-12bfd: use default coff_write_object_contents for XCOFF64Clément Chigot3-351/+14
There is no need for XCOFF64 to have is own write_object_contents. * coff64-rs6000.c (xcoff64_write_object_contents): Remove. * coffcode.h (coff_write_object_contents): Add bfd_mach_ppc_620 support for o_cputype field. Avoid creating an empty a.out header for XCOFF64.
2021-03-12bfd: add missing smclass when creating csect for xcoff64Clément Chigot2-3/+8
* coff64-rs6000.c (xcoff64_create_csect_from_smclas): Add missing smclass.
2021-03-12Re: x86: correct decoding of nop/reserved space (0f18 ... 0x1f)Alan Modra2-1/+5
* i386-dis.c (print_insn <PREFIX_IGNORED>): Correct typo.
2021-03-12PE image base falloutAlan Modra7-21/+53
Fixes x86_64-w64-mingw32 tests that failed with the recent diagnosis for out of range RVA, and a couple of other gc-sections tests that failed for other reasons. * testsuite/ld-gc/gc.exp: Pass "-image-base 0" to ld for PE, and arrange to define __main for some run_dump_test tests. * testsuite/ld-gc/pr13683.d: Accept more symbols. * testsuite/ld-gc/pr14265.d: Likewise, and ordering. * testsuite/ld-scripts/crossref.exp: Pass "-image-base 0" to ld for PE. * testsuite/ld-srec/srec.exp: Likewise. * testsuite/lib/ld-lib.exp (ld_link_defsyms): Use is_pecoff_format.
2021-03-12Automatic date update in version.inGDB Administrator1-1/+1
2021-03-11x86: re-order logic in OP_XMM()Jan Beulich2-35/+35
Instead of excluding an increasing number of modes in the initial if(), check the special modes first.
2021-03-11x86: drop a few redundant EVEX-related checksJan Beulich2-4/+10
vex.b can only be set when vex.evex is also set. Similarly vex.evex can only be set when need_vex is also set.
2021-03-11x86: remove stray uses of xmmq_modeJan Beulich2-4/+6
xmmq_mode is documented to not allow for broadcast - don't include it in respective checks in OP_E_memory().
2021-03-11RISC-V: Improve multiple relax passes problem.Nelson Chu8-10/+108
According to the commit abd20cb637008da9d32018b4b03973e119388a0a, an intersting thing is that - the more relax passes, the more chances of relaxations are reduced [1]. Originally, we set the boolean `again` to TRUE once the code is actually deleted, and then we run the relaxations repeatedly if `again` is still TRUE. But `again` only works for the relax pass itself, and won't affect others. That is - we can not use `again` to re-run the relax pass when we already enter into the following passes (can not run the relax passes backwards). Besides, we must seperate the PCREL relaxations into two relax passes for some reasons [2], it make us lose some relax opportunities. This patch try to fix the problem, and the basic idea was come from Jim Wilson - we use a new boolean, restart_relax, to determine if we need to run the whole relax passes again from 0 to 2. Once we have deleted the code between relax pass 0 to 2, the restart_relax will be set to TRUE, we should run the whole relaxations again to give them more chances to shorten the code. We will only enter into the relax pass 3 when the restart_relax is FALSE, since we can't relax anything else once we start to handle the alignments. I have passed the gcc/binutils regressions by riscv-gnu-toolchain, and looks fine for now. [1] https://sourceware.org/pipermail/binutils/2020-November/114223.html [2] https://sourceware.org/pipermail/binutils/2020-November/114235.html bfd/ * elfnn-riscv.c (riscv_elf_link_hash_table): New boolean restart_relax, used to check if we need to run the whole relaxations from relax pass 0 to 2 again. (riscv_elf_link_hash_table_create): Init restart_relax to FALSE. (_bfd_riscv_relax_align): Remove obsolete sec_flg0 set. (_bfd_riscv_relax_delete): Set again to TRUE if we do delete the code. (bfd_elfNN_riscv_restart_relax_sections): New function. Called by after_allocation to check if we need to run the whole relaxations again. (_bfd_riscv_relax_section): We will only enter into the relax pass 3 when the restart_relax is FALSE; At last set restart_relax to TRUE if again is TRUE, too. * elfxx-riscv.h (bfd_elf32_riscv_restart_relax_sections): Declaration. (bfd_elf64_riscv_restart_relax_sections): Likewise. ld/ * emultempl/riscvelf.em (after_allocation): Run ldelf_map_segments many times if riscv_restart_relax_sections returns TRUE. * testsuite/ld-riscv-elf/restart-relax.d: New testcase. Before applying this patch, the call won't be relaxed to jal; But now we have more chances to do relaxations. * testsuite/ld-riscv-elf/restart-relax.s: Likewise. * testsuite/ld-riscv-elf/ld-riscv-elf.exp: Updated.
2021-03-11Automatic date update in version.inGDB Administrator1-1/+1
2021-03-10Use bool for "parse_completion"Tom Tromey4-13/+24
Some spots in GDB already use bool for "parse_completion", but a few were still using int. This patch updates these to bool. I'm checking this in. gdb/ChangeLog 2021-03-10 Tom Tromey <tromey@adacore.com> * parser-defs.h (parser_state): Change completion to bool. <parse_completion>: Likewise. * ada-lang.h (ada_find_operator_symbol, ada_resolve_funcall) (ada_resolve_variable, ada_resolve_function): Update. * ada-lang.c (ada_find_operator_symbol): Change parse_completion to bool. (ada_resolve_funcall, ada_resolve_variable) (ada_resolve_function): Likewise.
2021-03-10x86/Intel: correct AVX512 S/G disassemblyJan Beulich13-1044/+981
Commit 6ff00b5e12e7 ("x86/Intel: correct permitted operand sizes for AVX512 scatter/gather") brought the assembler side of AVX512 S/G insn handling in line with AVX2's, but the disassembler side was forgotten. This has the benefit of - allowing to fold a number of table entries, - rendering a few #define-s and enumerators unused.
2021-03-10x86: re-arrange enumerator and table entry orderJan Beulich2-77/+100
Some of the enumerators have ended up misplaced under the general current ordering scheme. Move them (and their table entries) around accordingly. Add a couple of blank lines as separators when close to code being touched anyway. Also drop the odd 0F from 0FXOP (there's no "0f" involved there anywhere) infixes where the respective enum gets played with anyway.
2021-03-10x86: reuse further VEX entries for EVEXJan Beulich6-98/+46
When the VEX.L=1 decode matches that of both EVEX.L'L=1 and EVEX.L'L=2 (typically when all three are invalid) the (smaller) VEX table entry can be reused by EVEX, instead of duplicating data. (Note that XM and XMM as well as EXxmm_md and EXd are equivalent at least for the purposes here.)
2021-03-10x86: reuse VEX entries for EVEX vperm{q,pd}Jan Beulich5-22/+20
By matching VEX decode order (L before W), some EVEX entries can refer back to VEX ones instead of carrying duplicates.