This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Go patch committed: Rationalize external symbol names


Hi Ian,

> From the error messages I guess the problem is that the assembler
> doesn't like symbols that start with ".1".  Do you know what names the
> assembler permits?

The x86 Assembly Language Reference Manual states:

2.1.2.1 Identifiers

An identifier is an arbitrarily-long sequence of letters and digits. The
first character must be a letter; the underscore (_) (ASCII 0x5F) and
the period (.) (ASCII 0x2E) are considered to be letters. Case is
significant: uppercase and lowercase letters are different.

Contrary to that, /bin/as won't assemble

.globl .1

The SPARC Assembly Language Reference Manual states this instead:

1.3.6 Symbol Names

The syntax for a symbol name is:

{ letter | _ | $ | . }   { letter | _ | $ | . | digit }* 

In the above syntax:

* Uppercase and lowercase letters are distinct; the underscore ( _ ),
  dollar sign ($), and dot ( . ) are treated as alphabetic characters.

* Symbol names that begin with a dot ( . ) are assumed to be local
  symbols. To simplify debugging, avoid using this type of symbol name
  in hand-coded assembly language routines.

* The symbol dot ( . ) is predefined and always refers to the address of
  the beginning of the current assembly language statement.

* External variable names beginning with the underscore character are
  reserved by the ANSI C Standard. Do not begin these names with the
  underscore; otherwise, the program will not conform to ANSI C and
  unpredictable behavior may result.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


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