Commit Graph

36 Commits

Author SHA1 Message Date
Jan Beulich
1cc4b7d755 bfin: drop _ASSIGN_BANG
A few testcases demonstrate that "=!" isn't supposed to be an
individual token, since "= !" is used in a number of places. So far
lexing that to a single token worked because of the scrubber being
overly aggressive in removing whitespace. As that's going to change,
replace uses by separate ASSIGN and BANG.
2024-07-19 11:56:46 +02:00
Alan Modra
fd67aa1129 Update year range in copyright notice of binutils files
Adds two new external authors to etc/update-copyright.py to cover
bfd/ax_tls.m4, and adds gprofng to dirs handled automatically, then
updates copyright messages as follows:

1) Update cgen/utils.scm emitted copyrights.
2) Run "etc/update-copyright.py --this-year" with an extra external
   author I haven't committed, 'Kalray SA.', to cover gas testsuite
   files (which should have their copyright message removed).
3) Build with --enable-maintainer-mode --enable-cgen-maint=yes.
4) Check out */po/*.pot which we don't update frequently.
2024-01-04 22:58:12 +10:30
Alan Modra
d87bef3a7b Update year range in copyright notice of binutils files
The newer update-copyright.py fixes file encoding too, removing cr/lf
on binutils/bfdtest2.c and ld/testsuite/ld-cygwin/exe-export.exp, and
embedded cr in binutils/testsuite/binutils-all/ar.exp string match.
2023-01-01 21:50:11 +10:30
Alan Modra
19f7966ede gas local label and dollar label handling
Much of the gas source and older BFD source use "long" for function
parameters and variables, when other types would be more appropriate.
This patch fixes one of those cases.  Dollar labels and numeric local
labels do not need large numbers.  Small positive itegers are usually
all that is required.  Due to allowing longs, it was possible for
fb_label_name and dollar_label_name to overflow their buffers.

	* symbols.c: Delete unnecessary forward declarations.
	(dollar_labels, dollar_label_instances): Use unsigned int.
	(dollar_label_defined, dollar_label_instance): Likewise.
	(define_dollar_label): Likewise.
	(fb_low_counter, fb_labels, fb_label_instances): Likewise.
	(fb_label_instance_inc, fb_label_instance): Likewise.
	(fb_label_count, fb_label_max): Make them size_t.
	(dollar_label_name, fb_label_name): Rewrite using sprintf.
	* symbols.h (dollar_label_defined): Update prototype.
	(define_dollar_label, dollar_label_name): Likewise.
	(fb_label_instance_inc, fb_label_name): Likewise.
	* config/bfin-lex.l (yylex): Remove unnecessary casts.
	* expr.c (integer_constant): Likewise.
	* read.c (read_a_source_file): Limit numeric label range to int.
2022-02-16 22:05:24 +10:30
Alan Modra
a2c5833233 Update year range in copyright notice of binutils files
The result of running etc/update-copyright.py --this-year, fixing all
the files whose mode is changed by the script, plus a build with
--enable-maintainer-mode --enable-cgen-maint=yes, then checking
out */po/*.pot which we don't update frequently.

The copy of cgen was with commit d1dd5fcc38ead reverted as that commit
breaks building of bfp opcodes files.
2022-01-02 12:04:28 +10:30
Alan Modra
fdb21288ca Don't include bfd/sysdep.h for gas files
* itbl-lex-wrapper.c: Include as.h not sysdep.h.
	* config/bfin-lex-wrapper.c: Likewise.
	* itbl-lex.l: Don't include as.h.
	* config/bfin-lex.l: Likewise.
2021-03-31 23:07:51 +10:30
Alan Modra
55add51eef PR23691, gas .y files vs. automatic make dependencies
A number of targets, bfin, rl78, rx, can show odd failures when
bfd/reloc.c changes BFD_RELOC_* enum values, if recompiling over a
build dir with existing objects.  The problem is caused by
bfin-parse.o and similar not being recompiled and so using stale
BFD_RELOC_* values.  This isn't fixed by making bfin-parse.c depend on
bfd/reloc.c, which isn't necessary anyway.  bfin-parse.o should have
been recompiled due to bfd/bfd.h changing when extracted bfd/reloc.c
BFD_RELOC_* values change, but that wasn't happening.  The problem is
that automake generates a makefile that loads gas/config/.deps/
dependency file for objects with corresponding sources mentioned in
EXTRA_as_new_SOURCES.  Unless we want to mess around generating
explicit dependencies, I think that mean moving some object files to
the build gas/config/.  This patch does that, removing some hacks for
m68k-parse.c that should no longer be necessary, and removes some
rules that catered to old bison producing code that triggers compiler
warnings.

	PR 23691
	* Makefile.am (TARGET_CPU_CFILES): Split off config/xtensa-relax.c..
	(TARGET_CPU_HFILES): ..and config/xtensa-relax.h..
	(TARGET_EXTRA_FILES): ..to here.  Add config/bfin-lex-wrapper.c,
	and use alongside TARGET_CPU_CFILES.
	(EXTRA_DIST): Update location of generated .c files.
	(config/m68k-parse.c): New rule replacing m68k-parse.c rule.
	(config/bfin-parse.c, config/rl78-parse.cm config/rx-parse.c),
	(config/bfin-lex.c, config/bfin-lex-wrapper.@OBJEXT@): Similarly.
	(itbl-lex-wrapper.@OBJEXT@): Simplify to just the needed
	dependencies.
	(itbl-parse.@OBJEXT@): Delete rule using NO_WERROR.
	(itbl-parse.c, itbl-parse.h): Tidy.
	* config/bfin-lex-wrapper.c: Include config/bfin-lex.c.
	* config/bfin-lex.l: Include config/bfin-parse.h.
	* configure.ac (extra_objects): Move object files corresponding
	to .y and .l files now in config/ to config/.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* po/POTFILES.in: Regenerate.
2021-02-24 10:13:00 +10:30
Mike Frysinger
adb0bd8fda gas: bfin: fix build time warnings 2021-01-14 00:53:13 -05:00
Alan Modra
250d07de5c Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
Alan Modra
251150adb1 ubsan: bfin-lex.l:503 left shift cannot be represented
* config/bfin-lex.l: Use an unsigned type for "value".
2020-09-02 16:30:42 +09:30
Alan Modra
b3adc24a07 Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
Alan Modra
827041555a Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
Alan Modra
219d1afa89 Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
Bernhard Rosenkranzer
2cedb9ebf8 Add support for processing lex source files with flex v 2.6.3
PR 21059
binutils* arlex.l: Support processing with flex 2.6.3.
	* deflex.l: Likewise.

gas	* config/bfin-lex.l: Support processing with flex 2.6.3.
	* itbl-lex.l: Likewise.
2017-01-18 13:38:27 +00:00
Alan Modra
2571583aed Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
Ambrogino Modigliani
8f02b5ad62 Fix spelling in comments in .l files (gas)
* config/bfin-lex.l: Fix spelling in comments.
2016-11-27 20:19:12 +10:30
Alan Modra
6f2750feaf Copyright update for binutils 2016-01-01 23:00:01 +10:30
Alan Modra
b90efa5b79 ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
Alan Modra
4b95cf5c0c Update copyright years 2014-03-05 22:16:15 +10:30
Mike Frysinger
36f446111a gas/opcodes: blackfin: punt BYTEOP2M insn support
The BYTEOP2M insn was part of the initial Blackfin designs, but never made
it into any actual silicon.  So punt support for it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-02-13 18:53:16 +00:00
Mike Frysinger
65646555b2 gas: blackfin: reign in overeager insn flag handling
Currently, trying to declare single letter variables in Blackfin assembly
can sometimes lead to parser errors if that letter is used for insn flags.
For example, X, Z, S, M, and T are used to change the behavior of insns:
    R0 = 1; R0 = 1 (X); R0 = 1 (Z);
But the current parser just looks for single letter tokens rather than
ones that show up in the (FLAGS) field.  So only match these letters as
flags when they're in parentheses.

Not a complete fix, but it at least lets gcc tests pass now (the test
gcc/testsuite/gcc.c-torture/compile/mangle-1.c to be exact).  A complete
fix would require a significant parser rewrite in order to handle:
    R0 = (x) (x);   /* zero extend the address of the symbol "x" */
    R0 = W; R0 = W[P0];

