RISC-V: Gas inserts cfa relocs in wrong section.
authorJim Wilson <jimw@sifive.com>
Sun, 24 May 2020 23:42:21 +0000 (16:42 -0700)
committerJim Wilson <jimw@sifive.com>
Sun, 24 May 2020 23:42:21 +0000 (16:42 -0700)
commit72393fd1030f4d55cd12e2a84a91ce42212d037c
tree5f2028354959997fc1bcae4eaec43e615f4aeea9
parent41a77cbaadd63b92362f5ea35b2cd11f90edf170
RISC-V: Gas inserts cfa relocs in wrong section.

The frag code makes a distinction between inserting frags before the frag
chains are chained together and afterward.  After chaining, we need to set
now_seg before creating the frag.  tc-xtensa.c has a function called
fix_new_exp_in_seg that handles this right, but switches segments twice each
time it is called.  In this case, we can inline it and pull the save and
restore out of the loop to get better code.

gas/
PR 26025
* config/tc-riscv.c (riscv_pre_output_hook): Change s type from const
asection to segT.  New locals seg and subseg.  Call subseg_set before
fix_new_exp.  Call subseg_set after loop to restore original values.
gas/ChangeLog
gas/config/tc-riscv.c
This page took 0.023746 seconds and 4 git commands to generate.