4.5 Functions

Assemblers can identify the start of a function when producing DWARF call frame information for ELF.

ARM syntax

The FUNCTION directive marks the start of a function. PROC is a synonym for FUNCTION.
The ENDFUNC directive marks the end of a function. ENDP is a synonym for ENDFUNC.
For example:
myproc  PROC
  ; Procedure body
  ENDP

GNU syntax

Use the .type directive to identify symbols as functions. For example:
  .type myproc, "function"
myproc:
  // Procedure body
GNU syntax assembly code provides the .func and .endfunc directives. However, these are not supported by armclang. armclang uses the .size directive to set the symbol size:
  .type myproc, "function"
myproc:
  // Procedure body
.Lmyproc_end0:
  .size myproc, .Lmyproc_end0-myproc

Note

Functions must be typed to link properly.
Related information
GNU Binutils - Using as: .type
armasm User Guide: FUNCTION or PROC
armasm User Guide: ENDFUNC or ENDP
Non-ConfidentialPDF file icon PDF versionARM DUI0742F
Copyright © 2014-2016 ARM. All rights reserved.