Build libraries with -ffunction-sections and -fdata-sections to reduce library code size when --gc-section is used.