5.5 Functions

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

armasm 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.
Non-ConfidentialPDF file icon PDF versionDUI0742J
Copyright © 2014–2017, 2019 Arm Limited or its affiliates. All rights reserved.