Class: ELFTools::Relocation
- Inherits:
-
Object
- Object
- ELFTools::Relocation
- Defined in:
- lib/elftools/relocation.rb
Overview
A relocation entry.
Can be either a REL or RELA relocation.
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, machine: nil) ⇒ Relocation
constructor
Instantiate a Relocation object.
-
#symbol_index ⇒ Integer
Which symbol this relocation is against, as an index into the symbol table.
-
#type ⇒ Integer
What this relocation does, which only means something together with the machine of the file.
-
#type_name ⇒ String
The name of #type.
Constructor Details
#initialize(header, stream, machine: nil) ⇒ Relocation
Instantiate a ELFTools::Relocation object.
20 21 22 23 24 |
# File 'lib/elftools/relocation.rb', line 20 def initialize(header, stream, machine: nil) @header = header @stream = stream @machine = machine end |
Instance Attribute Details
#header ⇒ ELFTools::Structs::ELF_Rel, ELFTools::Structs::ELF_Rela (readonly)
Returns Rel(a) header.
10 11 12 |
# File 'lib/elftools/relocation.rb', line 10 def header @header end |
#stream ⇒ #pos=, #read (readonly)
Returns Streaming object.
11 12 13 |
# File 'lib/elftools/relocation.rb', line 11 def stream @stream end |
Instance Method Details
#symbol_index ⇒ Integer
Which symbol this relocation is against, as an index into the symbol table.
29 30 31 |
# File 'lib/elftools/relocation.rb', line 29 def symbol_index sym_and_type.first end |
#type ⇒ Integer
What this relocation does, which only means something together with the machine of the file. #type_name names it.
36 37 38 |
# File 'lib/elftools/relocation.rb', line 36 def type sym_and_type.last end |