From 22f72c4868a1fd55d8d9b1cbabe6e01ed5a6f072 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 25 Jun 2019 10:12:58 +0930 Subject: PowerPC nops This patch corrects ppc rs_align_code handling to choose the alignment nops based on the machine in force at the alignment directive rather than the machine at the end of file. * config/tc-ppc.h (ppc_nop_select): Declare. (NOP_OPCODE): Define. * config/tc-ppc.c (ppc_elf_end, ppc_xcoff_end): Zero ppc_cpu. (ppc_nop_encoding_for_rs_align_code): New enum. (ppc_nop_select): New function. (ppc_handle_align): Don't use ppc_cpu here. Get nop type from frag. * testsuite/gas/ppc/groupnop.d, * testsuite/gas/ppc/groupnop.s: New test. * testsuite/gas/ppc/ppc.exp: Run it. --- gas/config/tc-ppc.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gas/config/tc-ppc.h') diff --git a/gas/config/tc-ppc.h b/gas/config/tc-ppc.h index 9de5c08..2b18ecd 100644 --- a/gas/config/tc-ppc.h +++ b/gas/config/tc-ppc.h @@ -82,6 +82,9 @@ extern const char *ppc_target_format (void); if ((FRAGP)->fr_type == rs_align_code) \ ppc_handle_align (FRAGP); +extern unsigned int ppc_nop_select (void); +#define NOP_OPCODE ppc_nop_select () + extern void ppc_handle_align (struct frag *); extern void ppc_frag_check (struct frag *); -- cgit v1.1