2.5 Building an application with microlib

To build a program using microlib, you must use the command-line option --library_type=microlib. This option can be used by the compiler, assembler or linker.

Use --library_type=microlib with the linker to override all other options.

Compiler option

armcc --library_type=microlib -c main.c
armcc -c extra.c
armlink -o image.axf main.o extra.o

Specifying --library_type=microlib when compiling main.c results in an object file containing an attribute that asks the linker to use microlib. Compiling extra.c with --library_type=microlib is unnecessary, because the request to link against microlib exists in the object file generated by compiling main.c.

Assembler option

armcc -c main.c
armcc -c extra.c
armasm --library_type=microlib more.s
armlink -o image.axf main.o extra.o more.o

The request to the linker to use microlib is made as a result of assembling more.s with --library_type=microlib.

Linker option

armcc -c main.c
armcc -c extra.c
armlink --library_type=microlib -o image.axf main.o extra.o

Neither object file contains the attribute requesting that the linker link against microlib, so the linker selects microlib as a result of being explicitly asked to do so on the command line.

Non-ConfidentialPDF file icon PDF versionARM DUI0475M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.