aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJinyang He <hejinyang@loongson.cn>2023-08-10 10:21:40 +0800
committerAlan Modra <amodra@gmail.com>2023-09-09 08:56:32 +0930
commit7ca61249cdc4003aa90e3f106ef00797827d4a4d (patch)
tree7dc7487c0269f66065c3743ca660fb1872e49759 /gas
parente9536c6dd51b6d989f6efbfa12bfdf5c2bc499a3 (diff)
downloadgdb-7ca61249cdc4003aa90e3f106ef00797827d4a4d.zip
gdb-7ca61249cdc4003aa90e3f106ef00797827d4a4d.tar.gz
gdb-7ca61249cdc4003aa90e3f106ef00797827d4a4d.tar.bz2
Make sure DW_CFA_advance_loc4 is in the same frag
Do the same as commit b9d8f5601bcf in another place generating DW_CFA_advance_loc4. The idea behind commit b9d8f5601bcf was that when a DW_CFA_advance_loc4 of zero is seen in eh_frame_relax_frag and eh_frame_convert_frag we want to remove the opcode entirely, not just convert to a nop. If the opcode was split over two frags then a size adjustment would need to be done to the first frag, not just the second as is correct for other cases with split frags. This would complicate the eh relaxation. It's easier to ensure the frag is not split. * ehopt.c (check_eh_frame): Don't allow DW_CFA_advance_loc4 to be placed in a different frag to the rs_cfa.
Diffstat (limited to 'gas')
-rw-r--r--gas/ehopt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gas/ehopt.c b/gas/ehopt.c
index feea61b..9d6606a 100644
--- a/gas/ehopt.c
+++ b/gas/ehopt.c
@@ -386,7 +386,7 @@ check_eh_frame (expressionS *exp, unsigned int *pnbytes)
{
/* This might be a DW_CFA_advance_loc4. Record the frag and the
position within the frag, so that we can change it later. */
- frag_grow (1);
+ frag_grow (1 + 4);
d->state = state_saw_loc4;
d->loc4_frag = frag_now;
d->loc4_fix = frag_now_fix ();