--- /dev/null
+#!/bin/sh -e
+## 209-hjl-binutils-error.dpatch
+##
+## DP: Description: Avoid unnecessary linker messages when running "make check"
+## DP: Author: H.J. Lu <hongjiu.lu@intel.com>
+## DP: Upstream status: hjl 2.17.50.0.18
+## DP: Original patch: binutils-error-3.patch
+
+if [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+ -patch) patch $patch_opts -p1 < $0;;
+ -unpatch) patch $patch_opts -p1 -R < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1;;
+esac
+
+exit 0
+
+bfd/
+
+2007-05-09 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/4409
+ * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Add an argument for
+ error ignored.
+ * elf-m10200.c (mn10200_elf_relocate_section): Updated.
+ * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
+ * elf32-arm.c (elf32_arm_relocate_section): Likewise.
+ * elf32-avr.c (elf32_avr_relocate_section): Likewise.
+ * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
+ (bfin_relocate_section): Likewise.
+ * elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise.
+ * elf32-cris.c (cris_elf_relocate_section): Likewise.
+ * elf32-crx.c (elf32_crx_relocate_section): Likewise.
+ * elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
+ * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
+ * elf32-frv.c (elf32_frv_relocate_section): Likewise.
+ * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
+ * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
+ * elf32-i386.c (elf_i386_relocate_section): Likewise.
+ * elf32-i860.c (elf32_i860_relocate_section): Likewise.
+ * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
+ * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
+ * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
+ * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
+ * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
+ * elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
+ * elf32-mt.c (mt_elf_relocate_section): Likewise.
+ * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
+ * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
+ * elf32-s390.c (elf_s390_relocate_section): Likewise.
+ * elf32-spu.c (spu_elf_relocate_section): Likewise.
+ * elf32-v850.c (v850_elf_relocate_section): Likewise.
+ * elf32-vax.c (elf_vax_relocate_section): Likewise.
+ * elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise.
+ * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
+ * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
+ * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
+ * elf64-mmix.c (mmix_elf_relocate_section): Likewise.
+ * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
+ * elf64-s390.c (elf_s390_relocate_section): Likewise.
+ * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
+ * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
+
+ * elfxx-ia64.c (elfNN_ia64_relocate_section): Skip if error
+ from RELOC_FOR_GLOBAL_SYMBOL in executable is ignored.
+
+ld/testsuite/
+
+2007-05-09 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/4409
+ * ld-ia64/error1.d: New file.
+ * ld-ia64/error1.s: Likewise.
+
+@DPATCH@
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf-bfd.h binutils-2.18~cvs20070812/bfd/elf-bfd.h
+--- binutils-2.18~cvs20070812~/bfd/elf-bfd.h 2007-08-12 13:36:50.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf-bfd.h 2007-08-12 13:37:05.000000000 +0200
+@@ -2064,7 +2064,7 @@
+ #define RELOC_FOR_GLOBAL_SYMBOL(info, input_bfd, input_section, rel, \
+ r_symndx, symtab_hdr, sym_hashes, \
+ h, sec, relocation, \
+- unresolved_reloc, warned) \
++ unresolved_reloc, warned, ignored) \
+ do \
+ { \
+ /* It seems this can happen with erroneous or unsupported \
+@@ -2079,6 +2079,7 @@
+ h = (struct elf_link_hash_entry *) h->root.u.i.link; \
+ \
+ warned = FALSE; \
++ ignored = FALSE; \
+ unresolved_reloc = FALSE; \
+ relocation = 0; \
+ if (h->root.type == bfd_link_hash_defined \
+@@ -2101,7 +2102,7 @@
+ ; \
+ else if (info->unresolved_syms_in_objects == RM_IGNORE \
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) \
+- ; \
++ ignored = TRUE; \
+ else if (!info->relocatable) \
+ { \
+ bfd_boolean err; \
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf-m10200.c binutils-2.18~cvs20070812/bfd/elf-m10200.c
+--- binutils-2.18~cvs20070812~/bfd/elf-m10200.c 2007-07-03 16:26:40.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf-m10200.c 2007-08-12 13:37:05.000000000 +0200
+@@ -392,12 +392,12 @@
+ }
+ else
+ {
+- bfd_boolean unresolved_reloc, warned;
++ bfd_boolean unresolved_reloc, warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ }
+
+ if (sec != NULL && elf_discarded_section (sec))
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf-m10300.c binutils-2.18~cvs20070812/bfd/elf-m10300.c
+--- binutils-2.18~cvs20070812~/bfd/elf-m10300.c 2007-07-03 16:26:40.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf-m10300.c 2007-08-12 13:37:05.000000000 +0200
+@@ -1417,13 +1417,13 @@
+ else
+ {
+ bfd_boolean unresolved_reloc;
+- bfd_boolean warned;
++ bfd_boolean warned, ignored;
+ struct elf_link_hash_entry *hh;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ hh, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+
+ h = (struct elf32_mn10300_link_hash_entry *) hh;
+
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-arm.c binutils-2.18~cvs20070812/bfd/elf32-arm.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-arm.c 2007-08-06 20:47:21.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-arm.c 2007-08-12 13:37:05.000000000 +0200
+@@ -6398,12 +6398,12 @@
+ }
+ else
+ {
+- bfd_boolean warned;
++ bfd_boolean warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+
+ sym_type = h->type;
+ }
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-avr.c binutils-2.18~cvs20070812/bfd/elf32-avr.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-avr.c 2007-07-03 16:26:40.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-avr.c 2007-08-12 13:37:05.000000000 +0200
+@@ -1204,12 +1204,12 @@
+ }
+ else
+ {
+- bfd_boolean unresolved_reloc, warned;
++ bfd_boolean unresolved_reloc, warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+
+ name = h->root.root.string;
+ }
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-bfin.c binutils-2.18~cvs20070812/bfd/elf32-bfin.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-bfin.c 2007-07-03 16:26:40.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-bfin.c 2007-08-12 13:37:05.000000000 +0200
+@@ -2197,13 +2197,13 @@
+ }
+ else
+ {
+- bfd_boolean warned;
++ bfd_boolean warned, ignored;
+ bfd_boolean unresolved_reloc;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ osec = sec;
+ }
+
+@@ -2895,12 +2895,12 @@
+ }
+ else
+ {
+- bfd_boolean warned;
++ bfd_boolean warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ }
+
+ if (sec != NULL && elf_discarded_section (sec))
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-cr16.c binutils-2.18~cvs20070812/bfd/elf32-cr16.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-cr16.c 2007-07-03 16:26:40.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-cr16.c 2007-08-12 13:37:05.000000000 +0200
+@@ -837,12 +837,12 @@
+ }
+ else
+ {
+- bfd_boolean unresolved_reloc, warned;
++ bfd_boolean unresolved_reloc, warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ }
+
+ r = cr16_elf_final_link_relocate (howto, input_bfd, output_bfd,
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-cr16c.c binutils-2.18~cvs20070812/bfd/elf32-cr16c.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-cr16c.c 2007-07-03 16:26:40.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-cr16c.c 2007-08-12 13:37:05.000000000 +0200
+@@ -718,12 +718,12 @@
+ }
+ else
+ {
+- bfd_boolean unresolved_reloc, warned;
++ bfd_boolean unresolved_reloc, warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ }
+
+ if (sec != NULL && elf_discarded_section (sec))
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-cris.c binutils-2.18~cvs20070812/bfd/elf32-cris.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-cris.c 2007-07-03 16:26:40.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-cris.c 2007-08-12 13:37:05.000000000 +0200
+@@ -996,13 +996,13 @@
+ }
+ else
+ {
+- bfd_boolean warned;
++ bfd_boolean warned, ignored;
+ bfd_boolean unresolved_reloc;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+
+ if (unresolved_reloc
+ /* Perhaps we should detect the cases that
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-crx.c binutils-2.18~cvs20070812/bfd/elf32-crx.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-crx.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-crx.c 2007-08-12 13:37:05.000000000 +0200
+@@ -869,12 +869,12 @@
+ }
+ else
+ {
+- bfd_boolean unresolved_reloc, warned;
++ bfd_boolean unresolved_reloc, warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ }
+
+ if (sec != NULL && elf_discarded_section (sec))
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-d10v.c binutils-2.18~cvs20070812/bfd/elf32-d10v.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-d10v.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-d10v.c 2007-08-12 13:37:05.000000000 +0200
+@@ -456,12 +456,12 @@
+ }
+ else
+ {
+- bfd_boolean unresolved_reloc, warned;
++ bfd_boolean unresolved_reloc, warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ }
+
+ if (sec != NULL && elf_discarded_section (sec))
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-fr30.c binutils-2.18~cvs20070812/bfd/elf32-fr30.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-fr30.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-fr30.c 2007-08-12 13:37:05.000000000 +0200
+@@ -567,12 +567,12 @@
+ }
+ else
+ {
+- bfd_boolean unresolved_reloc, warned;
++ bfd_boolean unresolved_reloc, warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+
+ name = h->root.root.string;
+ }
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-frv.c binutils-2.18~cvs20070812/bfd/elf32-frv.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-frv.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-frv.c 2007-08-12 13:37:05.000000000 +0200
+@@ -2813,13 +2813,13 @@
+ }
+ else
+ {
+- bfd_boolean warned;
++ bfd_boolean warned, ignored;
+ bfd_boolean unresolved_reloc;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ osec = sec;
+ }
+
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-h8300.c binutils-2.18~cvs20070812/bfd/elf32-h8300.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-h8300.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-h8300.c 2007-08-12 13:37:05.000000000 +0200
+@@ -452,12 +452,12 @@
+ }
+ else
+ {
+- bfd_boolean unresolved_reloc, warned;
++ bfd_boolean unresolved_reloc, warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ }
+
+ if (sec != NULL && elf_discarded_section (sec))
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-hppa.c binutils-2.18~cvs20070812/bfd/elf32-hppa.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-hppa.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-hppa.c 2007-08-12 13:37:05.000000000 +0200
+@@ -3676,13 +3676,14 @@
+ else
+ {
+ struct elf_link_hash_entry *eh;
+- bfd_boolean unresolved_reloc;
++ bfd_boolean unresolved_reloc, ignored;
+ struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rela,
+ r_symndx, symtab_hdr, sym_hashes,
+ eh, sym_sec, relocation,
+- unresolved_reloc, warned_undef);
++ unresolved_reloc, warned_undef,
++ ignored);
+
+ if (!info->relocatable
+ && relocation == 0
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-i386.c binutils-2.18~cvs20070812/bfd/elf32-i386.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-i386.c 2007-07-27 20:50:18.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-i386.c 2007-08-12 13:37:06.000000000 +0200
+@@ -2346,12 +2346,12 @@
+ }
+ else
+ {
+- bfd_boolean warned;
++ bfd_boolean warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ }
+
+ if (sec != NULL && elf_discarded_section (sec))
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-i860.c binutils-2.18~cvs20070812/bfd/elf32-i860.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-i860.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-i860.c 2007-08-12 13:37:06.000000000 +0200
+@@ -1120,12 +1120,12 @@
+ }
+ else
+ {
+- bfd_boolean unresolved_reloc, warned;
++ bfd_boolean unresolved_reloc, warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ }
+
+ if (sec != NULL && elf_discarded_section (sec))
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-ip2k.c binutils-2.18~cvs20070812/bfd/elf32-ip2k.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-ip2k.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-ip2k.c 2007-08-12 13:37:06.000000000 +0200
+@@ -1449,13 +1449,13 @@
+ }
+ else
+ {
+- bfd_boolean warned;
++ bfd_boolean warned, ignored;
+ bfd_boolean unresolved_reloc;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+
+ name = h->root.root.string;
+ }
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-iq2000.c binutils-2.18~cvs20070812/bfd/elf32-iq2000.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-iq2000.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-iq2000.c 2007-08-12 13:37:06.000000000 +0200
+@@ -586,12 +586,12 @@
+ else
+ {
+ bfd_boolean unresolved_reloc;
+- bfd_boolean warned;
++ bfd_boolean warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+
+ name = h->root.root.string;
+ }
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-m68hc1x.c binutils-2.18~cvs20070812/bfd/elf32-m68hc1x.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-m68hc1x.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-m68hc1x.c 2007-08-12 13:37:06.000000000 +0200
+@@ -945,12 +945,12 @@
+ }
+ else
+ {
+- bfd_boolean unresolved_reloc, warned;
++ bfd_boolean unresolved_reloc, warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation, unresolved_reloc,
+- warned);
++ warned, ignored);
+
+ is_far = (h && (h->other & STO_M68HC12_FAR));
+ stub_name = h->root.root.string;
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-m68k.c binutils-2.18~cvs20070812/bfd/elf32-m68k.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-m68k.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-m68k.c 2007-08-12 13:37:06.000000000 +0200
+@@ -1646,12 +1646,12 @@
+ }
+ else
+ {
+- bfd_boolean warned;
++ bfd_boolean warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ }
+
+ if (sec != NULL && elf_discarded_section (sec))
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-mcore.c binutils-2.18~cvs20070812/bfd/elf32-mcore.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-mcore.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-mcore.c 2007-08-12 13:37:06.000000000 +0200
+@@ -458,12 +458,12 @@
+ }
+ else
+ {
+- bfd_boolean unresolved_reloc, warned;
++ bfd_boolean unresolved_reloc, warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ }
+
+ if (sec != NULL && elf_discarded_section (sec))
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-msp430.c binutils-2.18~cvs20070812/bfd/elf32-msp430.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-msp430.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-msp430.c 2007-08-12 13:37:06.000000000 +0200
+@@ -450,12 +450,12 @@
+ }
+ else
+ {
+- bfd_boolean unresolved_reloc, warned;
++ bfd_boolean unresolved_reloc, warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ }
+
+ if (sec != NULL && elf_discarded_section (sec))
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-mt.c binutils-2.18~cvs20070812/bfd/elf32-mt.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-mt.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-mt.c 2007-08-12 13:37:06.000000000 +0200
+@@ -344,12 +344,12 @@
+ else
+ {
+ bfd_boolean unresolved_reloc;
+- bfd_boolean warned;
++ bfd_boolean warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+
+ name = h->root.root.string;
+ }
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-openrisc.c binutils-2.18~cvs20070812/bfd/elf32-openrisc.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-openrisc.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-openrisc.c 2007-08-12 13:37:06.000000000 +0200
+@@ -365,12 +365,12 @@
+ }
+ else
+ {
+- bfd_boolean unresolved_reloc, warned;
++ bfd_boolean unresolved_reloc, warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ }
+
+ if (sec != NULL && elf_discarded_section (sec))
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-ppc.c binutils-2.18~cvs20070812/bfd/elf32-ppc.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-ppc.c 2007-07-10 09:42:30.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-ppc.c 2007-08-12 13:37:06.000000000 +0200
+@@ -5718,10 +5718,12 @@
+ }
+ else
+ {
++ bfd_boolean ignored;
++
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+
+ sym_name = h->root.root.string;
+ }
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-s390.c binutils-2.18~cvs20070812/bfd/elf32-s390.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-s390.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-s390.c 2007-08-12 13:37:06.000000000 +0200
+@@ -2311,11 +2311,12 @@
+ else
+ {
+ bfd_boolean warned ATTRIBUTE_UNUSED;
++ bfd_boolean ignored ATTRIBUTE_UNUSED;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ }
+
+ if (sec != NULL && elf_discarded_section (sec))
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-spu.c binutils-2.18~cvs20070812/bfd/elf32-spu.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-spu.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-spu.c 2007-08-12 13:37:06.000000000 +0200
+@@ -2724,10 +2724,12 @@
+ }
+ else
+ {
++ bfd_boolean ignored;
++
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ sym_name = h->root.root.string;
+ }
+
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-v850.c binutils-2.18~cvs20070812/bfd/elf32-v850.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-v850.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-v850.c 2007-08-12 13:37:06.000000000 +0200
+@@ -1624,7 +1624,7 @@
+ }
+ else
+ {
+- bfd_boolean unresolved_reloc, warned;
++ bfd_boolean unresolved_reloc, warned, ignored;
+
+ /* Note - this check is delayed until now as it is possible and
+ valid to have a file without any symbols but with relocs that
+@@ -1641,7 +1641,7 @@
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ }
+
+ if (sec != NULL && elf_discarded_section (sec))
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-vax.c binutils-2.18~cvs20070812/bfd/elf32-vax.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-vax.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-vax.c 2007-08-12 13:37:06.000000000 +0200
+@@ -1415,12 +1415,12 @@
+ else
+ {
+ bfd_boolean unresolved_reloc;
+- bfd_boolean warned;
++ bfd_boolean warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+
+ if ((h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-xc16x.c binutils-2.18~cvs20070812/bfd/elf32-xc16x.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-xc16x.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-xc16x.c 2007-08-12 13:37:06.000000000 +0200
+@@ -374,12 +374,12 @@
+ }
+ else
+ {
+- bfd_boolean unresolved_reloc, warned;
++ bfd_boolean unresolved_reloc, warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ }
+
+ if (sec != NULL && elf_discarded_section (sec))
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-xstormy16.c binutils-2.18~cvs20070812/bfd/elf32-xstormy16.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-xstormy16.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-xstormy16.c 2007-08-12 13:37:06.000000000 +0200
+@@ -821,12 +821,12 @@
+ }
+ else
+ {
+- bfd_boolean unresolved_reloc, warned;
++ bfd_boolean unresolved_reloc, warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ }
+
+ if (sec != NULL && elf_discarded_section (sec))
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf32-xtensa.c binutils-2.18~cvs20070812/bfd/elf32-xtensa.c
+--- binutils-2.18~cvs20070812~/bfd/elf32-xtensa.c 2007-07-18 23:06:06.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf32-xtensa.c 2007-08-12 13:37:06.000000000 +0200
+@@ -2055,10 +2055,12 @@
+ }
+ else
+ {
++ bfd_boolean ignored;
++
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+
+ if (relocation == 0
+ && !unresolved_reloc
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf64-alpha.c binutils-2.18~cvs20070812/bfd/elf64-alpha.c
+--- binutils-2.18~cvs20070812~/bfd/elf64-alpha.c 2007-07-10 06:08:11.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf64-alpha.c 2007-08-12 13:37:06.000000000 +0200
+@@ -4176,7 +4176,7 @@
+ }
+ else
+ {
+- bfd_boolean warned;
++ bfd_boolean warned, ignored;
+ bfd_boolean unresolved_reloc;
+ struct elf_link_hash_entry *hh;
+ struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
+@@ -4184,7 +4184,7 @@
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ hh, sec, value,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+
+ if (warned)
+ continue;
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf64-mmix.c binutils-2.18~cvs20070812/bfd/elf64-mmix.c
+--- binutils-2.18~cvs20070812~/bfd/elf64-mmix.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf64-mmix.c 2007-08-12 13:37:06.000000000 +0200
+@@ -1402,12 +1402,13 @@
+ }
+ else
+ {
+- bfd_boolean unresolved_reloc;
++ bfd_boolean unresolved_reloc, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, undefined_signalled);
++ unresolved_reloc, undefined_signalled,
++ ignored);
+ name = h->root.root.string;
+ }
+
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf64-ppc.c binutils-2.18~cvs20070812/bfd/elf64-ppc.c
+--- binutils-2.18~cvs20070812~/bfd/elf64-ppc.c 2007-07-03 16:26:41.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf64-ppc.c 2007-08-12 13:37:06.000000000 +0200
+@@ -9900,10 +9900,12 @@
+ }
+ else
+ {
++ bfd_boolean ignored;
++
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h_elf, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ sym_name = h_elf->root.root.string;
+ sym_type = h_elf->type;
+ }
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf64-s390.c binutils-2.18~cvs20070812/bfd/elf64-s390.c
+--- binutils-2.18~cvs20070812~/bfd/elf64-s390.c 2007-07-10 06:08:11.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf64-s390.c 2007-08-12 13:37:06.000000000 +0200
+@@ -2285,11 +2285,12 @@
+ else
+ {
+ bfd_boolean warned ATTRIBUTE_UNUSED;
++ bfd_boolean ignored ATTRIBUTE_UNUSED;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ }
+
+ if (sec != NULL && elf_discarded_section (sec))
+diff -urNad binutils-2.18~cvs20070812~/bfd/elf64-x86-64.c binutils-2.18~cvs20070812/bfd/elf64-x86-64.c
+--- binutils-2.18~cvs20070812~/bfd/elf64-x86-64.c 2007-07-03 16:26:42.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elf64-x86-64.c 2007-08-12 13:37:06.000000000 +0200
+@@ -2104,12 +2104,12 @@
+ }
+ else
+ {
+- bfd_boolean warned;
++ bfd_boolean warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ }
+
+ if (sec != NULL && elf_discarded_section (sec))
+diff -urNad binutils-2.18~cvs20070812~/bfd/elfxx-ia64.c binutils-2.18~cvs20070812/bfd/elfxx-ia64.c
+--- binutils-2.18~cvs20070812~/bfd/elfxx-ia64.c 2007-07-03 16:26:42.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elfxx-ia64.c 2007-08-12 13:37:06.000000000 +0200
+@@ -4741,17 +4741,17 @@
+ else
+ {
+ bfd_boolean unresolved_reloc;
+- bfd_boolean warned;
++ bfd_boolean warned, ignored;
+ struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sym_sec, value,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+
+ if (h->root.type == bfd_link_hash_undefweak)
+ undef_weak_ref = TRUE;
+- else if (warned)
++ else if (warned || (ignored && info->executable))
+ continue;
+ }
+
+diff -urNad binutils-2.18~cvs20070812~/bfd/elfxx-sparc.c binutils-2.18~cvs20070812/bfd/elfxx-sparc.c
+--- binutils-2.18~cvs20070812~/bfd/elfxx-sparc.c 2007-07-03 16:26:42.000000000 +0200
++++ binutils-2.18~cvs20070812/bfd/elfxx-sparc.c 2007-08-12 13:37:06.000000000 +0200
+@@ -2533,12 +2533,12 @@
+ }
+ else
+ {
+- bfd_boolean warned;
++ bfd_boolean warned, ignored;
+
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+- unresolved_reloc, warned);
++ unresolved_reloc, warned, ignored);
+ if (warned)
+ {
+ /* To avoid generating warning messages about truncated
+diff -urNad binutils-2.18~cvs20070812~/ld/ldmain.c binutils-2.18~cvs20070812/ld/ldmain.c
+--- binutils-2.18~cvs20070812~/ld/ldmain.c 2007-07-06 16:09:41.000000000 +0200
++++ binutils-2.18~cvs20070812/ld/ldmain.c 2007-08-12 13:37:06.000000000 +0200
+@@ -103,6 +103,9 @@
+ /* TRUE if we should demangle symbol names. */
+ bfd_boolean demangling;
+
++/* How to report unresolved symbols. */
++enum report_method how_to_report_unresolved_symbols = RM_GENERATE_ERROR;
++
+ args_type command_line;
+
+ ld_config_type config;
+@@ -348,6 +351,27 @@
+ if (! link_info.shared || link_info.pie)
+ link_info.executable = TRUE;
+
++ /* When creating a shared library, the default behaviour is to
++ ignore any unresolved references. */
++
++ if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET)
++ {
++ if (link_info.shared && !link_info.pie)
++ link_info.unresolved_syms_in_objects = RM_IGNORE;
++ else
++ link_info.unresolved_syms_in_objects
++ = how_to_report_unresolved_symbols;
++ }
++
++ if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET)
++ {
++ if (link_info.shared && !link_info.pie)
++ link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
++ else
++ link_info.unresolved_syms_in_shared_libs
++ = how_to_report_unresolved_symbols;
++ }
++
+ /* Treat ld -r -s as ld -r -S -x (i.e., strip all local symbols). I
+ don't see how else this can be handled, since in this case we
+ must preserve all externally visible symbols. */
+diff -urNad binutils-2.18~cvs20070812~/ld/ldmain.h binutils-2.18~cvs20070812/ld/ldmain.h
+--- binutils-2.18~cvs20070812~/ld/ldmain.h 2007-07-06 16:09:41.000000000 +0200
++++ binutils-2.18~cvs20070812/ld/ldmain.h 2007-08-12 13:37:06.000000000 +0200
+@@ -35,6 +35,7 @@
+ extern bfd_boolean as_needed;
+ extern bfd_boolean add_needed;
+ extern bfd_boolean demangling;
++extern enum report_method how_to_report_unresolved_symbols;
+ extern int g_switch_value;
+ extern const char *output_filename;
+ extern struct bfd_link_info link_info;
+diff -urNad binutils-2.18~cvs20070812~/ld/lexsup.c binutils-2.18~cvs20070812/ld/lexsup.c
+--- binutils-2.18~cvs20070812~/ld/lexsup.c 2007-07-06 16:09:41.000000000 +0200
++++ binutils-2.18~cvs20070812/ld/lexsup.c 2007-08-12 13:37:06.000000000 +0200
+@@ -567,7 +567,6 @@
+ struct option *longopts;
+ struct option *really_longopts;
+ int last_optind;
+- enum report_method how_to_report_unresolved_symbols = RM_GENERATE_ERROR;
+
+ shortopts = xmalloc (OPTION_COUNT * 3 + 2);
+ longopts = xmalloc (sizeof (*longopts) * (OPTION_COUNT + 1));
+@@ -1113,12 +1112,7 @@
+ if (config.has_shared)
+ {
+ link_info.shared = TRUE;
+- /* When creating a shared library, the default
+- behaviour is to ignore any unresolved references. */
+- if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET)
+- link_info.unresolved_syms_in_objects = RM_IGNORE;
+- if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET)
+- link_info.unresolved_syms_in_shared_libs = RM_IGNORE;
++ link_info.pie = FALSE;
+ }
+ else
+ einfo (_("%P%F: -shared not supported\n"));
+@@ -1444,14 +1438,6 @@
+ set_default_dirlist (default_dirlist);
+ free (default_dirlist);
+ }
+-
+- if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET)
+- /* FIXME: Should we allow emulations a chance to set this ? */
+- link_info.unresolved_syms_in_objects = how_to_report_unresolved_symbols;
+-
+- if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET)
+- /* FIXME: Should we allow emulations a chance to set this ? */
+- link_info.unresolved_syms_in_shared_libs = how_to_report_unresolved_symbols;
+ }
+
+ /* Add the (colon-separated) elements of DIRLIST_PTR to the
+diff -urNad binutils-2.18~cvs20070812~/ld/testsuite/ld-ia64/error1.d binutils-2.18~cvs20070812/ld/testsuite/ld-ia64/error1.d
+--- binutils-2.18~cvs20070812~/ld/testsuite/ld-ia64/error1.d 1970-01-01 01:00:00.000000000 +0100
++++ binutils-2.18~cvs20070812/ld/testsuite/ld-ia64/error1.d 2007-08-12 13:37:06.000000000 +0200
+@@ -0,0 +1,7 @@
++#source: error1.s
++#ld: -unresolved-symbols=ignore-all
++#readelf: -s
++
++#...
++[ ]+[0-9]+:[ ]+[0]+[ ]+0[ ]+NOTYPE[ ]+GLOBAL DEFAULT[ ]+UND[ ]+foo
++#pass
+diff -urNad binutils-2.18~cvs20070812~/ld/testsuite/ld-ia64/error1.s binutils-2.18~cvs20070812/ld/testsuite/ld-ia64/error1.s
+--- binutils-2.18~cvs20070812~/ld/testsuite/ld-ia64/error1.s 1970-01-01 01:00:00.000000000 +0100
++++ binutils-2.18~cvs20070812/ld/testsuite/ld-ia64/error1.s 2007-08-12 13:37:06.000000000 +0200
+@@ -0,0 +1,30 @@
++ .explicit
++ .pred.safe_across_calls p1-p5,p16-p63
++ .text
++ .align 16
++ .global _start#
++ .proc _start#
++_start:
++ .prologue 12, 32
++ .mii
++ .save ar.pfs, r33
++ alloc r33 = ar.pfs, 0, 3, 0, 0
++ .save rp, r32
++ mov r32 = b0
++ mov r34 = r1
++ .body
++ ;;
++ .bbb
++ nop 0
++ nop 0
++ br.call.sptk.many b0 = foo#
++ ;;
++ .mmi
++ nop 0
++ mov r1 = r34
++ mov b0 = r32
++ .mib
++ nop 0
++ mov ar.pfs = r33
++ br.ret.sptk.many b0
++ .endp _start#
+diff -urNad binutils-2.18~cvs20070812~/ld/testsuite/ld-ia64/error2.d binutils-2.18~cvs20070812/ld/testsuite/ld-ia64/error2.d
+--- binutils-2.18~cvs20070812~/ld/testsuite/ld-ia64/error2.d 1970-01-01 01:00:00.000000000 +0100
++++ binutils-2.18~cvs20070812/ld/testsuite/ld-ia64/error2.d 2007-08-12 13:37:06.000000000 +0200
+@@ -0,0 +1,7 @@
++#source: error1.s
++#ld: -pie -unresolved-symbols=ignore-all
++#readelf: -s
++
++#...
++[ ]+[0-9]+:[ ]+[0]+[ ]+0[ ]+NOTYPE[ ]+GLOBAL DEFAULT[ ]+UND[ ]+foo
++#pass
+diff -urNad binutils-2.18~cvs20070812~/ld/testsuite/ld-ia64/error3.d binutils-2.18~cvs20070812/ld/testsuite/ld-ia64/error3.d
+--- binutils-2.18~cvs20070812~/ld/testsuite/ld-ia64/error3.d 1970-01-01 01:00:00.000000000 +0100
++++ binutils-2.18~cvs20070812/ld/testsuite/ld-ia64/error3.d 2007-08-12 13:37:06.000000000 +0200
+@@ -0,0 +1,7 @@
++#source: error1.s
++#ld: -pie -shared
++#readelf: -s
++
++#...
++[ ]+[0-9]+:[ ]+[0]+[ ]+0[ ]+NOTYPE[ ]+GLOBAL DEFAULT[ ]+UND[ ]+foo
++#pass
+diff -urNad binutils-2.18~cvs20070812~/ld/testsuite/ld-ia64/error4.d binutils-2.18~cvs20070812/ld/testsuite/ld-ia64/error4.d
+--- binutils-2.18~cvs20070812~/ld/testsuite/ld-ia64/error4.d 1970-01-01 01:00:00.000000000 +0100
++++ binutils-2.18~cvs20070812/ld/testsuite/ld-ia64/error4.d 2007-08-12 13:37:06.000000000 +0200
+@@ -0,0 +1,3 @@
++#source: error1.s
++#ld: -shared -pie
++#error: .*undefined reference to `foo'