Skip to content

Commit

Permalink
Update object dependency to 0.36.0
Browse files Browse the repository at this point in the history
  • Loading branch information
philipc committed May 26, 2024
1 parent 1b8a280 commit 0d9a980
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: ['ubuntu-latest']
rust_channel: ['stable', 'beta', 'nightly', '1.65.0']
rust_channel: ['stable', 'beta', 'nightly']
include:
- rust_channel: stable
os: macOS-latest
Expand Down Expand Up @@ -50,6 +50,17 @@ jobs:
- name: Test
run: cargo test --verbose --no-default-features --features read-all -p gimli

msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install rust
uses: dtolnay/[email protected]
- name: Build
run: cargo build --verbose -p gimli
- name: Test
run: cargo test --verbose -p gimli

build_fuzz_targets:
name: Build fuzz targets
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion crates/examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fallible-iterator = { version = "0.3.0", default-features = false, optional = tr
getopts = "0.2"
memmap2 = "0.9.4"
num_cpus = "1"
object = { version = "0.35.0", features = ["wasm", "write"] }
object = { version = "0.36.0", features = ["wasm", "write"] }
rayon = "1.0"
regex = "1"
typed-arena = "2"
Expand Down
17 changes: 8 additions & 9 deletions crates/examples/src/bin/simple_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,21 +250,20 @@ fn define_main(
// ret
main_data.extend_from_slice(&[0xc3]);

// Add the main function in its own subsection (equivalent to -ffunction-sections).
let (main_section, main_offset) =
obj.add_subsection(object::write::StandardSection::Text, b"main", &main_data, 1);
// Add a globally visible symbol for the main function.
let main_size = main_data.len() as u64;
let main_symbol = obj.add_symbol(object::write::Symbol {
name: (*b"main").into(),
value: main_offset,
size: main_size,
value: 0,
size: 0,
kind: object::SymbolKind::Text,
scope: object::SymbolScope::Linkage,
weak: false,
section: object::write::SymbolSection::Section(main_section),
section: object::write::SymbolSection::Undefined,
flags: object::SymbolFlags::None,
});
// Add the main function in its own subsection (equivalent to -ffunction-sections).
let main_section = obj.add_subsection(object::write::StandardSection::Text, b"main");
let main_offset = obj.add_symbol_data(main_symbol, main_section, &main_data, 1);

// Add a read only string constant for the puts argument.
// We don't create a symbol for the constant, but instead refer to it by
Expand All @@ -277,7 +276,7 @@ fn define_main(
obj.add_relocation(
main_section,
object::write::Relocation {
offset: s_reloc_offset as u64,
offset: main_offset + s_reloc_offset as u64,
symbol: rodata_symbol,
addend: s_offset as i64 + s_reloc_addend,
flags: s_reloc_flags,
Expand Down Expand Up @@ -307,5 +306,5 @@ fn define_main(
},
)?;

Ok((main_symbol, main_size))
Ok((main_symbol, main_data.len() as u64))
}

0 comments on commit 0d9a980

Please sign in to comment.