[PATCH][GAS][AARCH64]Record instruction alignment for .inst directive.

Renlin Li renlin.li@arm.com
Tue Apr 28 15:45:00 GMT 2015


Hi all,

This is a simple patch that moves the alignment recording code in 
mapping_state early before it returns. So that, all code related 
alignment will be recorded.

For example, one case missed is for .inst directive. When .inst is 
processed, it will call frag_align_code first, which calls 
mapping_state_2 and set current state to MAP_INSN. Later when 
mapping_state is called, it will return early, because there is no state 
change.

For example,
.text
.short 0xffff
.inst 0x12345678   --> this will set MAP_INSN
ret                --> while processing this insn, mapping_state will 
early return as there is no state change.

The alignment of .text section will not be recorded.

Okay to commit?

Regards,
Renlin Li

gas/ChangeLog:

2015-04-28  Renlin Li  <renlin.li@arm.com>

     * config/tc-aarch64.c (mapping_state): Recording alignment before exit.

gas/testsuite/ChangeLog

2015-04-28  Renlin Li  <renlin.li@arm.com>

     * gas/aarch64/codealign_1.s: New.
     * gas/aarch64/codealign_1.d: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 5.diff
Type: text/x-patch
Size: 1865 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150428/9dd47284/attachment.bin>


More information about the Binutils mailing list