summaryrefslogtreecommitdiff
path: root/tcc-doc.texi
diff options
context:
space:
mode:
authorThomas Preud'homme <thomas.preudhomme@celest.fr>2011-06-17 00:21:43 +0200
committerThomas Preud'homme <thomas.preudhomme@celest.fr>2011-06-17 00:21:43 +0200
commitcfef8921f4b5dfa31fd2336484d86e24e3beb2f3 (patch)
tree73f4399c5558a3ec75a1ee7128315d7d32bcc1b1 /tcc-doc.texi
parent406bee985de85229e0ba54a9efa767c194262d0c (diff)
Imported Upstream version 0.9.26+git20110616.330d2ee
Diffstat (limited to 'tcc-doc.texi')
-rw-r--r--tcc-doc.texi42
1 files changed, 33 insertions, 9 deletions
diff --git a/tcc-doc.texi b/tcc-doc.texi
index 7cc61bb..2522e48 100644
--- a/tcc-doc.texi
+++ b/tcc-doc.texi
@@ -2,6 +2,10 @@
@c %**start of header
@setfilename tcc-doc.info
@settitle Tiny C Compiler Reference Documentation
+@dircategory Software development
+@direntry
+* TCC: (tcc-doc). The Tiny C Compiler.
+@end direntry
@c %**end of header
@include config.texi
@@ -156,8 +160,12 @@ General Options:
@item -v
Display current TCC version, increase verbosity.
+@item -print-search-dirs
+Print the name of the configured installation directory and a list
+of program and library directories tcc will search.
+
@item -c
-Generate an object file (@option{-o} option must also be given).
+Generate an object file.
@item -o outfile
Put object file, executable, or dll into output file @file{outfile}.
@@ -277,20 +285,21 @@ libxxx.a. The library is searched in the paths specified by the
@option{-L} option.
@item -shared
-Generate a shared library instead of an executable (@option{-o} option
-must also be given).
+Generate a shared library instead of an executable.
+
+@item -soname name
+set name for shared library to be used at runtime
@item -static
Generate a statically linked executable (default is a shared linked
-executable) (@option{-o} option must also be given).
+executable).
@item -rdynamic
Export global symbols to the dynamic linker. It is useful when a library
opened with @code{dlopen()} needs to access executable symbols.
@item -r
-Generate an object file combining all input files (@option{-o} option must
-also be given).
+Generate an object file combining all input files.
@item -Wl,-Ttext,address
Set the start of the .text section to @var{address}.
@@ -306,6 +315,9 @@ Binary image (only for executable output)
COFF output format (only for executable output for TMS320C67xx target)
@end table
+@item -Wl,-rpath=path
+Set custom library search path
+
@end table
Debugger options:
@@ -915,9 +927,13 @@ be the best solution.
#define VT_BTYPE 0x000f /* mask for basic type */
#define VT_UNSIGNED 0x0010 /* unsigned type */
#define VT_ARRAY 0x0020 /* array type (also has VT_PTR) */
+#define VT_VLA 0x20000 /* VLA type (also has VT_PTR and VT_ARRAY) */
#define VT_BITFIELD 0x0040 /* bitfield modifier */
+#define VT_CONSTANT 0x0800 /* const modifier */
+#define VT_VOLATILE 0x1000 /* volatile modifier */
+#define VT_SIGNED 0x2000 /* signed type */
-#define VT_STRUCT_SHIFT 16 /* structure/enum name shift (16 bits left) */
+#define VT_STRUCT_SHIFT 18 /* structure/enum name shift (14 bits left) */
@end example
When a reference to another type is needed (for pointers, functions and
@@ -928,7 +944,8 @@ The @code{VT_UNSIGNED} flag can be set for chars, shorts, ints and long
longs.
Arrays are considered as pointers @code{VT_PTR} with the flag
-@code{VT_ARRAY} set.
+@code{VT_ARRAY} set. Variable length arrays are considered as special
+arrays and have flag @code{VT_VLA} set instead of @code{VT_ARRAY}.
The @code{VT_BITFIELD} flag can be set for chars, shorts, ints and long
longs. If it is set, then the bitfield position is stored from bits
@@ -944,6 +961,10 @@ integer:
#define VT_EXTERN 0x00000080 /* extern definition */
#define VT_STATIC 0x00000100 /* static variable */
#define VT_TYPEDEF 0x00000200 /* typedef definition */
+#define VT_INLINE 0x00000400 /* inline definition */
+#define VT_IMPORT 0x00004000 /* win32: extern data imported from dll */
+#define VT_EXPORT 0x00008000 /* win32: data exported from dll */
+#define VT_WEAK 0x00010000 /* win32: data exported from dll */
@end example
@section Symbols
@@ -955,7 +976,10 @@ contains @code{Sym} structures.
an idenfier is also a token, so a string is never necessary to store
it). @code{Sym.t} gives the type of the symbol. @code{Sym.r} is usually
the register in which the corresponding variable is stored. @code{Sym.c} is
-usually a constant associated to the symbol.
+usually a constant associated to the symbol like its address for normal
+symbols, and the number of entries for symbols representing arrays.
+Variable length array types use @code{Sym.c} as a location on the stack
+which holds the runtime sizeof for the type.
Four main symbol stacks are defined: