This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC][AARCH64][GAS]Stop creating new frag for .inst directive

Hi all,

I don't see any particular reasons why we call frag_align_code here.
If it's indeed have reasons to do so, I would be quite happy if somebody could explain it to me.

By removing the code to create a new frag when handling .inst directive, it fixes the error while assembling the following short code:

	.inst	0x01020304
	.if  ((. - 1b) != 4)
		.error	blah

Previously, .inst will create a frag, and (. - 1b) expression is non-constant as they are in different frags and frag_offset_fixed_p returns false.
A error message will be produced: "Error: non-constant expression in".if"  statement"

After the change, the above code can be assembled without errors.

gas and aarch64-none-elf regression tests finish without new issues.
Okay to commit?

Renlin Li


2015-03-23  Renlin Li  <>

	* config/tc-aarch64.c (s_aarch64_inst): Stop creating new frag.
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index 9179fc6..9aee6d5 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -1860,8 +1860,6 @@ s_aarch64_inst (int ignored ATTRIBUTE_UNUSED)
-  if (!need_pass_2)
-    frag_align_code (2, 0);
 #ifdef OBJ_ELF
   mapping_state (MAP_INSN);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]