aboutsummaryrefslogtreecommitdiff
path: root/gas
AgeCommit message (Collapse)AuthorFilesLines
2022-05-17RISC-V: Added half-precision floating-point v1.0 instructions.Nelson Chu6-1/+191
bfd/ * elfxx-riscv.c (riscv_implicit_subsets): Added implicit f and zicsr for zfh. (riscv_supported_std_z_ext): Added default v1.0 version for zfh. (riscv_multi_subset_supports): Handle INSN_CLASS_ZFH, INSN_CLASS_D_AND_ZFH and INSN_CLASS_Q_AND_ZFH. gas/ * config/tc-riscv.c (FLT_CHARS): Added "hH". (macro): Expand Pseudo M_FLH and M_FSH. (riscv_pseudo_table): Added .float16 directive. * testsuite/gas/riscv/float16-be.d: New testcase for .float16. * testsuite/gas/riscv/float16-le.d: Likewise. * testsuite/gas/riscv/float16.s: Likewise. * testsuite/gas/riscv/fp-zfh-insns.d: New testcase for zfh. * testsuite/gas/riscv/fp-zfh-insns.s: Likewise. include/ * opcode/riscv-opc.h: Added MASK and MATCH encodings for zfh. * opcode/riscv.h: Added INSN_CLASS and pseudo macros for zfh. opcodes/ * riscv-opc.c (riscv_opcodes): Added zfh instructions.
2022-05-16IBM zSystems: Fix left-shifting negative PCRel32 values (PR gas/29152)Ilya Leoshkevich1-3/+3
s390_insert_operand ()'s val, min and max are encoded PCRel32 values and need to be left-shifted by 1 before being shown to the user. Left-shifting negative values is undefined behavior in C, but the current code does not try to prevent it, causing UBSan to complain. Fix by casting the values to their unsigned equivalents before shifting.
2022-05-12Re: IBM zSystems: Accept (. - 0x100000000) PCRel32 operandsAlan Modra2-7/+7
The new test failed on s390-linux due to bfd_sprintf_vma trimming output to 32 bits for 32-bit targets. The test was faulty anyway, expecting zero as the min end of the range is plainly wrong, but that's what you get if you cast min to int. * config/tc-s390.c (s390_insert_operand): Print range error using PRId64. * testsuite/gas/s390/zarch-z900-err.l: Correct expected output.
2022-05-10gas: remove use of PTRAlan Modra1-1/+1
* config/obj-evax.c (evax_symbol_new_hook): Don't cast to PTR.
2022-05-09IBM zSystems: Accept (. - 0x100000000) PCRel32 operandsIlya Leoshkevich6-6/+26
as does not accept instructions like brasl %r0,.-0x100000000, because of two problems with the generic overflow check: 1. PCRel32 operands are signed, but are treated as unsigned. 2. The allowed range for these operands is [-(1 << 32), (1 << 32) - 1], and not [-(1 << 31), (1 << 31) - 1]. Fix both by disabling the generic overflow check - it's not needed, because s390_insert_operand () performs its own. gas/ * config/tc-s390.c (md_gather_operands): Set fx_no_overflow. * testsuite/gas/s390/s390.exp: Add zarch-z900-err. * testsuite/gas/s390/esa-z900.d: New test. * testsuite/gas/s390/esa-z900.s: New test. * testsuite/gas/s390/zarch-z900-err.l: New test. * testsuite/gas/s390/zarch-z900-err.s: New test.
2022-04-27x86: Disable 2 tests with large memory requirementH.J. Lu1-1/+2
gas/ * testsuite/gas/i386/i386.exp: Disable rept. ld/ * testsuite/ld-x86-64/x86-64.exp: Disable pr17618.
2022-04-27x86: VFPCLASSSH is Evex.LLIGJan Beulich5-0/+52
This also was mistakenly flagged as Evex.128.
2022-04-21Delete unused COFF gas macroAlan Modra1-6/+3
* config/obj-coff.h (sy_obj): Don't define. (OBJ_SYMFIELD_TYPE): Revise comments.
2022-04-20x86: reject all invalid SAE variantsJan Beulich3-1/+11
So far an SAE-only specifier was accepted for static-rounding insns, while SAE-only insns didn't accept static rounding specifiers. If anything it would make sense the other way around, allowing SAE-only insns to have the (ignored) rounding mode specified individually rather than globally via -mevexrcig=. But for now make things match the SDM.
2022-04-20Revert "as: Reject unknown -gXXX option" testsuiteAlan Modra4-6/+0
This reverts the test committed as part of 6ea673e2d6.
2022-04-19as: Reject unknown -gXXX optionH.J. Lu5-0/+8
* as.c (parse_args): Reject unknown -gXXX option. * testsuite/gas/all/empty.s: New file. * testsuite/gas/all/pr29067.d: Likewise. * testsuite/gas/all/pr29067.err: Likewise. * testsuite/gas/all/gas.exp: Run pr29067.
2022-04-19x86: don't mistake ordinary immediates for SAE / rounding controlJan Beulich3-3/+15
The way SAE templates are constructed was always puzzling me (including the need for separate templates in the first place), and expressing the extzra attribute via Imm8 actually has a bad effect: Ordinary immediates would also be accepted, leading to an extra byte being added after the instruction (i.e. generating bad code). Before re-working this (in particular to accept proper Intel syntax there), fix the immediate issue by adding the so far missing check.
2022-04-19x86: VCMPSH is Evex.LLIGJan Beulich5-0/+61
These were mistakenly flagged as Evex.128. Getting the LLIG status right for insns allowing for SAE is a prereq for planned further work.
2022-04-19x86/Intel: test non-legacy VCVT{,U}SI2SH insn formsJan Beulich2-6/+6
For an unclear reason corresponding AVX512F tests were apparently not cloned or used as reference here, and instead the bogus legacy forms of the insns (with the embedded rounding specifier not last) were used.
2022-04-19x86: correct and simplify NOP disassemblyJan Beulich3-43/+12
It's not just REX.W which is ignored with opcode 0x90. The same goes for REX.R and REX.X as well as empty REX. None of these are forms of "xchg %eax,%eax" (which would mean zero-extending %eax to %rax), so they also shouldn't be disassembled this way. While there simplify things: A single hook function suffices, thus making it unnecessary to keep two expressions in sync. And checking ins->address_mode for mode_64bit also is unnecessary, as "rex" can be non-zero only in that case anyway.
2022-04-14M68K: avoid quadratic slowdlow in label alignment checkSergei Trofimovich2-34/+26
Before the change tc-m68k maintained a list of seen labels. Alignment check traversed label list to resolve symbol to label. This caused quadratic slowdown as each symbol was checked against each label. Worst affected files are the ones built with debugging enabled as DWARF generates many labels. The change embeds auxiliary label information right into symbol using TC_SYMFIELD_TYPE. Before the change test from PR 29058 did not finish in 10 minutes. After the change it finishes in 2 seconds. gas/ChangeLog: PR 29058 * config/tc-m68k.h (TC_SYMFIELD_TYPE): define as m68k_tc_sy. * config/tc-m68k.c (m68k_frob_label): Use TC_SYMFIELD_TYPE to store label information.
2022-04-12gas: new_logical_line{,_flags}() can return "void"Jan Beulich3-18/+13
With the sole user of the return value gone, convert the return type to void. This in turn allows simplifying another construct, by moving it slightly later in the function.
2022-04-12gas: drop .appfile and .applineJan Beulich18-141/+109
These were used originally to represent "# <line> <file>" constructs inserted by (typically) compilers when pre-processing. Quite some time ago they were replaced by .linefile though. Since the original directives were never documented, we ought to be able to remove support for them. As a result in a number of case function parameter aren't used anymore and can hence be dropped.
2022-04-12gas: further adjust file/line handling for .macroJan Beulich4-22/+50
Commit 7992631e8c0b ("gas/Dwarf: improve debug info generation from .irp and alike blocks"), while dealing okay with actual assembly source files not using .file/.line and alike outside but not inside of .macro, has undue effects when the logical file/line pair was already overridden: Line numbers would continuously increment while processing the expanded macro, while the goal of the PR gas/16908 workaround is to keep the expansion associated with the line invoking the macro. However, as soon as enough state was overridden _inside_ the macro to cause as_where() to no longer fall back top as_where_physical(), honor this by resuming the bumping of the logical line number. Note that from_sb_is_expansion's initializer was 1 for an unknown reason. While renaming the variable and changing its type, also change the initializer to "expanding_none", which would have been "0" in the original code. Originally the initializer value itself wasn't ever used anyway (requiring sb_index != -1), as it necessarily had changed in input_scrub_include_sb() alongside setting sb_index to other than -1. Strictly speaking input_scrub_insert_line() perhaps shouldn't use expanding_none, yet none of the other enumerators fit there either. And then strictly speaking that function probably shouldn't exist in the first place. It's used only by tic54x.
2022-04-12gas: further adjust file/line handling for .irp and alikeJan Beulich17-1208/+1350
Commit 7992631e8c0b ("gas/Dwarf: improve debug info generation from .irp and alike blocks"), while dealing okay with actual assembly source files not using .file/.line and alike outside but not inside of .irp et al, has undue effects when the logical file/line pair was already overridden: Line numbers would continuously increment upon every iteration, thus potentially getting far off. Furthermore it left it to the user to actually insert .file/.line inside such constructs. Note though that before aforementioned change things weren't pretty either: Diagnostics (and debug info) would be associated with the directive terminating the iteration construct, rather than with the actual lines. Handle this automatically by simply latching the present line and then re-instating coordinates first thing on every iteration; note that the file can't change from what was previously pushed on the scrubber's state stack, and hence can be taken from there by using a new flavor of .linefile (which is far better memory-footprint-wise than recording the full path in the inserted directive). (This then leaves undisturbed any file/line control occurring in the body of the construct, as these will only be seen and processed afterwards.)
2022-04-12x86: make {disp16} work similarly to {disp32}Jan Beulich5-4/+22
In a few places {disp32} was handled specially when really {disp16} wants handling just the same.
2022-04-09Don't run pr27228 test for hppaAlan Modra1-1/+1
As the comment says, hppa doesn't support use of BFD_RELOC_* in .reloc directives. Using xfail can result in a spurious XPASS result as BFD_RELOC values change. * testsuite/gas/elf/pr27228.d: Change xfail to notarget for hppa.
2022-04-08gas: Port "copy st_size only if unset" to aarch64 and riscvFangrui Song3-21/+22
And disable the new test gas/elf/size.s for alpha which uses its own .set, for hppa*-*-hpux* which does not allow .size before declaration.
2022-04-07Add support for COFF secidx relocationsMark Harmstone8-23/+192
bfd * coff-i386.c (in_reloc_p): Add R_SECTION. (howto_table): Add R_SECTION. (coff_pe_i386_relocation_section): Add support for R_SECTION. (coff_i386_reloc_type_lookup): Add support for BFD_RELOC_16_SECCIDX. * coff-x86_64.c (in_reloc_p): Add R_SECTION. (howto_table): Add R_SECTION. (coff_pe_amd64_relocation_section): Add support for R_SECTION. (coff_amd64_reloc_type_lookup): Add support for BFD_RELOC_16_SECCIDX. * reloc.c: Add BFD_RELOC_16_SECIDX. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. gas * config/tc-i386.c (pe_directive_secidx): New function. (md_pseudo_table): Add support for secidx. (x86_cons_fix_new): Likewise. (tc_gen_reloc): Likewise. * expr.c (op_rank): Add O_secidx. * expr.h (operatorT): Likewise. * symbols.c (resolve_symbol_value): Add support for O_secidx. * testsuite/gas/i386/secidx.s: New test source file. * testsuite/gas/i386/secidx.d: New test driver file. * testsuite/gas/i386/i386.exp: Run new test. include * coff/i386.h: Define R_SECTION. * coff/x86_64.h: Likewise. ld * testsuite/ld-pe/secidx1.s: New test source file. * testsuite/ld-pe/secidx2.s: New test source file. * testsuite/ld-pe/secidx.d: New test driver file. * testsuite/ld-pe/secidx_64.d: New test driver file. * testsuite/ld-pe/pe.exp: Add new tests.
2022-04-07gas/Dwarf: record functionsJan Beulich7-7/+368
To help tools like addr2line looking up function names, in particular when dealing with e.g. PE/COFF binaries (linked from ELF objects), where there's no ELF symbol table to fall back to, emit minimalistic information for functions marked as such and having their size specified. Notes regarding the restriction to (pure) ELF: - I realize this is a layering violation; I don't see how to deal with that in a better way. - S_GET_SIZE(), when OBJ_MAYBE_ELF is defined, looks wrong: Unlike S_SET_SIZE() it does not check whether the hook is NULL. - symbol_get_obj(), when OBJ_MAYBE_ELF is defined, looks unusable, as its return type can only ever be one object format's type (and this may then not be ELF's). The new testcases are limited to x86 because I wanted to include the case where function size can't be determined yet at the time Dwarf2 info is generated. As .nops gains support by further targets, they could also be added here then (with, as necessary, expecations suitably relaxed to cover for insn size differences).
2022-04-07Arm64: arrange for line number emission for .instJan Beulich4-1/+24
Just like insns encoded the more conventional way these should have line number info associated with them.
2022-04-07Arm32: arrange for line number emission for .instJan Beulich2-0/+23
Just like insns encoded the more conventional way these should have line number info associated with them.
2022-04-07RISC-V: add testcase to check line number emission for .insnJan Beulich1-0/+71
Since no such test looks to exist, derive one from insn.s.
2022-04-07IBM zSystems: Add support for z16 as CPU name.Andreas Krebbel4-5/+12
So far z16 was identified as arch14. After the machine has been announced we can now add the real name. gas/ChangeLog: * config/tc-s390.c (s390_parse_cpu): Add z16 as alternate CPU name. * doc/as.texi: Add z16 and arch14 to CPU string list. * doc/c-s390.texi: Add z16 to CPU string list. opcodes/ChangeLog: * s390-mkopc.c (main): Enable z16 as CPU string in the opcode table.
2022-04-06Add code to display the contents of .debug_loclists sections which contain ↵Nick Clifton2-1/+6
offset entry tables. PR 28981 * dwarf.c (fetch_indexed_value): Rename to fecth_indexed_addr and return the address, rather than a string. (fetch_indexed_value): New function - returns a value indexed by a DW_FORM_loclistx or DW_FORM_rnglistx form. (read_and_display_attr_value): Add support for DW_FORM_loclistx and DW_FORM_rnglistx. (process_debug_info): Load the loclists and rnglists sections. (display_loclists_list): Add support for DW_LLE_base_addressx, DW_LLE_startx_endx, DW_LLE_startx_length and DW_LLE_default_location. (display_offset_entry_loclists): New function. Displays a .debug_loclists section that contains offset entry tables. (display_debug_loc): Call the new function. (display_debug_rnglists_list): Add support for DW_RLE_base_addressx, DW_RLE_startx_endx and DW_RLE_startx_length. (display_debug_ranges): Display the contents of the section's header. * dwarf.h (struct debug_info): Add loclists_base field. * testsuite/binutils-all/dw5.W: Update expected output. * testsuite/binutils-all/x86-64/pr26808.dump: Likewise.
2022-04-04gas: copy st_size only if unsetFangrui Song4-14/+48
For ``` .size foo1, 1 foo1: .set bar1, foo1 .size bar1, 2 .size bar2, 2 .set bar2, foo1 .set bar3, foo2 .size bar3, 2 .size bar4, 2 .set bar4, foo2 .size foo2, 1 foo2: ``` bar1's size is 2 while bar2, bar3, bar4's is 1. The behavior of bar1 makes sense (generally directives on the new symbol should win) and is relied upon by glibc stdio-common/errlist.c: ``` .hidden _sys_errlist_internal .globl _sys_errlist_internal .type _sys_errlist_internal, @object .size _sys_errlist_internal, 1072 _sys_errlist_internal: .globl __GLIBC_2_1_sys_errlist .set __GLIBC_2_1_sys_errlist, _sys_errlist_internal .type __GLIBC_2_1_sys_errlist, %object .size __GLIBC_2_1_sys_errlist, 125 * (64 / 8) // glibc expects that .size __GLIBC_2_1_sys_errlist, 125 * (64 / 8) wins. ``` The behavior of bar2/bar3/bar4 seems brittle. To avoid the reordering of the two code blocks which will result in the bar3 situation, glibc compiles errlist.c with gcc -fno-toplevel-reorder (previously -fno-unit-at-a-time). To fix the inconsistency and improve robustness, make bar2/bar3/bar4 match bar1, removing the directive order sensitivity. There is a pity that `.size dest, 0` is indistinguishable from the case where dest is unset, but the compromise seems fine. PR gas/29012 * config/obj-elf.c (elf_copy_symbol_attributes): don't copy if src's size has been set. * testsuite/gas/elf/elf.exp: New test. * testsuite/gas/elf/size.d: New file. * testsuite/gas/elf/size.s: Likewise.
2022-03-31aarch64: Relax check for RNG system registersRichard Sandiford2-0/+13
FEAT_RNG is an optional Armv8.5-A extension, but it can be backported to earlier architectures as well. GAS previously made the RNG registers conditional on having both armv8.5-a and +rng, but only +rng should be required. This seems to be the only feature that was handled like this. opcodes/ * aarch64-opc.c (SR_RNG): Don't require V8_5. gas/ * testsuite/gas/aarch64/rng-1.s, testsuite/gas/aarch64/rng-1.d: New test.
2022-03-29gas/Dwarf: special-case .linefile only for macrosJan Beulich3-1/+29
Restrict the PR gas/16908 workaround to just macros, matching the original intention as well as the comment there. For constructs like .irp or .rept the reasoning doesn't apply, as there's no separate "invocation" point which may be of interest to record (for, as said there, short macros).
2022-03-29RISC-V: correct FCVT.Q.L[U]Jan Beulich1-2/+2
While the spec isn't explicit about this, it pointing out the similarity with the D extension ought to extend to the ignoring of a meaningless rounding mode: "Note FCVT.D.W[U] always produces an exact result and is unaffected by rounding mode." Hence the chosen encodings also ought to match. Note that to avoid breaking existing code the forms with a 3rd operand are not removed, which means there continues to be a difference to FCVT.D.W[U].
2022-03-29asan: heap buffer overflow in pa_chk_field_selectorAlan Modra1-16/+29
The buffer overflow showed up running the gas "all macro" test. PR 29005 * config/tc-hppa.c (pa_chk_field_selector): Don't read past end of line.
2022-03-25libtool.m4: fix the NM="/nm/over/here -B/option/with/path" caseNick Alcock1-7/+13
My previous nm patch handled all cases but one -- if the user set NM in the environment to a path which contained an option, libtool's nm detection tries to run nm against a copy of nm with the options in it: e.g. if NM was set to "nm --blargle", and nm was found in /usr/bin, the test would try to run "/usr/bin/nm --blargle /usr/bin/nm --blargle". This is unlikely to be desirable: in this case we should run "/usr/bin/nm --blargle /usr/bin/nm". Furthermore, as part of this nm has to detect when the passed-in $NM contains a path, and in that case avoid doing a path search itself. This too was thrown off if an option contained something that looked like a path, e.g. NM="nm -B../prev-gcc"; libtool then tries to run "nm -B../prev-gcc nm" which rarely works well (and indeed it looks to see whether that nm exists, finds it doesn't, and wrongly concludes that nm -p or whatever does not work). Fix all of these by clipping all options (defined as everything including and after the first " -") before deciding whether nm contains a path (but not using the clipped value for anything else), and then removing all options from the path-modified nm before looking to see whether that nm existed. NM=my-nm now does a path search and runs e.g. /usr/bin/my-nm -B /usr/bin/my-nm NM=/usr/bin/my-nm now avoids a path search and runs e.g. /usr/bin/my-nm -B /usr/bin/my-nm NM="my-nm -p../wombat" now does a path search and runs e.g. /usr/bin/my-nm -p../wombat -B /usr/bin/my-nm NM="../prev-binutils/new-nm -B../prev-gcc" now avoids a path search: ../prev-binutils/my-nm -B../prev-gcc -B ../prev-binutils/my-nm This seems to be all combinations, including those used by GCC bootstrap (which, before this commit, fails to bootstrap when configured --with-build-config=bootstrap-lto, because the lto plugin is now using --export-symbols-regex, which requires libtool to find a working nm, while also using -B../prev-gcc to point at the lto plugin associated with the GCC just built.) Regenerate all affected configure scripts. * libtool.m4 (LT_PATH_NM): Handle user-specified NM with options, including options containing paths.
2022-03-25Re: gas/Dwarf: improve debug info generation from .irp and alike blocksAlan Modra1-2/+2
am33_2.0-linux is a mn10300 target. * testsuite/gas/elf/dwarf-5-irp.d: xfail am33.
2022-03-24x86: mention dropped L1OM/K1OM support in ld/ as wellJan Beulich1-2/+0
This amends e961c696dcb2 ("x86: drop L1OM/K1OM support from ld"). Also remove the marker that I mistakenly added in c085ab00c7b2 ("x86: drop L1OM/K1OM support from gas").
2022-03-23x86: reject relocations involving registersJan Beulich2-0/+17
To prevent fatal or even internal errors, add a simple check to i386_validate_fix(), rejecting relocations when their target symbol is an equate of a register (or resolved to reg_section for any other reason).
2022-03-23x86: improve resolution of register equatesJan Beulich4-2/+29
Allow transitive (or recursive) equates to work in addition to direct ones. The only requirements are that - the equate being straight of a register, i.e. no expressions involved (albeit I'm afraid something like "%eax + 0" will be viewed as %eax), - at the point of use there's no forward ref left which cannot be resolved, yet.
2022-03-23Revert "PR28977 tc-i386.c internal error in parse_register"Jan Beulich1-10/+9
This reverts commit 5fac3f02edacfca458f7eeaaaa33a87e26e0e332, which was superceeded / replaced by 4faaa10f3fab.
2022-03-23x86: don't attempt to resolve equates and alike from i386_parse_name()Jan Beulich5-2/+39
PR gas/28977 Perhaps right from its introduction in 4d1bb7955a8b it was wrong for i386_parse_name() to call parse_register(). This being a hook from the expression parser, it shouldn't be resolving e.g. equated symbols. That's relevant only for all other callers of parse_register(). To compensate, in Intel syntax mode check_register() needs calling; perhaps not doing so was an oversight right when the function was introduced. This is necessary in particular to force EVEX encoding when VRex registers are used (but of course also to reject bad uses of registers, i.e. fully matching what parse_register() needs it for).
2022-03-23gas/Dwarf5: re-use file 0 line string table entry when faking file 0Jan Beulich1-2/+10
No need to emit the same string a 2nd time for file 1 in this case.
2022-03-23gas/Dwarf5: adjust .debug_line file 0 checkingJan Beulich1-11/+10
First of all when a table entry has a NULL filename, the two inner if()s are better done the other way around: The 2nd doesn't depend on what the first does. This then renders redundant half of the conditions of the other if() and clarifies that subsequently only entry 0 is dealt with (indicating that part of the comment was wrong). Finally for there to be a usable name in slot 1, files_in_use needs to be larger than 1 and slot 1's (rather than slot 0's) name needs to be non-NULL.
2022-03-23gas/Dwarf5: drop dead codeJan Beulich1-11/+3
Commit 3417bfca676f ("GAS: DWARF-5: Ensure that the 0'th entry in the directory table contains the current... ") added a "dwarf_level < 5" check to out_dir_and_file_list(). This rendered dead that branch of the construct, due to the enclosing if()'s "DWARF2_LINE_VERSION >= 5". Delete that code as well as the corresponding part of the comment. While there also drop a redundant "dirs != NULL": "dirs" will always be non-NULL when dirs_in_use is not zero.
2022-03-23gas/Dwarf: improve debug info generation from .irp and alike blocksJan Beulich4-5/+116
Tying the bumping of the logical line number to reading from the original source file looks wrong: Upon finishing of the processing of an sb the original values will be restored anyway. Yet without bumping the line counter uses of .line inside e.g. an .irp construct won't have the intended effect: Such uses may be necessary to ensure proper debug info is emitted in particular when switching sections inside the .irp body, as dwarf2_gen_line_info() would bail without doing anything when it finds the line number unchanged from what it saw last.
2022-03-23ELF32: don't silently truncate relocation addendsJan Beulich6-9/+23
At least x86-64's x32 sub-mode and RISC-V's 32-bit mode calculate addends as 64-bit values, but store them in signed 32-bit fields when generating the file without encountering any earlier error. When the relocated field is a 64-bit one, the value resulting after processing the relocation record when linking (or the latest when loading) may thus be wrong due to the truncation. With the code change in place, one x32 testcase actually triggers the new diagnostic. That one case of too large a (negative) addend is being adjusted alongside the addition of a new testcase to actually trigger the new error. (Note that due to internal BFD behavior the relocation in .data doesn't get processed anymore after the errors in .text.) Note that in principle it is possible to express 64-bit relocations in ELF32, but this would require .rel relocations, i.e. with the addend stored in the 64-bit field being relocated. But I guess it would be a lot of effort for little gain to actually support this.
2022-03-23gas: retain whitespace between stringsJan Beulich5-3/+67
Macro arguments may be separated by commas or just whitespace. Macro arguments may also be quoted (where one level of quotes is removed in the course of determining the values for the respective formal parameters). Furthermore this quote removal knows _two_ somewhat odd escaping mechanisms: One, apparently in existence forever, is that a pair of quotes counts as the escaping of a quote, with the pair being transformed to a single quote in the course of quote removal. The other (introduced by c06ae4f232e6) looks more usual on the surface in that it deals with \" sequences, but it _retains_ the escaping \. Hence only the former mechanism is suitable when the value to be used by the macro body is to contain a quote. Yet this results in ambiguity of what "a""b" is intended to mean; elsewhere (e.g. for .ascii) it represents two successive string literals. However, in any event is the above different from "a" "b": I don't think this can be viewed the same as "a""b" when processing macro arguments. Change the scrubber to retain such whitespace, by making the processing of strings more similar to that of symbols. And indeed this appears to make sense when taking into account that for quite a while gas has been supporting quoted symbol names. Taking a more general view, however, the change doesn't go quite far enough. There are further cases where significant whitespace is removed by the scrubber. The new testcase enumerates a few in its ".if 0" section. I'm afraid the only way that I see to deal with this would be to significantly simplify the scrubber, such that it wouldn't do much more than collapse sequences of unquoted whitespace into a single blank. To be honest problems in this area aren't really surprising when seeing that there's hardly any checking of .macro use throughout the testsuite (and in particular in the [relatively] generic tests under all/).
2022-03-21x86: don't suppress overflow diagnostics in x32 modeJan Beulich3-1/+30
Unlike in 64-bit mode, where values wrap at the 64-bit boundary anyway, there's no wrapping at the 32-bit boundary here, and hence overflow detection shouldn't be suppressed just because rela relocations are going to be used. The extra check against NO_RELOC is actually a result of an ilp32 test otherwise failing. But thinking about it, reporting overflows for not-really-relocations (typically because of earlier errors) makes little sense in general. Perhaps this should even be extended to non- 64-bit modes.
2022-03-21z80 assembler: Fix new unexpected overflow warning in v2.37Nick Clifton4-1/+40
PR 28791 * config/tc-z80.c (emit_data_val): Do not warn about overlarge constants generated by bit manipulation operators. * testsuite/gas/z80/pr28791.s: New test source file. * testsuite/gas/z80/pr28791.d: New test driver file.