Class: Elf::Dynamic::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/elf/dynamic.rb

Overview

A .dynamic section entry

Direct Known Subclasses

SectionLink, StringEntry, TimestampEntry

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, file) ⇒ Entry

Returns a new instance of Entry.



175
176
177
178
179
180
181
182
183
# File 'lib/elf/dynamic.rb', line 175

def initialize(type, file)
  @file = file
  @type = type
  @value = case type.attribute
           when :Address then @file.read_addr
           when :Value then @file.elf_class == Class::Elf32 ? @file.read_word : @file.read_xword
           else @file.read_addr
           end
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



173
174
175
# File 'lib/elf/dynamic.rb', line 173

def type
  @type
end

#valueObject (readonly)

Returns the value of attribute value.



173
174
175
# File 'lib/elf/dynamic.rb', line 173

def value
  @value
end