+2018-01-12 Nick Clifton <nickc@redhat.com>
+
+ * emultempl/elf32.em (_handle_option): Add support for "-z undefs"
+ as the opposite of "-z defs".
+ * ld.texinfo: Document the new option. Update the description of
+ the -z defs option to make it clear that it does generate an error
+ if an undefined symbol reference is found in an object file whilst
+ creating a shared library.
+ * NEWS: Document this new feature.
+
2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-elf/pr22393-2a.rd: Replace "-z textonly" with
-*- text -*-
+
* Add -z separate-code to generate separate code PT_LOAD segment.
+* Add "-z undefs" command line option as the inverse of the "-z defs" option.
+
* Add -z globalaudit command line option to force audit libraries to be run
for every dynamic object loaded by an executable - provided that the loader
supports this functionality.
case 'z':
if (strcmp (optarg, "defs") == 0)
link_info.unresolved_syms_in_objects = RM_GENERATE_ERROR;
+ else if (strcmp (optarg, "undefs") == 0)
+ link_info.unresolved_syms_in_objects = RM_IGNORE;
else if (strcmp (optarg, "muldefs") == 0)
link_info.allow_multiple_definition = TRUE;
else if (CONST_STRNEQ (optarg, "max-page-size="))
using pages of this size.
@item defs
-Disallows undefined symbols in object files. Undefined symbols in
-shared libraries are still allowed.
+Report unresolved symbol references from regular object files. This
+is done even if the linker is creating a non-symbolic shared library.
+This option is the inverse of @samp{-z undefs}.
@item dynamic-undefined-weak
@itemx nodynamic-undefined-weak
relocations in read-only sections. Don't report an error if
@samp{notext} or @samp{textoff}.
+@item undefs
+Do not report unresolved symbol references from regular object files,
+either when creating an executable, or when creating a shared library.
+This option is the inverse of @samp{-z defs}.
+
@end table
Other keywords are ignored for Solaris compatibility.
@kindex --no-undefined
@kindex -z defs
+@kindex -z undefs
@item --no-undefined
@itemx -z defs
Report unresolved symbol references from regular object files. This
behaviour for reporting unresolved references found in shared
libraries being linked in.
+The effects of this option can be reverted by using @code{-z undefs}.
+
@kindex --allow-multiple-definition
@kindex -z muldefs
@item --allow-multiple-definition