Type:
Class
Constants:
NEXT : Document-const

NEXT

A predefined pseudo-handle of RTLD_NEXT

Which will find the next occurrence of a function in the search order after the current library.

DEFAULT : Document-const

DEFAULT

A predefined pseudo-handle of RTLD_DEFAULT

Which will find the first occurrence of the desired symbol using the default library search order

The DL::Handle is the manner to access the dynamic library

Example

Setup

libc_so = "/lib64/libc.so.6"
=> "/lib64/libc.so.6"
@handle = DL::Handle.new(libc_so)
=> #<DL::Handle:0x00000000d69ef8>

Setup, with flags

libc_so = "/lib64/libc.so.6"
=> "/lib64/libc.so.6"
@handle = DL::Handle.new(libc_so, DL::RTLD_LAZY | DL::RTLD_GLOBAL)
=> #<DL::Handle:0x00000000d69ef8>

Addresses to symbols

strcpy_addr = @handle['strcpy']
=> 140062278451968

or

strcpy_addr = @handle.sym('strcpy')
=> 140062278451968
close_enabled?

close_enabled? Instance Public methods Returns true if dlclose()

2015-04-03 18:23:22
[]

sym(name) Class Public methods Get the address as an

2015-04-03 18:02:40
new

initialize(lib = nil, flags = DL::RTLD_LAZY | DL::RTLD_GLOBAL) Class Public methods Create

2015-04-03 18:03:50
sym 2

sym(name) Instance Public methods Document-method:

2015-04-03 18:31:22
sym

sym(name) Class Public methods Document-method:

2015-04-03 18:10:21
enable_close

enable_close Instance Public methods Enable a call to dlclose() when this

2015-04-03 18:28:36
[] 2

sym(name) Instance Public methods Get the address as an

2015-04-03 18:17:09
to_i

to_i Instance Public methods Returns the memory address for this handle.

2015-04-03 18:34:21
close

close Instance Public methods Close this

2015-04-03 18:21:49
disable_close

disable_close Instance Public methods Disable a call to dlclose() when this

2015-04-03 18:24:08