This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch x64 seh]: Check for validity of segments for seh ops
- From: Richard Henderson <rth at redhat dot com>
- To: Kai Tietz <ktietz70 at googlemail dot com>
- Cc: Binutils <binutils at sourceware dot org>, Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- Date: Wed, 15 Sep 2010 09:28:26 -0700
- Subject: Re: [patch x64 seh]: Check for validity of segments for seh ops
- References: <AANLkTikQSoE6J4OUz4sVEz3LV3X9btk9FqQUOtiid-Ut@mail.gmail.com>
On 09/15/2010 08:09 AM, Kai Tietz wrote:
> +static int
> +seh_validate_seg (const char *directive, segT cseg)
> +{
> + const char *cseg_name, *nseg_name;
> + if (cseg == now_seg)
> + return 1;
> + cseg_name = bfd_get_section_name (stdoutput, cseg);
> + nseg_name = bfd_get_section_name (stdoutput, now_seg);
> + if (!strcmp (cseg_name, nseg_name))
> + return 1;
I should think that the first comparison would be all
you need, and the second would be redundant. Do you
have a test case to the contrary?
You might as well make use of the global variable,
since all users pass seh_ctx_cur->code_seg.
You might consider merging this function into
verify_context. One could consider the current
section part of the context.
r~