about summary refs log tree commit diff
path: root/src/resolve-system-dependencies/resolve-system-dependencies.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/resolve-system-dependencies/resolve-system-dependencies.cc')
-rw-r--r--src/resolve-system-dependencies/resolve-system-dependencies.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/resolve-system-dependencies/resolve-system-dependencies.cc b/src/resolve-system-dependencies/resolve-system-dependencies.cc
index 8502444ba0b2..a5f0cd7b3b70 100644
--- a/src/resolve-system-dependencies/resolve-system-dependencies.cc
+++ b/src/resolve-system-dependencies/resolve-system-dependencies.cc
@@ -54,7 +54,7 @@ std::set<std::string> runResolver(const Path & filename) {
         uint32_t narches = DO_SWAP(should_swap, ((struct fat_header*)obj)->nfat_arch);
 
         for(uint32_t iter = 0; iter < narches; iter++) {
-            ptrdiff_t header_offset = (ptrdiff_t)obj + sizeof(struct fat_header);
+            ptrdiff_t header_offset = (ptrdiff_t)obj + sizeof(struct fat_header) * (iter + 1);
             struct fat_arch* arch = (struct fat_arch*)header_offset;
             if(DO_SWAP(should_swap, arch->cputype) == CPU_TYPE_X86_64) {
                 mach64_offset = (ptrdiff_t)DO_SWAP(should_swap, arch->offset);