Signed-off-by: Steve Kilbane <steve.kilbane@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-11 08:37:20 +00:00
Mike Frysinger
efda024297 gas: blackfin: handle multibyte symbols
Accept any 8bit char with the high bit set so as to support multibyte
characters.  Also use the locale safe regular expressions to match
chars/digits.  This brings the Blackfin assembler inline with the
behavior of other assemblers.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-09-22 21:08:31 +00:00
Mike Frysinger
22215ae09b opcodes/gas: blackfin: handle more ASTAT flags
Support a few more ASTAT bits with the standard insns that operate on
ASTAT bits directly.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-09-22 21:05:03 +00:00
Mike Frysinger
1b182c3c15 gas: blackfin: support ABORT debug insn
There is a pseudo debug insn named ABORT that is commonly used in
simulation, so support it in the assembler too.  The disassembler
already supports it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-09-22 20:21:32 +00:00
Mike Frysinger
048e5b805b gas: bfin: replace index() with strchr() 2010-04-20 07:10:31 +00:00
Mike Frysinger
ee9e7c780e strip trailing whitespace in Blackfin files 2010-03-10 14:23:58 +00:00
Jie Zhang
62fb9fe1fc * config/bfin-aux.h: Remove argument names in function
declarations.
	* config/bfin-lex.l (parse_int): Fix shadowed variable name
	warning.
	* config/bfin-parse.y (value_match): Remove argument names
	in declaration.
	(notethat): Likewise.
	(yyerror): Likewise.
