From 9f160f41aaee44e207fb709edec8d6493d3c4f2d Mon Sep 17 00:00:00 2001 From: Richard Lowe Date: Wed, 17 Feb 2021 16:19:26 -0600 Subject: 13565 umem should only have one text section Reviewed by: Jason King Reviewed by: Robert Mustacchi Approved by: Gordon Ross --- usr/src/lib/libumem/common/umem.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'usr/src/lib/libumem/common/umem.c') 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() * ----------------- -- cgit v1.2.3