This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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 x64 seh]: Check for validity of segments for seh ops


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~


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