mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
fix relocation size
This commit is contained in:
parent
9e3fe7b405
commit
bcfab8d09e
2 changed files with 33 additions and 16 deletions
|
@ -275,17 +275,17 @@ fn generate_wrapper<'a, B: Backend<'a>>(
|
|||
};
|
||||
output.add_symbol(symbol);
|
||||
if let Some(sym_id) = output.symbol_id(name) {
|
||||
let encoding = match backend.target_info().architecture {
|
||||
let (encoding, size) = match backend.target_info().architecture {
|
||||
roc_target::Architecture::Aarch32 => todo!(),
|
||||
roc_target::Architecture::Aarch64 => RelocationEncoding::AArch64Call,
|
||||
roc_target::Architecture::Aarch64 => (RelocationEncoding::AArch64Call, 26),
|
||||
roc_target::Architecture::Wasm32 => todo!(),
|
||||
roc_target::Architecture::X86_32 => todo!(),
|
||||
roc_target::Architecture::X86_64 => RelocationEncoding::X86Branch,
|
||||
roc_target::Architecture::X86_64 => (RelocationEncoding::X86Branch, 32),
|
||||
};
|
||||
|
||||
let reloc = write::Relocation {
|
||||
offset: offset + proc_offset,
|
||||
size: 32,
|
||||
size,
|
||||
kind: RelocationKind::PltRelative,
|
||||
encoding,
|
||||
symbol: sym_id,
|
||||
|
@ -891,17 +891,17 @@ fn build_proc<'a, B: Backend<'a>>(
|
|||
}
|
||||
|
||||
if let Some(sym_id) = output.symbol_id(name.as_bytes()) {
|
||||
let encoding = match target_info.architecture {
|
||||
let (encoding, size) = match target_info.architecture {
|
||||
roc_target::Architecture::Aarch32 => todo!(),
|
||||
roc_target::Architecture::Aarch64 => RelocationEncoding::AArch64Call,
|
||||
roc_target::Architecture::Aarch64 => (RelocationEncoding::AArch64Call, 26),
|
||||
roc_target::Architecture::Wasm32 => todo!(),
|
||||
roc_target::Architecture::X86_32 => todo!(),
|
||||
roc_target::Architecture::X86_64 => RelocationEncoding::X86Branch,
|
||||
roc_target::Architecture::X86_64 => (RelocationEncoding::X86Branch, 32),
|
||||
};
|
||||
|
||||
write::Relocation {
|
||||
offset: offset + proc_offset,
|
||||
size: 32,
|
||||
size,
|
||||
kind: RelocationKind::PltRelative,
|
||||
encoding,
|
||||
symbol: sym_id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue