[mach-o] Add support for -sectalign option
authorNick Kledzik <kledzik@apple.com>
Wed, 30 Jul 2014 00:58:06 +0000 (00:58 +0000)
committerNick Kledzik <kledzik@apple.com>
Wed, 30 Jul 2014 00:58:06 +0000 (00:58 +0000)
commit2fcbe822c0be8773505afd9e4080d71f8a05953d
tree255020232526c15b71f88569408a13cd6146244b
parentf73da98f488c8177eb69b846a9f6045e01db6792
[mach-o] Add support for -sectalign option

The -sectalign option is used to increase the alignment required for a section.
It required some reworking of how the __TEXT segment is laid out because that
segment also contains the mach_header and load commands. And the size of load
commands depend on the number of segments, sections, and dependent dylibs used.

Using this option will simplify some future test cases because the final
address of code can be pinned down, making tests of its content easier.

llvm-svn: 214268
lld/include/lld/ReaderWriter/MachOLinkingContext.h
lld/lib/Driver/DarwinLdDriver.cpp
lld/lib/Driver/DarwinLdOptions.td
lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp
lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
lld/test/mach-o/sectalign.yaml [new file with mode: 0644]