aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-01-08sim: ppc: workaround uninitialized variable compiler warningsMike Frysinger1-2/+2
Some compilers don't understand the semctl API and think it's an input argument even when it's used as an output, and then complains that it is being used uninitialized. Zero it out explicitly to workaround it. This adds some runtime overhead, but should be fairly minor as it's a small stack buffer, and shouldn't be that relevant relative to all the other logic in these functions.
2024-01-08sim: warnings: enable -Wshift-negative-valueMike Frysinger2-0/+2
Now that all the relevant sources are fixed, enable the warning.
2024-01-08sim: sh: avoid left shifting negative valuesMike Frysinger1-2/+2
We just want to create a bitmask here, so cast the mask to unsigned to avoid left shifting a negative value which is undefined behavior.
2024-01-08sim: bfin: avoid left shifting negative valuesMike Frysinger1-2/+2
We just want to create a bitmask here, so cast the mask to unsigned to avoid left shifting a negative value which is undefined behavior.
2024-01-08sim: cgen: rework DI macros to avoid signed left shiftsMike Frysinger1-3/+3
The cgen code uses DI as int64_t and UDI as uint64_t. The DI macros are used to construct 64-bit values from 32-bit values (for the low and high parts). The MAKEDI macro casts the high 32-bit value to a signed 32-bit value before shifting. If this created a negative value, this would be undefined behavior according to the C standard. All we care about is shifting the 32-bits as they are to the high 32-bits, not caring about sign extension (since there's nothing left to shift into), and the low 32-bits being empty. This is what we get from shifting an unsigned value, so cast it to unsigned 32-bit to avoid undefined behavior. While we're here, change the SETLODI macro to truncate the lower value to 32-bits before we set it. If it was passing in a 64-bit value, those high bits would get included too, and that's not what we want. Similarly, tweak the SETHIDI macro to cast the value to an unsigned 64-bit instead of a signed 64-bit. If the value was only 32-bits, the behavior would be the same. If it happened to be signed 64-bit, it would trigger the undefined behavior too.
2024-01-09Automatic date update in version.inGDB Administrator1-1/+1
2024-01-08bpf: Added linker support for R_BPF_64_NODYLD32.Cupertino Miranda2-7/+11
This patch adds linker support to patch R_BPF_64_NODYLD32 relocations. The implementation was based on comments and code in LLVM, as the GNU toolchain does not uses this relocation type.
2024-01-08MAINTAINERS: Update my email addressJoseph Myers2-2/+2
2024-01-08MIPS/GAS: mips.exp, mark all mipsisa32*-linux as addr32YunQiang Su1-1/+1
Currently, only mipsisa32-linux and mipsisa32el-linux is marked as addr32, which make mipsisa32rN(el) not marked. This change can fix 2 test failures on mipsisa32rN(el)-linux: FAIL: MIPS MIPS64 MIPS-3D ASE instructions (-mips3d flag) FAIL: MIPS MIPS64 MDMX ASE instructions (-mdmx flag) These failures don't happen for mipsisa32rN-mti-elf etc, due to that, the output is set as NO_ABI instead of O32, then gas won't warn: `fp=64' used with a 32-bit ABI Maybe, we should change this behaivour in future.
2024-01-08arm: Add support for Armv8.9-A and Armv9.4-Asrinath10-0/+66
This patch adds AArch32 support for -march=armv8.9-a and -march=armv9.4-a. The behaviour of the new options can be expressed using a combination of existing feature flags and tables. The cpu_arch_ver entries for ARM_ARCH_V9_4A and ARM_ARCH_V8_9A are technically redundant but it including them for macro code consistency across architectures.
2024-01-08aarch64: Add ite feature system registers.srinath4-0/+29
This patch adds ite feature (FEAT_ITE) system registers, trcitecr_el1, trcitecr_el12, trcitecr_el2 and trciteedcr.
2024-01-08gas/doc: fix several typosSamuel Tardieu10-18/+18
Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
2024-01-08[gdb/testsuite] Add missing -no-prompt-anchor in ↵Tom de Vries1-1/+1
gdb.base/vfork-follow-parent.exp When running test-case gdb.base/vfork-follow-parent.exp it passes fine, but when running it with "taskset -c 0" I run into: ... (gdb) inferior 1^M [Switching to inferior 1 [process 26606] (vfork-follow-parent-exit)]^M [Switching to thread 1.1 (process 26606)]^M (gdb) Reading symbols from vfork-follow-parent-exit...^M FAIL: $exp: exec_file=vfork-follow-parent-exit: target-non-stop=on: \ non-stop=off: resolution_method=schedule-multiple: inferior 1 (timeout) ... Fix this by using -no-prompt-anchor. Tested on x86_64-linux. PR testsuite/31166 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31166
2024-01-08Add support for the aarch64-gnu target (GNU/Hurd on AArch64)Sergey Bugaev4-1/+44
Also recognized are aarch64-*-gnu tagrets, e.g. aarch64-pc-gnu or aarch64-unknown-gnu. The ld/emulparams/aarch64gnu.sh file is (for now) identical to aarch64fbsd.sh, or to aarch64linux.sh with Linux-specific logic removed; and mainly different from the generic aarch64elf.sh in that it does not set EMBEDDED=yes. Coupled with a corresponding GCC patch, this produces a toolchain that can sucessfully build working binaries targeting aarch64-gnu. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2024-01-08[gdb/testsuite] Make gdb.base/solib-search.exp more robustTom de Vries2-0/+6
On aarch64-linux, with gcc 13.2.1, I run into: ... (gdb) backtrace^M #0 break_here () at solib-search.c:30^M #1 0x0000fffff7f20194 in lib2_func4 () at solib-search-lib2.c:50^M #2 0x0000fffff7f70194 in lib1_func3 () at solib-search-lib1.c:50^M #3 0x0000fffff7f20174 in lib2_func2 () at solib-search-lib2.c:30^M #4 0x0000fffff7f70174 in lib1_func1 () at solib-search-lib1.c:30^M #5 0x00000000004101b4 in main () at solib-search.c:23^M (gdb) PASS: gdb.base/solib-search.exp: \ backtrace (with wrong libs) (data collection) FAIL: gdb.base/solib-search.exp: backtrace (with wrong libs) ... The FAIL is generated by this code in the test-case: ... if { $expect_fail } { # If the backtrace output is correct the test isn't sufficiently # testing what it should. if { $count == $total_expected } { set fail 1 } ... The test-case: - builds two versions of two shared libs, a "right" and "wrong" version, the difference being an additional dummy function (called spacer function), - uses the "right" version to generate a core file, - uses the "wrong" version to interpret the core file, and - generates a backtrace. The intent is that the backtrace is incorrect due to using the "wrong" version, but actually it's correct. This is because the spacer functions aren't large enough. Fix this by increasing the size of the spacer functions by adding a dummy loop, after which we have, as expected, an incorrect backtrace: ... (gdb) backtrace^M #0 break_here () at solib-search.c:30^M #1 0x0000fffff7f201c0 in ?? ()^M #2 0x0000fffff7f20174 in lib2_func2 () at solib-search-lib2.c:30^M #3 0x0000fffff7f20174 in lib2_func2 () at solib-search-lib2.c:30^M #4 0x0000fffff7f70174 in lib1_func1 () at solib-search-lib1.c:30^M #5 0x00000000004101b4 in main () at solib-search.c:23^M (gdb) PASS: gdb.base/solib-search.exp: \ backtrace (with wrong libs) (data collection) PASS: gdb.base/solib-search.exp: backtrace (with wrong libs) ... Tested on aarch64-linux.
2024-01-08i386: Use .insn describe jmpabs's testcases.Hu, Lin11-5/+5
gas/ChangeLog: * testsuite/gas/i386/x86-64-apx-jmpabs-inval.s: Use .insn instead of .byte to describe test cases.
2024-01-08Automatic date update in version.inGDB Administrator1-1/+1
2024-01-07i386: Correct adcx suffix in disassemblerH.J. Lu5-4/+29
Since 0x66 is the opcode prefix for adcx, it is wrong to use the 'S' prefix: 'S' => print 'w', 'l' or 'q' if suffix_always is true on adcx. Add 'L' => print 'l' or 'q' if suffix_always is true replace S with L on adcx and adox. gas/ PR binutils/31219 * testsuite/gas/i386/suffix.d: Updated. * testsuite/gas/i386/x86-64-suffix.d: Likewise. * testsuite/gas/i386/suffix.s: Add tests for adcx and adox. * testsuite/gas/i386/x86-64-suffix.s: Likewise. opcodes/ PR binutils/31219 * i386-dis.c: Add the 'L' suffix. (prefix_table): Replace S with L on adcx and adox. (putop): Handle the 'L' suffix.
2024-01-06sim: warnings: enable -Wshadow=localMike Frysinger2-1/+2
This brings us in sync with current set of gdb warnings (for C).
2024-01-06sim: cris: change temp var name slightly to avoid shadowingMike Frysinger3-52/+52
Rename the temp var to avoid shadowing another one: .../sim/cris/semcrisv10f-switch.c:11032:22: error: declaration of ‘tmp_tmpb’ shadows a previous local [-Werror=shadow=compatible-local] 11032 | tmp_tmpb = ({ SI tmp_tmpb; | ^~~~~~~~ .../sim/cris/semcrisv10f-switch.c:11031:24: note: shadowed declaration is here 11031 | tmp_tmpres = ({ SI tmp_tmpb; | ^~~~~~~~
2024-01-06sim: cris: add error fallbacks when decoding condition & swap codesMike Frysinger3-2/+28
The condition & swap code decoder only checks known bits and sets based on that. If the variable is out of range, it ends up returning uninitialized data. Turn that case into a hard error. This fixes build warnings like: sim/cris/semcrisv10f-switch.c:13115:11: error: variable 'tmp_condres' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
2024-01-07Automatic date update in version.inGDB Administrator1-1/+1
2024-01-06ld: Adjust x86 and x86-64 tests for -z mark-pltH.J. Lu26-25/+31
To support -z mark-plt enabled by default, adjust x86 tests to accept non-zero r_addend for JUMP_SLOT relocation and pass -z nomark-plt to x86-64 tests if -z mark-plt changes the expected outputs. * testsuite/ld-elf/indirect-extern-access-2.rd: Allow non-zero r_addend for JUMP_SLOT relocation. * testsuite/ld-elf/pr23161d.rd: Likewise. * testsuite/ld-ifunc/ifunc-25c-x86.d: Likewise. * testsuite/ld-ifunc/ifunc-16-x86-64-now.d: Pass -z nomark-plt to linker. * testsuite/ld-ifunc/ifunc-16-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-2-local-x86-64-now.d: Likewise. * testsuite/ld-ifunc/ifunc-2-local-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-2-x86-64-now.d: Likewise. * testsuite/ld-ifunc/ifunc-2-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-20-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-5b-x86-64.d: Likewise. * testsuite/ld-ifunc/pr17154-x86-64-now.d: Likewise. * testsuite/ld-ifunc/pr17154-x86-64.d: Likewise. * testsuite/ld-x86-64/dt-relr-1a-x32.d: Likewise. * testsuite/ld-x86-64/dt-relr-1a.d: Likewise. * testsuite/ld-x86-64/dt-relr-1b-x32.d: Likewise. * testsuite/ld-x86-64/dt-relr-1b.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2a-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2a.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3a-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3a.d: Likewise. * testsuite/ld-x86-64/pr19636-2d.d: Likewise. * testsuite/ld-x86-64/pr19636-2e.d: Likewise. * testsuite/ld-x86-64/pr19636-2f.d: Likewise. * testsuite/ld-x86-64/pr19636-2l.d: Likewise. * testsuite/ld-x86-64/x86-64.exp: Pass -z nomark-plt to linker in 6 tests.
2024-01-06gas: sframe: fix some typos in code commentsIndu Bhagat1-7/+7
2024-01-06Automatic date update in version.inGDB Administrator1-1/+1
2024-01-05x86: relax AMD Zen5 testcase expectationsJan Beulich1-1/+1
One item was too strict for PE/COFF, and there's really no need to check for specific comment contents here.
2024-01-05Add AMD znver5 processor supportTejas Joshi12-1/+72
gas/ * config/tc-i386.c (cpu_arch): Add znver5 ARCH. * doc/c-i386.texi: Add znver5. * testsuite/gas/i386/arch-15.d: New. * testsuite/gas/i386/arch-15.s: Likewise. * testsuite/gas/i386/arch-15-znver5.d: Likewise. * testsuite/gas/i386/i386.exp: Add new znver5 test cases. * testsuite/gas/i386/x86-64.exp: Likewise. * testsuite/gas/i386/x86-64-arch-5.d: Likewise. * testsuite/gas/i386/x86-64-arch-5.s: Likewise. * testsuite/gas/i386/x86-64-arch-5-znver5.d: Likewise. opcodes/ * i386-gen.c (isa_dependencies): Add ZNVER5 dependencies. * i386-init.h: Re-generated.
2024-01-05Arm/doc: separate @code from @item for older makeinfoJan Beulich1-103/+103
At least 4.12 doesn't like the constructs without a separator.
2024-01-05x86: corrections to CPU attribute/flags splittingJan Beulich2-4/+26
There are a number of issues with 734dfd1cc966 ("x86: pack CPU flags in opcode table"): - the condition when two array slots need writing wasn't correct (with enough new Cpu* added an out of bounds array access would validly have been complained about by the compiler), - table generation didn't take into account CpuAttrUnused and CpuUnused being independent, and hence there not always (not) being an "unused" bitfield member in both structures, - cpu_flags_from_attr() wasn't ready for use on big-endian hosts, - there were two style violations.
2024-01-05ELF: test certain .text/.data usagesJan Beulich9-0/+90
Various targets have / had overrides for .text and/or .data. Make sure that in such cases sub-section specifiers are accepted, as mandated by the doc.
2024-01-05ELF: test certain .bss usagesJan Beulich5-0/+47
Various targets have / had overrides for .bss. Make sure that in such cases - .previous still works correctly (requiring such targets to invoke obj_elf_section_change_hook() from their overriding handlers), - sub-section specifiers are accepted as far as feasible (mandated by the doc).
2024-01-05gas: correct .bss documentation for non-ELFJan Beulich1-1/+12
Only ELF permits the specification of a subsection, and even there not consistently: csky, mcore, and spu handle .bss similar to .lcomm.
2024-01-05z80: drop .bss overrideJan Beulich1-10/+0
It doesn't look to be a good idea to override the custom handlers that ELF and COFF have; afaict doing so broke .previous on ELF, and a sub- section specifier wasn't accepted either.
2024-01-05visium: drop .bss and .skip overridesJan Beulich1-22/+1
The comment in s_bss() looks bogus (perhaps simply stale, or wrongly copied from another target). It also doesn't look to be a good idea to override the custom handler that ELF has (afaict doing so broke .previous as well as sub-section specification). The override for .skip is simply pointless, for read.c having exactly the same. While there also drop two adjacent redundant (with read.h) declarations (which would be outright dangerous if read.h wasn't included anyway).
2024-01-05v850: drop .bss overrideJan Beulich1-5/+0
While there doesn't look to be anything wrong with this override, there's also no apparent reason why this override would be needed. Drop it, reducing overall size a tiny bit.
2024-01-05score: drop .bss overrideJan Beulich2-48/+2
The comment looks bogus (perhaps simply stale, or wrongly copied from another target). It also doesn't look to be a good idea to override the custom handler that ELF has (afaict doing so broke .previous as well as sub-section specification). While there also fold the identical handlers for .text (there likely is more room for such folding).
2024-01-05s390: drop .bss overrideJan Beulich1-12/+0
The comment looks bogus (perhaps simply stale), and there are also no other precautions against subsections being used on ELF with .bss. It also doesn't look to be a good idea to override the custom handler that ELF has (afaict doing so further broke .previous).
2024-01-05rx: drop .bss overrideJan Beulich1-11/+0
It doesn't look to be a good idea to override the custom handler that ELF has; afaict doing so broke .previous.
2024-01-05rl78: drop .bss overrideJan Beulich1-11/+0
It doesn't look to be a good idea to override the custom handler that ELF has; afaict doing so broke .previous.
2024-01-05pru: fix .text/.data interaction with .previousJan Beulich1-2/+2
Just like obj_elf_section() is called for .section, obj_elf_{text,data}() need calling for .text/.data.
2024-01-05microblaze: drop/restrict override of .text, .data, and .bssJan Beulich1-37/+9
While only ELF is supported right now, (stub) code generally is in place for the non-ELF case as well. Don't override .bss for ELF - that's unlikely to be a good idea anyway and prevented the sub-section specifier from being usable. Don't override .text and .data at all - for .data and ELF for the same reason, while for .text and ELF obj-elf.c's is all we need, and for (hypothetical) non-ELF read.c's identical handling would have been invoked anyway.
2024-01-05m68k: drop .bss overrideJan Beulich1-12/+0
The comment looks bogus (perhaps simply stale), and there are also no other precautions against subsections being used on ELF with .bss. It also doesn't look to be a good idea to override the custom handler that ELF has (afaict doing so further broke .previous).
2024-01-05m32c: drop .bss overrideJan Beulich1-13/+0
It doesn't look to be a good idea to override the custom handler that ELF has; afaict doing so broke .previous.
2024-01-05IA64: drop .bss overrideJan Beulich1-5/+3
It doesn't look to be a good idea to override the custom handlers that ELF and COFF have. While in this case interaction with ELF's .previous wasn't screwed, the sub-section specifier wasn't permitted.
2024-01-05d30v: fix .text/.data interaction with .previousJan Beulich1-2/+2
Just like obj_elf_section() is called for .section, obj_elf_{text,data}() need calling for .text/.data.
2024-01-05bfin: drop .bss overrideJan Beulich1-11/+0
It doesn't look to be a good idea to override the custom handler that ELF has; afaict doing so broke .previous.
2024-01-05Arm64: drop .bss overrideJan Beulich2-17/+1
The comment looks bogus (perhaps simply stale, perhaps wrongly copied from Arm in the first place), and there are also no other precautions against subsections being used on ELF with .bss. It also doesn't look to be a good idea to override the custom handlers that ELF and COFF have (afaict doing so further broke .previous on ELF). As to the mapping state update - such also doesn't appear to be done for other section switching, so its original purpose was at best questionable as well.
2024-01-05Arm: drop .bss overrideJan Beulich2-20/+1
The comment looks bogus (perhaps simply stale), and there are also no other precautions against subsections being used on ELF with .bss. It also doesn't look to be a good idea to override the custom handlers that ELF and COFF have (afaict doing so further broke .previous on ELF).
2024-01-05Enforce C++11 as a minimum for building gold [PR30867]Tamar Christina6-2/+1012
The attempt in 5e9091dab885 to correct gold for modern LLVM has broken gold for older compilers. This commit introduced C++11 types without changing the build system to require a C++ compiler. More importantly it depends on the compiler having at least C++11 as the default language. Older compilers which support C++11 but not as the default language needlessly break. Fix that. PR gold/30867 * configure.ac (AX_CXX_COMPILE_STDCXX): Require C++11. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * config.in: Regenerate. * configure: Regenerate. * testsuite/Makefile.in: Regenerate.
2024-01-05loongarch: 'index' shadows globalAlan Modra1-2/+2
Avoid an error when compiling with older versions of gcc. * elfnn-loongarch.c (loongarch_relax_align): Rename "index" to "sym_index".