| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| arm:toolchain [2020/12/20 08:48] – utedass | arm:toolchain [2022/09/12 00:30] (current) – external edit 127.0.0.1 |
|---|
| [[https://gcc.gnu.org/onlinedocs/gcc-9.3.0/gcc/|Online documentation]] | [[https://gcc.gnu.org/onlinedocs/gcc-9.3.0/gcc/|Online documentation]] |
| |
| Good options [[https://gcc.gnu.org/onlinedocs/gcc-9.3.0/gcc/ARM-Options.html#ARM-Options|Arm options]] | Good options [[https://gcc.gnu.org/onlinedocs/gcc-9.3.0/gcc/Invoking-GCC.html#Invoking-GCC|Command line options]], [[https://gcc.gnu.org/onlinedocs/gcc-9.3.0/gcc/ARM-Options.html#ARM-Options|Arm options]] |
| * -march=armv6-m | * -march=armv6-m |
| * -mtune=cortex-m0plus | * -mtune=cortex-m0plus |
| * -mthumb | * -mthumb |
| * -mno-unaligned-access | * -mno-unaligned-access |
| | * To find unused functions: ''%%-ffunction-sections -fdata-sections -Wl,--gc-sections,--print-gc-sections%%'' |
| |
| | Passing linker options through gcc with -Wl,\\ |
| | ''gcc -Wl,-Tlinkerscript.ld'' |
| | |
| | Passing assembler options through gcc with -Wa,\\ |
| | ''gcc -Wa,-ag'' |
| | |
| | ^ Argument ^ Description ^ Example ^ |
| | | ''-c'' | Stop after assembly | ''# gcc main.c -c -o main.o '' | |
| | | ''-S'' | Stop after compile before assembly | ''# gcc main.c -S -o main.s '' | |
| | | ''-E'' | Stop after preprocessor | ''# gcc main.c -E -o main.pp '' | |
| | | ''-M'' | Generate file suitable for Make | ''# gcc main.c -M -o main.mk '' | |
| |
| ====== Binutils ====== | ====== Binutils ====== |
| [[https://sourceware.org/binutils/docs-2.34/binutils/index.html|Online documentation]] | [[https://sourceware.org/binutils/docs-2.34/binutils/index.html|Online documentation]] |
| |
| ===== ld ===== | ===== ld -- Linker ===== |
| [[https://sourceware.org/binutils/docs-2.34/ld/index.html|Online documentation]] | [[https://sourceware.org/binutils/docs-2.34/ld/index.html|Online documentation]] |
| |
| ===== as ===== | [[https://www.silabs.com/community/mcu/32-bit/knowledge-base.entry.html/2018/12/06/understand_the_gnul-PTm6|Understand the linker script]] -- Human readable guide to linker scripts |
| | ===== as -- Assembler ===== |
| [[https://sourceware.org/binutils/docs-2.34/as/index.html|Online documentation]] | [[https://sourceware.org/binutils/docs-2.34/as/index.html|Online documentation]] |
| |
| * -march=armv6-m | * -march=armv6-m |
| * -mthumb | * -mthumb |
| ===== nm ===== | ===== nm -- List symbols ===== |
| [[https://sourceware.org/binutils/docs-2.34/binutils/nm.html#nm|Online documentation]] | [[https://sourceware.org/binutils/docs-2.34/binutils/nm.html#nm|Online documentation]] |
| |
| ===== objcopy ===== | ===== objcopy -- Copy and/or transform object files ===== |
| [[https://sourceware.org/binutils/docs-2.34/binutils/objcopy.html#objcopy|Online documentation]] | [[https://sourceware.org/binutils/docs-2.34/binutils/objcopy.html#objcopy|Online documentation]] |
| |
| ===== objdump ===== | ===== objdump -- Investigate object files ===== |
| [[https://sourceware.org/binutils/docs-2.34/binutils/objdump.html#objdump|Onlinen documentation]] | [[https://sourceware.org/binutils/docs-2.34/binutils/objdump.html#objdump|Online documentation]] |
| |
| |
| |
| |