build: use -ffunction-sections and --gc-sections