Function Selection

The OBJECT keyword allows precise control over how functions are placed within a section. For example, if the functions pad and foot are to be placed before anything else in a section, use the code as shown in the example in the following listing.

Listing: Sample function selection using OBJECT keyword
SECTIONS {

  .program_section :

    {

      OBJECT (Fpad, main.c)

      OBJECT (Ffoot, main.c)

      * (.text)

     } > ROOT

  }
Note: If an object is written once using the OBJECT function selection keyword, the same object will not be written again if you use the ' *' file selection keyword.