+2020-12-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/27091
+ * elflink.c (elf_link_input_bfd): Copy elf_gnu_osabi_retain
+ from input only for relocatable link.
+
2020-12-18 Alan Modra <amodra@gmail.com>
* elf32-microblaze.c (dbg): Delete unused variable.
|| bed->elf_osabi == ELFOSABI_GNU
|| bed->elf_osabi == ELFOSABI_FREEBSD)
elf_tdata (output_bfd)->has_gnu_osabi
- |= elf_tdata (input_bfd)->has_gnu_osabi;
+ |= (elf_tdata (input_bfd)->has_gnu_osabi
+ & (bfd_link_relocatable (flinfo->info)
+ ? -1 : ~elf_gnu_osabi_retain));
/* Read the local symbols. */
isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
+2020-12-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/27091
+ * testsuite/ld-elf/retain7.s: New file.
+ * testsuite/ld-elf/retain7a.d: Likewise.
+ * testsuite/ld-elf/retain7b.d: Likewise.
+
2020-12-16 Howard Chu <hyc@symas.com>
H.J. Lu <hongjiu.lu@intel.com>
--- /dev/null
+ .type _start,"function"
+ .section .text,"axR",%progbits
+ .global _start
+_start:
+ .nop
--- /dev/null
+#name: SHF_GNU_RETAIN 7a
+#source: retain7.s
+#ld: -e _start --gc-sections
+#notarget: ![supports_gnu_osabi] ![check_gc_sections_available]
+#readelf: -h
+
+#failif
+ELF Header:
+#...
+ OS/ABI: UNIX - GNU
+#pass
--- /dev/null
+#name: SHF_GNU_RETAIN 7a
+#source: retain7.s
+#ld: -r
+#notarget: ![supports_gnu_osabi] ![check_gc_sections_available]
+#readelf: -h
+
+ELF Header:
+#...
+ OS/ABI: UNIX - GNU
+#pass