@@ -3,7 +3,7 @@ use crate::{
33 elf:: { ElfRelType , ElfSymbol , SymbolInfo , SymbolTable } ,
44 image:: { ElfCore , LoadedCore } ,
55 relocate_error,
6- relocation:: { Relocatable , RelocationContext , RelocationHandler , SymbolLookup } ,
6+ relocation:: { Relocatable , RelocationContext , RelocationHandler , SupportLazy , SymbolLookup } ,
77 sync:: Arc ,
88 tls:: TlsDescDynamicArg ,
99} ;
@@ -330,6 +330,39 @@ where
330330 }
331331 }
332332
333+ /// Executes the relocation process.
334+ ///
335+ /// This method consumes the relocator and returns the relocated ELF object.
336+ /// All configured symbol lookups, handlers, and options are applied.
337+ ///
338+ /// # Returns
339+ /// * `Ok(T::Output)` - The successfully relocated ELF object.
340+ /// * `Err(Error)` - If relocation fails for any reason.
341+ pub fn relocate ( self ) -> Result < T :: Output >
342+ where
343+ D : ' static ,
344+ {
345+ self . object . relocate (
346+ self . scope ,
347+ & self . pre_find ,
348+ & self . post_find ,
349+ & self . pre_handler ,
350+ & self . post_handler ,
351+ self . lazy ,
352+ self . lazy_scope ,
353+ )
354+ }
355+ }
356+
357+ impl < T , PreS , PostS , LazyS , PreH , PostH , D > Relocator < T , PreS , PostS , LazyS , PreH , PostH , D >
358+ where
359+ T : Relocatable < D > + SupportLazy ,
360+ PreS : SymbolLookup ,
361+ PostS : SymbolLookup ,
362+ LazyS : SymbolLookup + Send + Sync + ' static ,
363+ PreH : RelocationHandler ,
364+ PostH : RelocationHandler ,
365+ {
333366 /// Enables or disables lazy binding.
334367 ///
335368 /// When enabled, some relocations (typically PLT entries) will be resolved
@@ -359,29 +392,6 @@ where
359392 lazy_scope : Some ( scope) ,
360393 }
361394 }
362-
363- /// Executes the relocation process.
364- ///
365- /// This method consumes the relocator and returns the relocated ELF object.
366- /// All configured symbol lookups, handlers, and options are applied.
367- ///
368- /// # Returns
369- /// * `Ok(T::Output)` - The successfully relocated ELF object.
370- /// * `Err(Error)` - If relocation fails for any reason.
371- pub fn relocate ( self ) -> Result < T :: Output >
372- where
373- D : ' static ,
374- {
375- self . object . relocate (
376- self . scope ,
377- & self . pre_find ,
378- & self . post_find ,
379- & self . pre_handler ,
380- & self . post_handler ,
381- self . lazy ,
382- self . lazy_scope ,
383- )
384- }
385395}
386396
387397/// A wrapper type for relocation values, providing type safety and arithmetic operations.
0 commit comments