11.3 Locating Functions at a Specific Address

In this example, the C language function func is located at a specific address.
#include <stdio.h>
void __attribute__((address(0x9d002000))) func(void)
{ ... }
The equivalent function definition in assembly language appears below. The .align directive is optional and represents the default alignment in program memory. Use of * as a section name causes the assembler to generate a unique name based on the source file name.
.section	*,address(0x9d002000),code
               .align	2
               .globl	func
func:
               ......