diff options
author | Lang Hames <lhames@gmail.com> | 2015-05-22 00:25:34 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2015-05-22 00:25:34 +0000 |
commit | ff4b13c5389ba1f0e1559b413a913f58a5c0ca07 (patch) | |
tree | c34d194561aa5d72cb11b5524c12a835e4568e67 /lld | |
parent | b301533ef142ee7cb00c03e2fdb05ae9470a41d1 (diff) | |
download | bcm5719-llvm-ff4b13c5389ba1f0e1559b413a913f58a5c0ca07.tar.gz bcm5719-llvm-ff4b13c5389ba1f0e1559b413a913f58a5c0ca07.zip |
[lld] Make the MachO -stack_size default '0', add a test case.
Addresses some review comments for r237841.
llvm-svn: 237979
Diffstat (limited to 'lld')
-rw-r--r-- | lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp | 2 | ||||
-rw-r--r-- | lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp | 2 | ||||
-rw-r--r-- | lld/test/mach-o/stack-size.yaml | 11 |
3 files changed, 10 insertions, 5 deletions
diff --git a/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp b/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp index b6f5c3f4fc2..dc8b8c6223d 100644 --- a/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp +++ b/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp @@ -142,7 +142,7 @@ MachOLinkingContext::MachOLinkingContext() : _outputMachOType(MH_EXECUTE), _outputMachOTypeStatic(false), _doNothing(false), _pie(false), _arch(arch_unknown), _os(OS::macOSX), _osMinVersion(0), _pageZeroSize(0), _pageSize(4096), _baseAddress(0), - _stackSize(0x800000), _compatibilityVersion(0), _currentVersion(0), + _stackSize(0), _compatibilityVersion(0), _currentVersion(0), _deadStrippableDylib(false), _printAtoms(false), _testingFileUsage(false), _keepPrivateExterns(false), _demangle(false), _archHandler(nullptr), _exportMode(ExportMode::globals), diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp index 1cc5e013b66..a653c5f38c8 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp @@ -688,7 +688,7 @@ struct MappingTraits<NormalizedFile> { io.mapOptional("has-UUID", file.hasUUID, true); io.mapOptional("rpaths", file.rpaths); io.mapOptional("entry-point", file.entryAddress, Hex64(0)); - io.mapOptional("stack-size", file.stackSize, Hex64(0x800000)); + io.mapOptional("stack-size", file.stackSize, Hex64(0)); io.mapOptional("source-version", file.sourceVersion, Hex64(0)); io.mapOptional("OS", file.os); io.mapOptional("min-os-version", file.minOSverson, PackedVersion(0)); diff --git a/lld/test/mach-o/stack-size.yaml b/lld/test/mach-o/stack-size.yaml index aeba8357b72..0e8edb2b549 100644 --- a/lld/test/mach-o/stack-size.yaml +++ b/lld/test/mach-o/stack-size.yaml @@ -1,5 +1,7 @@ +# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 %s -o %t %p/Inputs/libSystem.yaml +# RUN: llvm-objdump -private-headers %t | FileCheck --check-prefix=CHECK-DEFAULT %s # RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 %s -o %t -stack_size 31415926000 %p/Inputs/libSystem.yaml -# RUN: llvm-objdump -private-headers %t | FileCheck %s +# RUN: llvm-objdump -private-headers %t | FileCheck --check-prefix=CHECK-EXPLICIT %s # RUN: not lld -flavor darwin -arch x86_64 -stack_size 0x31415926530 %s >/dev/null 2> %t # RUN: FileCheck < %t %s --check-prefix=CHECK-ERROR-MISPAGED # RUN: not lld -flavor darwin -arch x86_64 -stack_size hithere %s >/dev/null 2> %t @@ -11,8 +13,11 @@ defined-atoms: scope: global content: [] -# CHECK: cmd LC_MAIN -# CHECK: stacksize 3384796143616 +# CHECK-DEFAULT: cmd LC_MAIN +# CHECK-DEFAULT: stacksize 0 + +# CHECK-EXPLICIT: cmd LC_MAIN +# CHECK-EXPLICIT: stacksize 3384796143616 # CHECK-ERROR-MISPAGED: error: stack_size must be a multiple of page size (0x1000) |