From 7d23a9daf7d81e37d07613d73f1895c23ec14850 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Thu, 10 Jun 2021 12:54:25 +0200 Subject: [PATCH 1/2] Lower Arm64Call relocations in cranelift-object --- cranelift/object/src/backend.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cranelift/object/src/backend.rs b/cranelift/object/src/backend.rs index 6cf54fc30a..9800791dd4 100644 --- a/cranelift/object/src/backend.rs +++ b/cranelift/object/src/backend.rs @@ -585,6 +585,11 @@ impl ObjectModule { 32, ), Reloc::X86GOTPCRel4 => (RelocationKind::GotRelative, RelocationEncoding::Generic, 32), + Reloc::Arm64Call => ( + RelocationKind::Relative, + RelocationEncoding::AArch64Call, + 26, + ), Reloc::ElfX86_64TlsGd => { assert_eq!( self.object.format(), @@ -614,7 +619,7 @@ impl ObjectModule { ) } // FIXME - _ => unimplemented!(), + reloc => unimplemented!("{:?}", reloc), }; ObjectRelocRecord { offset: record.offset, From e9f3ac20684157ddef802c0f3017430c79b7563c Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 12 Jun 2021 12:02:09 +0200 Subject: [PATCH 2/2] Update object --- Cargo.lock | 4 ++-- cranelift/object/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 351e4e06ab..acd01d9e85 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1847,9 +1847,9 @@ checksum = "17b02fc0ff9a9e4b35b3342880f48e896ebf69f2967921fe8646bf5b7125956a" [[package]] name = "object" -version = "0.25.1" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9023c1c0973b327f073c7f2fceb9bcc049862f93a7d14c6feb46c8a56460a0d5" +checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7" dependencies = [ "crc32fast", "indexmap", diff --git a/cranelift/object/Cargo.toml b/cranelift/object/Cargo.toml index 265cc2e386..311c4f32a7 100644 --- a/cranelift/object/Cargo.toml +++ b/cranelift/object/Cargo.toml @@ -12,7 +12,7 @@ edition = "2018" [dependencies] cranelift-module = { path = "../module", version = "0.75.0" } cranelift-codegen = { path = "../codegen", version = "0.75.0", default-features = false, features = ["std"] } -object = { version = "0.25.0", default-features = false, features = ["write"] } +object = { version = "0.25.3", default-features = false, features = ["write"] } target-lexicon = "0.12" anyhow = "1.0" log = { version = "0.4.6", default-features = false }