LoongArch: fix internal error when as handling unsupported modifier.
This commit is contained in:
parent
f178a37508
commit
df4ffdd8c8
5 changed files with 13 additions and 4 deletions
|
@ -1629,9 +1629,6 @@ loongarch_larch_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
|
|||
return lht->bfd_type;
|
||||
}
|
||||
|
||||
(*_bfd_error_handler) (_("%pB: unsupported relocation type name %s"),
|
||||
abfd, l_r_name);
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
return BFD_RELOC_NONE;
|
||||
}
|
||||
|
||||
|
|
|
@ -132,7 +132,11 @@ reloc (const char *op_c_str, const char *id_c_str, offsetT addend)
|
|||
if (0 == strcmp (op_c_str, "plt"))
|
||||
btype = BFD_RELOC_LARCH_B26;
|
||||
else
|
||||
btype = loongarch_larch_reloc_name_lookup (NULL, op_c_str);
|
||||
{
|
||||
btype = loongarch_larch_reloc_name_lookup (NULL, op_c_str);
|
||||
if (btype == BFD_RELOC_NONE)
|
||||
as_fatal (_("unsupported modifier %s"), op_c_str);
|
||||
}
|
||||
|
||||
if (id_c_str)
|
||||
{
|
||||
|
|
3
gas/testsuite/gas/loongarch/reloc_type.d
Normal file
3
gas/testsuite/gas/loongarch/reloc_type.d
Normal file
|
@ -0,0 +1,3 @@
|
|||
#as:
|
||||
#source: reloc_type.s
|
||||
#error_output: reloc_type.l
|
2
gas/testsuite/gas/loongarch/reloc_type.l
Normal file
2
gas/testsuite/gas/loongarch/reloc_type.l
Normal file
|
@ -0,0 +1,2 @@
|
|||
.*Assembler messages:
|
||||
.*Fatal error: unsupported modifier (.*)$
|
3
gas/testsuite/gas/loongarch/reloc_type.s
Normal file
3
gas/testsuite/gas/loongarch/reloc_type.s
Normal file
|
@ -0,0 +1,3 @@
|
|||
.L1:
|
||||
nop
|
||||
addi.d $a0,$a1,%reloc(x)
|
Loading…
Add table
Reference in a new issue