class ELFTools::Relocation

A relocation entry.

Can be either a REL or RELA relocation. XXX: move this to an independent file?

Attributes

header[R]
stream[R]

Public Class Methods

new(header, stream) click to toggle source

Instantiate a {Relocation} object.

# File lib/elftools/sections/relocation_section.rb, line 82
def initialize(header, stream)
  @header = header
  @stream = stream
end

Public Instance Methods

r_info_sym() click to toggle source

r_info contains sym and type, use two methods to access them easier. @return [Integer] sym infor.

# File lib/elftools/sections/relocation_section.rb, line 90
def r_info_sym
  header.r_info >> mask_bit
end
Also aliased as: symbol_index
r_info_type() click to toggle source

r_info contains sym and type, use two methods to access them easier. @return [Integer] type infor.

# File lib/elftools/sections/relocation_section.rb, line 98
def r_info_type
  header.r_info & ((1 << mask_bit) - 1)
end
Also aliased as: type
symbol_index()
Alias for: r_info_sym
type()
Alias for: r_info_type

Private Instance Methods

mask_bit() click to toggle source
# File lib/elftools/sections/relocation_section.rb, line 105
def mask_bit
  header.elf_class == 32 ? 8 : 32
end