Date: Fri, 18 Jan 2013 06:09:33 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Steve Kiernan <stevek@juniper.net> Cc: Jason Evans <jasone@canonware.com>, freebsd-arch@freebsd.org Subject: Re: [JNPR] Proposal to add weak symbols for malloc, realloc, and free to libc Message-ID: <20130118040933.GU2522@kib.kiev.ua> In-Reply-To: <20130117184654.06f8e330@stevek-ubuntu> References: <20130117161311.4c15c7c4@stevek-ubuntu> <E4A1FEFD-B267-422B-8051-443B1F8519E1@canonware.com> <20130117184654.06f8e330@stevek-ubuntu>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Thu, Jan 17, 2013 at 06:46:54PM -0500, Steve Kiernan wrote: > On Thu, 17 Jan 2013 15:42:19 -0800 > Jason Evans <jasone@canonware.com> wrote: > > > On Jan 17, 2013, at 1:13 PM, Steve Kiernan wrote: > > > When libc was changed to use jemalloc, the weak symbols for malloc, realloc, and free ended up being removed. > > > This makes it a bit difficult for an application to replace (or augment) the malloc implementation. > > > > > > This proposal is to add back the weak symbols similar to how they existed in libc prior to jemalloc introduction. > > > > > > See the following patch for the changes: > > > http://people.freebsd.org/~marcel/Juniper/weak-malloc.diff > > > > > > I'm not sure if the the symbols are in the proper place in the Symbol.map file and would welcome comments. > > > > What about calloc(), posix_memalign(), and malloc_usable_size()? Similarly, I think the *allocm() functions in -current may need the same treatment. > > I think you are correct and those would probably be necessary, as well, yes. > > It looked like previously, calloc was not made weak because it was implemented in terms of malloc, but since that is not the case in jemalloc, it will need to be addressed. > > I'll update the patch. New symbols should be added to the current version, which is FBSD_1.3 for the 10.0. That said, what are the difficulties you experiencing with the malloc interposing ? According to the normal ELF symbol lookup rules, the definitions from any object which is loaded before libc overrides the libc symbols. [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQ+Mr8AAoJEJDCuSvBvK1BwJoP/i4KWKy869fJT9PMYUr62msL liKfv9BbDWkY258wTg/TScBNDV7GLvdYtyD58UsfcYoGLN+YKN6Ilf8FHzxj0lKu N62nobUUKELI3TbvacpxgZsy6aC1hlG1an1O4zZFgZk/dLsXhTQY4gX2gIVuBjPY t34v5pDUJrsjDzGv1NoSpWSfLbfjwPOu4Vf6bHlYa/5VIXrSCTEdqtvQmbDtb7B7 svBmwKpr2t1Nx/hG6de9Ro6V8uJMDbQvNt9qFtjMBffdHLLb4JN0cvMzje3R0W89 2UiWAgNDcvYwAPi1/6XUBOkcNR0GNGf2F8gDgdRQrTOmgRAOusEOR9vOn+UXSD0P xw9lWNyBadr5mSZ5gQrxcpMfAQqrBwQrLCk5uxqoEqImigO4/ifHadM/iQlg1DqR AAawBJpRjH8quXVWqAyQt5tmOGJmh+lWfbXSeVHmEo+OT3VKVRNzwCKhrrBGemKC 0oSjGFp7dc5wvzStpTjQQnSIFBbxs9tF2H5bNKeMnmYOs5YyIBrogFXI9UZ53K5F slZvZImvIo7cD32i4z9IqhQki5csRiPj4JBIXUnmZKKGmmse9ubf1VhXFeNRFk7B jIx/bolf8CEwC+0McQJ6HqX2hZaVecqIdkF3hXzzjayXTS3aPk353i8Dkb70NbaD 5K0YbJwPM189NhzHSRbg =5bY2 -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130118040933.GU2522>
