Class: Elf::Symbol

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

Overview

All values here are section offsets

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, section, type, sectoffset, bind, size) ⇒ Symbol

Returns a new instance of Symbol.



125
126
127
128
129
130
131
# File 'lib/mithril/elf.rb', line 125

def initialize(name,section,type,sectoffset, bind,size)
  @name,@section, @type, @sectoffset, @bind, @size = name.to_s,section,type,sectoffset, bind,size
  @is_dynamic = false
  @gnu_version =  :global
  @visibility = ElfFlags::SymbolVisibility::STV_DEFAULT
  @hidden = false
end

Instance Attribute Details

#bindObject

Returns the value of attribute bind.



112
113
114
# File 'lib/mithril/elf.rb', line 112

def bind
  @bind
end

#gnu_versionObject

Returns the value of attribute gnu_version.



113
114
115
# File 'lib/mithril/elf.rb', line 113

def gnu_version
  @gnu_version
end

#hiddenObject

Returns the value of attribute hidden.



113
114
115
# File 'lib/mithril/elf.rb', line 113

def hidden
  @hidden
end

#is_dynamicObject

Returns the value of attribute is_dynamic.



112
113
114
# File 'lib/mithril/elf.rb', line 112

def is_dynamic
  @is_dynamic
end

#nameObject

Returns the value of attribute name.



112
113
114
# File 'lib/mithril/elf.rb', line 112

def name
  @name
end

#sectionObject

Returns the value of attribute section.



112
113
114
# File 'lib/mithril/elf.rb', line 112

def section
  @section
end

#sectoffsetObject

Returns the value of attribute sectoffset.



112
113
114
# File 'lib/mithril/elf.rb', line 112

def sectoffset
  @sectoffset
end

#semanticsObject

Either one of the SHNs or a nil for normal symbols



115
116
117
# File 'lib/mithril/elf.rb', line 115

def semantics
  @semantics
end

#sizeObject

Returns the value of attribute size.



112
113
114
# File 'lib/mithril/elf.rb', line 112

def size
  @size
end

#typeObject

Returns the value of attribute type.



112
113
114
# File 'lib/mithril/elf.rb', line 112

def type
  @type
end

#visibilityObject

One of STV



114
115
116
# File 'lib/mithril/elf.rb', line 114

def visibility
  @visibility
end

Instance Method Details

#dynamic?Boolean

Returns:

  • (Boolean)


116
117
118
# File 'lib/mithril/elf.rb', line 116

def dynamic?
  is_dynamic
end

#undefined?Boolean

Returns:

  • (Boolean)


119
120
121
# File 'lib/mithril/elf.rb', line 119

def undefined?
  semantics == SHN::SHN_UNDEF
end

#weak?Boolean

Returns:

  • (Boolean)


122
123
124
# File 'lib/mithril/elf.rb', line 122

def weak?
  bind == STB::STB_WEAK
end