| @@ -414,13 +414,6 @@ is the same as writing · 413 unmodified lines |
| 414 | 414 | @end itemize |
| 415 | 415 | |
| 416 | 416 | @section GNU C extensions |
| 417 | | −@cindex aligned attribute |
| 418 | | −@cindex packed attribute |
| 419 | | −@cindex section attribute |
| 420 | | −@cindex unused attribute |
| 421 | | −@cindex cdecl attribute |
| 422 | | −@cindex stdcall attribute |
| 423 | | −@cindex regparm attribute |
| 424 | 417 | |
| 425 | 418 | TCC implements some GNU C extensions: |
| 426 | 419 | |
| @@ -454,13 +447,22 @@ instead of · 27 unmodified lines |
| 454 | 447 | @} |
| 455 | 448 | @end example |
| 456 | 449 | |
| 450 | +@cindex aligned attribute |
| 451 | +@cindex packed attribute |
| 452 | +@cindex section attribute |
| 453 | +@cindex unused attribute |
| 454 | +@cindex cdecl attribute |
| 455 | +@cindex stdcall attribute |
| 456 | +@cindex regparm attribute |
| 457 | +@cindex dllexport attribute |
| 458 | + |
| 457 | 459 | @item The keyword @code{__attribute__} is handled to specify variable or |
| 458 | 460 | function attributes. The following attributes are supported: |
| 459 | 461 | @itemize |
| 460 | 462 | |
| 461 | 463 | @item @code{aligned(n)}: align a variable or a structure field to n bytes |
| 462 | 464 | (must be a power of two). |
| 463 | | − |
| 465 | + |
| 464 | 466 | @item @code{packed}: force alignment of a variable or a structure field to |
| 465 | 467 | 1. |
| 466 | 468 | |
| @@ -478,6 +480,8 @@ section. · 11 unmodified lines |
| 478 | 480 | between 1 and 3. The first @var{n} function parameters are respectively put in |
| 479 | 481 | registers @code{%eax}, @code{%edx} and @code{%ecx}. |
| 480 | 482 | |
| 483 | + @item @code{dllexport}: export function from dll/executable (win32 only) |
| 484 | + |
| 481 | 485 | @end itemize |
| 482 | 486 | |
| 483 | 487 | Here are some examples: |
| @@ -733,10 +737,13 @@ TCC for Windows supports the native Win32 executable file format (PE-i386). It · 249 unmodified lines |
| 733 | 737 | generates both EXE and DLL files. DLL symbols can be imported thru DEF files |
| 734 | 738 | generated with the @code{tiny_impdef} tool. |
| 735 | 739 | |
| 736 | | −Currently TCC for Windows cannot generate nor read PE object files, so ELF |
| 737 | | −object files are used for that purpose. It can be a problem if |
| 738 | | −interoperability with MSVC is needed. Moreover, no leading underscore is |
| 739 | | −currently generated in the ELF symbols. |
| 740 | +On the object file level, currently TCC supports only the ELF format, not COFF |
| 741 | +as used by MINGW and MSVC. It is not possible to exchange object files or |
| 742 | +libraries between TCC and these compilers. However libraries for TCC from objects |
| 743 | +by TCC can be made using the @code{tiny_libmaker} tool or MINGW's @code{ar}. |
| 744 | + |
| 745 | +No leading underscore is generated in the ELF symbols. Only functions (no |
| 746 | +data) can be exported. Bounds checking (@option{-b}) is not supported currently. |
| 740 | 747 | |
| 741 | 748 | @section GNU Linker Scripts |
| 742 | 749 | @cindex scripts, linker |