llvm-project/llvm/lib/ObjCopy/MachO
Daniel Rodríguez Troitiño dd2165ef88 [objcopy] Fix order of Mach-O LINKEDIT pieces during layout
The exports trie and the chained fixups where in the opposite order, and
function starts happenned before them, instead of after them.

Restore the correct order and rewrite the code to make it easier to move
around in the future if needed by reusing the `Offset` variable and
keeping both the `StartOf...` and the size of each piece together.

This was found out while trying to use the system strip in a binary
already stripped by LLVM and receiving errors around chained fixups when
we enabled those in the linker.

Reviewed By: alexander-shaposhnikov

Differential Revision: https://reviews.llvm.org/D133974
2022-11-11 12:05:57 -08:00
..
MachOLayoutBuilder.cpp [objcopy] Fix order of Mach-O LINKEDIT pieces during layout 2022-11-11 12:05:57 -08:00
MachOLayoutBuilder.h [ObjCopy][NFC] Add missing const in MachOLayoutBuilder.h 2022-04-10 01:29:24 +00:00
MachOObjcopy.cpp [llvm] Don't use Optional::getValue (NFC) 2022-06-20 22:45:45 -07:00
MachOObject.cpp [objcopy][MachO] Clean up Section ctors, NFC 2022-10-15 00:53:52 +00:00
MachOObject.h [llvm-objcopy][MachO] Add support for LC_DYLIB_CODE_SIGN_DRS 2022-10-14 15:41:19 -07:00
MachOReader.cpp [llvm-objcopy][MachO] Add support for LC_DYLIB_CODE_SIGN_DRS 2022-10-14 15:41:19 -07:00
MachOReader.h [llvm-objcopy][MachO] Add support for LC_DYLIB_CODE_SIGN_DRS 2022-10-14 15:41:19 -07:00
MachOWriter.cpp [llvm-objcopy][MachO] Add support for LC_DYLIB_CODE_SIGN_DRS 2022-10-14 15:41:19 -07:00
MachOWriter.h [llvm-objcopy][MachO] Add support for LC_DYLIB_CODE_SIGN_DRS 2022-10-14 15:41:19 -07:00