Age | Commit message (Collapse) | Author | Files | Lines |
|
With the SDM long having dropped the NDS/NDD/DDS concept of identifying
encoding variants, we can finally do away with this concept as well. Of
the few consumers of the attribute, only an assertion was still checking
for a particular value, which we don't really need to retain.
When touching lines anyway, modernize other aspects as well. This often
improves similarity to adjacent lines.
|
|
The function has accumulated a number of special cases for no real
reason. Some were necessary because insn attributes (SwapSources in
particular) weren't suitably utilized instead. Note that the addition of
SwapSources actually increases consistency among the templates: Like
others which already have the attribute, these are all insns where the
VEX.VVVV-encoded register comes first (or last when looking at the SDM).
Note that the vexvvvv attribute now has merely boolean meaning anymore,
in line with the SDM long having dropped the NDS/NDD/DDS concept of
identifying encoding variants. The fallout will be taken care of
subsequently, though, to not further clutter the change here.
As to the TILEZERO special case: If more instructions like this
appeared, a new attribute would likely be the way to go. But as long as
it's only a single insn, going from the mnemonic is cheaper.
|
|
Recent BPF patch removed and renamed the list of relocations based on
the limitations of BPF instruction set.
This patch is a correction to the tests.
|
|
Even a unary '+' has to be considered arithmetic; at least on x86 in
Intel Syntax mode otherwise bogus insn operands may be accepted.
Convert this specific case to binary + (i.e. 0 + <register>). (An
implication is that md_operator(,1,) would need to deal with arch-
specific equivalents of unary '+' is a similar way, if such an arch-
specific variant would be specified in the first place.)
To avoid duplicating what make_expr_symbol() does to construct a
constant-zero expression, simply make its previously local variable a
file-scope static one. This way there's also no need to invoke
clean_up_expression().
|
|
Yet again with the removal of gasp about 20 years ago this extra level
of indirection isn't necessary anymore either. Drop macro.c's local
variable and make as.c's global.
While doing the conversion, switch the variable to "bool".
|
|
Again with the removal of gasp about 20 years ago the extra level of
indirection isn't necessary anymore. Drop macro.c's local variable and
use the global flag directly.
|
|
This removes a leftover from i960 support; with that nothing is left
which would set macro_strip_at to non-zero, so the variable is converted
to a #define (retaining the logic in case a new user would appear) and
macro_init()'s respective parameter is dropped.
|
|
With the removal of gasp (about 20 years ago) the need for this kind-
of-hook has disappeared. Go a step beyond merely moving the to be called
function: Inline its contents right at the sole call site.
|
|
This target has its own ld emulation based on aarch64elf.em.
|
|
- Removed not needed relocations.
- Renamed relocations to match llvm and linux kernel.
Relocation changes:
R_BPF_INSN_64 => R_BPF_64_64
R_BPF_INSN_DISP32 => R_BPF_64_32
R_BPF_DATA_32 => R_BPF_64_ABS32
R_BPF_DATA_64 => R_BPF_64_ABS64
ChangeLog:
* bfd/bpf-reloc.def: Created file with BPF_HOWTO macro entries.
* bfd/reloc.c: Removed non needed relocations.
* bfd/bfd-in2.h: regenerated.
* bfd/libbfd.h: regenerated.
* bfd/elf64-bpf.c: Changed relocations.
* include/elf/bpf.h: Adapted relocation values/names.
* gas/config/tc-bpf.c: Changed relocation mapping.
|
|
PR 30206
* doc/as.texi (Pseudo Ops): Document that data directives such as .byte and .int are not intended for encoding instructions.
|
|
* read.c (current_name, current_label, dwarf_file, dwarf_line): Move
to file scope.
(pobegin): Tidy pop_override_ok.
(read_a_source_file): Make last_eol an auto var.
(s_reloc): Constify bfd_relocs.
(read_begin): Init more variables.
|
|
This fixes a bug in .include and .incbin where given an absolute path
the -I dirs would be searched for the path.
* read.c (include_dir_count, include_dir_maxlen): Make them size_t.
(search_and_open): New function.
(s_incbin, s_include): Use search_and_open.
(init_include_dir): New function.
(add_include_dir): Don't set initial "." dir here.
* read.h (include_dir_count, include_dir_maxlen): Update.
(init_include_dir, search_and_open): Declare.
* as.c (gas_early_init): Call init_include_dir.
* config/tc-rx.c (rx_include): Avoid warning by using size_t.
* config/tc-tic54x.c (tic54x_set_default_include): Simplify and
use notes for include path.
(tic54x_mlib): Use search_and_open.
|
|
* dwarf2dbg.c (dw2_line, dw2_filename): Move to file scope and..
(dwarf2_gen_line_info): ..renamed from here.
(label_num, last_used, last_used_dir_len): Move to file scope.
(dwarf2_init): Init moved statics, except last_used_dir_len.
|
|
It might have made sense once upon a time, but doesn't nowadays when
compilers expand memset inline.
* ecoff.c (add_aux_sym_tir, allocate_scope, allocate_vlinks),
(allocate_shash, allocate_thash, allocate_tag, allocate_forward),
(allocate_thead, allocate_lineno_list): Use memset rather than
copying zero struct.
|
|
* compress-debug.c (compress_init): Clear all of strm.
|
|
Logic exists to deal with prereqs or prereqs, and in many cases
transitive prereqs are already not spelled out explicitly. Drop further
ones:
- FP is already a prereq to F16,
- SIMD and F16 are already prereqs to COMPNUM, and
- SVE2 and BFLOAT16 are already prereqs to SME.
|
|
A number of newer features are really SIMD or FP extensions, but don't
have this properly specified.
|
|
Keep both representing exclusively what was parsed from input, to avoid
the need for (potentially bogus) calculations when processing .insn.
|
|
Before altering how build_modrm_byte() works, arrange for this part of
the testcase to actually use distinguishable source and destination
register numbers, such that incorrect propagation of, in particular, the
high bit encodings (from REX to VEX) can be noticed (in turn
specifically assertions [not] triggering in the respective code).
|
|
Put it in optimize_disp() such that it can then be re-used by .insn
handling. The movement makes it necessary (or at least very desirable,
to avoid introducing a fragile cast) to convert to local variable to
"unsigned", which in turn requires an adjustment to the pre-existing
loop header.
Having the caller pass in the specific template under consideration has
another benefit then: We can replace the two uses of current_templates
in the function as well, thus no longer looking at some merely "related"
template. (This may allow further tightening, but if so that's to be the
subject of another change.)
|
|
This is benign for all existing insns, but is going to be needed for
handling of .insn operands. The earlier use requires moving up the
function, to avoid the need for a forward declaration.
|
|
Fix another case of oss-fuzz tripping over gas static state,
ie. starting over testing another input file with rubbish left
uncleared in bss. size_end_sym pointed at garbage.
* ehopt.c (get_cie_info): Delete forward declaration.
(struct frame_data): Move to file scope.
(frame): New static, packaged..
(check_eh_frame): ..eh_frame_data and debug_frame_data.
(eh_begin): New function.
* as.c (gas_init): Call eh_begin.
* as.h (eh_begin): Declare.
|
|
This:
.struct -1
x:
.fill 1
y:
results in an internal error in frag_new due to abs_section_offset
wrapping from -1 to 0. Frags in the absolute section don't do much so
I think we can allow the address wrap.
* frags.c (frag_new): Allow address wrap in absolute section.
|
|
Open-coding part of what may eventually be needed is somewhat risky.
Let's use the function we have, taking care of all pieces of data which
may need swapping, no matter that
- right now i.flags[] and i.reloc[] aren't relevant here (yet),
- EVEX masking and embedded broadcast aren't applicable.
|
|
In commit a5748e0d8c50 ("x86/Intel: allow MASM representation of
embedded broadcast") I replaced the calculation of i.broadcast.bytes in
check_VecOperands() not paying attention to the immediately following
call to get_broadcast_bytes() doing exactly that (again) first thing.
|
|
While commit b0c295e1b8d0 ("add --enable-default-compressed-debug-
sections-algorithm configure option") adjusted flag_compress_debug's
initializer, it didn't alter the default used when the command line
option was specified with an (optional!) argument. This rendered help
text inconsistent with actual behavior in certain configurations.
As to help text - the default reported there clearly shouldn't be
affected by a possible earlier --compress-debug-sections= option, so
flag_compress_debug can't be used when emitting usage information.
|
|
In the course of using the upcoming .insn directive to eliminate various
.byte uses in testcases I've come across these, which needlessly use
more .byte than necessary even without the availability of .insn.
|
|
* macro.c (macro_expand): Ensure input string buffer is not
read past end.
|
|
Changing mri mode between macro definition and use isn't good. This
.macro x
.endm
.mri 1
x
leads to a segfault. Fixed with the following patch, but I suppose
what should really happen is that macros be marked as being mri mode
when defined, and that determine whether the magic NARG parameter be
supplied at expansion. Nobody has complained about this in 30 years
so I'm not inclined to change gas behaviour to that extent.
* macro.c (macro_expand): Don't segfault in mri mode if NARG
formal isn't found.
|
|
Also fix an error introduced in 1998 in reporting a zero count for
negative counts.
* read.c (s_space): Use unsigned multiply, and catch overflow.
Correct order of tests for invalid repeat counts. Ensure
ignored directives don't affect mri_pending_align.
|
|
Fix an internal error after "non-constant fill count for absolute
section".
* read.c (s_fill): Don't create frags after errors.
|
|
* read.c (do_repeat): Free sb on error path.
|
|
This change supports MEC which is part of RME (Realm Management Extension).
|
|
As 1fafeaac8503eea2f61c3a35f0eef183b7e7cc65, "line.s" and "Line.s" are
identical in case insensitive file systems. Thus, gas doesn't trigger
an input file switch.
gas/ChangeLog:
* testsuite/gas/elf/dwarf-5-macro.s: Change Line.s to Line2.s.
|
|
PR 28909 * doc/local.mk (asconfig.texi): Use "cp -p" to preserve timestamps. * Makefile.in: Regenerate.
|
|
Several insns have a (typically shorter) non-ModR/M and a (typically
longer) ModR/M encoding. In most cases the former is used by default.
This isn't too dissimilar from register-only insns sometimes having two
encoding forms. In those cases {load} or {store} can be used to control
the encoding used. Extend this to ModR/M-less encodings which have a
ModR/M counterpart (note that BSWAP hasn't). For insn reading and
writing their (explicit) memory operand, both prefixes are honored;
otherwise only the applicable one is.
Note that for some forms of XCHG, {store} has already been performing
this function, apparently as an unnoticed side effect of adding D to
the template.
|
|
These have their own CPUID bit and hence they should also have their own
separate control.
|
|
The feature isn't universally available on 64-bit CPUs.
Note that in i386-gen.c:isa_dependencies[] I'm only adding it to models
where I'm certain the functionality exists. For Nocona and Core I'm
uncertain in particular.
|
|
While MOV to/from segment register as well as selector storing insns
already permit 32- and 64-bit GPR operands, selector loading insns and
ARPL do not. Split templates accordingly.
|
|
For shifts (but not ordinary rotates) and other cases where an immediate
describes e.g. a bit count or position, allowing negative operands is at
best confusing. An extreme example would be the two rotate-through-carry
insns, where a negative value would _not_ mean rotating the
corresponding number of bits in the other direction. To refuse such,
give meaning to the combination of Imm8 and Imm8S in templates (so far
these weren't used together anywhere). The issue was with
smallest_imm_type() blindly setting .imm8 for signed numbers determined
to fit in a byte.
VPROT{B,W,D,Q} is a little special: The rotate count there is a signed
quantity, so Imm8 is replaced by Imm8S. Adjust affected testcases
accordingly as well.
Another small adjustment to the testsuite is necessary: AAM and AAD were
never sensible to use with 0xffffff90 operands. This should have been an
error.
|
|
Just like we suppress emitting REX.W for e.g. MOV from/to segment
register, there's also no need for it for LAR and LSL - these can only
ever return 32-bit values and hence always zero-extend their results
anyway.
While there also drop the redundant Word from the first operand of
the second template each - this is already implied by Reg16.
|
|
In 64-bit mode BT can have REX.W or a data size prefix dropped in
certain cases. Outside of 64-bit mode all 4 insns can have the data
size prefix dropped in certain cases.
|
|
When dealing with case insensitive file systems, ".file line.s" and
".file Line.s" are identical and thus gas won't change the current
input file.
However, in line.l test, it's expecting to trigger an input file switch.
As the second filename doesn't matter in it, change it to fit for those
file systems.
gas/ChangeLog:
* testsuite/gas/elf/line.l: Change Line.s to Line2.s.
* testsuite/gas/elf/line.s: Adjust output.
|
|
PowerPC ELF always uses bfd_arch_powerpc, so we shouldn't allow the
gas -mpwr, -mpwr2 or -mpwrx options to choose bfd_arch_rs6000.
Given the possible values of ppc_cpu, I think the as_fatal at the end
of ppc_arch will never be reached, so it can be deleted and the code
simplified a little.
PR 30046
* config/tc-ppc.c (ppc_arch): Return bfd_arch_powerpc for ELF.
Delete dead code.
|
|
I don't see much point in cluttering the source with the PROGRESS
macros, which of course do nothing at all with the definitions in
progress.h. progress.h is unchanged apart from the copyright comment
since commit d4d4c53c68f0 in 1994.
binutils/
* ar.c: Don't include progress.h, or invoke PROGRESS macros.
* nm.c: Likewise.
* objcopy.c: Likewise.
* objdump.c: Likewise.
gas/
* as.h: Don't include progress.h.
* as.c: Don't invoke PROGRESS macros.
* write.c: Likewise.
include/
* progress.h: Delete.
ld/
* ldmain.c: Don't include progress.h, or invoke PROGRESS macros.
|
|
Rename gas_late_init to plain gas_init, to reinforce the idea that
this is where the bulk of gas initialisation belongs. Also reorder
some initialisation.
* as.c (gas_init): Rename from gas_late_init. Open output
file and arrange for dump_statistics to be called here rather
than in main. Create .gasversion. local symbol earlier,
because we can.
|
|
Therefore there shouldn't be any at the end of the format string.
|
|
PR gas/30117
Once a symbol had its expression evaluated, the "segment" of the symbol
may be reg_section if a register is merely involved in the expression,
not just when the expression references a "plain" register. Therefore
the first of the assertions put in place by 4d1bb7955a8b was too strict.
Convert it to an if() to deal with situations like this one found by
fuzzing:
x=s
s=%eax+0
y=s
or $6,x
In non-debug builds this also avoids potentially silently generating bad
code.
|
|
In 7545aa2dd2eb ("gas: improve interaction between read_a_source_file()
and s_linefile()") I didn't pay attention to the dual purpose of the
nul character previously used. This was to a fair degree because of the
open-coding of certain operations. Insert the earlier found line
terminator instead of a hard-coded newline, and do so early in this
special case (bypassing the later general insertion point). Plus
properly use sb_terminate() to mark the end of the string. (Note that
saved_eol_char was misnamed: Without calling sb_terminate() there's
simply random data at that position in the buffer.)
|