This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: BZ #14370: Check mismatched TLS/non-TLS symbols


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]