++count;
}
+ // Add LC_DATA_IN_CODE if needed
+ if (!_file.dataInCode.empty()) {
+ size += sizeof(linkedit_data_command);
+ ++count;
+ }
+
return size;
}
lc[sizeof(dylib_command)+dep.path.size()] = '\0';
lc += size;
}
+ // Add LC_DATA_IN_CODE if needed.
+ if (_dataInCodeSize != 0) {
+ linkedit_data_command* dl = reinterpret_cast<linkedit_data_command*>(lc);
+ dl->cmd = LC_DATA_IN_CODE;
+ dl->cmdsize = sizeof(linkedit_data_command);
+ dl->dataoff = _startOfDataInCode;
+ dl->datasize = _dataInCodeSize;
+ if (_swap)
+ swapStruct(*dl);
+ lc += sizeof(linkedit_data_command);
+ }
}
return ec;
}
writeLazyBindingInfo();
// TODO: add weak binding info
writeExportInfo();
+ writeDataInCodeInfo();
writeSymbolTable();
}
}
-# RUN: lld -flavor darwin -arch armv7 -r -print_atoms %s -o %t | FileCheck %s \
-# RUN: && lld -flavor darwin -arch armv7 -r -print_atoms %t -o %t2 | FileCheck %s
+# RUN: lld -flavor darwin -arch armv7 -r -print_atoms %s -o %t | FileCheck %s
+# RUN: lld -flavor darwin -arch armv7 -r -print_atoms %t -o %t2 | FileCheck %s
+# RUN: lld -flavor darwin -arch armv7 -dylib %s -o %t3.dylib %p/Inputs/libSystem.yaml \
+# RUN: && llvm-objdump -macho -private-headers %t3.dylib | FileCheck --check-prefix=CHECK2 %s
#
# Test parsing LC_DATA_IN_CODE
#
# CHECK: offset: 20
+# CHECK2: cmd LC_DATA_IN_CODE
+# CHECK2: cmdsize 16
+# CHECK2: datasize 64
+
# .code 16
# .thumb_func _foo_thumb