diff options
author | Nick Kledzik <kledzik@apple.com> | 2014-11-18 00:30:25 +0000 |
---|---|---|
committer | Nick Kledzik <kledzik@apple.com> | 2014-11-18 00:30:25 +0000 |
commit | 63adb08c2ca3b8a4c119643e225fe45c856571b9 (patch) | |
tree | c281147802d2ac1bb3e84a57137f46707513c298 /lld/lib/ReaderWriter/MachO/File.h | |
parent | f6e5ace974b6949297e228ed2afd09b9ff628e6f (diff) | |
download | bcm5719-llvm-63adb08c2ca3b8a4c119643e225fe45c856571b9.tar.gz bcm5719-llvm-63adb08c2ca3b8a4c119643e225fe45c856571b9.zip |
[mach-o] extract atom alignment information from mach-o files
llvm-svn: 222201
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/File.h')
-rw-r--r-- | lld/lib/ReaderWriter/MachO/File.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lld/lib/ReaderWriter/MachO/File.h b/lld/lib/ReaderWriter/MachO/File.h index 666bab6b111..831de2451fa 100644 --- a/lld/lib/ReaderWriter/MachO/File.h +++ b/lld/lib/ReaderWriter/MachO/File.h @@ -39,9 +39,11 @@ public: name = name.copy(_allocator); content = content.copy(_allocator); } + DefinedAtom::Alignment align(inSection->alignment, + sectionOffset % (1 << inSection->alignment)); MachODefinedAtom *atom = new (_allocator) MachODefinedAtom(*this, name, scope, type, merge, - thumb, noDeadStrip, content); + thumb, noDeadStrip, content, align); addAtomForSection(inSection, atom, sectionOffset); } @@ -59,11 +61,13 @@ public: content = content.copy(_allocator); sectionName = sectionName.copy(_allocator); } + DefinedAtom::Alignment align(inSection->alignment, + sectionOffset % (1 << inSection->alignment)); MachODefinedCustomSectionAtom *atom = new (_allocator) MachODefinedCustomSectionAtom(*this, name, scope, type, merge, thumb, noDeadStrip, content, - sectionName); + sectionName, align); addAtomForSection(inSection, atom, sectionOffset); } @@ -75,8 +79,11 @@ public: // Make a copy of the atom's name and content that is owned by this file. name = name.copy(_allocator); } + DefinedAtom::Alignment align(inSection->alignment, + sectionOffset % (1 << inSection->alignment)); MachODefinedAtom *atom = - new (_allocator) MachODefinedAtom(*this, name, scope, size, noDeadStrip); + new (_allocator) MachODefinedAtom(*this, name, scope, size, noDeadStrip, + align); addAtomForSection(inSection, atom, sectionOffset); } |