File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,6 +42,9 @@ pub const DT_SYMTAB: usize = 6;
4242pub const DT_RELA : usize = 7 ;
4343pub const DT_RELASZ : usize = 8 ;
4444pub const DT_RELAENT : usize = 9 ;
45+ pub const DT_REL : usize = 17 ;
46+ pub const DT_RELSZ : usize = 18 ;
47+ pub const DT_RELENT : usize = 19 ;
4548pub const DT_SYMENT : usize = 11 ;
4649pub const DT_VERSYM : usize = 0x6fff_fff0 ;
4750pub const DT_VERDEF : usize = 0x6fff_fffc ;
@@ -233,6 +236,34 @@ impl Elf_Rela {
233236 }
234237}
235238
239+ #[ cfg( target_pointer_width = "32" ) ]
240+ #[ repr( C ) ]
241+ pub struct Elf_Rel {
242+ pub r_offset : usize ,
243+ pub r_info : u32 ,
244+ }
245+
246+ #[ cfg( target_pointer_width = "64" ) ]
247+ #[ repr( C ) ]
248+ pub struct Elf_Rel {
249+ pub r_offset : usize ,
250+ pub r_info : u64 ,
251+ }
252+
253+ impl Elf_Rel {
254+ #[ inline]
255+ pub fn type_ ( & self ) -> u32 {
256+ #[ cfg( target_pointer_width = "32" ) ]
257+ {
258+ self . r_info & 0xff
259+ }
260+ #[ cfg( target_pointer_width = "64" ) ]
261+ {
262+ ( self . r_info & 0xffff_ffff ) as u32
263+ }
264+ }
265+ }
266+
236267#[ cfg( target_arch = "x86_64" ) ]
237268pub const R_RELATIVE : u32 = 8 ; // `R_X86_64_RELATIVE`
238269#[ cfg( target_arch = "x86" ) ]
You can’t perform that action at this time.
0 commit comments