Linker Options
7-9
Linker Description
-
Producing a Relocatable Output Module (– r Option)
When you use the –r option without the –a option, the linker retains
relocation entries in the output module. If the output module will be
relocated (at load time) or relinked (by another linker execution), use –r to
retain the relocation entries.
The linker produces a
file that is not executable when you use the –r option
without –a. A file that is not executable does not contain special linker
symbols or an optional header. The file may contain unresolved refer-
ences, but these references do not prevent creation of an output module.
The following example links file1.obj and file2.obj and creates a relocat-
able output module called a.out:
lnk500 –r file1.obj file2.obj
The output file a.out can be relinked with other object files or relocated at
load time. (Linking a file that will be relinked with other files is called partial
linking.) For more information, see Section 7.18,
Linker Example, on page
7-71.
-
Producing an Executable Relocatable Output Module (–ar)
If you invoke the linker with both the –a and –r options, the linker produces
an
executable, relocatable object module. The output file contains the
special linker symbols, an optional header, and all resolved symbol
references; however, the relocation information is retained.
The following example links file1.obj and file2.obj and creates an
executable, relocatable output module called xr.out:
lnk500 –ar file1.obj file2.obj –o xr.out
You can string the options together (lnk500 –ar) or enter them separately
(lnk500 –a –r).
-
Relocating or Relinking an Absolute Output Module
The linker issues a warning message (but continues executing) when it
encounters a file that contains no relocation or symbol table information.
Relinking an absolute file can be successful only if each input file contains
no information that needs to be relocated (that is, each file has no
unresolved references and is bound to the same virtual address that it was
bound to when the linker created it).
Summary of Contents for TMS320C54x
Page 38: ......
Page 39: ......
Page 40: ......
Page 41: ......
Page 42: ......
Page 43: ......
Page 44: ......
Page 45: ......
Page 46: ......
Page 47: ......
Page 48: ......
Page 49: ......
Page 50: ......
Page 51: ......
Page 52: ......
Page 53: ......
Page 54: ......
Page 55: ......
Page 56: ......
Page 57: ......
Page 58: ......
Page 59: ......
Page 60: ......
Page 61: ......
Page 62: ......
Page 276: ......
Page 277: ......
Page 278: ......
Page 279: ......
Page 280: ......
Page 281: ......
Page 282: ......
Page 283: ......
Page 284: ......
Page 285: ......
Page 286: ......
Page 287: ......
Page 288: ......
Page 289: ......
Page 290: ......
Page 291: ......
Page 292: ......
Page 293: ......
Page 294: ......
Page 295: ......
Page 296: ......
Page 297: ......
Page 298: ......
Page 299: ......
Page 300: ......
Page 301: ......
Page 302: ......