Loading...
--- dyld/dyld-46.12/src/dyldInitialization.cpp
+++ dyld/dyld-45.1/src/dyldInitialization.cpp
@@ -31,9 +31,6 @@
#if __ppc__ || __ppc64__
#include <mach-o/ppc/reloc.h>
#endif
-#if __x86_64__
- #include <mach-o/x86_64/reloc.h>
-#endif
#include "dyld.h"
#if __LP64__
@@ -50,11 +47,7 @@
#define RELOC_SIZE 2
#endif
-#if __x86_64__
- #define POINTER_RELOC X86_64_RELOC_UNSIGNED
-#else
#define POINTER_RELOC GENERIC_RELOC_VANILLA
-#endif
//
// Code to bootstrap dyld into a runnable state
@@ -114,9 +107,6 @@
const struct load_command* const cmds = (struct load_command*)(((char*)mh)+sizeof(macho_header));
const struct load_command* cmd = cmds;
const struct macho_segment_command* linkEditSeg = NULL;
-#if __x86_64__
- const struct macho_segment_command* firstWritableSeg = NULL;
-#endif
const struct dysymtab_command* dynamicSymbolTable = NULL;
for (uint32_t i = 0; i < cmd_count; ++i) {
switch (cmd->cmd) {
@@ -138,10 +128,6 @@
}
}
}
-#if __x86_64__
- if ( (firstWritableSeg == NULL) && (seg->initprot & VM_PROT_WRITE) )
- firstWritableSeg = seg;
-#endif
}
break;
case LC_DYSYMTAB:
@@ -152,11 +138,7 @@
}
// use reloc's to rebase all random data pointers
-#if __x86_64__
- const uintptr_t relocBase = firstWritableSeg->vmaddr + slide;
-#else
const uintptr_t relocBase = (uintptr_t)mh;
-#endif
const relocation_info* const relocsStart = (struct relocation_info*)(linkEditSeg->vmaddr + slide + dynamicSymbolTable->locreloff - linkEditSeg->fileoff);
const relocation_info* const relocsEnd = &relocsStart[dynamicSymbolTable->nlocrel];
for (const relocation_info* reloc=relocsStart; reloc < relocsEnd; ++reloc) {