]> git.saurik.com Git - apple/ld64.git/blobdiff - src/ld.cpp
ld64-85.tar.gz
[apple/ld64.git] / src / ld.cpp
old mode 100755 (executable)
new mode 100644 (file)
index 49f05c4..be90999
@@ -753,7 +753,17 @@ inline void Linker::addAtom(ObjectFile::Atom& atom)
                        }
                }
                // add to symbol table
-               fGlobalSymbolTable.add(atom);
+               if ( fOptions.outputKind() == Options::kObjectFile ) {
+                       // in ld -r mode don't add .eh symbols to symbol table 
+                       // instead kGroupSubordinate references will keep them paired
+                       // with their functions.
+                       const char* sectionName = atom.getSectionName();
+                       if ( (sectionName != NULL) && (strcmp(sectionName, "__eh_frame") != 0) )
+                               fGlobalSymbolTable.add(atom);
+               }
+               else {
+                       fGlobalSymbolTable.add(atom);
+               }
        }
 
        // record section orders so output file can have same order