diff options
Diffstat (limited to 'vendor/object/src/write/elf')
-rw-r--r-- | vendor/object/src/write/elf/object.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/vendor/object/src/write/elf/object.rs b/vendor/object/src/write/elf/object.rs index 8b9eadaf8..acc820c9e 100644 --- a/vendor/object/src/write/elf/object.rs +++ b/vendor/object/src/write/elf/object.rs @@ -126,6 +126,7 @@ impl<'a> Object<'a> { Architecture::Arm => false, Architecture::Avr => true, Architecture::Bpf => false, + Architecture::Csky => true, Architecture::I386 => false, Architecture::X86_64 => true, Architecture::X86_64_X32 => true, @@ -329,6 +330,7 @@ impl<'a> Object<'a> { Architecture::Arm => elf::EM_ARM, Architecture::Avr => elf::EM_AVR, Architecture::Bpf => elf::EM_BPF, + Architecture::Csky => elf::EM_CSKY, Architecture::I386 => elf::EM_386, Architecture::X86_64 => elf::EM_X86_64, Architecture::X86_64_X32 => elf::EM_X86_64, @@ -548,6 +550,16 @@ impl<'a> Object<'a> { return Err(Error(format!("unimplemented relocation {:?}", reloc))); } }, + Architecture::Csky => match (reloc.kind, reloc.encoding, reloc.size) { + (RelocationKind::Absolute, _, 32) => elf::R_CKCORE_ADDR32, + (RelocationKind::Relative, RelocationEncoding::Generic, 32) => { + elf::R_CKCORE_PCREL32 + } + (RelocationKind::Elf(x), _, _) => x, + _ => { + return Err(Error(format!("unimplemented relocation {:?}", reloc))); + } + }, Architecture::I386 => match (reloc.kind, reloc.size) { (RelocationKind::Absolute, 32) => elf::R_386_32, (RelocationKind::Relative, 32) => elf::R_386_PC32, |