aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-07-24 09:43:30 +0930
committerAlan Modra <amodra@gmail.com>2019-07-24 16:12:02 +0930
commitcc364be6ff45669150077387f22723de33d5f1b1 (patch)
tree927f4388426d20c907ba4ada7efb51b5cf27ea29 /gas
parentc5e20471be97e2dcd3498ac284487e2546715f66 (diff)
downloadgdb-cc364be6ff45669150077387f22723de33d5f1b1.zip
gdb-cc364be6ff45669150077387f22723de33d5f1b1.tar.gz
gdb-cc364be6ff45669150077387f22723de33d5f1b1.tar.bz2
Complain about mbind, ifunc, and unique in final_write
It's not as good as complaining in gas/config/obj-elf.c since you lose any reference to the source file. bfd/ * elf-bfd.h (struct elf_backend_data): Return bfd_boolean from elf_backend_final_write_processing, don't pass linker arg. (_bfd_elf_final_write_processing): Update prototype. * elf.c (_bfd_elf_write_object_contents): Adjust call. (_bfd_elf_final_write_processing): Return error on incompatible OSABI and has_gnu_osabi. Remove linker arg. * elf-nacl.h (nacl_final_write_processing): Update prototype. * elf-vxworks.h (elf_vxworks_final_write_processing): Likewise. * elfxx-mips.h (_bfd_mips_final_write_processing): Likewise. (_bfd_mips_elf_final_write_processing): Likewise. * elf-hppa.h (elf_hppa_final_write_processing): Return status and remove linker arg. * elf-m10300.c (_bfd_mn10300_elf_final_write_processing): Likewise. * elf-nacl.c (nacl_final_write_processing): Likewise. * elf-vxworks.c (elf_vxworks_final_write_processing): Likewise. * elf32-arc.c (arc_elf_final_write_processing): Likewise. * elf32-arm.c (arm_final_write_processing): Likewise. (elf32_arm_final_write_processing): Likewise. (elf32_arm_nacl_final_write_processing): Likewise. (elf32_arm_vxworks_final_write_processing): Likewise. * elf32-avr.c (bfd_elf_avr_final_write_processing): Likewise. * elf32-bfin.c (elf32_bfin_final_write_processing): Likewise. * elf32-cr16.c (_bfd_cr16_elf_final_write_processing): Likewise. * elf32-cris.c (cris_elf_final_write_processing): Likewise. * elf32-h8300.c (elf32_h8_final_write_processing): Likewise. * elf32-lm32.c (lm32_elf_final_write_processing): Likewise. * elf32-m32r.c (m32r_elf_final_write_processing): Likewise. * elf32-m68k.c (elf_m68k_final_write_processing): Likewise. * elf32-mips.c (mips_vxworks_final_write_processing): Likewise. * elf32-msp430.c (bfd_elf_msp430_final_write_processing): Likewise. * elf32-nds32.c (nds32_elf_final_write_processing): Likewise. * elf32-or1k.c (or1k_elf_final_write_processing): Likewise. * elf32-pj.c (pj_elf_final_write_processing): Likewise. * elf32-ppc.c (ppc_final_write_processing): Likewise. (ppc_elf_final_write_processing): Likewise. (ppc_elf_vxworks_final_write_processing): Likewise. * elf32-sparc.c (sparc_final_write_processing): Likewise. (elf32_sparc_final_write_processing): Likewise. (elf32_sparc_vxworks_final_write_processing): Likewise. * elf32-v850.c (v850_elf_final_write_processing): Likewise. * elf32-xc16x.c (elf32_xc16x_final_write_processing): Likewise. * elf32-xtensa.c (elf_xtensa_final_write_processing): Likewise. * elf64-ia64-vms.c (elf64_vms_final_write_processing): Likewise. * elfnn-ia64.c (elfNN_ia64_final_write_processing): Likewise. * elfxx-mips.c (_bfd_mips_final_write_processing): Likewise. (_bfd_mips_elf_final_write_processing): Likewise. gas/ * config/obj-elf.c (obj_elf_section, obj_elf_type): Set has_gnu_osabi. * testsuite/gas/elf/section12a.d: Update xfails. * testsuite/gas/elf/section12b.d: Likewise.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/obj-elf.c3
-rw-r--r--gas/testsuite/gas/elf/section12a.d2
-rw-r--r--gas/testsuite/gas/elf/section12b.d2
4 files changed, 11 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index fcde8b0..c08ccbc 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,11 @@
2019-07-24 Alan Modra <amodra@gmail.com>
+ * config/obj-elf.c (obj_elf_section, obj_elf_type): Set has_gnu_osabi.
+ * testsuite/gas/elf/section12a.d: Update xfails.
+ * testsuite/gas/elf/section12b.d: Likewise.
+
+2019-07-24 Alan Modra <amodra@gmail.com>
+
* testsuite/gas/elf/section12a.d: xfail visium and cloudabi.
* testsuite/gas/elf/section12b.d: Likewise.
* testsuite/gas/elf/section13.d: Likewise.
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index fd2c943..bdf3da8 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -1242,6 +1242,7 @@ done:
&& bed->elf_osabi != ELFOSABI_FREEBSD)
as_bad (_("GNU_MBIND section is supported only by GNU "
"and FreeBSD targets"));
+ elf_tdata (stdoutput)->has_gnu_osabi |= elf_gnu_osabi_mbind;
}
elf_section_flags (now_seg) |= gnu_attr;
@@ -2060,6 +2061,7 @@ obj_elf_type (int ignore ATTRIBUTE_UNUSED)
&& bed->elf_osabi != ELFOSABI_FREEBSD)
as_bad (_("symbol type \"%s\" is supported only by GNU "
"and FreeBSD targets"), type_name);
+ elf_tdata (stdoutput)->has_gnu_osabi |= elf_gnu_osabi_ifunc;
type = BSF_FUNCTION | BSF_GNU_INDIRECT_FUNCTION;
}
else if (strcmp (type_name, "gnu_unique_object") == 0)
@@ -2072,6 +2074,7 @@ obj_elf_type (int ignore ATTRIBUTE_UNUSED)
else if (bed->elf_osabi != ELFOSABI_GNU)
as_bad (_("symbol type \"%s\" is supported only by GNU targets"),
type_name);
+ elf_tdata (stdoutput)->has_gnu_osabi |= elf_gnu_osabi_unique;
type = BSF_OBJECT | BSF_GNU_UNIQUE;
}
#ifdef md_elf_symbol_type
diff --git a/gas/testsuite/gas/elf/section12a.d b/gas/testsuite/gas/elf/section12a.d
index 5b764af..84c032f 100644
--- a/gas/testsuite/gas/elf/section12a.d
+++ b/gas/testsuite/gas/elf/section12a.d
@@ -3,7 +3,7 @@
#readelf: -Sg --wide
#name: mbind sections
# A number of targets do not support SHF_GNU_MBIND
-#xfail: msp430-*-* visium-*-*
+#xfail: arm*-*-netbsdelf* arm*-*-nto* msp430-*-* visium-*-*
#xfail: *-*-hpux* *-*-cloudabi
#...
diff --git a/gas/testsuite/gas/elf/section12b.d b/gas/testsuite/gas/elf/section12b.d
index a8406c3..847f9a8 100644
--- a/gas/testsuite/gas/elf/section12b.d
+++ b/gas/testsuite/gas/elf/section12b.d
@@ -6,7 +6,7 @@
# expected below.
#xfail: rx-*-*
# A number of targets do not support SHF_GNU_MBIND
-#xfail: msp430-*-* visium-*-*
+#xfail: arm*-*-netbsdelf* arm*-*-nto* msp430-*-* visium-*-*
#xfail: *-*-hpux* *-*-cloudabi
#...