public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: Patch: Support .loc STABS directive on ELF based toolchains.
@ 1999-09-30  2:18 Nick Clifton
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Clifton @ 1999-09-30  2:18 UTC (permalink / raw)
  To: ian; +Cc: binutils

Hi Ian,

: We don't reject .loc outside of a .text section because we are
: mean-hearted.  We reject it because it won't work.  ECOFF debugging
: information builds a single table of line numbers for an object file.
: That table is implicitly assumed to be attached to the .text section.
: I don't see how to avoid that, given the weird construction of the
: ECOFF symbol table.
: 
: If you want to use ECOFF debugging information, I think you need to
: avoid using linkonce sections.  Or vice-versa.  I recommend using
: straight stabs debugging information instead.
: 
: If the debugging information really does work correctly, particularly
: after processing through ld -r, let me know (by work correctly, I mean
: that objdump -dl and gdb can correctly report line numbers for the
: linkonce functions in question).

You are right - it doesn't really work.  I was fooled into believing
that it did because some line number information does get through into
the object file, but not the information for the constructors and
destructors.

I withdraw my patch and I will look to see if I can find a way for gcc
to workaround this.

Cheers
	Nick

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

* Re: Patch: Support .loc STABS directive on ELF based toolchains.
  1999-09-29  7:37 Nick Clifton
@ 1999-09-29  8:01 ` Ian Lance Taylor
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Lance Taylor @ 1999-09-29  8:01 UTC (permalink / raw)
  To: nickc; +Cc: binutils

   Date: Wed, 29 Sep 1999 15:37:42 +0100
   From: Nick Clifton <nickc@cygnus.com>

     Here is a small patch to allow the .loc STABS directive to be used
     on ELF toolchains which use .gnu.linkonce.t sections as special
     cases of the .text section.

   1999-09-29  Nick Clifton  <nickc@cygnus.com>

	   * ecoff.c (ecoff_directive_loc): Allow the .loc directive to
	   appear inside .gnu.linkoce.t. sections for ELF based
	   toolchains. 

We don't reject .loc outside of a .text section because we are
mean-hearted.  We reject it because it won't work.  ECOFF debugging
information builds a single table of line numbers for an object file.
That table is implicitly assumed to be attached to the .text section.
I don't see how to avoid that, given the weird construction of the
ECOFF symbol table.

If you want to use ECOFF debugging information, I think you need to
avoid using linkonce sections.  Or vice-versa.  I recommend using
straight stabs debugging information instead.

If the debugging information really does work correctly, particularly
after processing through ld -r, let me know (by work correctly, I mean
that objdump -dl and gdb can correctly report line numbers for the
linkonce functions in question).

   !       const char name[] = ".gnu.linkonce.t.";

I don't think K&R C compilers support automatic array initialization.
Make it static.

Ian

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

* Patch: Support .loc STABS directive on ELF based toolchains.
@ 1999-09-29  7:37 Nick Clifton
  1999-09-29  8:01 ` Ian Lance Taylor
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Clifton @ 1999-09-29  7:37 UTC (permalink / raw)
  To: binutils

Hi Guys,

  Here is a small patch to allow the .loc STABS directive to be used
  on ELF toolchains which use .gnu.linkonce.t sections as special
  cases of the .text section.

  OK to apply ?

Cheers
	Nick

1999-09-29  Nick Clifton  <nickc@cygnus.com>

	* ecoff.c (ecoff_directive_loc): Allow the .loc directive to
	appear inside .gnu.linkoce.t. sections for ELF based
	toolchains. 

Index: gas/ecoff.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gas/ecoff.c,v
retrieving revision 1.68
diff -p -r1.68 ecoff.c
*** ecoff.c	1999/06/20 17:46:13	1.68
--- ecoff.c	1999/09/29 14:27:51
*************** ecoff_directive_loc (ignore)
*** 3301,3309 ****
  
    if (now_seg != text_section)
      {
!       as_warn (_(".loc outside of .text"));
!       demand_empty_rest_of_line ();
!       return;
      }
  
    /* Skip the file number.  */
--- 3301,3318 ----
  
    if (now_seg != text_section)
      {
! #ifdef OBJ_ELF
!       /* The GNU toolchain uses an extension for ELF: a section
! 	 beginning with the magic string .gnu.linkonce.t. is a
! 	 linkonce .text section.  */
!       const char name[] = ".gnu.linkonce.t.";
!       if (strncmp (segment_name (now_seg), name, sizeof name - 1))
! #endif
! 	{
! 	  as_warn (_(".loc outside of .text"));
! 	  demand_empty_rest_of_line ();
! 	  return;
! 	}
      }
  
    /* Skip the file number.  */

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

end of thread, other threads:[~1999-09-30  2:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-30  2:18 Patch: Support .loc STABS directive on ELF based toolchains Nick Clifton
  -- strict thread matches above, loose matches on Subject: below --
1999-09-29  7:37 Nick Clifton
1999-09-29  8:01 ` Ian Lance Taylor

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).