meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
gcc [2017/06/30 14:26] niziak |
gcc [2024/04/26 14:39] (current) niziak |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== GCC ====== | ||
+ | |||
+ | ===== preprocesor files ===== | ||
+ | |||
+ | ''-save-temps=obj'' | ||
+ | |||
+ | |||
===== Linker ===== | ===== Linker ===== | ||
* **--as-needed** - do not load symbols from libraries specified in command line when they are not needed. This option couses many unresolved symbol errors when order of libraries specified in command line is not correct. [[http://savannah.gnu.org/forum/forum.php?forum_id=5655]] | * **--as-needed** - do not load symbols from libraries specified in command line when they are not needed. This option couses many unresolved symbol errors when order of libraries specified in command line is not correct. [[http://savannah.gnu.org/forum/forum.php?forum_id=5655]] | ||
Line 13: | Line 20: | ||
[[http://www.math.utah.edu/docs/info/ld_3.html]] | [[http://www.math.utah.edu/docs/info/ld_3.html]] | ||
+ | |||
+ | === Place const variables === | ||
+ | <file> | ||
+ | .crc 0x7FFE : { KEEP(*(.crc)) } | ||
+ | </file> | ||
+ | or | ||
+ | <file> | ||
+ | .crc (ORIGIN(rom)+LENGTH(rom)-2): | ||
+ | { | ||
+ | _crcstart = .; | ||
+ | KEEP(*(.crc)) | ||
+ | _crcend = .; | ||
+ | } >rom | ||
+ | </file> | ||
+ | |||
+ | <code c> | ||
+ | const uint32_t crcValue __attribute__ ((section (".crc"))) = 0xDEADBEEF; | ||
+ | </code> | ||
=== Place some symbols === | === Place some symbols === |