| ... | @@ -51,10 +51,10 @@ pub fn isIFunc(symbol: Symbol, elf_file: *Elf) bool { | ... | @@ -51,10 +51,10 @@ pub fn isIFunc(symbol: Symbol, elf_file: *Elf) bool { |
| 51 | } | 51 | } |
| 52 | | 52 | |
| 53 | pub fn @"type"(symbol: Symbol, elf_file: *Elf) u4 { | 53 | pub fn @"type"(symbol: Symbol, elf_file: *Elf) u4 { |
| 54 | const s_sym = symbol.elfSym(elf_file); | 54 | const esym = symbol.elfSym(elf_file); |
| 55 | const file_ptr = symbol.file(elf_file).?; | 55 | const file_ptr = symbol.file(elf_file).?; |
| 56 | if (s_sym.st_type() == elf.STT_GNU_IFUNC and file_ptr == .shared_object) return elf.STT_FUNC; | 56 | if (esym.st_type() == elf.STT_GNU_IFUNC and file_ptr == .shared_object) return elf.STT_FUNC; |
| 57 | return s_sym.st_type(); | 57 | return esym.st_type(); |
| 58 | } | 58 | } |
| 59 | | 59 | |
| 60 | pub fn name(symbol: Symbol, elf_file: *Elf) [:0]const u8 { | 60 | pub fn name(symbol: Symbol, elf_file: *Elf) [:0]const u8 { |
| ... | @@ -111,7 +111,7 @@ pub fn gotAddress(symbol: Symbol, elf_file: *Elf) u64 { | ... | @@ -111,7 +111,7 @@ pub fn gotAddress(symbol: Symbol, elf_file: *Elf) u64 { |
| 111 | } | 111 | } |
| 112 | | 112 | |
| 113 | pub fn pltGotAddress(symbol: Symbol, elf_file: *Elf) u64 { | 113 | pub fn pltGotAddress(symbol: Symbol, elf_file: *Elf) u64 { |
| 114 | if (!(symbol.flags.has_plt and symbol.flags.has_got and !symbol.flags.is_canonical)) return 0; | 114 | if (!(symbol.flags.has_plt and symbol.flags.has_got)) return 0; |
| 115 | const extras = symbol.extra(elf_file).?; | 115 | const extras = symbol.extra(elf_file).?; |
| 116 | const shdr = elf_file.shdrs.items[elf_file.plt_got_section_index.?]; | 116 | const shdr = elf_file.shdrs.items[elf_file.plt_got_section_index.?]; |
| 117 | return shdr.sh_addr + extras.plt_got * 16; | 117 | return shdr.sh_addr + extras.plt_got * 16; |