This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

PATCH: Clarify .type documentation in GAS


The GAS manual documents various .type directives, but some of them
don't work on all architectures; for example, the "@function" syntax
doesn't work on ARM, because "@" is the comment character in ARM
assembly.

This change to the documentation mentions this gotcha.  

OK to apply?

--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

2006-04-13  Mark Mitchell  <mark@codesourcery.com>

	* doc/as.texinfo: Mention that some .type syntaxes are not
	supported on all architectures.

Index: as.texinfo
===================================================================
RCS file: /cvs/src/src/gas/doc/as.texinfo,v
retrieving revision 1.141
diff -c -5 -p -r1.141 as.texinfo
*** as.texinfo	17 Mar 2006 00:45:13 -0000	1.141
--- as.texinfo	13 Apr 2006 19:44:20 -0000
*************** For ELF targets, the @code{.type} direct
*** 5962,5974 ****
  @end smallexample
  
  This sets the type of symbol @var{name} to be either a
  function symbol or an object symbol.  There are five different syntaxes
  supported for the @var{type description} field, in order to provide
! compatibility with various other assemblers.  The syntaxes supported are:
  
  @smallexample
    .type <name>,#function
    .type <name>,#object
  
    .type <name>,@@function
    .type <name>,@@object
--- 5962,5986 ----
  @end smallexample
  
  This sets the type of symbol @var{name} to be either a
  function symbol or an object symbol.  There are five different syntaxes
  supported for the @var{type description} field, in order to provide
! compatibility with various other assemblers.  
! 
! Because some of the characters used in these syntaxes (such as @samp{@@} and
! @samp{#}) are comment characters for some architectures, some of the syntaxes
! below do not work on all architectures.  The first variant will be accepted by
! the GNU assembler on all architectures so that variant should be used for
! maximum portability, if you do not need to assemble your code with other
! assemblers.
! 
! The syntaxes supported are:
  
  @smallexample
+   .type <name> STT_FUNCTION
+   .type <name> STT_OBJECT
+ 
    .type <name>,#function
    .type <name>,#object
  
    .type <name>,@@function
    .type <name>,@@object
*************** compatibility with various other assembl
*** 5976,5988 ****
    .type <name>,%function
    .type <name>,%object
    
    .type <name>,"function"
    .type <name>,"object"
-   
-   .type <name> STT_FUNCTION
-   .type <name> STT_OBJECT
  @end smallexample
  @end ifset
  @end ifset
  
  @node Uleb128
--- 5988,5997 ----


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