default:
/* Possibly an attributes section. */
- if (hdr->sh_type == SHT_GNU_ATTRIBUTES
- || hdr->sh_type == bed->obj_attrs_section_type)
+ if (get_elf_backend_data (abfd)->target_os != is_solaris
+ /* PR 33153: Solaris defines SHT_SUNW_cap which collides with SHT_GNU_ATTRIBUTES. */
+ && (hdr->sh_type == SHT_GNU_ATTRIBUTES
+ || hdr->sh_type == bed->obj_attrs_section_type))
{
if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex))
goto fail;
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-sparc-sol2"
-#undef elf32_bed
+#undef ELF_TARGET_OS
+#define ELF_TARGET_OS is_solaris
+
+#undef elf32_bed
#define elf32_bed elf32_sparc_sol2_bed
/* The 32-bit static TLS arena size is rounded to the nearest 8-byte
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf64-sparc-sol2"
+#undef ELF_TARGET_OS
+#define ELF_TARGET_OS is_solaris
+
/* Restore default: we cannot use ELFOSABI_SOLARIS, otherwise ELFOSABI_NONE
objects won't be recognized. */
#undef ELF_OSABI
-#undef elf64_bed
+#undef elf64_bed
#define elf64_bed elf64_sparc_sol2_bed
/* The 64-bit static TLS arena size is rounded to the nearest 16-byte
boundary. */
-#undef elf_backend_static_tls_alignment
+#undef elf_backend_static_tls_alignment
#define elf_backend_static_tls_alignment 16
#undef elf_backend_strtab_flags