Class: ELFTools::Dynamic::HashTable

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

Overview

A table of names the loader looks a symbol up in, instead of searching the symbol table for it.

A file records one of two kinds, or both of them. Both answer the same two questions, how far the symbol table they index reaches and which index a name sits at, and differ in how they are laid out, in how they hash a name, and in which symbols they index at all.

Defined Under Namespace

Classes: Gnu, SysV

Instance Method Summary collapse

Constructor Details

#initialize(stream, offset, elf_class:, endian:) ⇒ HashTable

Instantiate a ELFTools::Dynamic::HashTable object.

Parameters:

  • stream (#pos=, #read)

    Streaming object.

  • offset (Integer)

    The file offset the table starts at.

  • elf_class (Integer)

    32 or 64, the width of a mask of the table.

  • endian (Symbol)

    :little or :big.



20
21
22
23
24
25
# File 'lib/elftools/dynamic/hash_table.rb', line 20

def initialize(stream, offset, elf_class:, endian:)
  @stream = stream
  @offset = offset
  @elf_class = elf_class
  @endian = endian
end