#include <mach/machine.h>
#include <vector>
+#include <map>
#include "ld.hpp"
#include "dylibs.h"
{
// const bool log = false;
- // only optimize dylibs in final linked images
- if ( opts.outputKind() == Options::kObjectFile )
- return;
-
// clear "willRemoved" bit on all dylibs
for (std::vector<ld::dylib::File*>::iterator it = state.dylibs.begin(); it != state.dylibs.end(); ++it) {
ld::dylib::File* aDylib = *it;
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