User Tools

Site Tools


arm:toolchain

General

GCC

Online documentation

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

Online documentation

Understand the linker script – Human readable guide to linker scripts

as -- Assembler

Online documentation

Good options Arm-options

  • -mcpu=cortex-m0plus
  • -march=armv6-m
  • -mthumb

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

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki