History

tccasm: Accept .balign

Michael Matz committed 10 years ago

Commit 63e3ff71 parent 8e4da423 files · +4 −1Browse files

Unified · Split

3 files
  1. tccasm.c +2 −1
  2. tcctok.h +1 −0
  3. tests/asmtest.S +1 −0
tccasm.c+2−1
@@ -368,6 +368,7 @@ static void asm_parse_directive(TCCState *s1) · 367 unmodified lines
368368 sec = cur_text_section;
369369 switch(tok) {
370370 case TOK_ASMDIR_align:
371+ case TOK_ASMDIR_balign:
371372 case TOK_ASMDIR_p2align:
372373 case TOK_ASMDIR_skip:
373374 case TOK_ASMDIR_space:
@@ -381,7 +382,7 @@ static void asm_parse_directive(TCCState *s1) · 7 unmodified lines
381382 n = 1 << n;
382383 tok1 = TOK_ASMDIR_align;
383384 }
384− if (tok1 == TOK_ASMDIR_align) {
385+ if (tok1 == TOK_ASMDIR_align || tok1 == TOK_ASMDIR_balign) {
385386 if (n < 0 || (n & (n-1)) != 0)
386387 tcc_error("alignment must be a positive power of two");
387388 offset = (ind + n - 1) & -n;
tcctok.h+1−0
@@ -305,6 +305,7 @@ · 304 unmodified lines
305305 DEF_ASMDIR(byte) /* must be first directive */
306306 DEF_ASMDIR(word)
307307 DEF_ASMDIR(align)
308+ DEF_ASMDIR(balign)
308309 DEF_ASMDIR(p2align)
309310 DEF_ASMDIR(skip)
310311 DEF_ASMDIR(space)
tests/asmtest.S+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 .align 8
1212 .byte 1
1313 /* .align 16, 0x90 gas is too clever for us with 0x90 fill */
14+ .balign 4, 0x92
1415 .align 16, 0x91 /* 0x91 tests the non-clever behaviour */
1516 .skip 3
1617 .skip 15, 0x90

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t