From a67f6f17467fcb4703b857cd0f467530e373d06c Mon Sep 17 00:00:00 2001 From: Shoaib Meenai Date: Thu, 25 Jul 2019 00:29:13 +0000 Subject: [Object] Add public MaxSectionAlignment to MachOUniversal Change MAXSECTALIGN to a public MaxSectionAlignment in MachOUniversal. Will be used in a follow-up. Patch by Anusha Basana Differential Revision: https://reviews.llvm.org/D65117 llvm-svn: 366969 --- llvm/lib/Object/MachOUniversal.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'llvm/lib/Object/MachOUniversal.cpp') diff --git a/llvm/lib/Object/MachOUniversal.cpp b/llvm/lib/Object/MachOUniversal.cpp index b3f0993412c..8b5cd0518a5 100644 --- a/llvm/lib/Object/MachOUniversal.cpp +++ b/llvm/lib/Object/MachOUniversal.cpp @@ -155,12 +155,13 @@ MachOUniversalBinary::MachOUniversalBinary(MemoryBufferRef Source, Error &Err) ") extends past the end of the file"); return; } -#define MAXSECTALIGN 15 /* 2**15 or 0x8000 */ - if (A.getAlign() > MAXSECTALIGN) { - Err = malformedError("align (2^" + Twine(A.getAlign()) + ") too large " - "for cputype (" + Twine(A.getCPUType()) + ") cpusubtype (" + - Twine(A.getCPUSubType() & ~MachO::CPU_SUBTYPE_MASK) + - ") (maximum 2^" + Twine(MAXSECTALIGN) + ")"); + + if (A.getAlign() > MaxSectionAlignment) { + Err = malformedError("align (2^" + Twine(A.getAlign()) + + ") too large for cputype (" + Twine(A.getCPUType()) + + ") cpusubtype (" + + Twine(A.getCPUSubType() & ~MachO::CPU_SUBTYPE_MASK) + + ") (maximum 2^" + Twine(MaxSectionAlignment) + ")"); return; } if(A.getOffset() % (1 << A.getAlign()) != 0){ -- cgit v1.2.3