Class: Bfd::Symbol

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

Constant Summary collapse

FLAG_LOCAL =

From bfd.h: ‘The symbol has local scope; <<static>> in <<C>>. The value is the offset into the section of the data.’

'LOCAL'
FLAG_GLOBAL =

From bfd.h: ‘The symbol has global scope; initialized data in <<C>>. The value is the offset into the section of the data.’

'GLOBAL'
FLAG_DEBUG =

From bfd.h: ‘The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set.’

'DEBUGGING'
FLAG_FUNC =

From bfd.h: ‘The symbol denotes a function entry point. Used in ELF, perhaps others someday.’

'FUNCTION'
FLAG_WEAK =

From bfd.h: ‘A weak global symbol, overridable without warnings by a regular global symbol of the same name.’

'WEAK'
FLAG_SEC =

From bfd.h: ‘This symbol was created to point to a section, e.g. ELF’s STT_SECTION symbols.‘

'SECTION_SYM'
FLAG_CTOR =

From bfd.h: ‘Signal that the symbol is the label of constructor section.’

'CONSTRUCTOR'
FLAG_INDIRECT =

From bfd.h: ‘Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol.’

'INDIRECT'
FLAG_FILE =

From bfd.h: ‘BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols.’

'FILE'
FLAG_DYNAMIC =

From bfd.h: ‘Symbol is from dynamic linking information.’

'DYNAMIC'
FLAG_OBJ =

From bfd.h: ‘The symbol denotes a data object. Used in ELF, and perhaps others someday.’

'OBJECT'
FLAG_THREAD =

From bfd.h: ‘This symbol is thread local. Used in ELF.’

'THREAD_LOCAL'
FLAGS =

Symbol flags. Defined in /usr/include/bfd.h : typedef struct bfd_symbol. From bfd.h: ‘A normal C symbol would be one of:

<<BSF_LOCAL>>, <<BSF_COMMON>>,  <<BSF_UNDEFINED>> or
<<BSF_GLOBAL>>.'
{ 0x000001 => FLAG_LOCAL,
        0x000002 => FLAG_GLOBAL,
        0x000004 => FLAG_DEBUG,
        0x000008 => FLAG_FUNC,
        0x000020 => 'KEEP',
        0x000040 => 'KEEP_G',
        0x000080 => FLAG_WEAK,
        0x000100 => FLAG_SEC,
        0x000200 => 'OLD_COMMON',
        0x000400 => 'NOT_AT_END',
        0x000800 => FLAG_CTOR,
        0x001000 => 'WARNING',
        0x002000 => FLAG_INDIRECT,
        0x004000 => FLAG_FILE,
        0x008000 => FLAG_DYNAMIC,
        0x010000 => FLAG_OBJ,
        0x020000 => 'DEBUGGING_RELOC',
        0x040000 => FLAG_THREAD,
        0x080000 => 'RELC',
        0x100000 => 'SRELC',
        0x200000 => 'SYNTHETIC',
        0x400000 => 'GNU_INDIRECT_FUNCTION',
        0x800000 => 'GNU_UNIQUE' 
}

Instance Method Summary collapse

Instance Method Details

#flagsObject

Return an array of the names of the bit-flags that are set in Symbol. See raw_flags.



461
462
463
464
465
# File 'lib/BFD.rb', line 461

def flags()
  f = []
  FLAGS.each { |k,v| f << v if (@raw_flags & k > 0) }
  return f
end

#inspectObject



471
472
473
# File 'lib/BFD.rb', line 471

def inspect
  "%s 0x%X %s" % [@name, @value, flags.join('|')]
end

#to_sObject



467
468
469
# File 'lib/BFD.rb', line 467

def to_s
  "#{@name} (#{@binding})"
end