@@ -84,9 +84,8 @@ impl WriterRelocate {
8484 match reloc. name {
8585 super :: DebugRelocName :: Section ( _) => unreachable ! ( ) ,
8686 super :: DebugRelocName :: Symbol ( sym) => {
87- let addr = jit_product. lookup_func (
88- cranelift_module:: FuncId :: from_u32 ( sym. try_into ( ) . unwrap ( ) ) ,
89- ) ;
87+ let addr = jit_product
88+ . lookup_func ( cranelift_module:: FuncId :: from_u32 ( sym. try_into ( ) . unwrap ( ) ) ) ;
9089 let val = ( addr as u64 as i64 + reloc. addend ) as u64 ;
9190 self . writer
9291 . write_udata_at ( reloc. offset as usize , val, reloc. size )
@@ -163,12 +162,7 @@ impl Writer for WriterRelocate {
163162 self . write_udata_at ( offset, 0 , size)
164163 }
165164
166- fn write_eh_pointer (
167- & mut self ,
168- address : Address ,
169- eh_pe : gimli:: DwEhPe ,
170- size : u8 ,
171- ) -> Result < ( ) > {
165+ fn write_eh_pointer ( & mut self , address : Address , eh_pe : gimli:: DwEhPe , size : u8 ) -> Result < ( ) > {
172166 match address {
173167 // Address::Constant arm copied from gimli
174168 Address :: Constant ( val) => {
@@ -186,27 +180,25 @@ impl Writer for WriterRelocate {
186180 } ;
187181 self . write_eh_pointer_data ( val, eh_pe. format ( ) , size)
188182 }
189- Address :: Symbol { symbol, addend } => {
190- match eh_pe. application ( ) {
191- gimli:: DW_EH_PE_pcrel => {
192- let size = match eh_pe. format ( ) {
193- gimli:: DW_EH_PE_sdata4 => 4 ,
194- _ => return Err ( gimli:: write:: Error :: UnsupportedPointerEncoding ( eh_pe) ) ,
195- } ;
196- self . relocs . push ( DebugReloc {
197- offset : self . len ( ) as u32 ,
198- size,
199- name : DebugRelocName :: Symbol ( symbol) ,
200- addend,
201- kind : object:: RelocationKind :: Relative ,
202- } ) ;
203- self . write_udata ( 0 , size)
204- }
205- _ => {
206- return Err ( gimli:: write:: Error :: UnsupportedPointerEncoding ( eh_pe) ) ;
207- }
183+ Address :: Symbol { symbol, addend } => match eh_pe. application ( ) {
184+ gimli:: DW_EH_PE_pcrel => {
185+ let size = match eh_pe. format ( ) {
186+ gimli:: DW_EH_PE_sdata4 => 4 ,
187+ _ => return Err ( gimli:: write:: Error :: UnsupportedPointerEncoding ( eh_pe) ) ,
188+ } ;
189+ self . relocs . push ( DebugReloc {
190+ offset : self . len ( ) as u32 ,
191+ size,
192+ name : DebugRelocName :: Symbol ( symbol) ,
193+ addend,
194+ kind : object:: RelocationKind :: Relative ,
195+ } ) ;
196+ self . write_udata ( 0 , size)
208197 }
209- }
198+ _ => {
199+ return Err ( gimli:: write:: Error :: UnsupportedPointerEncoding ( eh_pe) ) ;
200+ }
201+ } ,
210202 }
211203 }
212204}
0 commit comments