This is the mail archive of the binutils@sources.redhat.com 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]

Re: COFF .endef Handling of def_symbol_in_progress


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




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