Using Tools: 5 Glue

Up: GEOS SDK TechDocs | Up | Prev: 4 Esp | Next: 6 Goc

Glue is the GEOS linker. It creates GEOS or DOS executables from object files. (It can also create GEOS VM and font files, if you have the appropriate tools.) These object files may have been created by a C compiler, or by the Esp assembler. To create the executables, Glue must create a combined file, resolve external declarations, determine how to call libraries, and apportion the code and data into resources. Glue will also create a .sym file--a file containing symbolic debugging information which the Swat debugger will use for viewing the geode's data.

Most users will never call Glue directly, instead going through pmake , which will make the proper calls to Glue for the most common cases. If you use the default makefiles, the variable LINKFLAGS will determine which arguments Glue receives; thus, by creating a local makefile that modifies this variable's value, you can pass more flags to glue. See How to Customize pmake for help in creating a local makefile.

The Glue application takes the following arguments:

glue @file
glue <flags> <objFile>+ [-l<objFile>]*
@file
The Glue linker should take its arguments from the file file in addition to those on the command line. This may come in handy if you often use the same long string of options. Since you may need to pass Glue more arguments than may be input on the command line, sometimes this option is necessary.

Note that if you use this option, then all arguments must be included in the file--there should be no others on the command line itself.

The pmake program uses this option to pass arguments to Glue.

-D var
Defines the variable var ; used with ifdef statements within the .gp file to allow for conditional linking (see the GP file keyword reference for the syntax of Glue's ifdef statements).
-L path
Specifies where Glue looks for .ldf (library definition) files. These files are placed in a standard directory by the system makefiles on a " pmake lib¨.
-N string
Specify a copyright notice. This string must be 32 characters or less.
-Oe
Creating DOS executable (".exe") file. Of course, this option is not valid if the object files contain GEOS directives which will not work outside GEOS.
-Oc
Creating DOS command (".com") file. Of course, this option is not valid if the object files contains GEOS directives which will not work outside of GEOS.
-Og file
Creating GEOS executable (".geo") file. You must provide the name of the geode's Glue parameters file (the .GP file). For information about setting up a parameter file, see the Hello World chapter.

When creating a .geo file, you may pass any of the following options:

-E
Link Error checking version of geode.
-R number
Specify release number of geode (e.g. 3.2.1.0).
-P number
Specify protocol number of geode (e.g. 1.0).
-T number
File type.
-l
Creating a library; Glue should create .ldf file.
-Ov
Creating GEOS Virtual Memory (.vm) file. Using this option, you may create .vm storage files as set up by the Esp assembler. You may pass the following options when creating .vm files (if you don't know the meaning of some of these terms, see the Virtual Memory chapter):
-A number
VMAttributes to use for the file.
-C number
Compaction threshold.
-M string
Map block segment name.
-P number
Protocol number (e.g. 2.5.0.3).
-R number
Release number (e.g. 12.3).
-i name
A .geo file from which to get the table of imported libraries. This allows the VM file to be opened by that geode and objects in the file to be used.
-t token
File token
-c token
Creator's manufacturer token.
-l string
File's long name.
-u notes
File's user notes.
-N string
Copyright notice which will be embedded in header of .GEO or .VM files.
-G number
You should never have to use this option. This specifies a non-standard GEOS release number (e.g. 1.3); if this release used a different VM header than GEOS 2.0, Glue will still construct the proper header as long as this option is passed. Since the default release number is 2, developers for 2.X do not need this option.
-Wall
Requests that Glue output all optional warnings.
-Wunref
Requests that Glue output optional unreferenced global symbol warnings.
-d
Dump memory. Normally used only when debugging Glue.
-m
Provide memory map in output. This information gives information about the sizes of various parts of the geode. This information proves especially helpful when making geodes work with small devices.
-nll
Disables the output of line numbers for local memory segments for any application with 163 resources or more.
-o file
Specify name of output file (e.g. WOROPRO.GEO).
-q
Leave the symbolic information behind even if an error was encountered. Normally, this flag is used only when debugging Glue.
-r
Maps segment relocations to non-shared resources to resource IDs. This is normally used only by multi-launchable C applications. When running more than one instance of a multi-launchable application, the system only uses one copy of the read-only portion of the application. The system makes separate copies of the writable data for each instance of the application. This can lead to conflict when the relocation instructions for the read-only data uses the handle or segment of a writable resource; which copy should be responsible for providing these addresses? If you don't pass this flag and Glue detects the above situation, Glue will simply refuse to make the application multi-launchable. This flag instructs Glue to instead use the resource ID of the writable resource where it would normally use the segment or handle of that resource.
If you use this option, make sure that if you use the address of a variable in a resource other than dgroup that you use GeodeGetOptrNS() and lock down or dereference the handle of the returned optr.
-s file
Specify name of symbol file (the .SYM file).
-z
Output localization information.

Up: GEOS SDK TechDocs | Up | Prev: 4 Esp | Next: 6 Goc