This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PATCH: BZ #14370: Check mismatched TLS/non-TLS symbols
- From: Carlos O'Donell <carlos_odonell at mentor dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: "H.J. Lu" <hongjiu dot lu at intel dot com>, GNU C Library<libc-alpha at sourceware dot org>
- Date: Wed, 5 Sep 2012 11:08:54 -0400
- Subject: Re: PATCH: BZ #14370: Check mismatched TLS/non-TLS symbols
- References: <20120904221920.GA6320@intel.com>
On 9/4/2012 6:19 PM, H.J. Lu wrote:
> Hi,
>
> Mismatched TLS/non-TLS symbols from poorly built DSO may crash ld.so.
> This patch adds check for mismatched TLS/non-TLS symbols. Performance
> impact is tool small to be visible for glibc build/check on ia32, x86-64
> and x32. OK to install?
>
> Thanks.
>
>
> H.J.
> ---
> ChangeLog | 6 ++++++
> elf/dl-lookup.c | 25 +++++++++++++++++++++++++
> 2 files changed, 31 insertions(+)
>
> diff --git a/ChangeLog b/ChangeLog
> index 5411be3..838c607 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,9 @@
> +2012-09-04 H.J. Lu <hongjiu.lu@intel.com>
> +
> + [BZ #14370]
> + * elf/dl-lookup.c (_dl_lookup_symbol_x): Check mismatched
> + TLS/non-TLS symbols.
> +
I think this patch is good.
It helps us diagnose user errors that could conceivable happen.
It also doesn't seem to impact performance much and uses values that
are likely to already be in registers.
It is however a slippery slope. Making the dynamic linker robust
against these kinds of failures needs to evaluated on a cast-by-case
basis.
In this case I think it's a slight win.
I'd like to see other people comment on this patch before accepting it.
Cheers,
Carlos.
--
Carlos O'Donell
Mentor Graphics / CodeSourcery
carlos_odonell@mentor.com
carlos@codesourcery.com
+1 (613) 963 1026