mirror of
https://github.com/rui314/mold.git
synced 2024-10-04 16:48:04 +03:00
[Mach-O] Do not write x86-64 NOPs if ARM64
This commit is contained in:
parent
b0c6aa9a0f
commit
73074389ed
@ -539,7 +539,11 @@ static void copy_sections_to_output_file(Context<E> &ctx) {
|
||||
[&](std::unique_ptr<OutputSegment<E>> &seg) {
|
||||
Timer t2(ctx, std::string(seg->cmd.get_segname()), &t);
|
||||
|
||||
// Fill text segment paddings with NOPs
|
||||
// Fill text segment paddings with single-byte NOP instructions so
|
||||
// that otool wouldn't out-of-sync when disassembling an output file.
|
||||
// Do this only for x86-64 because ARM64 instructions are always 4
|
||||
// bytes long.
|
||||
if constexpr (std::is_same_v<E, X86_64>)
|
||||
if (seg->cmd.get_segname() == "__TEXT")
|
||||
memset(ctx.buf + seg->cmd.fileoff, 0x90, seg->cmd.filesize);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user