diff --git a/elf/input-sections.cc b/elf/input-sections.cc index a8b41a4250..b7c5f243c7 100644 --- a/elf/input-sections.cc +++ b/elf/input-sections.cc @@ -196,11 +196,10 @@ void InputSection::write_to(Context &ctx, u8 *buf) { // Copy data if constexpr (E::e_machine == EM_RISCV) { copy_contents_riscv(ctx, buf); + } else if (is_compressed()) { + uncompress(ctx, buf); } else { - if (is_compressed()) - uncompress(ctx, buf); - else - memcpy(buf, contents.data(), contents.size()); + memcpy(buf, contents.data(), contents.size()); } // Apply relocations