Code Comments
Programming Forum and web based access to our favorite programming groups.I have a shared lib I'm opening with dlopen() but do not have access to its source code. It automatically executes an init fn on loading (and fini() in exiting) which do stuff I want to disable. Is there any way to do this programatically? Thanks AB
Post Follow-up to this messageborg@swirve.com (Adrian B.) writes: > I have a shared lib I'm opening with dlopen() but do not have access > to its source code. It automatically executes an init fn on loading > (and fini() in exiting) which do stuff I want to disable. Is there > any way to do this programatically? You could use objcopy to rename those symbols to something harmless. -- Måns Rullgård mru@kth.se
Post Follow-up to this messageMåns Rullgård <mru@kth.se> writes: > borg@swirve.com (Adrian B.) writes: > No, not really. > You could use objcopy to rename those symbols to something harmless. At least on ELF systems, these symbols are not referenced by the dynamic loader "by name"; rather their address is recorded in the the PT_DYNAMIC header as DT_INIT and DT_FINI at link time. Renaming the _init/_fini will not do the OP any good. OTOH, binary-editing the .dynamic section and setting DT_INIT/DT_FINI to some other "harmless" address should do the trick. Cheers, -- In order to understand recursion you must first understand recursion. Remove /-nsp/ for email.
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.