KEEP

Forces the linker to not dead strip the unused symbols in the specified section.

Syntax
KEEP(*(sectionType))
  
Parameter

sectionType

Identifier for any user-defined or predefined section.

Example

KEEP Directive Usage shows the sample usage.

Listing 1. KEEP Directive Usage
GROUP : {
         .text (TEXT) : {}

         .mycode (TEXT) : {KEEP(*(.mycode))}

...}