Skip to content

Commit fbc8bca

Browse files
authored
Merge pull request open-mpi#7839 from markalle/interception_early_toc_read_v31x
noinline to avoid compiler reading TOC before PATCHER_BEGIN
2 parents 50cf061 + 1263bb6 commit fbc8bca

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

opal/mca/memory/patcher/memory_patcher_component.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,22 @@ opal_memory_patcher_component_t mca_memory_patcher_component = {
107107
* data. If this can be resolved the two levels can be joined.
108108
*/
109109

110+
/*
111+
* Nathan's original fix described above can have the same problem reappear if the
112+
* interception functions inline themselves.
113+
*/
114+
static void *_intercept_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) __opal_attribute_noinline__;
115+
static int _intercept_munmap(void *start, size_t length) __opal_attribute_noinline__;
116+
#if defined(__linux__)
117+
static void *_intercept_mremap (void *start, size_t oldlen, size_t newlen, int flags, void *new_address) __opal_attribute_noinline__;
118+
#else
119+
static void *_intercept_mremap (void *start, size_t oldlen, void *new_address, size_t newlen, int flags) __opal_attribute_noinline__;
120+
#endif
121+
static int _intercept_madvise (void *start, size_t length, int advice) __opal_attribute_noinline__;
122+
static int _intercept_brk (void *addr) __opal_attribute_noinline__;
123+
static void *_intercept_shmat(int shmid, const void *shmaddr, int shmflg) __opal_attribute_noinline__;
124+
static int _intercept_shmdt (const void *shmaddr) __opal_attribute_noinline__;
125+
110126
#if defined (SYS_mmap)
111127

112128
#if defined(HAVE___MMAP) && !HAVE_DECL___MMAP

0 commit comments

Comments
 (0)