Class: ELFTools::Sections::DynamicSection

Inherits:
Section
  • Object
show all
Includes:
Dynamic
Defined in:
lib/elftools/sections/dynamic_section.rb

Overview

Class for dynamic table section.

This section should always be named .dynamic. This class knows how to get the list of dynamic tags.

Instance Attribute Summary

Attributes inherited from Section

#header, #stream

Instance Method Summary collapse

Methods included from Dynamic

#each_tag, #relocations, #tag_at, #tag_by_type, #tags, #tags_by_type

Methods included from Dynamic::Symbols

#each_symbol, #num_symbols, #symbol_at, #symbol_by_name, #symbols

Methods inherited from Section

create, #data, #name, #null?, #type

Constructor Details

#initialize(header, stream, machine: nil, **_kwargs) ⇒ DynamicSection

Instantiate a ELFTools::Sections::DynamicSection object.

Parameters:

  • header (ELFTools::Structs::ELF_Shdr)

    See Section#initialize for more information.

  • stream (#pos=, #read)

    See Section#initialize for more information.

  • machine (Integer) (defaults to: nil)

    The machine of the ELF file, which decides what the entries a tag points at mean. This should be e_machine of the ELF header.



23
24
25
26
# File 'lib/elftools/sections/dynamic_section.rb', line 23

def initialize(header, stream, machine: nil, **_kwargs)
  @machine = machine
  super
end

Instance Method Details

#tag_startInteger

Get the start address of tags.

Returns:

  • (Integer)

    Start address of tags.



30
31
32
# File 'lib/elftools/sections/dynamic_section.rb', line 30

def tag_start
  header.sh_offset
end