This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ping**4 [PATCH] stabs for powerpc Darwin target
- From: Geoff Keating <geoffk at desire dot geoffk dot org>
- To: george at gly dot bris dot ac dot uk
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 3 Jun 2004 14:13:24 -0700
- Subject: Re: ping**4 [PATCH] stabs for powerpc Darwin target
- References: <200406011249.i51CnQp01248@olivine.geology.bristol.ac.uk>
The comment from our linker guy was:
> The correct stab for a .comm symbol is a GSYM. The LCSYM stab is
> used only for the .lcomm symbol.
Reading stabs.texinfo, I see that this is true:
Common Blocks
=============
A common block is a statically allocated section of memory which can be
referred to by several source files. It may contain several variables.
I believe Fortran is the only language with this feature.
A `N_BCOMM' stab begins a common block and an `N_ECOMM' stab ends
it. The only field that is significant in these two stabs is the
string, which names a normal (non-debugging) symbol that gives the
address of the common block. According to IBM documentation, only the
`N_BCOMM' has the name of the common block (even though their compiler
actually puts it both places).
The stabs for the members of the common block are between the
`N_BCOMM' and the `N_ECOMM'; the value of each stab is the offset
within the common block of that variable. IBM uses the `C_ECOML' stab
type, and there is a corresponding `N_ECOML' stab type, but Sun's
Fortran compiler uses `N_GSYM' instead. The variables within a common
block use the `V' symbol descriptor (I believe this is true of all
Fortran variables). Other stabs (at least type declarations using
`C_DECL') can also be between the `N_BCOMM' and the `N_ECOMM'.
So, I think that you should remove all Darwin references from your
patch. We should not be using LCSYM for Fortran common blocks on any
system; we should be using N_BCOMM, N_ECOMM, and N_GSYM everywhere.
Once that's done, could you send the patch again?
--
- Geoffrey Keating <geoffk@geoffk.org>