DLL Programmer's Guide for TNS/E Systems
Advanced DLL Facility Controls
DLL Programmer’s Guide for TNS/E Systems—527252-006
5-9
Using the Linker to Change an Existing Loadfile
-d address
this is a hexadecimal number that sets the starting address of the data segment.
In both cases, the linker rounds up address to a virtual memory page boundary. If
-t, but not -d, is inserted, then -t specifies the starting address of the entire
contiguous DLL. By inserting -d, you can cause the DLL to load in two separate
regions.
By default, the loader loads the text and data of a DLL into a contiguous virtual-
memory area, starting with the text (including code) section. This area is chosen to
avoid memory interference with other loaded files. These linker-assigned addresses
are called the preferred addresses; if this address range for a DLL is available, the
loader will use it.
If -t, but not -d, is inserted, then -t specifies the preferred starting address of the
entire contiguous DLL. By inserting -d, you can cause the linker to assign the two DLL
segments to disjoint address ranges. If you do that, the loader will reject the DLL.
In general, you should not use the -d option because it may result in the creation of
an object file that the operating system will refuse to load.
In contrast to a DLL, a program is always divided into two separate regions. For a
program, the default for -t is 0x70000000 and for -d is 0x08000000. If a non-default
value is specified, the loader will reject the program.
Summarizing these two options: -t is useful to specify a preferred address for a DLL,
so that it will not overlap the preferred address ranges of other DLLs that will appear in
the same process; with non-overlapping address ranges the DLLs will load slightly
faster. Otherwise, -t and -d are useful only in unusual circumstances that are beyond
the scope of this manual.
Using the Linker to Change an Existing
Loadfile
The options described in this subsection act on existing loadfiles, rather than a file
being linked. In the following options, <loadfileName> is the name of the target
loadfile.
Changing the Attributes of an Existing Loadfile
To alter any attribute of an existing loadfile, invoke the linker and insert the -change
<attribute> <value> <filename> option.
The <attribute> and <value> choices are the same as for -set, as described in
How to Set Run-Time Attributes of Your Loadfile on page 5-6. The -change option
overwrites the attribute in the existing loadfile. You must be able to open the existing
loadfile for update. If an error occurs in -change processing, the specified change
may or may not have occurred and the file will be otherwise unmodified.










