//
// Copyright (C) 2022-2026 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#include <vpux_elf/writer.hpp>
#include "vpux/compiler/dialect/ELF/IR/ops.hpp"

void vpux::ELF::PadOp::serialize(elf::writer::BinaryDataSection<uint8_t>& binDataSection) {
    auto padSize = getPaddingSize();

    auto padValue = getPaddingValue().value_or(0);

    SmallVector<uint8_t> padding(padSize, padValue);

    binDataSection.appendData(padding.data(), padSize);
}

size_t vpux::ELF::PadOp::getBinarySize(config::ArchKind) {
    return getPaddingSize();
}
