arm:toolchain
Table of Contents
General
GCC
Good options Command line options, Arm options
- -march=armv6-m
- -mtune=cortex-m0plus
- -mcpu=cortex-m0plus
- -mlong-calls
- -mthumb
- -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
ld -- Linker
Understand the linker script – Human readable guide to linker scripts
as -- Assembler
nm -- List symbols
objcopy -- Copy and/or transform object files
objdump -- Investigate object files
arm/toolchain.txt · Last modified: 2022/09/12 00:30 by 127.0.0.1
