Merge pull request #1076 from masahir0y/asm_macro

asm_macros: set the default assembly code alignment to 4 byte
This commit is contained in:
davidcunado-arm 2017-09-06 09:16:17 +01:00 committed by GitHub
commit e524d78f9f
1 changed files with 6 additions and 7 deletions

View File

@ -12,11 +12,12 @@
* to enable elimination of unused code during linking. It also adds * to enable elimination of unused code during linking. It also adds
* basic debug information to enable call stack printing most of the * basic debug information to enable call stack printing most of the
* time. The optional _align parameter can be used to force a * time. The optional _align parameter can be used to force a
* non-standard alignment (indicated in powers of 2). Do *not* try to * non-standard alignment (indicated in powers of 2). The default is
* use a raw .align directive. Since func switches to a new section, * _align=2 because both Aarch32 and Aarch64 instructions must be
* this would not have the desired effect. * word aligned. Do *not* try to use a raw .align directive. Since func
* switches to a new section, this would not have the desired effect.
*/ */
.macro func _name, _align=-1 .macro func _name, _align=2
/* /*
* Add Call Frame Information entry in the .debug_frame section for * Add Call Frame Information entry in the .debug_frame section for
* debugger consumption. This enables callstack printing in debuggers. * debugger consumption. This enables callstack printing in debuggers.
@ -36,9 +37,7 @@
* .debug_frame * .debug_frame
*/ */
.cfi_startproc .cfi_startproc
.if (\_align) != -1 .align \_align
.align \_align
.endif
\_name: \_name:
.endm .endm