Class: ELFTools::Relocation
- Inherits:
-
Object
- Object
- ELFTools::Relocation
- Defined in:
- lib/elftools/sections/relocation_section.rb
Overview
A relocation entry.
Can be either a REL or RELA relocation. XXX: move this to an independent file?
Instance Attribute Summary collapse
-
#header ⇒ ELFTools::Structs::ELF_Rel, ELFTools::Structs::ELF_Rela
readonly
Rel(a) header.
-
#stream ⇒ #pos=, #read
readonly
Streaming object.
Instance Method Summary collapse
-
#initialize(header, stream) ⇒ Relocation
constructor
Instantiate a Relocation object.
-
#r_info_sym ⇒ Integer
(also: #symbol_index)
r_info
contains sym and type, use two methods to access them easier. -
#r_info_type ⇒ Integer
(also: #type)
r_info
contains sym and type, use two methods to access them easier.
Constructor Details
#initialize(header, stream) ⇒ Relocation
Instantiate a ELFTools::Relocation object.
82 83 84 85 |
# File 'lib/elftools/sections/relocation_section.rb', line 82 def initialize(header, stream) @header = header @stream = stream end |
Instance Attribute Details
#header ⇒ ELFTools::Structs::ELF_Rel, ELFTools::Structs::ELF_Rela (readonly)
Returns Rel(a) header.
78 79 80 |
# File 'lib/elftools/sections/relocation_section.rb', line 78 def header @header end |
#stream ⇒ #pos=, #read (readonly)
Returns Streaming object.
79 80 81 |
# File 'lib/elftools/sections/relocation_section.rb', line 79 def stream @stream end |
Instance Method Details
#r_info_sym ⇒ Integer Also known as: symbol_index
r_info
contains sym and type, use two methods to access them easier.
90 91 92 |
# File 'lib/elftools/sections/relocation_section.rb', line 90 def r_info_sym header.r_info >> mask_bit end |
#r_info_type ⇒ Integer Also known as: type
r_info
contains sym and type, use two methods to access them easier.
98 99 100 |
# File 'lib/elftools/sections/relocation_section.rb', line 98 def r_info_type header.r_info & ((1 << mask_bit) - 1) end |