1
1
openmpi/opal/util/Makefile.am
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

121 строка
2.8 KiB
Makefile

#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2007-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2013 NVIDIA Corporation. All rights reserved.
# Copyright (c) 2013 Intel, Inc. All rights reserved
# Copyright (c) 2016 Los Alamos National Security, LLC. All rights
# reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
SUBDIRS = keyval
dist_opaldata_DATA = help-opal-util.txt
AM_LFLAGS = -Popal_show_help_yy
LEX_OUTPUT_ROOT = lex.opal_show_help_yy
noinst_LTLIBRARIES = libopalutil.la
AM_CPPFLAGS = $(LTDLINCL)
# Source code files
headers = \
alfg.h \
arch.h \
argv.h \
basename.h \
bit_ops.h \
cmd_line.h \
crc.h \
daemon_init.h \
error.h \
fd.h \
few.h \
if.h \
keyval_parse.h \
malloc.h \
net.h \
numtostr.h \
opal_environ.h \
opal_getcwd.h \
opal_pty.h \
os_dirpath.h \
os_path.h \
output.h \
path.h \
printf.h \
proc.h \
qsort.h \
show_help.h \
show_help_lex.h \
stacktrace.h \
strncpy.h \
sys_limits.h \
timings.h \
uri.h
libopalutil_la_SOURCES = \
$(headers) \
alfg.c \
arch.c \
argv.c \
basename.c \
cmd_line.c \
crc.c \
daemon_init.c \
error.c \
fd.c \
few.c \
if.c \
keyval_parse.c \
malloc.c \
net.c \
numtostr.c \
opal_environ.c \
opal_getcwd.c \
opal_pty.c \
os_dirpath.c \
os_path.c \
output.c \
path.c \
printf.c \
proc.c \
qsort.c \
show_help.c \
show_help_lex.l \
stacktrace.c \
strncpy.c \
sys_limits.c \
uri.c
if OPAL_COMPILE_TIMING
libopalutil_la_SOURCES += timings.c
endif
libopalutil_la_LIBADD = \
keyval/libopalutilkeyval.la
libopalutil_la_DEPENDENCIES = \
keyval/libopalutilkeyval.la
# Conditionally install the header files
if WANT_INSTALL_HEADERS
opaldir = $(opalincludedir)/$(subdir)
opal_HEADERS = $(headers)
endif