This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [RFC][AARCH64][GAS]Stop creating new frag for .inst directive
- From: Nicholas Clifton <nickc at redhat dot com>
- To: Renlin Li <renlin dot li at arm dot com>, binutils at sourceware dot org
- Cc: Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>
- Date: Wed, 25 Mar 2015 13:23:29 +0000
- Subject: Re: [RFC][AARCH64][GAS]Stop creating new frag for .inst directive
- Authentication-results: sourceware.org; auth=none
- References: <550FF68A dot 1000701 at arm dot com>
Hi Renlin,
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.
Certainly. It is there in order to ensure 4-byte alignment when
generating instructions. Consider this variation of your test case:
.inst 0x01020304
nop
.short 0x1234
.inst 0x12345678
With your patch applied this generates:
0: 01020304 .inst 0x01020304 ; undefined
4: d503201f nop
8: 1234 .short 0x1234
a: 12345678 and w24, w19, #0xfffff003
Whereas the current code produces:
0: 01020304 .inst 0x01020304 ; undefined
4: d503201f nop
8: 1234 .short 0x1234
a: 0000 .short 0x0000
c: 12345678 and w24, w19, #0xfffff003
Note the two bytes of padding at address 0xa, so that the second .inst
pseudo starts on a 4-byte aligned boundary.
Cheers
Nick
PS. Your test case was missing a 1: label, and the error message needed
to be in quotes...