summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2016-02-09 02:10:39 +0000
committerPete Cooper <peter_cooper@apple.com>2016-02-09 02:10:39 +0000
commit9b28a4559eb5c1f61501422c916469cc8f611fad (patch)
tree42424bd3dee277425fdaf5391b6cfc73359cc59e /lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
parenta64e1adf849c07232c2bd27b90a59f29659211e7 (diff)
downloadbcm5719-llvm-9b28a4559eb5c1f61501422c916469cc8f611fad.tar.gz
bcm5719-llvm-9b28a4559eb5c1f61501422c916469cc8f611fad.zip
Add cmdline options for LC_DATA_IN_CODE load command.
Also added the defaults for whether to generate this load command, which the cmdline options are able to override. There was also a difference to ld64 which is fixed here in that ld64 will generate an empty data in code command if requested. rdar://problem/24472630 llvm-svn: 260191
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp')
-rw-r--r--lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
index d3929bdf281..b34f70343cd 100644
--- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
+++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
@@ -1186,6 +1186,8 @@ void Util::addFunctionStarts(const lld::File &, NormalizedFile &file) {
}
void Util::buildDataInCodeArray(const lld::File &, NormalizedFile &file) {
+ if (!_ctx.generateDataInCodeLoadCommand())
+ return;
for (SectionInfo *si : _sectionInfos) {
for (const AtomInfo &info : si->atomsAndOffsets) {
// Atoms that contain data-in-code have "transition" references
@@ -1377,6 +1379,8 @@ normalizedFromAtoms(const lld::File &atomFile,
// source object files.
normFile.hasMinVersionLoadCommand = true;
}
+ normFile.generateDataInCodeLoadCommand =
+ context.generateDataInCodeLoadCommand();
normFile.pageSize = context.pageSize();
normFile.rpaths = context.rpaths();
util.addDependentDylibs(atomFile, normFile);
OpenPOWER on IntegriCloud