Print this page
7319 Need a way to turn off ld "multiple inclusion" warnings
Reviewed by: Martin Bochnig <opensxce@mail.ru>
Reviewed by: Kim Shrier <kshrier@racktopsystems.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>

@@ -22,11 +22,11 @@
        [-z globalaudit] [-z groupperm | nogroupperm]
        [-z guidance[=id1,id2...] [-z help ]
        [-z ignore | record] [-z initarray=function] [-z initfirst]
        [-z interpose] [-z lazyload | nolazyload]
        [-z ld32=arg1,arg2,...] [-z ld64=arg1,arg2,...]
-       [-z loadfltr] [-z muldefs] [-z nocompstrtab] [-z nodefaultlib]
+       [-z loadfltr] [-z muldefs] [-z mulincl] [-z nocompstrtab] [-z nodefaultlib]
        [-z nodelete] [-z nodlopen] [-z nodump] [-z noldynsym]
        [-z nopartial] [-z noversion] [-z now] [-z origin]
        [-z preinitarray=function] [-z redlocsym] [-z relaxreloc]
        [-z rescan-now] [-z recan] [-z rescan-start ... -z rescan-end]]
        [-z target=sparc|x86] [-z text | textwarn | textoff]

@@ -62,13 +62,13 @@
        related technologies and utilities, are extensively documented in the
        Linker and Libraries Guide.
 
 
        If any argument is a library, ld by default searches the library
-       exactly once at the point the library is encountered on the argument
-       list. The library can be either a shared object or relocatable archive.
-       See ar.h(3HEAD)).
+       exactly once at the point the library is first encountered on the
+       argument list. The library can be either a shared object or relocatable
+       archive. See ar.h(3HEAD)).
 
 
        A shared object consists of an indivisible, whole unit that has been
        generated by a previous link-edit of one or more input files. When the
        link-editor processes a shared object, the entire contents of the

@@ -889,10 +889,20 @@
            definitions that occur between relocatable objects result in a
            fatal error condition. This option, suppresses the error condition,
            allowing the first symbol definition to be taken.
 
 
+       -z mulincl
+
+           Allows multiple inclusion of the same file. By default, a warning
+           is generated for libraries that are passed multiple times on the
+           command line.  This option suppresses that warning, allowing -z
+           fatal-warnings to be used when compiling code that makes multiple
+           inclusions.  Note: When a file is specified more than once, only
+           the first instance is included.
+
+
        -z nocompstrtab
 
            Disables the compression of ELF string tables. By default, string
            compression is applied to SHT_STRTAB sections, and to SHT_PROGBITS
            sections that have their SHF_MERGE and SHF_STRINGS section flags

@@ -1308,6 +1318,6 @@
        links to linker output files should explicitly remove and relink the
        other file names.
 
 
 
-                              September 10, 2013                         LD(1)
+                                August 24, 2016                          LD(1)