motorola digital signal processing development software motorola dsp linker/librarian reference manual motorola, incorporated semiconductor products sector dsp division 6501 william cannon drive west austin, tx, 78735-8598 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
specification and information herein are subject to change without notice. motorola re- serves the right to make changes without further notice to any products described in this document to improve reliability, function, or design. motorola does not assume any liability arising out of the application or use of any product or circuit described herein, neither does it convey any license under its patent rights or the rights of others. motorola is a registered trademark of motorola, inc. motorola, inc. is an equal employment/affirmative action em- ployer. this manual documents the linker and librarian as of version 6.0 of the software. ? copyright motorola, inc. 1996. all rights reserved. asm56000, sim56000, asm96000, sim96000, asm56100, sim56100, asm56300, sim56300, asm56800, and sim56800 are trademarks of motorola. ms-dos and windows are trademarks of microsoft corporation. sun-4 and sunos are trademarks of sun microsystems, inc. macintosh and mpw are trademarks of apple computer. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
preface motorola dsp linker/librarian reference manual iii notation the notational conventions used in this manual are: directive all linker directives and options are shown in bold upper case to highlight them. however, the linker will recognize both upper and lower case for options and direc- tives. { } contains a list of elements or directives, one of which must be selected. each choice will be separated by a vertical bar. for example, { r i l } indicates that either r or l must be selected. [ ] contains one or more optional elements. if more than one optional element is shown, the required element separators are indicated. all elements outside of the angle brackets (< >) must be specified as they appear. for example, the syntacti- cal element [,] requires the comma to be specified if the optional element is selected. preface f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
iv dsp linker/librarian reference manual motorola preface < > the element names are printed in lower case and contained in angle brackets. some common elements used to describe linker options are: or a linker expression a numeric constant a string of ascii characters enclosed in quotes a delimiter character a linker option or a linker symbol supporting publications dsp56000 family manual. motorola, inc. 1992. dsp96002 users manual. motorola, inc. 1989. dsp56100 family manual. motorola, inc. 1993. dsp56300 family manual. motorola, inc. 1995. dsp56800 family manual. motorola, inc. 1996. motorola dsp simulator reference manual. motorola, inc. 1996. motorola dsp assembler reference manual. motorola, inc. 1996. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp linker/librarian reference manual v table of contents preface table of contents chapter 1 motorola dsp linker 1.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 1.2 installing the linker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 1.3 running the linker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 1.4 linker options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3 chapter 2 linker operation 2.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1 2.2 relocation and linking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1 2.3 linker passes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 2.4 linking with regions and sections . . . . . . . . . . . . . . . . . . . . . . . 2-3 2.5 linking with circular buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3 2.6 linking with overlays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4 chapter 3 linker directives 3.1 memory control file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1 3.2 linker directive descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1 3.3 memory control file example . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19 chapter 4 motorola dsp librarian 4.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1 4.2 installing the librarian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1 4.3 running the librarian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1 4.4 librarian options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2 4.5 library processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents vi dsp linker/librarian reference manual motorola chapter 5 motorola dsp s-record conversion utility (srec) 5.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1 5.2 installing srec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1 5.3 running srec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1 5.4 srec options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1 5.5 srec processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6 5.6 s-record file format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8 5.6.1 s-record content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8 5.6.2 s-record types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9 5.6.2.1 s0 record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9 5.6.2.2 s1, s2, s3 records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10 5.6.2.3 s7, s8, s9 records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10 chapter 6 motorola dsp coff file dump utility (cofdmp) 6.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1 6.2 installing cofdmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1 6.3 running cofdmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1 6.4 cofdmp options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 6.5 cofdmp processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4 appendix a linker messages a.1 introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . a-1 a.2 command line errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . a-2 a.3 warnings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . a-4 a.4 errors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . a-6 a.5 fatal errors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . a-15 appendix b librarian messages b.1 introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . b-1 b.2 command line errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . b-2 b.3 warnings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . b-3 b.4 fatal errors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . b-4 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents motorola dsp linker/librarian reference manual vii appendix c linker map file format c.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . c-1 c.2 map file commentary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . c-1 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp linker/librarian reference manual 1-1 chapter 1 motorola dsp linker 1.1 introduction the motorola dsp linker is a program that processes relocatable object files produced by the motorola dsp assemblers, generating an absolute executable file which can be loaded directly into one of the motorola dsp simulators, downloaded to an application de- velopment system, or converted to motorola s-record format for prom burning. a com- mand line option provides for specification of a base address for each dsp memory space and logical location counter. in addition, a memory control file may be supplied to indicate absolute positioning of sections in dsp memory as well as physical mappings to internal and external memory. the linker optionally generates a map file which shows memory assignment of sections by memory space and a sorted list of symbols with their load time values. 1.2 installing the linker the linker is distributed on various media and in different formats depending on the host operating system environment. see appendix g in the motorola dsp assembler ref- erence manual , host-dependent information, for details on installing and oper- ating the linker on your particular machine. 1.3 running the linker the general format of the command line to invoke the linker is: dsplnk [options] where: [options] any of the following command line options. these can be in any order, but must precede the list of source filenames. some options can be given more f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp linker running the linker 1-2 dsp linker/librarian reference manual motorola than once; the individual descriptions indicate which options may be speci- fied multiple times. option letters can be in either upper or lower case. command options that are used regularly may be placed in the environment variable dsplnkopt . if the variable is found in the environment the linker adds the associated text to the existing command line prior to processing any options. see your host documentation for instructions on how to define environment variables. option arguments may immediately follow the option letter or may be sepa- rated from the option letter by blanks or tabs. however, an ambiguity arises if an option takes an optional argument. consider the following command line: dsplnk -b main io in this example it is not clear whether the file main is an input file or is meant to be an argument to the -b option. if the ambiguity is not resolved the link- er will assume that main is an input file and attempt to open it for reading. this may not be what the programmer intended. there are several ways to avoid this ambiguity. if main is supposed to be an argument to the -b option it can be placed immediately after the option letter: dsplnk -b main io if there are other options on the command line besides those that take op- tional arguments the other options can be placed between the ambiguous option and the list of input file names: dsplnk -b main -v io an alternative is to use two successive hyphens to indicate the end of the option list: dsplnk -b -- main io in this latter case the linker interprets main as an input file name and uses the default naming conventions for the -b option. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp linker linker options motorola dsp linker/librarian reference manual 1-3 1.4 linker options -a auto-align circular buffers. any modulo or reverse-carry buffers defined in the object file input sections are relocated independently in order to optimize placement in memory. code and data surrounding the buffer is packed to fill the space formerly occupied by the buffer and any corresponding alignment gaps. example: dsplnk -a myprog.cln link the file myprog.cln and optimally align any buffers encoun- tered in the input. -b [] this option specifies that an object file is to be created for linker output. can be any legal operating system filename, including an optional pathname. a hyphen also may be used as an argument to indicate that the object file should be sent to the standard output. if a pathname is not specified, the file will be created in the current directory. if no filename is specified, or if the -b option is not present, the linker will use the basename (filename without extension) of the first filename encoun- tered in the input file list and append .cld to the basename. if the -i option is present (see below) an explicit filename must be given. this is because if the linker followed the default action it possibly could overwrite one of the existing input files. the -b option should be specified only once. if the file named in the -b option already exists, it will be overwritten. example: dsplnk -b filter.cld main.cln fft.cln fio.cln in this example, the files main.cln, fft.cln, and fio.cln are linked together to produce the absolute executable file filter.cld. -ea -ew these options allow the standard error output file to be reassigned on hosts that do not support error output redirection from the command line. must be present as an argument, but can be any legal operating system file- name, including an optional pathname. the -ea option causes the standard error stream to be written to ; if exists, the output stream is appended to the end of the file. the -ew option also writes the standard error stream to ; if exists it is rewound (truncated to zero), and the output stream is written from the be- f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp linker linker options 1-4 dsp linker/librarian reference manual motorola ginning of the file. note that there must be white space separating either option from the filename argument. example: dsplnk -ew errors myprog.cln redirect the standard error output to the file errors. if the file al- ready exists, it will be overwritten. -f indicates that the linker should read command line input from . can be any legal operating system filename, including an optional pathname. is a text file containing further options, arguments, and filenames to be passed to the linker. the arguments in the file need be sep- arated only by some form of white space (blank, tab, newline). a semicolon ( ; ) on a line following white space makes the rest of the line a comment. the -f option was introduced to circumvent the problem of limited line lengths in some host system command interpreters. it may be used as often as desired, including within the argument file itself. command options may also be supplied using the dsplnkopt environment variable. see the dis- cussion of dsplnkopt under [options] at the beginning of this section. example: dsplnk -f opts.cmd invoke the linker and take command line options and input filenames from the command file opts.cmd. -g send source file line number information to the object file. the generated line number information can be used by debuggers to provide source-level debugging. example: dsplnk -b -g myprog.cln link the file myprog.cln and send source file line number infor- mation to the resulting object file myprog.cld. -i the linker ordinarily produces an absolute executable file as output. when the -i option is given the linker combines the input files into a single relocat- able object file suitable for reprocessing by the linker. no absolute ad- dresses are assigned and no errors are issued for unresolved external references. note that the -b option must be used when performing incre- f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp linker linker options motorola dsp linker/librarian reference manual 1-5 mental linking in order to give an explicit name to the output file. if the file- name were allowed to default it could overwrite an existing input file. example: dsplnk -i -b filter.cln main.cln fft.cln fio.cln in this example, the files main.cln, fft.cln, and fio.cln are combined to produce the relocatable object file filter.cln. -l the linker ordinarily processes a list of input files which each contain a sin- gle relocatable code module. if the -l option is encountered the linker treats the following argument as a library file and searches the file for any outstanding unresolved references. if a module is found in the library that resolves an outstanding external ref- erence, the module is read from the library and included in the object file out- put. the linker continues to search a library until all external references are resolved or no more references can be satisfied within the current library. the linker searches a library only once, when it is encountered on the com- mand line. therefore, the position of the -l option on the command line is significant. example: dsplnk -b filter main fir -l io this example illustrates linking with a library. the files main.cln and fir.cln are combined with any needed modules in the library io.lib to create the file filter.cld. -m [] this option indicates that a map file is to be created. can be any legal operating system filename, including an optional pathname. a hyphen also may be used as an argument to indicate that the map file should be sent to the standard output. if a pathname is not specified, the file will be created in the current directory. if no filename is specified, the linker will use the basename (filename with- out extension) of the first filename encountered in the input file list and ap- pend .map to the basename. if the -m option is not specified, then the linker will not generate a map file. the -m option should be specified only once. if the file named in the -m option already exists, it will be over- written. example: dsplnk -m -- filter.cln gauss.cln in this example, the files filter.cln and gauss.cln are linked together to produce a map file. because no filename was given with the -m option, the output file will be named using the basename of the f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp linker linker options 1-6 dsp linker/librarian reference manual motorola first input file, in this case filter. the map file will be called fil- ter.map. -n the linker considers case significant in symbol names. when the -n option is given the linker ignores case in symbol names; all symbols are mapped to lower case. example: dsplnk -n filter.cln fft.cln fio.cln in this example, the files filter.cln, fft.cln, and fio.cln are linked to produce the absolute executable file filter.cld. all sym- bol references are mapped to lower case. -o [][]: by default the linker generates instructions and data for the output file be- ginning at absolute location zero for all dsp memory spaces. this option allows the programmer to redefine the start address for any memory space and associated location counter. is one of the single-character memory space identifiers (x, y, l, p). the letter may be upper or lower case. the optional is a letter indicat- ing the high ( h ) or low ( l ) location counters. if no counter is specified the default counter is used. is also optional and signifies the desired physical mapping for all relocatable code in the given memory space. it may be i for internal memory, e for external memory, r for rom, a for port a, and b for port b. if is not supplied, then no explicit mapping is pre- sumed. the is a hexadecimal number signifying the new relocation address for the given memory space. the -o option may be specified as many times as needed on the command line. this option has no effect if incremental linking is being done (see the -i option). example: dsplnk -ope:200 myprog -lmylib this will initialize the default p memory counter to hex 200 and map the program space to external memory. -p when the linker encounters input files, the current directory (or the directory given in the library specification) is first searched for the file. if it is not found and the -p option is specified, the linker prefixes the filename (and optional pathname) of the file specification with and searches the newly formed directory pathname for the file. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp linker linker options motorola dsp linker/librarian reference manual 1-7 the pathname must be a legal operating system pathname. the -p option may be repeated as many times as desired. the directories will be searched in the order specified on the command line. example: dsplnk -p \project\ testprog this example uses ibm pc pathname conventions, and would cause the linker to prefix any library files not found in the current directory with the \project\ pathname. -q on some hosts the linker displays a banner on the console when invoked. this option inhibits the banner display. it has no effect on hosts where the signon banner is not displayed by default. example: dsplnk -q myprog.cln link the file myprog.cln but do not display the signon banner on the console. -r [] this option indicates that a memory control file is to be read to determine the placement of sections in dsp memory and other linker control func- tions. can be any legal operating system filename, including an op- tional pathname. if a pathname is not specified, an attempt will be made to open the file in the current directory. if no filename is specified, the linker will use the base- name (filename without extension) of the first filename encountered in the link input file list and append .ctl to the basename. if the -r option is not specified, then the linker will not use a memory control file. the -r option should be specified only once. example: dsplnk -r proj filter.cln gauss.cln in this example, the files filter.cln and gauss.cln are linked together using the memory file proj.ctl. -u allows the declaration of an unresolved reference from the command line. must be specified. this option is useful for creating an undefined external reference in order to force linking entirely from a library. example: dsplnk -u start -l proj.lib declare the symbol start undefined so that it will be resolved by code within the library proj.lib. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp linker linker options 1-8 dsp linker/librarian reference manual motorola -v this option causes the linker to report linking progress (beginning of pass- es, opening and closing of input files) to the standard error output stream. this is useful to insure that link editing is proceeding normally. example: dsplnk -v myprog.cln link the file myprog.cln and send progress lines to the standard error output. -x [,,...,] the -x option provides for link time options that alter the standard operation of the linker. the options are described below (* means default). all op- tions may be preceded by no to reverse their meaning. the -x se- quence can be repeated for as many options as desired. option meaning abc* perform address bounds checking aec* check form of address expressions asc enable absolute section bounds checking csl cumulate section length data (see chapter 3, sizsym set size symbol) eso do not allocate memory below ordered sections ovlp warn on section overlap psb* preserve sign bit in twos-complement negative operands ro allow region overlap rsc* enable relative section bounds checking svo preserve object file on errors wex add warning count to exit status example: dsplnk -x wex filter.cln fft.cln fio.cln have the linker add the warning count to the exit status so that a project build will abort on warnings as well as errors. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp linker linker options motorola dsp linker/librarian reference manual 1-9 -z the linker strips source file line number and symbol information from the output file. symbol information normally is retained for debugging purpos- es. this option has no effect if incremental linking is being done (see the -i option). example: dsplnk -z filter.cln fft.cln fio.cln in this example, the files filter.cln, fft.cln, and fio.cln are linked to produce the absolute object file filter.cld. the output file will contain no symbol or line number information. a list of operating system compatible filenames (including optional path- names). if no extension is supplied for a given file, the linker first will at- tempt to open the file using the filename as supplied. if that is not successful the linker appends .cln to the filename and attempts to open the file again. if no pathname is specified for a given file, the linker will look for that file in the current directory. the list of files will be processed sequentially in the order given and all files will be used to generate the object file and map list- ing. for more details on linker operation in a particular machine environment see appendix g, host-dependent information, in the motorola dsp assembler reference manual . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp linker/librarian reference manual 2-1 chapter 2 linker operation 2.1 introduction using a linker allows the programmer to break up a large program into more manageable modules which may be assembled or compiled separately. these modules can then be link edited to produce an absolute module of the complete program. if a problem arises, only the module with the problem need be edited and reassembled. then the programmer can relink the updated relocatable object module and the other previously created object modules to produce a new executable file. 2.2 relocation and linking the input to the linker is a set of relocatable object modules produced by the motorola dsp assembler. the term relocatable means that the data in the module has not yet been assigned to absolute addresses in memory; instead, each different section is as- sembled as though it started at relative address 0 (an exception to this is absolute blocks, which do get assigned to absolute addresses at assembly time). when creating an abso- lute object module, it is the job of the linker to read all the relocatable object modules which comprise a program and assign the relocatable blocks in each section to an abso- lute memory address. then in the process of actually putting the code and data read from each object module into the proper location in the executable file, the linker must fill in the correct addresses for such items as absolute addresses and references across sec- tions. this is the process of relocation. along with relocation, the linker performs resolution between modules, so that one mod- ule may reference symbols defined in a different module. at assembly time the module doing the referencing has no idea where the symbol it is referencing will be in the final absolute module. therefore, the assembler sets up information in the relocatable object module which indicates that an external symbol is referenced in this module and where the symbol is referenced. in the relocatable object module where the symbol is defined there is information indicating that this is the module in which the symbol is defined, along with the value of the symbol in the module. when the modules are presented as input to the linker, the correct value of the symbol can be inserted wherever it is referenced. if an external reference is made to a symbol for which there is no corresponding record in the input, the linker flags it as an unresolved external reference. no final values are as- f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker operation linker passes 2-2 dsp linker/librarian reference manual motorola signed to these references, and the resulting output file is unusable. a list of unresolved references is sent to the linkers standard output and to the optional link map file. references in the input file may be specified as either absolute or relative expressions. an absolute expression is one which consists only of absolute terms, or is the difference between two relative terms. a relative expression consists of one relative term along with absolute terms and/or the result of two relative terms with opposing signs. expressions in the input file are a modified notation as supported by the assembler. see appendix e in the motorola dsp assembler reference manual for more information on the format of relocatable object file expressions. 2.3 linker passes the linker makes two partial passes over the input data. during the first pass, it collects section, symbol, and external reference information from each input file given on the com- mand line. if the input file is a library, the linker checks to see if there are any external references outstanding. if there are, the linker opens the library file and searches each module in the library until all external references are resolved or no more references can be satisfied within that library. if there are no outstanding unresolved references, the link- er skips the library. at the end of the first pass a list of unresolved external references is sent to the standard output as well as to the map file if one exists. references to unre- solved symbols may be fixed up using the symbol directive of the memory control file, discussed in chapter 3. prior to the second pass, the linker scans its internal tables and performs fixups on sec- tion start addresses and symbol values. this includes setting the base relocation address for any memory spaces and counters as given by the -o option on the command line or the base directive in the memory control file. if a memory control file was specified on the command line it is opened and read to determine placement of any named sections in memory. blocks of code and data are arranged in memory first by region then by location counter assignment. absolute sections are located first, followed by ordered sections, and then any remaining sections are placed in memory. it is possible that addresses assigned to a section using a numbered location counter might overlap addresses of another section us- ing a different counter. this design is intentional so that counters may be used as a logical connection to the physical mapping of separate memories (e.g. internal and external ram), or as a means for supporting load and runtime counters for overlays. during the second pass, the linker processes the data records, evaluating data fields as expressions and writing the modified values to the output file. errors are reported during either pass, and the linker may abort depending on the severity of the error. linker errors are routed to standard output so they may be redirected to a file if necessary. an output file produced with errors should not be used in any case. the number of errors is returned as an exit status when the linker returns control to the host operating system. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker operation linking with regions and sections motorola dsp linker/librarian reference manual 2-3 2.4 linking with regions and sections the basic relocatable entity is the section . sections are created by the assembler sec- tion directive. a section may contain code or data from any dsp memory space, and the addresses of the code or data may be relocatable or absolute. sections that are not ab- solute at assembly time can be located either directly using the linker memory control file section directive, or indirectly via the linker command line -o option or the control file base directive. note that sections do not have to be relocatable to be linked; an absolute section can be linked with any arbitrary module that contains or satisfies a reference to that section. sections may be grouped for relocation into regions . a region is a defined area of mem- ory where sections are located. regions make it possible to specify varying base ad- dresses for different groups of sections and set boundaries for section growth. whereas sections represent blocks of code or data which are positioned within a given memory map, regions designate an area of a specified size where sections can be placed. there is always at least one default region. other regions are defined using the linker re- gion directive. a region always has a size and a start and end address. if these are not given, the linker uses default values (e.g. if no end address is supplied for a region, the highest target address is used). regions should not overlap. one exception is that regions may overlap for setting overlay base addresses. another exception is the default region, which allows explicit regions to supersede it for relocation blocks. after all sections in explicit regions are located, the linker relocates remaining sections around the previously assigned blocks within the de- fault region. this behavior can be altered with the linker ro option (see section 1.3). 2.5 linking with circular buffers a circular buffer is a fixed area of memory manipulated via special-purpose dsp ad- dressing modes. because of the way buffers are accessed, they must be suitably aligned on an address boundary. when the programmer declares a modulo or reverse-carry buff- er, the assembler aligns the buffer block at an address corresponding to the size of the buffer. the alignment may create a padding gap comprising the locations skipped to prop- erly position the buffer block in memory. the linker processes buffer blocks in one of two ways. by default, it keeps track of the largest buffer in any section and aligns the entire section based on the size of the largest buffer block. this insures that any smaller buffers contained in the section will remain aligned after relocation, but it can introduce additional padding gaps because of the sec- tion alignment. if the -a option is given on the linker command line, or if one of the buffer alignment di- rectives is specified in the memory control file, the linker auto-aligns buffers. it extracts the buffer blocks in a given section, locates them in memory before any other relocatable blocks, and repositions the section code and data to fill in gaps left from padding and re- f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker operation linking with overlays 2-4 dsp linker/librarian reference manual motorola located buffers. the linker sorts the buffers, placing the largest blocks in memory first in order to make more eligible addresses available for subsequent smaller blocks. auto-alignment works only with relocatable buffers; the linker will not attempt to realign any absolute block. also, a buffer defined inside a relocatable overlay cannot be auto- aligned because the assumption is that the overlay block will move, invalidating any opti- mal placement of the buffer. if a buffer is declared using an open-ended alignment direc- tive such as baddr , the linker will not auto-align any buffers within that section associated with the current memory space and counter. this is because the linker has no knowledge of how far the open-ended block extends, and since alignment works only at the section level, the linker must abandon auto-alignment of all buffers in the section. see chapter 4 in the motorola dsp assembler reference manual for more information on circular buffers. 2.6 linking with overlays an overlay is a segment of code or data that is loaded at one address, but is moved and executed or used at another location. a good example is a user program burned into prom and transferred into internal ram by the dsp bootstrap program. the linker han- dles overlays by recognizing overlay blocks, reconciling overlay block addresses with pre- viously relocated sections, and altering values for symbols associated with overlay blocks. processing of any overlays is postponed until after all absolute and otherwise relocatable sections have been placed into the memory map. this is done so that any overlays based on an explicit address (e.g. a relocatable expression) will be properly located. if overlays exist that were not explicitly based (default overlays), the linker attempts to base them from previous explicit blocks. if there are no explicit blocks, the linker will base the default overlays from the enclosing section or region base address. in all cases for default over- lays, the blocks will be located as if they were contiguous; that is, default overlays will not overlap one another. after all overlay blocks are processed the linker resolves overlay symbols. overlay sym- bols are those labels defined inside an overlay within the source file. the overlay block information is retained for reporting to the link map file. see chapter 4 in the motorola dsp assembler reference manual for more information on overlays. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp linker/librarian reference manual 3-1 chapter 3 linker directives 3.1 memory control file a memory control file is simply a text file containing linker directives. it optionally contains module identification, a global starting load address for linking purposes, and ordering, sizing, or placement information for any named sections. section addresses may be for any memory space and any logical location counter. the memory control file also can specify physical memory mappings (internal, external) associated with any memory space or counter. in addition, global unresolved symbols may be assigned values in the memory control file. 3.2 linker directive descriptions linker directives are commands which control the operation of the linker with respect to section relocation, buffer alignment, symbol definition, and map file format. linker direc- tives are listed below: balign map sbalign sizsym base memory secsize start ident region section symbol include reserve set several of the directives use the notation mem or memx to indicate the contents of a field. the definitions of mem and memx are as follows: mem = : memx = :.. attr = | scm = [][] sme = [][(exp)] spc = x|y|l|p ctr =l|h map = i|e|r|a|b exp = expression f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker directives linker directive descriptions 3-2 dsp linker/librarian reference manual motorola the spc field indicates one of the dsp memory spaces (x, y, l, p). the ctr field specifies either l ow or h igh location counters; if none is given the default counter is used. alterna- tively, an expression in parentheses may be provided to indicate an arbitrary counter des- ignation. the map field indicates i nternal memory, e xternal memory, r om, port a , or port b ; this field may be omitted, in which case no explicit mapping is done. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker directives linker directive descriptions motorola dsp linker/librarian reference manual 3-3 balign auto-align circular buffers balign [,...,] the balign directive auto-aligns circular buffers within a particular region. all relocat- able buffers found in any section within the region are relocated independently for optimal placement in memory. code and data around the buffer is made contiguous in order to fill in previously occupied space. the argument indicates where in memory the align- ment should begin. example: balign xe:$200,ye:$200 ; realign x and y external buffers f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker directives linker directive descriptions 3-4 dsp linker/librarian reference manual motorola base set region base address base [,...,] the base directive indicates where to begin the location counter for the given memory region. this will be the base link address for all specified memory areas and all linked code and data within the region except for sections relocated absolutely via a memory file section directive. code and data not explicitly relocated will originate from this ad- dress. the base directive is analogous to the linker -o command line option. example: base xe:$200,ye:$200,pi:$200 ; set memory base addresses f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker directives linker directive descriptions motorola dsp linker/librarian reference manual 3-5 ident object module identification ident [;] the ident directive functions similarly to the assembler ident directive by identifying the name, version number, and revision number of the absolute or incrementally linked output module. the information is sent to the resulting output file. the adheres to the rules for assembly language labels, so that it must begin with an alphabetic character and consist only of alphanumeric characters or the underscore up to a length of 255. the version number and revision number must be absolute expressions. if a com- ment follows the version and revision numbers it will be copied into the output file as well. example: ident mymodule 1 2 ; mymodule, version 1, revision 2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker directives linker directive descriptions 3-6 dsp linker/librarian reference manual motorola include include directive file include the include directive provides for insertion of separate files containing other linker control directives. file inclusion can be convenient for always including a set of master directives in several different configuration files. must be in quotes. example: include main.ctl ; include master control file f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker directives linker directive descriptions motorola dsp linker/librarian reference manual 3-7 map page map file format control map page [,[,[,[,]]]] the map page modifier works similarly to the assembler page directive, and causes the .map file to be printed on the page according to the parameters supplied. if no map page appears in the memory control file, the linker produces a map file with a column width of 80, a physical page length of 66 lines, and no blank lines at top and bottom. example: map page 132,,3,3 the above map page directive indicates a column width of 132, a physical page length of 66 lines (default), with three blank lines at the top and bottom of each page. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker directives linker directive descriptions 3-8 dsp linker/librarian reference manual motorola map opt map file contents control map opt [, ,..., ] the map opt modifier determines the content of the output in the linker map file. the following map opt options are available: globmap - produce global map by memory space noconst - do not list symbols without a memory space attribute noglobsym - omit symbols from global map nolocal - do not list non-global symbols (e.g. symbols which are local to a section) nosecaddr - do not list sections by address nosecname - do not list sections by name nosymname - do not list symbols by name nosymval - do not list symbols by value nounused - do not list unused memory blocks if no map opt is found in the memory control file, the linker will list all symbols and sec- tions by name, address, and value. example: map opt noconst,nosymval the above map opt directive specifies no constants in the map listing and no symbols by value. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker directives linker directive descriptions motorola dsp linker/librarian reference manual 3-9 memory set region high memory address memory [,...,] the memory directive establishes a maximum high memory address for locating code and data in the given memory region. if the linker attempts to relocate a block beyond the address specified in the memory directive, an error will occur. this directive is use- ful for reflecting the true physical memory limits of the target system. example: memory pe:$1fff ; external program memory ends at hex 1fff f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker directives linker directive descriptions 3-10 dsp linker/librarian reference manual motorola region establish memory region region [[,...,]] . . . endr the region directive defines a region of memory in which to locate sections. the region name identifies the region. the optional parameter gives an absolute region size. the region directive is used in conjunction with existing control directives to specify a bounds for placing sections in memory. for example, a base directive used within a re- gion/endr pair defines the base address for that region only . likewise a memory di- rective within a region scope indicates the high address for the enclosing region. example: region internal_rom x:$256,y:$256 base x:0,y:0 ; base for internal_rom region only section buffers endr f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker directives linker directive descriptions motorola dsp linker/librarian reference manual 3-11 reserve reserve memory block reserve [,...,] the reserve directive sets aside a block of memory which the linker will not use for relocation. the expression field in the parameter takes the form of a range n..m , where n is the low reserve address and m is the high reserve address. this directive can be used to protect rom locations, system code, or uninitialized buffer areas. example: reserve pi:$0..$1ff ; protect interrupt vectors f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker directives linker directive descriptions 3-12 dsp linker/librarian reference manual motorola sbalign auto-align section buffers sbalign [,...,] the sbalign directive auto-aligns circular buffers within a named section. all relocat- able buffers found in the section are relocated independently for optimal placement in memory. code and data around the buffer is made contiguous in order to fill in previously occupied space. the argument indicates where in memory the alignment should begin. example: sbalign mysec xe:$200 ; realign x external buffers f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker directives linker directive descriptions motorola dsp linker/librarian reference manual 3-13 secsize pad section length secsize [[,...,]] the secsize directive provides a mechanism for padding a section to a particular length despite its code or data content. the value field in the mem parameter is an expression which can either be an absolute size expressed as an integer, or a floating point value rep- resenting a percentage to pad. example: secsize padsec x:$1000,y:$1000 ; x and y absolute size secsize padsec p:150.0 ; increase size by one half f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker directives linker directive descriptions 3-14 dsp linker/librarian reference manual motorola section set section base address section [[,...,]] the section directive either assigns a section of code or data to an absolute location in dsp memory, or implies an ordering if no address specification is present. the addresses serve as the base for the corresponding memory spaces and counters in the named sec- tion. any memory areas not indicated in the section directive are relocated relative to the global starting load address given by the -o command line option or the memory file base directive. if there is no -o option or base directive, unassigned areas are placed in memory relative to location zero. if the section directive appears with only a section name and no address, it means that the linker should locate this section in memory before handling any other default sec- tions. thus given a set of sections a, b, c, and d, if b and c were listed in section directives without a corresponding address, the linker would place b and c in memory before a and d. this provides a means for ordering sections in memory. example: section abs x:$2000,y:$2000 ; x and y absolute base section ord ; ordered section f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker directives linker directive descriptions motorola dsp linker/librarian reference manual 3-15 set set symbol value set { | } the set directive is a synonym for the symbol directive, described below. it is useful for sharing counter declaration files between the assembler and linker since the syntax is compatible. example: set pctr 5 ; set p memory counter number f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker directives linker directive descriptions 3-16 dsp linker/librarian reference manual motorola sizsym set size symbol sizsym :[] the sizsym directive makes it possible to declare an arbitrary symbol to hold section length data. this is useful when the programmer needs a cumulative section length for overlay handling. it is analogous to the symbol directive, in that the symbol so defined may be employed to resolve an external reference in a source file. if no section name is supplied the linker returns the length of all sections for the memory space and counter specified. ordinarily the linker retains length data only for relocatable sections; use csl (see -x option) to cumulate length data for absolute and buffer sections as well. note that sizsym symbols are valued after the memory control file is read, so that attempting to reference the symbol value within the memory control file itself may cause erroneous results. example: sizsym xlen x: ; assign length of x memory to xlen f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker directives linker directive descriptions motorola dsp linker/librarian reference manual 3-17 start establish start address start the start directive gives an alternative start address to which the program will jump at runtime. this value is ordinarily given by the assembler end directive. the expression may consist of an absolute value or a global symbol whose value will be adjusted during link processing. example: start begin ; jump to location begin after loading f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker directives linker directive descriptions 3-18 dsp linker/librarian reference manual motorola symbol set symbol value symbol { | } the symbol directive allows the programmer to specify a value for an otherwise unre- solved reference. the named symbol must not have been defined during link processing. the symbol is stored as an absolute global symbol. the symbol value may be either in- teger or floating point. if the value is an address it may contain a memory space reference and optionally a counter and mapping designation. example: symbol target x:$200 ; set target to hex 200 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker directives memory control file example motorola dsp linker/librarian reference manual 3-19 3.3 memory control file example figure 1 shows the contents of an example memory control file. the ident directive iden- tifies the object module and gives it explicit version and revision numbers. the comment is also preserved in the output file. the start directive gives a starting address of fil- ter for the program, overriding any previous settings done with the assembler end di- rective. the base directive indicates that the x and y low memory counters are to be mapped into internal dsp memory, with a starting address of 100 hexadecimal. any data associ- ated with the x or y low memory counters, and not relocated due to a subsequent memory file section directive, will be assigned addresses relative to this starting location. the base directive also shows that x and y high memory counters have been assigned start- ing address 2000 hexadecimal in external dsp memory, and that linking to external pro- gram memory begins at location 200 hexadecimal. note that any memory specifications given by the -o command line option override the values supplied by the memory file base directive for the default region. the reserve directives set aside a part of the low internal x and y data memory, even though the base address is lower than the reserved area. the linker will locate data around the reserved portions as if they had been previously allocated. the region directive defines a sized region of memory for modulo buffers in internal rom. the corresponding memory directive indicates that there are only 256 words of memory in each data space for this region (the default base is zero). the example section directives are similar to the format of the base directive, except that the particular section is named so that the individual section counters may be modi- fied. for the section named input, the program low memory counter is initialized to 100 hex and mapped to external memory. the program memory for the filter section uses the default location counter and sets the initial value to 400 hex, mapped to external mem- ory. finally, the output section is set to 800 hex, using the high memory p space counter mapped to external memory. two unresolved symbols are given values with the symbol directive. the symbol xda- ta is assigned to external high x memory with a value of 2000 hexadecimal. the symbol ydata is assigned to external high y memory with a value of 2000 hexadecimal. both symbols will be stored as absolute global entities. the map directives control the formatting and content of the link map file. the first direc- tive sets the page width to 132, with three blank lines at top and bottom. the second di- rective disables the reporting of sections by address and symbols by value. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker directives memory control file example 3-20 dsp linker/librarian reference manual motorola ident filter 2 1 ; filter module start filter base xli:$100,xhe:$2000,yli:$100,yhe:$2000,pe:$200 reserve xli:$200..$3ff,yli:$200..$3ff region internal_rom memory x:256,y:256 section buffers endr section input ple:$100 section filter pe:$400 section output phe:$800 symbol xdata xhe:$2000 symbol ydata yhe:$2000 map page 132,,3,3 map opt nosecaddr,nosymval figure 1. dsp linker memory control file example f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp linker/librarian reference manual 4-1 chapter 4 motorola dsp librarian 4.1 introduction the motorola dsp librarian is a stand-alone utility that allows separate files to be grouped together into a single file for linking or archival storage. after a library is created, files may be added, deleted, replaced, or extracted from the library. the library contents may also be listed, indicating the module name (base name of the input file path), size in bytes, and the date and time the module was entered into the library. 4.2 installing the librarian the librarian is distributed on various media and in different formats depending on the host operating system environment. see appendix g in the motorola dsp assembler reference manual , host-dependent information, for details on installing and operating the librarian on your particular machine. 4.3 running the librarian the general format of the command line to invoke the librarian is: dsplib [options] [] [] where: [options] any one of the following command line options. the single option must pre- cede the library name. option letters may be specified in either upper or low- er case. if no option is supplied, the librarian operates as if the update ( -u ) option were given. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp librarian librarian options 4-2 dsp linker/librarian reference manual motorola 4.4 librarian options -a this option adds the modules in the file list to the named library. the library file must exist, and the modules must not already be in the library. example: dsplib -a fftlib fft16.cln fft512.cln ditfft.cln in this example, the files fft16.cln, fft512.cln, and ditfft.cln are added to the existing library fftlib.lib. -c create a new library file and add any specified modules to it. if the library file already exists, an error is issued. example: dsplib -c fftlib fft16.cln fft512.cln ditfft.cln in this example, a new library file fftlib.lib is created and the files fft16.cln, fft512.cln, and ditfft.cln are added to the li- brary. -d delete the named modules from the library. if the module is not in the li- brary, an error is issued. example: dsplib -d fftlib fft16.cln in this example, the module fft16.cln is removed from the library fftlib.lib. -ea -ew these options allow the standard error output file to be reassigned on hosts that do not support error output redirection from the command line. must be present as an argument, but can be any legal operating system file- name, including an optional pathname. the -ea option causes the standard error stream to be written to ; if exists, the output stream is appended to the end of the file. the -ew option also writes the standard error stream to ; if exists it is rewound (truncated to zero), and the output stream is written from the be- ginning of the file. example: dsplib -ew errors -a fftlib fft16.cln fft512.cln ditfft.cln redirect the standard error output to the file errors. if the file al- ready exists, it will be overwritten. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp librarian librarian options motorola dsp linker/librarian reference manual 4-3 -f indicates that the librarian should read command line input from . can be any legal operating system filename, including an optional pathname. is a text file containing module names to be passed to the librarian. the arguments in the file need be separated only by some form of white space (blank, tab, newline). a semicolon ( ; ) on a line following white space makes the rest of the line a comment. the -f option was introduced to circumvent the problem of limited line lengths in some host system command interpreters. example: dsplib -f opts.cmd invoke the librarian and take command line filenames from the com- mand file opts.cmd. -l list library contents. this option lists the module name as contained in the library header, the module size (less library overhead), and the date and time the file was stored into the library. the listing output is routed to stan- dard output so that it may be redirected to a file if desired. example: dsplib -l fftlib > fftlib.lst this example lists the contents of the library fftlib.lib. the output is redirected to the file fftlib.lst. -q on some hosts the librarian displays a banner on the console when invoked. this option inhibits the banner display. it has no effect on hosts where the signon banner is not displayed by default. example: dsplib -aq mylib.clb myprog.cln add the file myprog.cln to the library mylib.clb, but do not dis- play the signon banner. -r this option replaces the named modules in the given library. the modules must already be present in the library file. example: dsplib -r fftlib fft512.cln ditfft.cln this example replaces the files fft512.cln and ditfft.cln in the library fftlib.lib. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp librarian librarian options 4-4 dsp linker/librarian reference manual motorola -u this option updates the specified modules if they exist in the library; other- wise it adds them to the end of the library file. example: dsplib -u fftlib ditfft.cln in this example, the file ditfft.cln is updated in the library fftlib.lib. -v display the librarian version number and copyright notice on standard out- put. example: dsplib -v this example displays the current librarian version number and copy- right notice. -x extract named modules from the library. the resulting files are given the name of the modules as stored in the library module header. example: dsplib -x fftlib fft16.cln fft612.cln this example extracts the files fft16.cln and fft512.cln from the library fftlib.lib. the files are placed in the current directory. an operating system compatible filename (including optional pathname) specifying the library file to create or access. if no extension is supplied, the librarian will automatically append .lib to the filename. if no pathname is specified, the librarian will look for the library in the current directory. the librarian also has an interactive mode, where commands can be en- tered repeatedly without reloading the librarian program for each operation. if the librarian is invoked without arguments, it prompts for a command string. the interactive commands correspond to those given above, and the syntax is similar to that of the command line. because interactive input is taken from the standard input channel of the host environment, it is possible to create a batch of librarian commands and feed them to the program for execution via redirection. enter help or ? at the prompt for more information on the librarian interactive mode. a list of operating system compatible filenames separated by blanks. if no pathname is specified for a given file, the librarian will look for that file in the f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp librarian library processing motorola dsp linker/librarian reference manual 4-5 current directory. for input operations the filenames may also contain an optional pathname; the path is stripped when the file is written to the library. for output operations only the filename should be used to refer to library modules. the list of files will be processed sequentially in the order given. 4.5 library processing a library file may contain several relocatable object modules, each of which contains one or more global symbol definitions. rather than being normal input to the linker, a library file is searched. this means that for each relocatable object module in the library, a check is made to determine whether any globally defined symbols in the library module match any externally referenced symbols encountered in previous input modules. if so, the relo- catable object module from the library is included in the executable file. if not, the search continues with the next module in the library file. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp linker/librarian reference manual 5-1 chapter 5 motorola dsp s-record conversion utility (srec) 5.1 introduction the motorola dsp s-record conversion utility srec converts motorola dsp coff for- mat files into motorola s-record files. the s-record format was devised for the purpose of encoding programs or data files in a printable form for transportation between computer systems. motorola s-record format is recognized by many prom programming systems. 5.2 installing srec srec is distributed on various media and in different formats depending on the host op- erating system environment. see appendix g in the motorola dsp assembler refer- ence manual , host-dependent information, for details on installing and operating srec on your particular machine. 5.3 running srec the general format of the command line to invoke srec is: srec [options] where: [options] any of the following command line options. the options must precede the file names. option letters may be specified in either upper or lower case. 5.4 srec options -a use as the s-record address length. a value of 2 indicates a two- byte address and will generate s1 records. a value of 3 indicates a three- byte address and will generate s2 records. a value of 4 indicates a four- byte address and will generate s3 records. this option overrides any s- record address length implied by the processor type. address truncation f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp s-record conversion utility (srec) srec options 5-2 dsp linker/librarian reference manual motorola may occur for targets with address ranges greater than what can ac- commodate. example: srec -a 4 prog the file prog.cld is translated to s-records using the s3-s7 record format. -b use byte addressing when transferring load addresses to s-record address- es. this means that object file start addresses are multiplied by the number of bytes per target dsp word and subsequent s1/s3 record addresses are computed based on the data byte count. example: srec -b prog in this example, the file prog.cld is translated to s-record format using byte addressing. the load addresses will be multiplied by the number of bytes per dsp word. a separate output file will be pro- duced for each dsp memory space (x, y, l, p, or e) represented in the input file. -l use double-word addressing when transferring load addresses from l space to s-record addresses. this means that object file records for l space data are moved unchanged and subsequent s1/s3 record addresses are computed based on the data word count divided by 2. this option should always be used when the object file contains sections in l memory space. example: srec -l filter.cld convert the file filter.cld into separate s-record files for each memory space in the object file. convert l space load addresses to long addresses in the s-record file. -m split each dsp word into bytes and store the bytes in parallel s-records. the -m and -s options are mutually exclusive. example: srec -m main for each memory space in the file main.cld create multiple s- record files that correspond to each byte in the target dsp word. for example, if main.cld contained only references to p memory and the target dsp is the dsp56000, then srec would produce the files main.p0, main.p1, and main.p2. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp s-record conversion utility (srec) srec options motorola dsp linker/librarian reference manual 5-3 -o : add to s-record addresses in memory space. is one of the valid memory space specifiers: x, y, l, p, or e. must be given in hexadecimal. example: srec -o p:100 prog the file prog.cld is translated to s-record format with the value 100 hexadecimal added to all p memory addresses. -p assume object file format. this makes a difference in the type of s-type data records produced. is one of the motorola dsp pro- cessor numbers, e.g. 56000, 96000, etc. this option overrides the object file machine id. it is useful for handling object files from programs that do not generate target machine information. example: srec -p 56000 prog the file prog.cld is translated to s-record format with the assump- tion that the target processor is in the dsp56000 family of proces- sors. -q on some hosts srec displays a banner on the console when invoked. this option inhibits the banner display. it has no effect on hosts where the signon banner is not displayed by default. example: srec -q myprog.cld translate the file myprog.cld to s-record format but do not dis- play the signon banner on the console. -r write bytes high to low, rather than low to high. this option has no effect when used with the -m option. example: srec -r prog the file prog.cld is translated to s-record format with bytes writ- ten high to low. a separate output file will be produced for each dsp memory space (x, y, l, p, or e) represented in the input file. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp s-record conversion utility (srec) srec options 5-4 dsp linker/librarian reference manual motorola -s write data to a single file, putting memory space information into the ad- dress field of the s0 header record. the -m and -s options are mutually ex- clusive. example: srec -s filter this example writes the s-record output to a single file called fil- ter.s and stores the memory space information in the address field of the s0 header record. an s0 record is emitted whenever the mem- ory space changes in the object file. -t use as the target word length. a value of 2 indicates a two-byte word length. a value of 3 indicates a three-byte word length. a value of 4 indi- cates a four-byte word length. this option overrides any target word length implied by the processor type, and therefore may lead to value padding or truncation. example: srec -t 4 prog the file prog.cld is translated to s-records using four-byte data words. -u write words high to low, rather than low to high when processing l memory data records. this option has no effect when used with the -x option. example: srec -u prog the file prog.cld is translated to s-record format with l memory words written high to low. a separate output file will be produced for each dsp memory space (x, y, l, p or e) represented in the input file. -w use word addressing when transferring load addresses to s-record ad- dresses. this means that object file start addresses are moved unchanged and subsequent s1/s3 record addresses are computed based on the data word count. example: srec -w main in this example, the file main.cld is translated to s-record format using word addressing. a separate output file will be produced for f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp s-record conversion utility (srec) srec options motorola dsp linker/librarian reference manual 5-5 each dsp memory space (x, y, l, p, or e) represented in the input file. -x split l memory input words into respective x and y data records. this op- tion has no effect when used with the -u option. example: srec -x prog the file prog.cld is translated to s-record format with l memory words translated to equivalent x and y data values. a separate out- put file will be produced for each dsp memory space (x, y, l, p, or e) represented in the input file. a list of operating system compatible filenames separated by blanks. if no pathname is specified for a given file, srec will look for that file in the cur- rent directory. if the special character - is used as a filename srec will read from the standard input stream. the list of files will be processed se- quentially in the order given. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp s-record conversion utility (srec) srec processing 5-6 dsp linker/librarian reference manual motorola 5.5 srec processing srec takes as input a motorola dsp absolute object file and produces byte-wide motor- ola s-record files suitable for prom burning. the motorola dsp coff file header records are mapped into s0 and s7/s8/s9 records respectively. dsp coff section raw data are mapped into s1, s2, or s3-type records depending on the magnitude of the address value or on the type of the target processor. since motorola dsps use different word sizes, the words must be split into bytes and stored in a suitable format. the program keeps track of the input address magnitude to determine the appropriate s-record format to generate. if the -a or -p option is selected, srec uses a format corresponding to the address size or processor type specified. for example, if the programmer entered a -p 96000 option, srec would always produce s3/ s7 records regardless of the input address size. in the default mode of operation the program writes the low, middle, and high bytes of each word consecutively to the current s1/s2/s3 record being written. for example, given the dsp56000 raw data record below: 0008f8 300000 340000 094e3e |||| |||fourth word ||third word | second word first word srec would create the following s1 record: byte count field | address field checksum field || | s10d0000f808000000300000343e4e09f9 |||| | | | fourth word | | third word | second word first word output records are written to a file named according to the following convention: . where < basename > is the filename of the input object file without extension and is the memory space specifier (x, y, l, or p) for this set of data words. note that a separate file is created for each memory space encountered in the input file; thus the maximum number of output files in the default mode is 4. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp s-record conversion utility (srec) srec processing motorola dsp linker/librarian reference manual 5-7 when the -m option is specified, srec splits each dsp source word into bytes and stores the bytes in parallel s1/s2/s3 records. for example, the following dsp56000 raw data: 0008f8 300000 340000 094e3e |||| |||fourth word ||third word | second word first word would be converted by srec into the three s1 records below: byte count field | address field || s1070000f800003ec2 -- low byte s10700000800004ea2 -- mid byte s1070000003034098b -- high byte ||||| | | | | checksum field |||fourth word | | third word | second word first word the three records corresponding to the high, middle, and low bytes of each data word are written to separate files. the files are named according to the following convention: .<#> where < basename > is the filename of the input object file without extension, < m > is the memory space specifier (x, y, l, p, or e) for this set of data words, and < # > is one of the digits 0, 1, or 2 corresponding to low, middle, and high bytes, respectively. note that a separate set of byte-wide files is created for each memory space encountered in the input file. thus the number of output files generated is (number of memory spaces in input * size of dsp word). the -s option writes all information to a single file, storing the memory space information in the address field of the s0 header record. the values stored in the address field and their correspondence to the dsp memory spaces are as follows: value dsp memory space 1x 2y 3l 4p 5e when the memory space changes in the object file section record, a new s0 header record is generated. the resulting output file is named .s , where motorola dsp s-record conversion utility (srec) s-record file format 5-8 dsp linker/librarian reference manual motorola name> is the filename of the input object file without extension. the -m and -s options are mutually exclusive. address fields in dsp section records are copied as is to the appropriate s1, s2, or s3 record. subsequent s1, s2, or s3 record addresses are byte incremented until a new sec- tion is encountered or end-of-file is reached. in some cases the starting s1/s2/s3 record address must be adjusted for byte addressing by multiplying the section start address by the number of bytes in a dsp word. when the -b option is given, any section address fields are adjusted to begin on a byte-multiple address. if the -w option is specified (the default) byte-incrementing is not done when generating s-record addresses, e.g. the s- record addresses are word-oriented rather than byte-oriented. the -b and -w options have no effect when used in conjunction with the -m mode, since in that case byte and word address mappings are 1:1. section records for l space memory contain words which are loaded into adjacent x and y memory locations. in these cases performing the default strict word addressing may be inappropriate. the -l option may be given to indicate that double-word addressing should be used to generate subsequent s1/s2/s3 addresses after the initial load address. in ad- dition the -l option should be used when doing byte addressing since the initial load ad- dresses must be adjusted to account for double-word addressing in the object file. in general, it is a good idea to use the -l option whenever the input object file contains sec- tions which refer to l memory space. 5.6 s-record file format an s-record file consists of a sequence of specially formatted ascii character strings. these character strings are made up of several fields which identify the record type, record length, memory address, code or data, and checksum. each byte of binary data is encoded as a 2-character hexadecimal number, the first character representing the high-order 4 bits, and the second the low-order 4 bits of the byte. 5.6.1 s-record content an s-record consists of 5 distinct fields: the type field, the record length , ad- dress field, code/data , and the checksum field. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp s-record conversion utility (srec) s-record file format motorola dsp linker/librarian reference manual 5-9 printable field characters contents type 2 s-record type: s0, s1, etc. record length 2 the count of the character pairs in the record, excluding the type and record length. address 4, 6, or 8 the 2-, 3-, or 4-byte address at which the data field is to be loaded into memory. code/data 0-2n from 0 to n bytes of executable code, memory loadable data, or descriptive in- formation. checksum 2 the least significant byte of the ones complement of the sum of the values rep- resented by the pairs of characters mak- ing up the record length, address, and the code/data fields. 5.6.2 s-record types there are ten possible motorola s-record types. the following sections discuss the s- record types used by the motorola dsp srec utility. 5.6.2.1 s0 record the s0 record is the header record (sometimes called the sign-on record) for a block of motorola s-records. the address field is always 4 printable characters representing a 2- byte address. it is normally zero, but when the srec -s option is used, the program gen- erates a code corresponding to the dsp memory space of the subsequent s-record data block: value dsp memory space 1x 2y 3l 4p 5e with the -s option whenever a memory change occurs a new s0 header record is pro- duced. in this case if a data block were to be located in x memory, the address field would contain 30303031 (note that such use of the s0 address field is a dsp-specific extension to the standard s0 record format). the code/data field may contain any descriptive infor- mation identifying the following block of s-records. this is followed by the normal two- character checksum. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp s-record conversion utility (srec) s-record file format 5-10 dsp linker/librarian reference manual motorola 5.6.2.2 s1, s2, s3 records each data record begins with the start characters s1, s2, or s3 followed by a byte count. these record types vary only by the length of their respective address fields. an s1 record has a 2-byte address field represented by 4 hexadecimal characters. an s2 record has a 3-byte address field represented by 6 hexadecimal characters. an s3 record has a 4-byte address field represented by 8 hexadecimal characters. data bytes follow the address field and are represented by hexadecimal character pairs. a two-character checksum ter- minates the data record. the srec program guarantees that the number of bytes in an s1, s2, or s3 data record is an integral multiple of the word size of the target dsp. 5.6.2.3 s7, s8, s9 records these are end-of-file records and may appear only once in the s-record file. each trailer record begins with the start characters s7, s8, or s9 followed by a byte count. as with the data records these record types vary only by the length of their respective address fields. an s7 record has a 4-byte address field represented by 8 hexadecimal characters. an s8 record has a 3-byte address field represented by 6 hexadecimal characters. an s9 record has a 2-byte address field represented by 4 hexadecimal characters. the address field in the trailer record is used by the srec program to store the end address given in the object file optional header record. a two-character checksum immediately follows the address field. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp linker/librarian reference manual 6-1 chapter 6 motorola dsp coff file dump utility (cofdmp) 6.1 introduction the motorola dsp coff file dump program cofdmp is a stand-alone utility that reads an absolute or relocatable common object file format (coff) file and produces a for- matted display of the object file contents. the entire file or only selected portions may be processed depending on command line options. the program also can generate either codes or symbolic references to entities such as symbol type and storage class. 6.2 installing cofdmp the cofdmp program is distributed on various media and in different formats depending on the host operating system environment. see appendix g in the motorola dsp as- sembler reference manual , host-dependent information, for details on install- ing and operating cofdmp on your particular machine. 6.3 running cofdmp the general format of the command line to invoke cofdmp is: cofdmp [options] where: [options] any of the following command line options. the options must precede the file name. option letters may be specified in either upper or lower case. if no option is supplied the entire input file is dumped. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp coff file dump utility (cofdmp) cofdmp options 6-2 dsp linker/librarian reference manual motorola 6.4 cofdmp options -c dump the string table of the specified file. this information may not be present if the object file has been stripped. example: cofdmp -c fft16.cld in this example, the symbol table is listed from the absolute object file fft16.cld. -d this option specifies that a dump file is to be created for cofdmp output. can be any legal operating system filename, including an optional pathname. if the -d option is not specified, then the program will route dump output to the standard output (usually the console or terminal screen) by default. the -d option should be specified only once. if the file named in the -d option already exists, it will be overwritten. example: cofdmp -d filter.dmp filter.cld in this example, the absolute load file filter.cld will be dumped to the output file filter.dmp. -f dump the file header of the specified file. example: cofdmp -f fft16.cln in this example, the file header is listed from the relocatable object file fft16.cln. -h dump the section headers of the specified file. example: cofdmp -h fft16.cld in this example, the section headers are listed from the absolute ob- ject file fft16.cld. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp coff file dump utility (cofdmp) cofdmp options motorola dsp linker/librarian reference manual 6-3 -l dump the source file line number information from the specified file. this information may not be present if the object file has been stripped. example: cofdmp -l fft16.cln in this example, the source file line number information is listed from the relocatable object file fft16.cln. -o dump the optional header of the specified file. example: cofdmp -o fft16.cln in this example, the optional header is listed from the relocatable ob- ject file fft16.cln. -q on some hosts cofdmp displays a banner on the console when invoked. this option inhibits the banner display. it has no effect on hosts where the signon banner is not displayed by default. example: cofdmp -q myprog.cld dump the file myprog.cld but do not display the signon banner on the console. -r dump section relocation entries from the specified file. only relocatable ob- ject files will contain this information. example: cofdmp -r fft16.cln in this example, the section relocation information is listed from the relocatable object file fft16.cln. -s dump the section raw data from the specified file. example: cofdmp -s fft16.cld in this example, the section raw data is listed from the absolute object file fft16.cld. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp coff file dump utility (cofdmp) cofdmp processing 6-4 dsp linker/librarian reference manual motorola -t dump the symbol table from the specified file. this information may not be present if the object file has been stripped. example: cofdmp -t fft16.cln in this example, the symbol table is listed from the relocatable object file fft16.cln. -v dump the specified file symbolically, using names for bit flags, symbol types, and storage classes. example: cofdmp -v fft16.cld in this example, the entire contents of the absolute object file fft16.cld is dumped symbolically. a list of operating system compatible filenames. if no pathname is specified for a file, the program will look for that file in the current directory. an explicit filename must be provided; there is no default extension for the input file. 6.5 cofdmp processing the cofdmp program reads the input file and writes a formatted dump of the file con- tents to the standard output (unless the -d command line option is given). i/o redirection may be used to send the output to a file if the host operating system supports it. the program currently will not dump individual modules from library files; they must be ex- tracted and then dumped. also note that if the file has been stripped some information may no longer be available in the file, such as relocation information, line number entries, and symbol and string table data. the input file must be a motorola dsp coff object file, either absolute or relocatable. see appendix e in the motorola dsp assembler reference manual , motorola dsp object file format, for more information on motorola dsp coff object files. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp linker/librarian reference manual a-1 appendix a linker messages a.1 introduction linker messages are grouped into four categories: command line errors these errors indicate invalid command line options, missing filenames, file open errors, or other invocation errors. command line errors generally cause the linker to stop processing. warnings warnings notify the programmer of suspect constructs but do not otherwise affect the object file output. errors these errors indicate problems with object file format, size of address fields, and syntax. in these cases the resulting object code is generally not valid. fatal fatal errors signify serious problems encountered during the link process such as lack of memory, file not found, or other internal errors. the linker halts immediate- ly. the linker also will provide information on the file name, module id, and section location of the error, if it can be ascertained. messages are always routed to standard output. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker messages command line errors a-2 dsp linker/librarian reference manual motorola a.2 command line errors align not valid with incremental link - ignored both the -i and -a options were given on the command line. the -a option auto- aligns circular buffers in the output file, but an incrementally linked file ( -i ) must re- tain original buffer placement for future linking. if both are specified, the linker does not auto-align. cannot open command file cannot open library file cannot open map file cannot open memory control file cannot open object file the file associated with a -f , -l , -m , -r , or -b command line option was not found or could not be opened. default object file not allowed in incremental link when performing an incremental link using the -i option the -b option must be used in order to name the output object file. the default naming convention cannot be used because it might overwrite one of the input files. duplicate map file specified - ignored duplicate memory control file specified - ignored duplicate object file specified - ignored more than one -m , -r , or -b option was encountered on the command line. illegal command line option the option specified on the command line was not recognized by the linker. illegal command line -e option neither of the qualifiers -a or -w were provided with the -e option. illegal command line -x option argument the argument given with the -x command line option was not recognized by the linker. invalid syntax for command line -e option there must be whitespace between the -e option and its filename argument. missing argument for command line -e option the -e command line option must have a filename argument. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker messages command line errors motorola dsp linker/librarian reference manual a-3 missing command line option argument the expected arguments following a command line specifier were missing. missing object filename there must be at least one object filename specified on the command line. no modules linked - empty object file an object file header record was never found in the input. object file name same as executable file name object file name same as map file name one of the object files appeared to the linker to have the same name as the spec- ified executable or map file. the linker aborts rather than potentially writing over an input object file. options for both debug and strip specified - strip ignored both the -g and -z options were given on the command line. the -g option takes precedence. seek failure an attempt to seek randomly to verify a library file has failed. strip not valid with incremental link - ignored both the -i and -z options were given on the command line. the -i option takes pre- cedence. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker messages warnings a-4 dsp linker/librarian reference manual motorola a.3 warnings actual length of section greater than specified size the length of a section is greater than the absolute size given in a memory control file secsize directive. duplicate global symbol a global symbol in one object file was also defined by the same name in a different module. duplicate xdef symbol an external symbol in one object file was also defined by the same name in a dif- ferent module. emi 8-bit memory value truncated emi 12-bit memory value truncated emi 16-bit memory value truncated emi 20-bit memory value truncated the value in a data directive was too large for the current emi memory configura- tion. empty bit mask field the first operand of a bfxxx -type instruction was zero. expression value outside fractional domain the expected fractional value was not within the range -1.0 <= m < 1. incompatible debug format the input object file debug information is not compatible with the current version of the linker. memory model mismatch an object file produced by the c compiler is incompatible with other files in the input stream. this can result when c source files compiled using x memory for data stor- age and others compiled using y memory for data storage are linked. the linker cannot reconcile the memory differences. no modules linked - empty object file an object file header record was never found in the input. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker messages warnings motorola dsp linker/librarian reference manual a-5 object file major version number greater than linker major version number object file minor version number greater than linker minor version number the input file version number generated by the assembler does not match the cur- rent version number of the linker. options for both debug and strip specified - strip ignored both the -g and -z options were given on the command line. the -g option takes precedence. overlay buffer not aligned a circular buffer inside a relocatable overlay will be misaligned when the overlay is transferred at runtime. the linker makes no attempt to realign buffers located in- side relative overlay blocks. remapping region remapping section a region or section directive set an existing memory space to a different map- ping attribute. section already set as absolute a section listed as ordered in a memory control file section record was found to be already located absolutely. string truncated in expression evaluation only the first four characters of a string constant are used during expression eval- uation. strip not valid with incremental link - ignored the -i and -z command line options are mutually exclusive. the -i option takes pre- cedence. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker messages errors a-6 dsp linker/librarian reference manual motorola a.4 errors arithmetic exception an internal floating point exception occurred while evaluating an expression. the result of the evaluation is probably not valid. autoaligned buffer not allowed in overlay a circular buffer inside a relocatable overlay cannot be auto-aligned because the overlay block will be moved, voiding any benefit of optimal buffer placement. binary constant expected a character other than ascii '0' or '1' either followed the binary constant delimiter (%) or appeared in an expression where a binary value was expected by default. bit mask cannot span more than eight bits if the first operand of a bfxxx -type instruction was shifted one bit to the right until the low-order bit was a 1, the resulting value must not exceed $ff hexadecimal. buffer block too large the runtime location counter overflowed while the linker was attempting to allo- cate storage for a data buffer. the linker automatically advances the program counter to the next valid base address given the size of the modulo or reverse carry buffer. buffer out of order the buffer sequence numbers in the input stream are out of phase. cannot nest regions a region directive in the memory control file may not appear between another region/endr pair. cannot open include file the file specified in a memory control file include directive was not found or could not be opened. decimal constant expected a character other than ascii '0' through '9' either followed the decimal constant de- limiter (`) or appeared in an expression where a decimal value was expected by default. divide by zero the expression evaluator detected a divide by zero. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker messages errors motorola dsp linker/librarian reference manual a-7 duplicate global symbol two identically named global symbols have been found. duplicate local symbol two identically named symbols have been found which are local to the same sec- tion. duplicate region assignment for section a memory control file section directive with the same name and memory at- tributes was assigned to more than one region. duplicate special symbol the linker reserves a few symbol names to deal with certain floating point entities such as infinity and not-a-number. these symbols are inf, nan, tiny, and huge. endr without corresponding region directive an endr directive in the memory control file did not have a matching region di- rective. expression cannot have a negative value the map page directive does not allow negative expression arguments. expression contains forward references the expression representing a location counter number contains a term which the expression evaluation logic cannot resolved (e.g. an undefined symbol). expression involves incompatible memory spaces the memory space attribute is regarded by the linker as a type, in the same sense that high level languages use type for variables. symbols may have memory space attributes of x , y , l , p (rogram), e (mi), or n (one); only n is fully compatible with all other attributes. in this case, two operands were evaluated with different memory space attributes, neither of which was n . expression result must be absolute certain directives and some linker usage require absolute values as arguments or operands. expression result must be integer the expression refers to an address; therefore the result must be an integer within the address range of the target dsp. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker messages errors a-8 dsp linker/librarian reference manual motorola external reference not allowed in expression the expression contained an undefined symbol which the expression evaluation logic cannot resolve. extra characters beyond expression the expression evaluator found extra characters after the end of a valid expres- sion. unbalanced parentheses can cause this error. extra characters in function argument or missing ')' for function mismatched parentheses or wrong number of parameters in a function invocation. floating point constant expected a character other than ascii '0' through '9', 'e' or 'e', or '.' appeared in an expres- sion where a floating point value was expected by default. floating point not allowed in relative expression relative expressions are generally used for address computation, therefore a float- ing point value would not be appropriate. hex constant expected a character other than ascii '0' through '9', 'a' through 'f', or 'a' through 'f' either followed the hexadecimal constant delimiter ( $ ) or appeared in an expression where a hexadecimal value was expected by default. illegal memory counter specified the memory counter specifier must be h for the high counter, l for the low counter, or absent for the default counter. illegal memory map character the memory map indicator must be i for internal memory, e for external memory, r for rom, a for port a, b for port b, or absent for no explicit mapping. illegal operator for floating point element bitwise operators are invalid for floating point values. illegal option a bad argument was provided with the -x command line option. invalid address expression the memory space attributes of the expression operands are incompatible. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker messages errors motorola dsp linker/librarian reference manual a-9 invalid address relocation field either a new record began or end-of-file was reached when the linker was reading the address specification in a memory file base or section record. invalid emi memory designation the emi memory type does not fall within an appropriate range of values. invalid function name the linker could not match an internal function name. invalid include file name the filename associated with a memory control file include directive is missing or malformed. invalid map option invalid map option field invalid map page field invalid map record field one of the options or fields in a memory control file map record was not recog- nized by the linker. invalid memory space field the memory space specifier for a sizsym directive was not found. invalid module name field the module name field associated with a memory control file ident directive is missing or malformed. invalid overlay base address an overlay base address was given that specified an address within another over- lay segment. invalid page length specified the minimum page length allowed by the map page directive is 10 lines per page. the maximum is 255. invalid page width specified the minimum page width allowed by the map page directive is 1 column per line. the maximum is 255. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker messages errors a-10 dsp linker/librarian reference manual motorola invalid region name field the region name associated with a memory control file region directive is miss- ing or malformed. invalid relative expression the terms of a relative expression may only participate in addition and subtraction operations and must have opposing signs. invalid relocation type field an invalid record type was encountered in the memory control file. invalid reserve range syntax the syntax for the memory control file reserve is such that the range is given as two values from the same memory space and mapping, separated by two periods in succession ( .. ). invalid revision number field the revision number field in a memory control file ident record is not valid. the value must be a decimal integer number. invalid section name field the section name associated with a memory control file section directive is missing or malformed. invalid shift amount a shift expression must evaluate to within the range 0 <= n <= 32. invalid source line number the source line number in a relocation expression must be an integer. invalid start address expression the end address expression in the optional header record is malformed. invalid start address field the start address field in a memory control file start record is not valid. the con- tents must be a positive numeric value. invalid symbol symbols are limited to 512 characters. the first character must be alphabetic or the underscore character (a-z, a-z, _ ). the remaining characters must be alphanu- meric, including the underscore character (a-z, a-z, 0-9, _ ). f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker messages errors motorola dsp linker/librarian reference manual a-11 invalid symbol memory mapping the memory type for a symbol in the symbol table does match a valid linker mem- ory configuration. invalid symbol name field either a new record began or end-of-file was reached when the linker was reading the name specification in a memory file symbol record. invalid symbol value field either a new record began or end-of-file was reached when the linker was reading the value specification in a memory file symbol record. invalid version number field the version number field in a memory control file ident record is not valid. the value must be a decimal integer number. left margin exceeds page width the blank left margin value in the map page directive exceeds the default or specified page width parameter. missing '(' for function parentheses are not balanced in an internal function call. missing ')' in expression parentheses are not balanced in an expression. missing ']' in expression square brackets are not balanced in an expression. missing '}' in expression curly braces are not balanced in an expression. missing expression an expression was expected by the expression evaluator. missing filename the filename associated with a memory control file include directive is missing. missing option the argument associated with the -x command line option is missing. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker messages errors a-12 dsp linker/librarian reference manual motorola missing quote in string a single or double quote character was expected by the string parsing routines. missing string after concatenation operator the string concatenation operator ( ++ ) must be followed by another quoted string. no previous function declaration an end-of-function symbol record was encountered without a corresponding func- tion type symbol record. operation not allowed with address term only addition and subtraction are allowed in expressions with address terms. overlay address involves incompatible memory spaces the memory space attribute is regarded by the linker as a type, in the same sense that high level languages use type for variables. symbols may have memory space attributes of x , y , l , p (rogram), e (mi), or n (one); only n is fully compatible with all other attributes. in this case, the runtime overlay address was found to be incom- patible with the memory space used as the overlay origin. overlay out of order the overlay sequence numbers in the input stream are out of phase. page length too small for specified top and bottom margins the sum of the top and bottom margins specified in the map page directive is greater than the page length - 10. page length too small to allow default bottom margin the bottom margin exceeds the page length specified in the map page directive. region high address lower than base address a memory control file base directive had a greater value than a corresponding memory directive for a given region. region size/address mismatch the size field in a memory control file region directive does not correlate with the computed size derived from base and memory directives for the same region. region without associated endr directive a region directive in the memory control file did not have a matching endr di- rective. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker messages errors motorola dsp linker/librarian reference manual a-13 relative expression must be integer a relative expression must evaluate to an integer value. relative terms from different sections not allowed two relative terms from different sections may not participate in an arithmetic op- eration since the result might not be meaningful. this error may be disabled with the linker xc option. section not found the section named in a section , sbalign , or secsize directive could not be found by the linker. section padding percentage too small the percentage of padding in a memory control file secsize record must be greater than 100.0. specified address greater than maximum memory address the directive address is greater than the argument given in a previously encoun- tered memory directive for this region. specified size greater than maximum memory address the size given in a memory control file secsize directive is greater than the argu- ment given in a previously encountered memory directive for this region. symbol already defined a symbol assumed to be unresolved and named in a memory file symbol record has already been defined. symbol name too long symbols are limited to 512 characters. the first character must be alphabetic or the underscore character (a-z, a-z, _). the remaining characters must be alphanumer- ic, including the underscore character (a-z, a-z, 0-9, _). symbol tag mismatch a matching tag reference could not be found for a tagged symbol table entry. syntax error - expected ':' syntax error - expected '):' the linker was expecting the end of either a memory space designator or a loca- tion counter expression while parsing a memory attribute string. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker messages errors a-14 dsp linker/librarian reference manual motorola syntax error - expected comma the linker was expecting a comma while parsing the arguments of a function. syntax error - expected quote the linker was expecting the start of a quoted string. syntax error in expression the syntax in a memory file base or section record is not correct (possibly missing a colon before the address specification). unresolved overlay base address the symbol used as the runtime overlay address was never resolved during the fix- up phase. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker messages fatal errors motorola dsp linker/librarian reference manual a-15 a.5 fatal errors arithmetic exception an internal floating point exception occurred while evaluating an expression. cannot determine file size the size of the input link module could not be determined. cannot find global section the memory control file processing logic could not locate a global section record. cannot find section record the linker was unable to locate a previously accessed section record. this is a se- rious internal error that should be reported to motorola. cannot open library file cannot open object file the linker attempted to open a library or object file for reprocessing on the second pass and the open failed. cannot read file header from library module cannot read file header from object module an i/o error occurred which prevented the linker from reading the file headers in a library or object file. cannot read line number entries from object module cannot read module string table size cannot read object module section headers cannot read object module string table cannot read object module symbol entries cannot read raw data from object module cannot read relocation entries from object module an i/o error occurred which prevented the linker from reading entities in the input object file. cannot read optional header from library module cannot read optional header from object module an i/o error occurred which prevented the linker from reading the optional head- ers in a library or object file. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker messages fatal errors a-16 dsp linker/librarian reference manual motorola cannot seek to library module symbol table an i/o error occurred which prevented the linker from positioning correctly when attempting to read a library module symbol table. cannot seek to object module line number entries cannot seek to object module raw data cannot seek to object module relocation entries cannot seek to object module section headers cannot seek to object module symbol table an i/o error occurred which prevented the linker from positioning correctly in the input object file. cannot seek to start of line number entries cannot seek to start of object data cannot seek to start of object file cannot seek to start of object module cannot seek to start of section headers cannot seek to start of string table cannot seek to start of symbol table an i/o error occurred which prevented the linker from positioning correctly in the output object file. cannot set current section the current module section map has been corrupted. this is a serious internal er- ror that should be reported to motorola. cannot set section counter the current module counter map has been corrupted. this is a serious internal er- ror that should be reported to motorola. cannot write left margin to map file cannot write new line to map file cannot write new page to map file cannot write page header to map file cannot write string to map file an i/o error occurred which prevented the linker from writing data to the output map file. cannot write .text/.data headers to object file cannot write file header to object file cannot write line number entries to object file cannot write optional header to object file cannot write padding to object file f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker messages fatal errors motorola dsp linker/librarian reference manual a-17 cannot write raw data to object module cannot write relocation entries to object module cannot write section headers to object module cannot write string table to object file cannot write symbols to object file an i/o error occurred which prevented the linker from writing data to the output object file. compare select failure the comparison indicator passed to the evaluator selection logic was not valid. this is a serious internal error that should be reported to motorola. current relocation map not available a valid relocation map could not be accessed. this is a serious internal error that should be reported to motorola. current relocation section not available a valid relocation section could not be accessed. this is a serious internal error that should be reported to motorola. current section not available a valid current section could not be accessed. this is a serious internal error that should be reported to motorola. duplicate section entry an attempt was made to place two sections with the same name and memory at- tributes into a single region. expression operator failure expression operator lookup has failed. this is a serious internal error that should be reported to motorola. expression stack underflow the internal expression evaluation list is out of sequence. this is a serious internal error that should be reported to motorola. fatal segmentation or protection fault; contact motorola a program error has caused the linker to access an invalid host system address. this generally indicates a bug in the linker software. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker messages fatal errors a-18 dsp linker/librarian reference manual motorola file contains no relocation information an absolute object file was specified as input to the linker. invalid data block type internal section type information has been corrupted. invalid global section a section with a sequence number of zero did not have the proper global section name. invalid library module header an i/o error occurred when attempting to read a library module header. invalid library module header format the module header for a file contained in a library has been corrupted. invalid object file for target processor incompatible target processor object files were specified as input to the linker. invalid operand bit size the bit size operand in an object file expression was not recognized. invalid section number a new section encountered by the linker does not have a unique section number. invalid section number data the section number in a section symbol record is out of range. map option select failure the value returned from the mapping selection logic was not valid. this is a serious internal error that should be reported to motorola. no current counter map a valid counter map was not available. this is a serious internal error that should be reported to motorola. offset failure an attempt to save the object file offset has failed. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker messages fatal errors motorola dsp linker/librarian reference manual a-19 option select error the value returned from the option selection logic was not valid. this is a serious internal error that should be reported to motorola. out of memory - link aborted there is not enough internal memory to perform dynamic allocation. since the linker stores all working information in memory, including symbol and section in- formation, there is the possibility that memory will be exhausted if many symbols or sections are defined in a single linker run. relocation type select failure a value returned from the memory control file function select logic is bad. this is a serious internal error that should be reported to motorola. section map lookup failure a valid section map could not be accessed. this is a serious internal error that should be reported to motorola. section nesting error the section nesting count is out of phase. seek failure an attempt to seek randomly in the object file has failed. symbol map lookup failure a valid symbol map could not be accessed. this is a serious internal error that should be reported to motorola. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp linker/librarian reference manual b-1 appendix b librarian messages b.1 introduction librarian messages are grouped into three categories: command line errors these errors indicate invalid command line options, missing filenames, file open errors, or other invocation errors. command line errors generally cause the librar- ian to stop processing. warnings warnings indicate that a file cannot be open, or that a module already exists or does not exist in the library. the librarian continues processing. fatal errors fatal errors signify serious problems encountered during library processing such as lack of memory, file not found, or other internal errors. the librarian halts imme- diately. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
librarian messages command line errors b-2 dsp linker/librarian reference manual motorola b.2 command line errors argument missing a necessary argument, such as a module name, was missing from the librarian command line. unknown option the given command line option is not recognized. the librarian continues as if the -u option had been given. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
librarian messages warnings motorola dsp linker/librarian reference manual b-3 b.3 warnings already in library in an add operation a module with the same name as the one specified already ex- ists in the library. not in library the named module was not found in the specified library. this error can occur for example during a replace operation. ambiguous command the interactive command issued at the librarian prompt was not unique to the set of characters entered. cannot open module file the named module file could not be open. either the file does not exist or there was an i/o error. command requires library name all interactive commands require that the library name follow the command name on the input line. duplicate module name the same module name was entered twice on the command line. invalid command the librarian did not recognize an interactive command. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
librarian messages fatal errors b-4 dsp linker/librarian reference manual motorola b.4 fatal errors add requires explicit module names at least one module name must be given for an add operation. cannot allocate argument vector cannot allocate copy buffer cannot allocate input buffer cannot allocate module structure cannot allocate module vector cannot allocate output buffer the librarian did not have enough memory to allocate internal data structures. cannot create temporary file name the librarian was unable to create a temporary file name for the library scratch file. cannot open command file the named command line option file does not exist, or there was an i/o error. cannot open library file the named library file does not exist, or there was an i/o error. cannot open temporary file an i/o error prevented the librarian from opening the temporary library scratch file. cannot read module header the librarian could not read the module header in the specified library. either an i/ o error occurred, or the library file is empty. cannot rename an error occurred while attempting to rename a library file. cannot save command file arguments the librarian could not obtain enough memory to store the module names given in the command line option file. cannot stat module the librarian could not obtain date and time information for the named module. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
librarian messages fatal errors motorola dsp linker/librarian reference manual b-5 cannot write end of module marker an i/o error occurred preventing the librarian from writing the end of module mark- er to the library file. cannot write header to library file an i/o error occurred preventing the librarian from writing the module header to the library file. delete requires explicit module names at least one module name must be given for a delete operation. error reading file an i/o error occurred while reading a file. error writing file an i/o error occurred while writing a file. fatal errors - not altered this is an informative message indicating that the named library was not changed because of previous fatal errors. file i/o error an i/o error occurred while either reading or writing a file. improper module header format a module header in the library file has been corrupted, or the specified file is not a library file. library file already exists in a create operation the named library file already exists. missing command filename the required argument on a -f command line option was missing. out of memory - librarian aborted there is not enough internal memory to perform dynamic allocation. since the li- brarian stores all working information in memory, there is the possibility that mem- ory will be exhausted if many modules are processed in a single library operation. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola dsp linker/librarian reference manual c-1 appendix c linker map file format c.1 introduction the linker optionally produces a memory map listing file when the command line -m is specified. see chapter 1, running the linker for more information on command line and map listing options. if the -m command line option is given, the map listing goes to the file named as the option argument; if no argument is specified, the map listing file takes the name of the first object file on the command line and changes the extension to .map (see chapter 1). c.2 map file commentary figure c-1 is a linker-generated map listing of a sample application. the listing illustrates a selection of the format and reporting features provided by the linker. the following sec- tion highlights some of those features. at the top of every map listing page is a banner which identifies the linker and lists its version number, the date and time of linking, the current input file name, and the page number. the map file page length, width, and margins can be controlled by the memory control file map page record (see chapter 3, map page map file format control). the first titled grouping in the report is a list of sections sorted by starting address. this list of sections is subdivided by dsp memory and ordered by counter such that all x de- fault (counter 0) memory references are grouped together, followed by x low (counter 1) memory, and so forth. each line gives the starting address, ending address, and length of every uniquely-named section in the linker input stream if that section contained code or data for the current memory space. the length reflects the total of all section fragments assimilated from separate input files. as a result there is only one line for each section even if the section appears in different files. if sections are located such that they overlap in memory the linker will flag the overlap in the map file to the right of the section name. the link map also shows any unused memory areas between allocated blocks. these lines may be disabled using the map opt nounused directive (see chapter 3, map opt map file contents control). a section name may be repeated for a given memory space if that section contains buff- ers, overlays, or absolute blocks. in this case the start, end, and size of the block is re- ported and the type of block is placed to the right of the section name. on page 1 of the f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker map file format map file commentary c-2 dsp linker/librarian reference manual motorola example listing section sect1 contains a modulo buffer of length 32 starting at address 20 hexadecimal in x memory. on the same page the section sect2 has an overlay seg- ment of length 7 that is loaded at address 12 hexadecimal in p memory. the listing of sec- tions by address can be turned off with the memory control file map opt nosecaddr directive (see chapter 3, map opt map file contents control). the next titled grouping on the map report (page 2) is a list of sections sorted by name. the name of the section is given along with the start, end, and length of blocks in each dsp memory space. as in the section by address listing special blocks such as buffers or overlays are shown on a line by themselves. the section by name report can be disabled by using the memory control file map opt nosecname directive (see chapter 3, map opt map file contents control). after the section-oriented reports there appears on page 3 of the map file a symbol listing ordered by name. each line starts with the symbol name (truncated to 16 characters), fol- lowed by the symbol type (integer or floating point), the memory space if any and value, the name of the section in which the symbol is defined, and the symbol attributes. a sym- bol can be absolute or relative (rel), local, xdefed (extern), or global, and possibly associated with a buffer or overlay. this portion of the map listing may be omitted through the memory control file map opt nosymname directive (see chapter 3, map opt map file contents control). the last page of the listing shows a symbol listing sorted by value. the listing by value can be turned off with the memory control file map opt nosymval directive (see chapter 3, map opt map file contents control). the final report group lists the unresolved externals found during the link phase. this con- sists of all the symbol references for which there was no corresponding definition found in the link input. the linker indicates the symbol name and the module in which the refer- ence was made. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker map file format map file commentary motorola dsp assembler reference manual c-3 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker map file format map file commentary c-4 dsp assembler reference manual motorola f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker map file format map file commentary motorola dsp assembler reference manual c-5 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
linker map file format map file commentary c-6 dsp assembler reference manual motorola f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
index motorola dsp linker/librarian reference manual i-1 b buffer auto-align .................................... 1-3 circular ......................................... 2-3 c case significance ............................. 1-6 cofdmp installation ................................... 6-1 operation ..................................... 6-1 processing ................................... 6-4 command line .................................. 1-1 command line option .. 1-1, 4-1, 5-1, 6-1 -a ........................... 1-3, 4-2, 5-1, 5-4 -b .......................................... 1-3, 5-2 -c ......................................... 4-2, 6-2 -d ......................................... 4-2, 6-2 -ea ....................................... 1-3, 4-2 -ew ...................................... 1-3, 4-2 -f .................... 1-3, 1-4, 4-2, 4-3, 6-2 -g ................................................ 1-4 -h ................................................ 6-2 -i .................................................. 1-4 -l ........................... 1-5, 4-3, 5-2, 6-3 -m ..................................1-5, 1-6, 5-2 -n ................................................ 1-6 -o ......................................... 5-3, 6-3 -p .......................................... 1-6, 5-3 -q .......................... 1-7, 4-3, 5-3, 6-3 -r .......................... 1-7, 4-3, 5-3, 6-3 -s .......................................... 5-4, 6-3 -t ................................................. 6-4 -u .................................. 1-7, 4-4, 5-4 -v .................................. 1-8, 4-4, 6-4 -w ............................................... 5-4 -x .................................. 1-8, 4-4, 5-5 -z ................................................ 1-9 d debug ............................................... 1-4 dsplnkopt ................................... 1-2 e environment variable ....................... 1-2 error command line ..................... a-2, b-2 fatal ................................... a-15, b-4 output ................................... 1-3, 4-2 f file object .......................................... 1-9 i incremental link ................................ 1-4 l librarian installation ................................... 4-1 operation ..................................... 4-1 library .............................................. 4-4 create .......................................... 4-2 list ............................................... 4-3 index f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
i-2 dsp linker/librarian reference manual motorola index path ............................................. 1-6 processing ............................ 1-5, 4-5 link file ............................................. 1-9 linker command line .............................. 1-1 directive ....................................... 3-1 installation ................................... 1-1 operation ..................................... 1-1 option .......................................... 1-8 pass ............................................ 2-2 region ................................. 2-3, 3-10 section ......................................... 2-3 linking .............................................. 2-1 listing file commentary ................................c-1 format ..........................................c-1 m map file ............................................. 1-5 commentary ................................c-1 format ..........................................c-1 memory maximum .................................... 3-9 origin ........................................... 1-6 region ................................. 2-3, 3-10 reserve ...................................... 3-11 memory control file .................... 1-7, 3-1 balign directive ........................ 3-3 base directive ............................ 3-4 ident directive ........................... 3-5 include directive ...................... 3-6 map opt directive ..................... 3-8 map page directive ................... 3-7 memory directive ..................... 3-9 region directive ..................... 3-10 reserve directive .................. 3-11 sbalign directive .................... 3-12 secsize directive .................... 3-13 section directive .................... 3-14 set directive ............................. 3-15 sizsym directive ...................... 3-16 start directive ........................ 3-17 symbol directive .....................3-18 module add ...............................................4-2 delete ...........................................4-2 extract ..........................................4-4 replace .........................................4-3 update ..........................................4-4 o object file .................................. 1-3, 1-9 data ..............................................6-3 file header ....................................6-2 line number ..................................6-3 optional header ............................6-3 relocation .....................................6-3 section header .............................6-2 string table ...................................6-2 symbol table ................................6-4 overlay ..............................................2-4 r region ..................................... 2-3, 3-10 relocation .........................................2-1 s section ..............................................2-3 address ......................................3-14 size ............................................3-13 srec installation ....................................5-1 operation ......................................5-1 processing ...................................5-6 s-record content .........................................5-8 format ..........................................5-8 type ..............................................5-9 w warning .....................................a-4, b-3 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .