public inbox for gas2@sourceware.org
 help / color / mirror / Atom feed
* Lxx vs .Lxxx - gcc vs gas
@ 1995-06-17 14:58 DJ Delorie
  1995-06-17 16:33 ` Ken Raeburn
  1995-06-17 17:00 ` Ronald F. Guilmette
  0 siblings, 2 replies; 3+ messages in thread
From: DJ Delorie @ 1995-06-17 14:58 UTC (permalink / raw)
  To: gcc2, gas2

[Be careful when replying; this was sent to two mailing lists - DJ]

There are two types of "local" labels used by gcc and gas:

(1)	Lfoo:
(2)	.Lfoo:

gcc chooses which to use based on whether the target prepends an
underscore to external symbols or not.

gas chooses which to use based on whether the output object format is
COFF or not (for the i386, at least).

DJGPP is coff with underscores, and the two don't agree on which is
right, so I end up with all the local labels in the object's symbol
table.

Which should I fix?  Is there a global solution, or will I need a
special case for djgpp?

DJ
dj@delorie.com


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

* Re: Lxx vs .Lxxx - gcc vs gas
  1995-06-17 14:58 Lxx vs .Lxxx - gcc vs gas DJ Delorie
@ 1995-06-17 16:33 ` Ken Raeburn
  1995-06-17 17:00 ` Ronald F. Guilmette
  1 sibling, 0 replies; 3+ messages in thread
From: Ken Raeburn @ 1995-06-17 16:33 UTC (permalink / raw)
  To: DJ Delorie; +Cc: gas2, gcc2

It's a gas bug.  I'll fix it.


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

* Re: Lxx vs .Lxxx - gcc vs gas
  1995-06-17 14:58 Lxx vs .Lxxx - gcc vs gas DJ Delorie
  1995-06-17 16:33 ` Ken Raeburn
@ 1995-06-17 17:00 ` Ronald F. Guilmette
  1 sibling, 0 replies; 3+ messages in thread
From: Ronald F. Guilmette @ 1995-06-17 17:00 UTC (permalink / raw)
  To: DJ Delorie; +Cc: gcc2, gas2

In message < 199506172158.RAA25682@delorie.com >, you wrote:

>
>[Be careful when replying; this was sent to two mailing lists - DJ]
>
>There are two types of "local" labels used by gcc and gas:
>
>(1)	Lfoo:
>(2)	.Lfoo:
>
>gcc chooses which to use based on whether the target prepends an
>underscore to external symbols or not.

I'm not sure if that is a proper way to make the distinction, but it
might be.  Then again, it might not.

What I _can_ tell you is that the convention on ELF-based systems is
_not_ to put an underscore before a user-declared identifier (when
converting it from the C level to the assembly level).  This differs
from the older UNIX tradition of putting one underscore in front of
each user-declared name (at the assembly level).

I believe that for most COFF-based systems, the convention was to prepend
a leading underscore to the names of all entities which were declared by
the user at the C-language level.  (But I might be wrong about that.  It
has been a LONG time since I used COFF.)

Separately, there is the question of what prefix will force the assembler
NOT to write a given label into the symbol table of the object file.  In
the case of all ELF assemblers that I am familiar with, a leading period
will cause the relevant label NOT to appear in the symbol table of the
resulting object file... but these conventions are highly assembler-
dependent, and I don't knon that there is any hard-and-fast rule by
which you could predict (for any given assembler) what the ``hiding
prefix'' is.  You just have to try some experiments and see.

>gas chooses which to use based on whether the output object format is
>COFF or not (for the i386, at least).

I think that's probably wrong.  If you had said that GAS uses leading
periods as the ``hiding prefix'' for _both_ COFF and ELF, then I might
believe that gas was doing the Right Thing.  Even then however, I think
that the wisest thing to do (in _both_ gas and gcc) would be to establish
an entirely separate and independent target macro to control/determine
the ``hiding prefix''.

>DJGPP is coff with underscores, and the two don't agree on which is
>right, so I end up with all the local labels in the object's symbol
>table.
>
>Which should I fix?  Is there a global solution, or will I need a
>special case for djgpp?

See above.  I think that _somebody_ should fix both gas and gcc so that
the assembly-level ``hiding prefix'' can be specified independently from
everything else.  I really don't think that there is 100% correlation
between the object file format and the hiding prefix.  Any correlations
which seem to relate one to the other are, I believe, simply the product
of luck rather than the product of universal rules or universally obeyed
conventions.


-- Ron Guilmette, Sunnyvale, CA -------- RG Consulting ---------------------
---- E-mail: rfg@segfault.us.com --------Purveyors of Compiler Test Suites -
---- finger: rfg@rahul.net -------------------------------------------------


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

end of thread, other threads:[~1995-06-17 17:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-06-17 14:58 Lxx vs .Lxxx - gcc vs gas DJ Delorie
1995-06-17 16:33 ` Ken Raeburn
1995-06-17 17:00 ` Ronald F. Guilmette

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