[lld] r237979 - [lld] Make the MachO -stack_size default '0', add a test case.
Lang Hames
lhames at gmail.com
Thu May 21 17:25:34 PDT 2015
Author: lhames
Date: Thu May 21 19:25:34 2015
New Revision: 237979
URL: http://llvm.org/viewvc/llvm-project?rev=237979&view=rev
Log:
[lld] Make the MachO -stack_size default '0', add a test case.
Addresses some review comments for r237841.
Modified:
lld/trunk/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp
lld/trunk/test/mach-o/stack-size.yaml
Modified: lld/trunk/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/MachOLinkingContext.cpp?rev=237979&r1=237978&r2=237979&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/MachOLinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/MachOLinkingContext.cpp Thu May 21 19:25:34 2015
@@ -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),
Modified: lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp?rev=237979&r1=237978&r2=237979&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp Thu May 21 19:25:34 2015
@@ -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));
Modified: lld/trunk/test/mach-o/stack-size.yaml
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/mach-o/stack-size.yaml?rev=237979&r1=237978&r2=237979&view=diff
==============================================================================
--- lld/trunk/test/mach-o/stack-size.yaml (original)
+++ lld/trunk/test/mach-o/stack-size.yaml Thu May 21 19:25:34 2015
@@ -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)
More information about the llvm-commits
mailing list