diff options
author | Richard Lowe <richlowe@richlowe.net> | 2021-02-17 16:19:26 -0600 |
---|---|---|
committer | Richard Lowe <richlowe@richlowe.net> | 2021-03-05 13:32:27 -0600 |
commit | 9f160f41aaee44e207fb709edec8d6493d3c4f2d (patch) | |
tree | 1f48c84bb366d618181ce1af619148507a90d2be /usr/src/lib/libumem/common/umem.c | |
parent | 6d14434bff9ecb720b0d5e27ee39f9ec442f837e (diff) | |
download | illumos-joyent-9f160f41aaee44e207fb709edec8d6493d3c4f2d.tar.gz |
13565 umem should only have one text section
Reviewed by: Jason King <jason.brian.king+illumos@gmail.com>
Reviewed by: Robert Mustacchi <rm+illumos@fingolfin.org>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Diffstat (limited to 'usr/src/lib/libumem/common/umem.c')
-rw-r--r-- | usr/src/lib/libumem/common/umem.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/usr/src/lib/libumem/common/umem.c b/usr/src/lib/libumem/common/umem.c index 598a45eb39..9c5e3ec829 100644 --- a/usr/src/lib/libumem/common/umem.c +++ b/usr/src/lib/libumem/common/umem.c @@ -484,18 +484,17 @@ * ----------------------------------------------- * * The last piece of this puzzle is how we actually jam ptcmalloc() into the - * PLT. To handle this, we have defined two functions, _malloc and _free and - * used a special mapfile directive to place them into the a readable, - * writeable, and executable segment. Next we use a standard #pragma weak for - * malloc and free and direct them to those symbols. By default, those symbols - * have text defined as nops for our generated functions and when they're - * invoked, they jump to the default malloc and free functions. - * - * When umem_genasm() is called, it goes through and generates new malloc() and - * free() functions in the text provided for by _malloc and _free just after the - * jump. Once both have been successfully generated, umem_genasm() nops over the - * original jump so that we now call into the genasm versions of these - * functions. + * PLT. To handle this, we have defined two functions, _malloc and _free, we + * use a standard #pragma weak for malloc and free and direct them to those + * symbols. By default, those symbols have text defined as nops for our + * generated functions and when they're invoked, they jump to the default + * malloc and free functions. + * + * When umem_genasm() is called, it makes _malloc and _free writeable and goes + * through and updates the text provided for by _malloc and _free just after + * the jump. Once both have been successfully generated, umem_genasm() nops + * over the original jump so that we now call into the genasm versions of + * these functions, and makes the functions read-only once again. * * 8.3 umem_genasm() * ----------------- |