From 1daf786ba3db83455d4d2a9661d0715f433f8a3f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Cl=C3=A9ment=20Chigot?= Date: Tue, 22 Jun 2021 10:15:06 +0200 Subject: [PATCH] gas: update csect alignment for PPC prefixed instructions on XCOFF Power10 prefixed instructions must not cross 64-byte boundaries. This is already handled. However, on XCOFF, the csect must be updated to match the new alignment. * config/tc-ppc.c (md_assemble): Update ppc_current_csect alignment when finding prefixed instructions. --- gas/ChangeLog | 5 +++++ gas/config/tc-ppc.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/gas/ChangeLog b/gas/ChangeLog index 927e443d891..1b318559212 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2021-06-24 Clément Chigot + + * config/tc-ppc.c (md_assemble): Update ppc_current_csect + alignment when finding prefixed instructions. + 2021-06-22 Alan Modra * config/tc-pj.c (md_apply_fix): Apply PJ_CODE_REL32 relocs. diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index ad85d3863b0..80818e9c943 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -4039,6 +4039,11 @@ md_assemble (char *str) boundaries. */ frag_align_code (6, 4); record_alignment (now_seg, 6); +#ifdef OBJ_XCOFF + /* Update alignment of the containing csect. */ + if (symbol_get_tc (ppc_current_csect)->align < 6) + symbol_get_tc (ppc_current_csect)->align = 6; +#endif /* Update "dot" in any expressions used by this instruction, and a label attached to the instruction. By "attached" we mean -- 2.30.2