@@ -126,6 +126,7 @@ impl<'a> Object<'a> {
126
126
Architecture :: Arm => false ,
127
127
Architecture :: Avr => true ,
128
128
Architecture :: Bpf => false ,
129
+ Architecture :: Csky => true ,
129
130
Architecture :: I386 => false ,
130
131
Architecture :: X86_64 => true ,
131
132
Architecture :: X86_64_X32 => true ,
@@ -329,6 +330,7 @@ impl<'a> Object<'a> {
329
330
Architecture :: Arm => elf:: EM_ARM ,
330
331
Architecture :: Avr => elf:: EM_AVR ,
331
332
Architecture :: Bpf => elf:: EM_BPF ,
333
+ Architecture :: Csky => elf:: EM_CSKY ,
332
334
Architecture :: I386 => elf:: EM_386 ,
333
335
Architecture :: X86_64 => elf:: EM_X86_64 ,
334
336
Architecture :: X86_64_X32 => elf:: EM_X86_64 ,
@@ -548,6 +550,16 @@ impl<'a> Object<'a> {
548
550
return Err ( Error ( format ! ( "unimplemented relocation {:?}" , reloc) ) ) ;
549
551
}
550
552
} ,
553
+ Architecture :: Csky => match ( reloc. kind , reloc. encoding , reloc. size ) {
554
+ ( RelocationKind :: Absolute , _, 32 ) => elf:: R_CKCORE_ADDR32 ,
555
+ ( RelocationKind :: Relative , RelocationEncoding :: Generic , 32 ) => {
556
+ elf:: R_CKCORE_PCREL32
557
+ }
558
+ ( RelocationKind :: Elf ( x) , _, _) => x,
559
+ _ => {
560
+ return Err ( Error ( format ! ( "unimplemented relocation {:?}" , reloc) ) ) ;
561
+ }
562
+ } ,
551
563
Architecture :: I386 => match ( reloc. kind , reloc. size ) {
552
564
( RelocationKind :: Absolute , 32 ) => elf:: R_386_32 ,
553
565
( RelocationKind :: Relative , 32 ) => elf:: R_386_PC32 ,
0 commit comments