public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* COFF .endef Handling of def_symbol_in_progress
@ 2001-09-06  9:45 Tracy Kuhrt
  2001-09-07  1:39 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Tracy Kuhrt @ 2001-09-06  9:45 UTC (permalink / raw)
  To: binutils

In the obj_coff_endef function, the following exists:

static void
obj_coff_endef (ignore)
     int ignore ATTRIBUTE_UNUSED;
{
...
 /* Set the section number according to storage class.  */
  switch (S_GET_STORAGE_CLASS (def_symbol_in_progress))
    {
...
    case C_FCN:
      {
        CONST char *name;
        S_SET_SEGMENT (def_symbol_in_progress, text_section);

Why is the def_symbol_in_progress' section set to the text_section
versus now_seg?  If the compiler/user defines a section that is located
in the code section and is requesting debug information the .bf and .ef
symbols for a function in that section appear in the text section versus
the user-defined section.  Is this the correct behavior?

Tracy



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: COFF .endef Handling of def_symbol_in_progress
  2001-09-06  9:45 COFF .endef Handling of def_symbol_in_progress Tracy Kuhrt
@ 2001-09-07  1:39 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2001-09-07  1:39 UTC (permalink / raw)
  To: Tracy Kuhrt; +Cc: binutils

Hi Tracy,

> In the obj_coff_endef function, the following exists:
> 
> static void
> obj_coff_endef (ignore)
>      int ignore ATTRIBUTE_UNUSED;
> {
> ...
>  /* Set the section number according to storage class.  */
>   switch (S_GET_STORAGE_CLASS (def_symbol_in_progress))
>     {
> ...
>     case C_FCN:
>       {
>         CONST char *name;
>         S_SET_SEGMENT (def_symbol_in_progress, text_section);
> 
> Why is the def_symbol_in_progress' section set to the text_section
> versus now_seg?  If the compiler/user defines a section that is located
> in the code section and is requesting debug information the .bf and .ef
> symbols for a function in that section appear in the text section versus
> the user-defined section.  Is this the correct behavior?

No, obviously not.  I suspect that the code was intended to cope with
situations where there is local data defined at the end of the
function, but before the function's real end.  In that case now_seg
would be .data which is also an obviously wrong place for the function
end pointer.

The correct behaviour, I believe, would be to assign the symbol to
now_seg provided that it is a code section, otherwise assign it to the
text section, or the most recently used code section, if that can be
found.

Cheers
        Nick



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-09-07  1:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-06  9:45 COFF .endef Handling of def_symbol_in_progress Tracy Kuhrt
2001-09-07  1:39 ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).