Class: ELFTools::Sections::RelativeRelocationSection
- Defined in:
- lib/elftools/sections/relative_relocation_section.rb
Overview
Class of the section packing the relocations that only add the load bias.
This section is usually named .relr.dyn, and records the very relocations
the DT_RELR tag points at.
Instance Attribute Summary
Attributes inherited from Section
Instance Method Summary collapse
-
#initialize(header, stream, machine: nil, **_kwargs) ⇒ RelativeRelocationSection
constructor
Instantiate a RelativeRelocationSection object.
-
#num_relocations ⇒ Integer
How many relocations the section packs.
-
#relocations ⇒ Array<ELFTools::Relocation>
The relocations the section packs.
Methods inherited from Section
#allocated?, create, #data, #executable?, #name, #null?, #type, #writable?
Constructor Details
#initialize(header, stream, machine: nil, **_kwargs) ⇒ RelativeRelocationSection
Instantiate a ELFTools::Sections::RelativeRelocationSection object.
21 22 23 24 |
# File 'lib/elftools/sections/relative_relocation_section.rb', line 21 def initialize(header, stream, machine: nil, **_kwargs) @machine = machine super end |
Instance Method Details
#num_relocations ⇒ Integer
How many relocations the section packs.
41 42 43 |
# File 'lib/elftools/sections/relative_relocation_section.rb', line 41 def num_relocations relocations.size end |
#relocations ⇒ Array<ELFTools::Relocation>
The relocations the section packs.
32 33 34 35 36 37 |
# File 'lib/elftools/sections/relative_relocation_section.rb', line 32 def relocations @relocations ||= RelativeRelocations.new( stream, header.sh_offset.to_i...(header.sh_offset.to_i + header.sh_size.to_i), elf_class: header.elf_class, endian: header.class.self_endian, machine: @machine ).to_a end |