Skip to content

Commit

Permalink
RISC-V: Set EF_RISCV_TSO also on .option arch
Browse files Browse the repository at this point in the history
This is a minor fix to commit 96462b0
("RISC-V: Implement Ztso extension").  Currently, it sets EF_RISCV_TSO ELF
flag when initial ISA string contains the 'Ztso' extension.  However, GAS
has a way to update the ISA string: ".option arch".

When the architecture is updated by ".option arch", EF_RISCV_RVC ELF flag
is set when the 'C' extension is detected.  Analogously, this commit sets
the EF_RISCV_TSO when the 'Ztso' extension is detected.

gas/ChangeLog:

	* config/tc-riscv.c (s_riscv_option): Set TSO ELF flag if the
	'Ztso' extension is specified via ".option arch" directive.
  • Loading branch information
a4lg committed Sep 21, 2022
1 parent 3094c89 commit acab2a6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gas/config/tc-riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -3888,6 +3888,9 @@ s_riscv_option (int x ATTRIBUTE_UNUSED)
riscv_set_rvc (false);
if (riscv_subset_supports (&riscv_rps_as, "c"))
riscv_set_rvc (true);

if (riscv_subset_supports (&riscv_rps_as, "ztso"))
riscv_set_tso ();
}
else if (strcmp (name, "push") == 0)
{
Expand Down

0 comments on commit acab2a6

Please sign in to comment.