This commit is contained in:
bellard 2004-11-08 21:19:47 +00:00
parent 0b8d7f44b4
commit 6ab1140623
1 changed files with 48 additions and 26 deletions

View File

@ -403,6 +403,13 @@ is the same as writing
@end itemize
@section GNU C extensions
@cindex aligned attribute
@cindex packed attribute
@cindex section attribute
@cindex unused attribute
@cindex cdecl attribute
@cindex stdcall attribute
@cindex regparm attribute
TCC implements some GNU C extensions:
@ -439,18 +446,27 @@ instead of
@item The keyword @code{__attribute__} is handled to specify variable or
function attributes. The following attributes are supported:
@itemize
@item @code{aligned(n)}: align data to n bytes (must be a power of two).
@item @code{section(name)}: generate function or data in assembly
section name (name is a string containing the section name) instead
of the default section.
@item @code{aligned(n)}: align a variable or a structure field to n bytes
(must be a power of two).
@item @code{packed}: force alignment of a variable or a structure field to
1.
@item @code{section(name)}: generate function or data in assembly section
name (name is a string containing the section name) instead of the default
section.
@item @code{unused}: specify that the variable or the function is unused.
@item @code{cdecl}: use standard C calling convention.
@item @code{cdecl}: use standard C calling convention (default).
@item @code{stdcall}: use Pascal-like calling convention.
@item @code{regparm(n)}: use fast i386 calling convention. @var{n} must be
between 1 and 3. The first @var{n} function parameters are respectively put in
registers @code{%eax}, @code{%edx} and @code{%ecx}.
@end itemize
Here are some examples:
@ -615,21 +631,27 @@ They can be defined several times in the same source. Use 'b'
@section Directives
@cindex assembler directives
@cindex directives, assembler
@cindex .align
@cindex .skip
@cindex .space
@cindex .byte
@cindex .word
@cindex .short
@cindex .int
@cindex .long
@cindex .string
@cindex .globl
@cindex .global
@cindex .section
@cindex .text
@cindex .data
@cindex .bss
@cindex align directive
@cindex skip directive
@cindex space directive
@cindex byte directive
@cindex word directive
@cindex short directive
@cindex int directive
@cindex long directive
@cindex quad directive
@cindex globl directive
@cindex global directive
@cindex section directive
@cindex text directive
@cindex data directive
@cindex bss directive
@cindex fill directive
@cindex org directive
@cindex previous directive
@cindex string directive
@cindex asciz directive
@cindex ascii directive
All directives are preceeded by a '.'. The following directives are
supported:
@ -638,12 +660,12 @@ supported:
@item .align n[,value]
@item .skip n[,value]
@item .space n[,value]
@item .byte value1[,value2...]
@item .word value1[,value2...]
@item .short value1[,value2...]
@item .int value1[,value2...]
@item .long value1[,value2...]
@item .string string
@item .byte value1[,...]
@item .word value1[,...]
@item .short value1[,...]
@item .int value1[,...]
@item .long value1[,...]
@item .quad immediate_value1[,...]
@item .globl symbol
@item .global symbol
@item .section section