diff options
author | Alexander Ivchenko <aivchenk@gcc.gnu.org> | 2016-12-27 15:35:19 +0000 |
---|---|---|
committer | Alexander Ivchenko <aivchenk@gcc.gnu.org> | 2016-12-27 15:35:19 +0000 |
commit | bffa6b6c6214169d8d10f05a418f9f072235f068 (patch) | |
tree | e2879c0655bdacaf6b2e1c5755568957d0b3f79d /libmpx | |
parent | 2700d0e3ab767c765246cdc480ff7ad5792eb2e6 (diff) | |
download | gcc-bffa6b6c6214169d8d10f05a418f9f072235f068.tar.gz |
libtool-version: New version.
libmpx/
2016-12-27 H.J. Lu <hongjiu.lu@intel.com>
Alexander Ivchenko <alexander.ivchenko@intel.com>
* mpxwrap/libtool-version: New version.
* mpxwrap/mpx_wrappers.c (__mpx_wrapper_realloc): Make it
static with external alias.
(__mpx_wrapper_bzero): Ditto.
(mpx_wrapper_memcpy): Ditto.
(__mpx_wrapper_mempcpy): Ditto.
From-SVN: r243942
Diffstat (limited to 'libmpx')
-rw-r--r-- | libmpx/ChangeLog | 10 | ||||
-rw-r--r-- | libmpx/mpxwrap/libtool-version | 2 | ||||
-rw-r--r-- | libmpx/mpxwrap/mpx_wrappers.c | 35 |
3 files changed, 34 insertions, 13 deletions
diff --git a/libmpx/ChangeLog b/libmpx/ChangeLog index 4f7a68425da..67ae96a352e 100644 --- a/libmpx/ChangeLog +++ b/libmpx/ChangeLog @@ -1,3 +1,13 @@ +2016-12-27 H.J. Lu <hongjiu.lu@intel.com> + Alexander Ivchenko <alexander.ivchenko@intel.com> + + * mpxwrap/libtool-version: New version. + * mpxwrap/mpx_wrappers.c (__mpx_wrapper_realloc): Make it + static with external alias. + (__mpx_wrapper_bzero): Ditto. + (mpx_wrapper_memcpy): Ditto. + (__mpx_wrapper_mempcpy): Ditto. + 2016-12-26 Alexander Ivchenko <alexander.ivchenko@intel.com> * mpxrt/libtool-version: New version. diff --git a/libmpx/mpxwrap/libtool-version b/libmpx/mpxwrap/libtool-version index fab30fb091d..e241350d23b 100644 --- a/libmpx/mpxwrap/libtool-version +++ b/libmpx/mpxwrap/libtool-version @@ -3,4 +3,4 @@ # a separate file so that version updates don't involve re-running # automake. # CURRENT:REVISION:AGE -2:0:0 +2:1:0 diff --git a/libmpx/mpxwrap/mpx_wrappers.c b/libmpx/mpxwrap/mpx_wrappers.c index 171a780311d..aea0346b933 100644 --- a/libmpx/mpxwrap/mpx_wrappers.c +++ b/libmpx/mpxwrap/mpx_wrappers.c @@ -30,14 +30,20 @@ #include <assert.h> #include "mpxrt/mpxrt.h" -void * -__mpx_wrapper_malloc (size_t size) +/* Since internal MPX wrapper calls must avoid PLT which will clear bound + registers, we make them static with an external alias. */ +#define EXTERN_ALIAS(f) \ + __typeof (f) __##f __attribute__((alias(#f))); + +static void * +mpx_wrapper_malloc (size_t size) { void *p = (void *)malloc (size); if (!p) return __bnd_null_ptr_bounds (p); return __bnd_set_ptr_bounds (p, size); } +EXTERN_ALIAS (mpx_wrapper_malloc) void * __mpx_wrapper_mmap (void *addr, size_t length, int prot, int flags, @@ -52,7 +58,7 @@ void * __mpx_wrapper_realloc (void *ptr, size_t n) { if (!ptr) - return __mpx_wrapper_malloc (n); + return mpx_wrapper_malloc (n); /* We don't kwnow how much data is copied by realloc and therefore may check only lower bounds. */ @@ -74,8 +80,8 @@ __mpx_wrapper_calloc (size_t n_elements, size_t element_size) return __bnd_set_ptr_bounds (p, n_elements * element_size); } -void * -__mpx_wrapper_memset (void *dstpp, int c, size_t len) +static void * +mpx_wrapper_memset (void *dstpp, int c, size_t len) { if (len > 0) { @@ -85,10 +91,12 @@ __mpx_wrapper_memset (void *dstpp, int c, size_t len) return dstpp; } +EXTERN_ALIAS (mpx_wrapper_memset) + void __mpx_wrapper_bzero (void *dst, size_t len) { - __mpx_wrapper_memset (dst, 0, len); + mpx_wrapper_memset (dst, 0, len); } /* The mpx_pointer type is used for getting bits @@ -484,8 +492,8 @@ move_bounds (void *dst, const void *src, size_t n) return; } -void * -__mpx_wrapper_memmove (void *dst, const void *src, size_t n) +static void * +mpx_wrapper_memmove (void *dst, const void *src, size_t n) { if (n == 0) return dst; @@ -513,17 +521,20 @@ __mpx_wrapper_memmove (void *dst, const void *src, size_t n) return dst; } +EXTERN_ALIAS (mpx_wrapper_memmove) -void * -__mpx_wrapper_memcpy (void *dst, const void *src, size_t n) +static void * +mpx_wrapper_memcpy (void *dst, const void *src, size_t n) { - return __mpx_wrapper_memmove (dst, src, n); + return mpx_wrapper_memmove (dst, src, n); } +EXTERN_ALIAS (mpx_wrapper_memcpy) + void * __mpx_wrapper_mempcpy (void *dst, const void *src, size_t n) { - return (char *)__mpx_wrapper_memcpy (dst, src, n) + n; + return (char *)mpx_wrapper_memcpy (dst, src, n) + n; } char * |