Files
revive/crates/llvm-context/src/polkavm/context/build.rs
T
xermicus 6858cb9a61 mark internal functions linker private (#381)
Prevents unused functions in the emitted ELF object. Drive-by add a
missing test case (which misses a relocation under `-Oz` when all
internal functions are marked as private).

---------

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
2025-09-29 17:55:29 +02:00

31 lines
835 B
Rust

//! The LLVM module build.
use revive_common::BYTE_LENGTH_WORD;
use serde::Deserialize;
use serde::Serialize;
/// The LLVM module build.
#[derive(Debug, Serialize, Deserialize)]
pub struct Build {
/// The PolkaVM text assembly.
pub assembly_text: Option<String>,
/// The metadata hash.
pub metadata_hash: Option<[u8; BYTE_LENGTH_WORD]>,
/// The PolkaVM binary bytecode.
pub bytecode: Vec<u8>,
/// The PolkaVM bytecode hash. Unlinked builds don't have a hash yet.
pub bytecode_hash: Option<[u8; BYTE_LENGTH_WORD]>,
}
impl Build {
/// A shortcut constructor.
pub fn new(metadata_hash: Option<[u8; BYTE_LENGTH_WORD]>, bytecode: Vec<u8>) -> Self {
Self {
assembly_text: None,
metadata_hash,
bytecode,
bytecode_hash: None,
}
}
}