Mercurial > hg > CbC > CbC_llvm
comparison lib/Object/MachOUniversal.cpp @ 148:63bd29f05246
merged
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 14 Aug 2019 19:46:37 +0900 |
parents | c2174574ed3a |
children |
comparison
equal
deleted
inserted
replaced
146:3fc4d5c3e21e | 148:63bd29f05246 |
---|---|
1 //===- MachOUniversal.cpp - Mach-O universal binary -------------*- C++ -*-===// | 1 //===- MachOUniversal.cpp - Mach-O universal binary -------------*- C++ -*-===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 // | 4 // See https://llvm.org/LICENSE.txt for license information. |
5 // This file is distributed under the University of Illinois Open Source | 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 // License. See LICENSE.TXT for details. | |
7 // | 6 // |
8 //===----------------------------------------------------------------------===// | 7 //===----------------------------------------------------------------------===// |
9 // | 8 // |
10 // This file defines the MachOUniversalBinary class. | 9 // This file defines the MachOUniversalBinary class. |
11 // | 10 // |
154 Twine(A.getCPUType()) + ") cpusubtype (" + | 153 Twine(A.getCPUType()) + ") cpusubtype (" + |
155 Twine(A.getCPUSubType() & ~MachO::CPU_SUBTYPE_MASK) + | 154 Twine(A.getCPUSubType() & ~MachO::CPU_SUBTYPE_MASK) + |
156 ") extends past the end of the file"); | 155 ") extends past the end of the file"); |
157 return; | 156 return; |
158 } | 157 } |
159 #define MAXSECTALIGN 15 /* 2**15 or 0x8000 */ | 158 |
160 if (A.getAlign() > MAXSECTALIGN) { | 159 if (A.getAlign() > MaxSectionAlignment) { |
161 Err = malformedError("align (2^" + Twine(A.getAlign()) + ") too large " | 160 Err = malformedError("align (2^" + Twine(A.getAlign()) + |
162 "for cputype (" + Twine(A.getCPUType()) + ") cpusubtype (" + | 161 ") too large for cputype (" + Twine(A.getCPUType()) + |
163 Twine(A.getCPUSubType() & ~MachO::CPU_SUBTYPE_MASK) + | 162 ") cpusubtype (" + |
164 ") (maximum 2^" + Twine(MAXSECTALIGN) + ")"); | 163 Twine(A.getCPUSubType() & ~MachO::CPU_SUBTYPE_MASK) + |
164 ") (maximum 2^" + Twine(MaxSectionAlignment) + ")"); | |
165 return; | 165 return; |
166 } | 166 } |
167 if(A.getOffset() % (1 << A.getAlign()) != 0){ | 167 if(A.getOffset() % (1 << A.getAlign()) != 0){ |
168 Err = malformedError("offset: " + Twine(A.getOffset()) + | 168 Err = malformedError("offset: " + Twine(A.getOffset()) + |
169 " for cputype (" + Twine(A.getCPUType()) + ") cpusubtype (" + | 169 " for cputype (" + Twine(A.getCPUType()) + ") cpusubtype (" + |