diff options
author | Pete Cooper <peter_cooper@apple.com> | 2016-03-24 00:36:37 +0000 |
---|---|---|
committer | Pete Cooper <peter_cooper@apple.com> | 2016-03-24 00:36:37 +0000 |
commit | 3f564a52d074adc5b94c08968c59f70ea8d4fb70 (patch) | |
tree | 52ea48c1526a0f1b792f9131606b2bd3b2066e8d /lld/lib/ReaderWriter/MachO/MachONormalizedFile.h | |
parent | 0945a64767d9c79ee97833b9f9ab15264be74ee1 (diff) | |
download | bcm5719-llvm-3f564a52d074adc5b94c08968c59f70ea8d4fb70.tar.gz bcm5719-llvm-3f564a52d074adc5b94c08968c59f70ea8d4fb70.zip |
Parsed alignment should be a power of 2.
The .o path always makes sure to store a power of 2 value in the
Section alignment. However, the YAML code didn't verify this.
Added verification and updated all the tests which had a 3 but meant
to have 2^3.
llvm-svn: 264228
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/MachONormalizedFile.h')
-rw-r--r-- | lld/lib/ReaderWriter/MachO/MachONormalizedFile.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFile.h b/lld/lib/ReaderWriter/MachO/MachONormalizedFile.h index 400a30b8930..7934a6c0336 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFile.h +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFile.h @@ -105,6 +105,9 @@ typedef std::vector<uint32_t> IndirectSymbols; /// A typedef so that YAML I/O can encode/decode section attributes. LLVM_YAML_STRONG_TYPEDEF(uint32_t, SectionAttr) +/// A typedef so that YAML I/O can encode/decode section alignment. +LLVM_YAML_STRONG_TYPEDEF(uint16_t, SectionAlignment) + /// Mach-O has a 32-bit and 64-bit section record. This normalized form /// can support either kind. struct Section { @@ -115,7 +118,7 @@ struct Section { StringRef sectionName; SectionType type; SectionAttr attributes; - uint16_t alignment; + SectionAlignment alignment; Hex64 address; ArrayRef<uint8_t> content; Relocations relocations; |