Nick Clifton a62fb5
diff -rup binutils.orig/ld/emultempl/elf32.em binutils-2.29.1/ld/emultempl/elf32.em
Nick Clifton a62fb5
--- binutils.orig/ld/emultempl/elf32.em	2018-01-16 11:34:58.040749108 +0000
Nick Clifton a62fb5
+++ binutils-2.29.1/ld/emultempl/elf32.em	2018-01-16 11:35:35.697303875 +0000
Nick Clifton a62fb5
@@ -2666,6 +2666,8 @@ fragment <
Nick Clifton a62fb5
     case 'z':
Nick Clifton a62fb5
       if (strcmp (optarg, "defs") == 0)
Nick Clifton a62fb5
 	link_info.unresolved_syms_in_objects = RM_GENERATE_ERROR;
Nick Clifton a62fb5
+      else if (strcmp (optarg, "undefs") == 0)
Nick Clifton a62fb5
+	link_info.unresolved_syms_in_objects = RM_IGNORE;
Nick Clifton a62fb5
       else if (strcmp (optarg, "muldefs") == 0)
Nick Clifton a62fb5
 	link_info.allow_multiple_definition = TRUE;
Nick Clifton a62fb5
       else if (CONST_STRNEQ (optarg, "max-page-size="))
Nick Clifton a62fb5
Only in binutils-2.29.1/ld/emultempl: elf32.em.orig
Nick Clifton a62fb5
diff -rup binutils.orig/ld/ld.texinfo binutils-2.29.1/ld/ld.texinfo
Nick Clifton a62fb5
--- binutils.orig/ld/ld.texinfo	2018-01-16 11:34:58.208747127 +0000
Nick Clifton a62fb5
+++ binutils-2.29.1/ld/ld.texinfo	2018-01-16 11:35:35.699303851 +0000
Nick Clifton a62fb5
@@ -1125,8 +1125,9 @@ Generate common symbols with the STT_COM
Nick Clifton a62fb5
 link.
Nick Clifton a62fb5
 
Nick Clifton a62fb5
 @item defs
Nick Clifton a62fb5
-Disallows undefined symbols in object files.  Undefined symbols in
Nick Clifton a62fb5
-shared libraries are still allowed.
Nick Clifton a62fb5
+Report unresolved symbol references from regular object files.  This
Nick Clifton a62fb5
+is done even if the linker is creating a non-symbolic shared library.
Nick Clifton a62fb5
+This option is the inverse of @samp{-z undefs}.
Nick Clifton a62fb5
 
Nick Clifton a62fb5
 @item execstack
Nick Clifton a62fb5
 Marks the object as requiring executable stack.
Nick Clifton a62fb5
@@ -1279,6 +1280,11 @@ Generate GNU_PROPERTY_X86_FEATURE_1_SHST
Nick Clifton a62fb5
 to indicate compatibility with Intel Shadow Stack.  Supported for
Nick Clifton a62fb5
 Linux/i386 and Linux/x86_64.
Nick Clifton a62fb5
 
Nick Clifton a62fb5
+@item undefs
Nick Clifton a62fb5
+Do not report unresolved symbol references from regular object files,
Nick Clifton a62fb5
+either when creating an executable, or when creating a shared library.
Nick Clifton a62fb5
+This option is the inverse of @samp{-z defs}.
Nick Clifton a62fb5
+
Nick Clifton a62fb5
 @end table
Nick Clifton a62fb5
 
Nick Clifton a62fb5
 Other keywords are ignored for Solaris compatibility.
Nick Clifton a62fb5
@@ -1684,6 +1690,7 @@ while linking a large executable.
Nick Clifton a62fb5
 
Nick Clifton a62fb5
 @kindex --no-undefined
Nick Clifton a62fb5
 @kindex -z defs
Nick Clifton a62fb5
+@kindex -z undefs
Nick Clifton a62fb5
 @item --no-undefined
Nick Clifton a62fb5
 @itemx -z defs
Nick Clifton a62fb5
 Report unresolved symbol references from regular object files.  This
Nick Clifton a62fb5
@@ -1692,6 +1699,8 @@ The switch @option{--[no-]allow-shlib-un
Nick Clifton a62fb5
 behaviour for reporting unresolved references found in shared
Nick Clifton a62fb5
 libraries being linked in.
Nick Clifton a62fb5
 
Nick Clifton a62fb5
+The effects of this option can be reverted by using @code{-z undefs}.
Nick Clifton a62fb5
+
Nick Clifton a62fb5
 @kindex --allow-multiple-definition
Nick Clifton a62fb5
 @kindex -z muldefs
Nick Clifton a62fb5
 @item --allow-multiple-definition
Nick Clifton a62fb5
Only in binutils-2.29.1/ld: ld.texinfo.orig
Nick Clifton a62fb5
diff -rup binutils.orig/ld/NEWS binutils-2.29.1/ld/NEWS
Nick Clifton a62fb5
--- binutils.orig/ld/NEWS	2018-01-16 11:34:58.209747115 +0000
Nick Clifton a62fb5
+++ binutils-2.29.1/ld/NEWS	2018-01-16 11:35:57.855041557 +0000
Nick Clifton a62fb5
@@ -1,5 +1,7 @@
Nick Clifton a62fb5
 -*- text -*-
Nick Clifton a62fb5
 
Nick Clifton a62fb5
+* Add "-z undefs" command line option as the inverse of the "-z defs" option.
Nick Clifton a62fb5
+
Nick Clifton a62fb5
 Changes in 2.29:
Nick Clifton a62fb5
 
Nick Clifton a62fb5
 * Support for -z shstk in the x86 ELF linker to generate
Nick Clifton a62fb5
Only in binutils-2.29.1/ld: NEWS.orig
Nick Clifton a62fb5
Only in binutils-2.29.1/ld: NEWS.rej