When I incorporate say a 2 bit left shift in my code, the resulting .o file contains the entire library of shift functions and multiply functions.
The FR2422 has a hardware multiplier so I am not sure why those are pulled in.
These are my args to the compiler and linker
CFLAGS = -mmcu=$(MCU) -std=gnu11 -g -Os -fno-ipa-icf-functions \
-Wall -Wunused -ffunction-sections -fdata-sections -minrt -fomit-frame-pointer -fwrapv -MMD \
$(INCLUDES) $(USER_DEFINES)
ASFLAGS = -mmcu=$(MCU) -x assembler-with-cpp -Wa,-gstabs
LDFLAGS = -nostartfiles -Wl,--gc-sections,-Map=$(TARGET).map,-umain,-L$(TRIQDIR)/$(ARCH)/linker
The total of functions incorporated into the .o total 0x3c4 (964 bytes).
I have a custom bootloader/fw upload system on the FR2422 leaving only 4.8k left for application code space.
I have to trim this waste down.
Note that the final code does not run like a "normal" MSP430 executable, in that there is no main() function.
The executable is not invoked by the reset interrupt, but rather a FW loader.
Given that this code does not follow the typical formula, is there a simple linker flag that can pare down these unused functions?
Or some way to exclude these extra symbols to mitigate this in the short term?
Thanks,
Dave