1
1
openmpi/opal/util
Nathan Hjelm 27f8a4e806 opal: add code patcher framework
This commit adds a framework to abstract runtime code patching.
Components in the new framework can provide functions for either
patching a named function or a function pointer. The later
functionality is not being used but may provide a way to allow memory
hooks when dlopen functionality is disabled.

This commit adds two different flavors of code patching. The first is
provided by the overwrite component. This component overwrites the
first several instructions of the target function with code to jump to
the provided hook function. The hook is expected to provide the full
functionality of the hooked function.

The linux patcher component is based on the memory hooks in ucx. It
only works on linux and operates by overwriting function pointers in
the symbol table. In this case the hook is free to call the original
function using the function pointer returned by dlsym.

Both components restore the original functions when the patcher
framework closes.

Changes had to be made to support Power/PowerPC with the Linux
dynamic loader patcher. Some of the changes:

 - Move code necessary for powerpc/power support to the patcher
   base. The code is needed by both the overwrite and linux
   components.

 - Move patch structure down to base and move the patch list to
   mca_patcher_base_module_t. The structure has been modified to
   include a function pointer to the function that will unapply the
   patch. This allows the mixing of multiple different types of
   patches in the patch_list.

 - Update linux patching code to keep track of the matching between
   got entry and original (unpatched) address. This allows us to
   completely clean up the patch on finalize.

All patchers keep track of the changes they made so that they can be
reversed when the patcher framework is closed.

At this time there are bugs in the Linux dynamic loader patcher so
its priority is lower than the overwrite patcher.

Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
2016-04-13 17:16:13 -06:00
..
keyval Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
alfg.c Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
alfg.h Integrate PMIx 1.0 with OMPI. 2015-08-29 16:04:10 -07:00
arch.c Remove the (only two) fortran constants from OPAL. The only places that 2013-01-15 01:27:36 +00:00
arch.h Remove the (only two) fortran constants from OPAL. The only places that 2013-01-15 01:27:36 +00:00
argv.c more c99 updates 2015-06-25 10:14:13 -06:00
argv.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
basename.c more c99 updates 2015-06-25 10:14:13 -06:00
basename.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
bit_ops.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
cmd_line.c Refactor the ORTE DVM code so that external codes can submit multiple jobs using only a single connection to the HNP. 2016-02-13 08:10:44 -08:00
cmd_line.h Refactor the ORTE DVM code so that external codes can submit multiple jobs using only a single connection to the HNP. 2016-02-13 08:10:44 -08:00
crc.c more c99 updates 2015-06-25 10:14:13 -06:00
crc.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
daemon_init.c Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
daemon_init.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
error.c more c99 updates 2015-06-25 10:14:13 -06:00
error.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
fd.c Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
fd.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
few.c Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
few.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
help-opal-util.txt Cleanup the updated sys limits capability. Fix a few copy/paste bugs (my bad). Shift the limit set to the ODLS default module so that we sete the limits for all apps, even those that don't call opal_init. Leave it in opal_init as well to support direct-launch apps, but ensure we only set the limits once by removing the envar after launch by ODLS. 2013-04-04 16:00:17 +00:00
if.c opal/util: fix parse_ipv4_dots prototype 2015-10-01 14:03:08 +09:00
if.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
keyval_parse.c opal/keval_parse: fix conditional ordering 2016-03-08 10:06:14 -07:00
keyval_parse.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
Makefile.am opal: add code patcher framework 2016-04-13 17:16:13 -06:00
malloc.c Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
malloc.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
net.c Cleanup Coverity issues 2015-08-29 21:19:27 -07:00
net.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
numtostr.c Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
numtostr.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
opal_environ.c Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
opal_environ.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
opal_getcwd.c more c99 updates 2015-06-25 10:14:13 -06:00
opal_getcwd.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
opal_pty.c more c99 updates 2015-06-25 10:14:13 -06:00
opal_pty.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
os_dirpath.c Revert "Modify singularity support per patch from Greg Kurtzer" 2016-03-24 11:27:18 -07:00
os_dirpath.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
os_path.c Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
os_path.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
output.c Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
output.h more c99 updates 2015-06-25 10:14:13 -06:00
path.c - extend opal_path_nfs to retrieve the file system type 2016-01-26 13:36:21 -06:00
path.h - extend opal_path_nfs to retrieve the file system type 2016-01-26 13:36:21 -06:00
printf.c Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
printf.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
proc.c Silence a couple of warnings - strncpy returns a char*, not an int 2016-01-16 09:44:52 -08:00
proc.h opal: replace opal_convert_jobid_to_string with opal_snprintf_jobid 2016-01-14 10:39:03 +09:00
qsort.c Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
qsort.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
show_help_lex.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
show_help_lex.l Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
show_help.c Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
show_help.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
stacktrace.c more c99 updates 2015-06-25 10:14:13 -06:00
stacktrace.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
strncpy.c Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
strncpy.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
sys_limits.c more c99 updates 2015-06-25 10:14:13 -06:00
sys_limits.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
timings.c more c99 updates 2015-06-25 10:14:13 -06:00
timings.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
uri.c Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
uri.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00