]> git.saurik.com Git - apple/ld64.git/blobdiff - src/ld/passes/dylibs.cpp
ld64-274.1.tar.gz
[apple/ld64.git] / src / ld / passes / dylibs.cpp
index af1ecf6692b22828f925e1602da767742af879e8..7edc85ccc1beb6eb3b348ebdbc4aa2bfde3716d2 100644 (file)
@@ -30,6 +30,7 @@
 #include <mach/machine.h>
 
 #include <vector>
+#include <map>
 
 #include "ld.hpp"
 #include "dylibs.h"
@@ -93,9 +94,11 @@ void doPass(const Options& opts, ld::Internal& state)
                                                targetIsWeakImport = fit->weakImport;
                                                break;
                     default:
-                        break;   
+                        break;
                                }
                                if ( (target != NULL) && (target->definition() == ld::Atom::definitionProxy) ) {
+                                       if ( targetIsWeakImport && !opts.allowWeakImports() )
+                                               throwf("weak import of symbol '%s' not supported because of option: -no_weak_imports", target->name());
                                        ld::Atom::WeakImportState curWI = target->weakImportState();
                                        if ( curWI == ld::Atom::weakImportUnset ) {
                                                // first use of this proxy, set weak-import based on this usage