Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a prepend header feature to polkatool #190

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crates/polkavm-common/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4115,6 +4115,11 @@ impl ProgramBlob {
&self.rw_data
}

/// Returns the jump table entry size (z)
pub fn jump_table_entry_size(&self) -> u8 {
self.jump_table_entry_size
}

/// Returns the size of the read-write data section.
///
/// This can be larger than the length of `rw_data`, in which case the rest of the space is assumed to be filled with zeros.
Expand Down
4 changes: 3 additions & 1 deletion crates/polkavm-disassembler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ impl<'a> Disassembler<'a> {
w!("// RO data = {}/{} bytes", self.blob.ro_data().len(), self.blob.ro_data_size());
w!("// RW data = {}/{} bytes", self.blob.rw_data().len(), self.blob.rw_data_size());
w!("// Stack size = {} bytes", self.blob.stack_size());
w!();
w!("// Jump table entry point size = {} bytes", self.blob.jump_table_entry_size());
w!("// RO data = {:?}", self.blob.ro_data());
w!("// RW data = {:?}", self.blob.rw_data());
w!("// Instructions = {}", instructions.len());
w!("// Code size = {} bytes", self.blob.code().len());
w!();
Expand Down
9 changes: 9 additions & 0 deletions services/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[build]
target = "riscv32ema-unknown-none-elf"

[target.riscv32ema-unknown-none-elf]
rustflags = [
"-C", "relocation-model=pie",
"-C", "link-arg=--emit-relocs",
"-C", "link-arg=--unique",
]
4 changes: 4 additions & 0 deletions services/.cargo/solana.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SECTIONS {
.heap_size (INFO) : { *(.heap_size) }
/DISCARD/ : { *(.polkavm_exports .eh_frame .symtab .debug_loc .debug_abbrev .debug_info .debug_aranges .debug_ranges .debug_str .debug_pubnames .debug_pubtypes .debug_line .debug_frame) }
}
1 change: 1 addition & 0 deletions services/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target
103 changes: 103 additions & 0 deletions services/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions services/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[profile.release]
lto = "fat"
panic = "abort"
opt-level = 3
codegen-units = 1
debug = true

[profile.no-lto]
inherits = "release"
lto = false

[workspace]
resolver = "2"
members = [
"fib",
"admin",
"staking",
"accounts",
# "tokens",
]
17 changes: 17 additions & 0 deletions services/accounts/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cargo-features = ["edition2024"]

[package]
name = "accounts"
version = "0.1.0"
edition = "2024"
publish = false

[lib]
name = "accounts"
path = "src/main.rs"
crate-type = ["staticlib", "rlib"]

[dependencies]
polkavm-derive = { path = "../../crates/polkavm-derive" }
simplealloc = { path = "../../crates/simplealloc" }

Loading