]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
loongarch gcc-4.5 build fixes
authorAlan Modra <amodra@gmail.com>
Tue, 10 Jun 2025 10:59:33 +0000 (20:29 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 10 Jun 2025 21:56:07 +0000 (07:26 +0930)
commit9f8e772be472f457f19f06be10e1309568067a09
tree16bc4692e9a21a7d9011ca43139a8dfdde6aa491
parent04b475ac467a2af500a942c36ef122138f13d3a7
loongarch gcc-4.5 build fixes

Yet another case of missing fields in struct initialisation, which
I've replaced with a memset, and some complaints about identifiers
shadowing global declarations.  Fixing the shadowing in
loongarch-parse.y is easy.  This one isn't so easy:
gas/expr.c: In function 'expr':
gas/expr.c:1891:12: error: declaration of 'is_unsigned' shadows a global declaration
include/opcode/loongarch.h:224:14: error: shadowed declaration is here

opcode/loongarch.h declares lots of stuff that shouldn't be made
available to generic gas code, so I've removed that header from
tc-loongarch.h and moved the parts of TC_FORCE_RELOCATION_SUB_LOCAL
and TC_FORCE_RELOCATION_SUB_LOCAL that need LARCH_opts to functions
in tc-loongarch.c

* config/loongarch-parse.y (loongarch_parse_expr): Rename
        param to avoid shadowing.
* config/tc-loongarch.c (loongarch_assemble_INSNs): Use memset
rather than struct initialisation.
(loongarch_force_relocation_sub_local): New function.
(loongarch_force_relocation_sub_same): Likewise.
* config/tc-loongarch.h: Don't include opcode/loongarch.h.
(loongarch_force_relocation_sub_local): Declare, and..
(TC_FORCE_RELOCATION_SUB_LOCAL): ..use here.
(loongarch_force_relocation_sub_same): Declare, and..
(TC_FORCE_RELOCATION_SUB_SAME): ..use here.
gas/config/loongarch-parse.y
gas/config/tc-loongarch.c
gas/config/tc-loongarch.h