X-Git-Url: https://git.saurik.com/apple/ld64.git/blobdiff_plain/599556ff3dd31aab68bb9685f1ed7fc4867803e7..7f09b9353af9897bf18933788d6a59c152c29edd:/src/ld/passes/order.cpp diff --git a/src/ld/passes/order.cpp b/src/ld/passes/order.cpp index 139e761..a7d31f3 100644 --- a/src/ld/passes/order.cpp +++ b/src/ld/passes/order.cpp @@ -510,8 +510,14 @@ void Layout::buildOrdinalOverrideMap() switch ( atom->section().type() ) { case ld::Section::typeZeroFill: case ld::Section::typeTentativeDefs: - if ( atom->size() <= 512 ) - moveToData.insert(atom); + if ( atom->size() <= 512 ) { + const char* dstSeg; + bool wildCardMatch; + const ld::File* f = atom->file(); + const char* path = (f != NULL) ? f->path() : NULL; + if ( !_options.moveRwSymbol(atom->name(), path, dstSeg, wildCardMatch) ) + moveToData.insert(atom); + } break; default: break; @@ -579,6 +585,10 @@ void Layout::buildOrdinalOverrideMap() break; } } + // update atom-to-section map + for (std::set::iterator it=moveToData.begin(); it != moveToData.end(); ++it) { + _state.atomToSection[*it] = dataSect; + } } }