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 12:25] 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 4: | Line 11: | ||
* **--hash-style** - insert faster GNU hash table instead of SysV table. But looses compatiblity with older systems. [[http://stackoverflow.com/questions/11741816/only-one-hash-style-in-embedded-linux-why]] | * **--hash-style** - insert faster GNU hash table instead of SysV table. But looses compatiblity with older systems. [[http://stackoverflow.com/questions/11741816/only-one-hash-style-in-embedded-linux-why]] | ||
- | https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Using_ld_the_GNU_Linker/sections.html | + | ===== ld script ===== |
+ | |||
+ | [[https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Using_ld_the_GNU_Linker/assignments.html | ||
+ | [[https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Using_ld_the_GNU_Linker/sections.html]] | ||
+ | [[https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Using_ld_the_GNU_Linker/expressions.html]] | ||
+ | [[https://ftp.gnu.org/pub/old-gnu/Manuals/ld-2.9.1/html_node/ld_21.html]] | ||
+ | [[https://sourceware.org/binutils/docs-2.27/ld/Builtin-Functions.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 === |