mirror of
https://github.com/frida/tinycc
synced 2024-12-24 22:16:49 +03:00
tccasm: Accept .balign
This commit is contained in:
parent
8e4da42384
commit
63e3ff7cca
3
tccasm.c
3
tccasm.c
@ -368,6 +368,7 @@ static void asm_parse_directive(TCCState *s1)
|
||||
sec = cur_text_section;
|
||||
switch(tok) {
|
||||
case TOK_ASMDIR_align:
|
||||
case TOK_ASMDIR_balign:
|
||||
case TOK_ASMDIR_p2align:
|
||||
case TOK_ASMDIR_skip:
|
||||
case TOK_ASMDIR_space:
|
||||
@ -381,7 +382,7 @@ static void asm_parse_directive(TCCState *s1)
|
||||
n = 1 << n;
|
||||
tok1 = TOK_ASMDIR_align;
|
||||
}
|
||||
if (tok1 == TOK_ASMDIR_align) {
|
||||
if (tok1 == TOK_ASMDIR_align || tok1 == TOK_ASMDIR_balign) {
|
||||
if (n < 0 || (n & (n-1)) != 0)
|
||||
tcc_error("alignment must be a positive power of two");
|
||||
offset = (ind + n - 1) & -n;
|
||||
|
1
tcctok.h
1
tcctok.h
@ -305,6 +305,7 @@
|
||||
DEF_ASMDIR(byte) /* must be first directive */
|
||||
DEF_ASMDIR(word)
|
||||
DEF_ASMDIR(align)
|
||||
DEF_ASMDIR(balign)
|
||||
DEF_ASMDIR(p2align)
|
||||
DEF_ASMDIR(skip)
|
||||
DEF_ASMDIR(space)
|
||||
|
@ -11,6 +11,7 @@
|
||||
.align 8
|
||||
.byte 1
|
||||
/* .align 16, 0x90 gas is too clever for us with 0x90 fill */
|
||||
.balign 4, 0x92
|
||||
.align 16, 0x91 /* 0x91 tests the non-clever behaviour */
|
||||
.skip 3
|
||||
.skip 15, 0x90
|
||||
|
Loading…
Reference in New Issue
Block a user