Re: [PATCH] DW_AT_calling_convention support REV 2

Daniel Jacobowitz
2002-07-11T15:07:54Z

On Thu, Jul 11, 2002 at 11:09:37AM -0400, Petr Sorfa wrote:
> Hi Daniel,
>
> > main_name(), I assume. Basically I would like everywhere that
> > currently checks by a strcmp/STREQ with main_name() to use
> > is_main_symbol () instead, etc. Things that call lookup_symbol on
> > main_name() should just use get_main_symbol () if possible. Then
> > set_main_name () could include calling lookup_symbol(main_name()), so
> > that get_main_symbol would always be valid, etc....
> Unforuntately after looking at this I realized this will not work always
> correctly. It is quite possible that a symbol is not created for "main"
> until much later. There are calls to set_main_name() before the symbol
> is created, so your proposition to do a lookup_symbol() in
> set_main_name() will not work in all cases.
>
> I suggest that the get_main_symbol() is altered to your suggestions, to
> which I want to add further checks such as ensuring that the main name
> is equal to the main symbol's name.
>
> If this is ok with you, I'll do a rev 3 patch for this and submit it.

That's unfortunate, but I guess not surprising... yes, your solution
sounds good to me.

--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer