The attached patch is version 2 of the SHF_GNU_RETAIN patch that was previously discussed here: https://sourceware.org/pipermail/binutils/2020-September/113406.html The following changes have been made: - Removed the .retain directive - The assembler will create different input sections for sections with the same name but SHF_GNU_RETAIN set/unset (thanks to H.J. for that). This means the linker will be able to do a better job garbage collecting input sections, as the "retain" attribute applied to a symbol declaration in the source code will not cause other parts of the program that are not required, but are in the same section, to be unnecessarily retained. - Added GNU OSABI handling (also thanks to H.J.). I've successfully regtested the patch for the Binutils, GAS and LD testsuites for the following targets: aarch64-elf arc-elf arm-eabi arm-elf avr-elf bfin-elf cr16-elf cris-elf crx-elf csky-elf d10v-elf d30v-elf dlx-elf epiphany-elf fr30-elf frv-elf ft32-elf h8300-elf hppa-elf i386-elf ip2k-elf iq2000-elf lm32-elf m32c-elf m32r-elf m68hc11-elf m68hc12-elf m68k-elf mcore-elf mep-elf metag-elf microblaze-elf mips-elf moxie-elf msp430-elf mt-elf nios2-elf or1k-elf pj-elf ppc-elf pru-elf riscv-elf rl78-elf rx-elf s12z-elf score-elf sh-elf sparc-elf spu-elf tic6x-elf tilegx-elf tilepro-elf v850-elf visium-elf wasm32-elf xgate-elf xstormy16-elf xtensa-elf z80-elf. The new tests only run for the targets that use the GNU OSABI. From the above list, arm-elf, hppa-elf, msp430-elf, visium-elf do not use the GNU OSABI, so do not support SHF_GNU_RETAIN. Ok to apply? Thanks, Jozef