2010-01-14 04:52:57 +00:00
Jie Zhang
c639698b41 * config/bfin-lex.l: Remove V as STATUS_REG. 2009-09-03 17:52:06 +00:00
Jie Zhang
f31bf2c696 * config/bfin-defs.h (F_REG_ALL): Remove macro.
(F_REG_HIGH): Redefine.
	(F_REG_NONE): New macro.
	(F_REG_LOW): New macro.
	(REG_CLASS): Enclose macro argument in parentheses when used.
	(REG_EVEN): Likewise.
	(IS_H): Use flags.
	(IS_HCOMPL): Use flags.
	* config/bfin-lex.l (SP.L, SP.H, FP.L, FP.H): Set flags.
	(parse_reg): Set flags.
	(parse_halfreg): Set flags.
2009-09-03 17:06:38 +00:00
Alan Modra
aa820537ea update copyright dates 2009-09-02 07:25:43 +00:00
Jie Zhang
fec8276095 * config/bfin-lex.l (NUMBER): Protect special `.'.
testsuite/
	* gas/bfin/misc.s: New test.
	* gas/bfin/misc.d: New test.
	* gas/bfin/bfin.exp: Add misc test.
2008-08-22 07:21:49 +00:00
Nick Clifton
ec2655a6a7 Switch to GPLv3 2007-07-03 11:01:12 +00:00
Alan Modra
ebd1c8757c remove some duplicate #include's. 2006-06-07 11:27:58 +00:00
Bernd Schmidt
1ac4baeded * config/bfin-defs.h (Expr_Node_Type enum): Add Expr_Node_GOT_Reloc.
* config/bfin-lex.l: Recognize GOT17M4 and FUNCDESC_GOT17M4.
	* config/bfin-parse.y: Include "libbfd.h", "elf/common.h" and
	"elf/bfin.h".
	(GOT17M4, FUNCDESC_GOT17M4): New tokens of type <value>.
	(any_gotrel): New rule.
	(got): Use it, and create Expr_Node_GOT_Reloc nodes.
	* config/tc-bfin.c: Include "libbfd.h", "elf/common.h" and
	"elf/bfin.h".
	(DEFAULT_FLAGS, bfin_flags, bfin_pic_flag): New.
	(bfin_pic_ptr): New function.
	(md_pseudo_table): Add it for ".picptr".
	(OPTION_FDPIC): New macro.
	(md_longopts): Add -mfdpic.
	(md_parse_option): Handle it.
	(md_begin): Set BFD flags.
	(md_apply_fix3, bfin_fix_adjustable): Handle new relocs.
	(bfin_gen_ldstidxi): Adjust to match the trees that the parser gives
	us for GOT relocs.
	* Makefile.am (bfin-parse.o): Update dependencies.
	(DEPTC_bfin_elf): Likewise.
	* Makefile.in: Regenerate.
2006-03-26 01:12:07 +00:00
Jie Zhang
9ba4c44513 bfd/
* elf32-bfin.c (bfd_bfin_elf32_create_embedded_relocs): Fix signedness
	warning.
gas/
	* Makefile.am (bfin-parse.h): Renamed from bfin-parse.tab.h.
	(EXTRA_DIST): Add bfin-parse.h and bfin-lex.c.
	* Makefile.in: Regenerate.
	* config/bfin-lex.l: Include bfin-parse.h instead of bfin-parse.tab.h.
	* config/tc-bfin.c (md_chars_to_number): Change the type of first
	argument from unsigned char * to char * to remove signedness warnings.
2005-10-24 16:31:22 +00:00
Catherine Moore
07c1b327c7 * Makefile.am: Bfin support.
* Makefile.in: Regenerated.
	* aclocal.m4: Regenerated.
	* configure: Regenerated.
	* configure.in: Bfin support.
	* configure.tgt: Bfin support.
	* config/bfin-aux.h: New file.
	* config/bfin-defs.h: New file.
	* config/bfin-lex.l: New file.
	* config/bfin-parse.y: New file.
	* config/tc-bfin.c: New file.
	* config/tc-bfin.h: New file.
	* doc/Makefile.am: Recognize c-bfin.texi.
	* doc/Makefile.in: Regenerated.
	* doc/all.texi: Bfin support.
	* doc/as.texinfo: Likewise.
	* doc/c-bfin.texi: Document bfin-specific syntax and
	directives.
2005-09-30 15:05:07 +00:00