ping**4 [PATCH] stabs for powerpc Darwin target

Geoff Keating geoffk@desire.geoffk.org
Thu Jun 3 21:33:00 GMT 2004


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>



More information about the Gcc-patches mailing list