Class: ELFTools::Sections::Symbol

Inherits:
Object
  • Object
show all
Defined in:
lib/elftools/sections/sym_tab_section.rb

Overview

Class of symbol.

XXX: Should this class be defined in an independent file?

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(header, stream, symstr: nil) ⇒ Symbol

Instantiate a ELFTools::Sections::Symbol object.

Parameters:



114
115
116
117
118
# File 'lib/elftools/sections/sym_tab_section.rb', line 114

def initialize(header, stream, symstr: nil)
  @header = header
  @stream = stream
  @symstr = symstr
end

Instance Attribute Details

#headerELFTools::Structs::ELF32_sym, ELFTools::Structs::ELF64_sym (readonly)

Returns Section header.



103
104
105
# File 'lib/elftools/sections/sym_tab_section.rb', line 103

def header
  @header
end

#stream#pos=, #read (readonly)

Returns Streaming object.

Returns:

  • (#pos=, #read)

    Streaming object.



104
105
106
# File 'lib/elftools/sections/sym_tab_section.rb', line 104

def stream
  @stream
end

Instance Method Details

#nameString

Return the symbol name.

Returns:

  • (String)

    The name.



122
123
124
# File 'lib/elftools/sections/sym_tab_section.rb', line 122

def name
  @name ||= @symstr.call.name_at(header.st_name)
end