7.7.2.1 Optimization

  • -mrelax

    Relax branches. Linker relaxing is enabled in the linker by passing the ‘—relax’ option to the linker. Using GCC as a frontend for the linker, this option is automatically passed to the linker when using ‘-O2’ or ‘-O3’ or explicitly using the ‘-mrelax’ option. When using this option, GCC outputs pseudo instructions like lda.w, call, etc. The linker can then, if the input file is tagged as relaxable, convert a pseudo instruction into the best possible instruction with regards to the final symbol address.