]> git.saurik.com Git - apple/ld64.git/blobdiff - src/ld/passes/order.cpp
ld64-274.2.tar.gz
[apple/ld64.git] / src / ld / passes / order.cpp
index 139e761d08cf57f8fccffbf8b3d1a8fa3047e335..a7d31f31618a77f910a4b67f416b3d6a18e0f0dd 100644 (file)
@@ -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<const ld::Atom*>::iterator it=moveToData.begin(); it != moveToData.end(); ++it) {
+                               _state.atomToSection[*it] = dataSect;
+                       }
                }
        }