ANALOG DEVICES W3.5 Utilities Manual

W 3.5
Linker and Utilities Manual
for 16-Bit Processors
Analog Devices, Inc. One Technology Way Norwood, Mass. 02062-9106
Revision 1.0, October 2003
Part Number
82-000035-07
a
Copyright Information
© 2003 Analog Devices, Inc., ALL RIGHTS RESERVED. This docu­ment may not be reproduced in any form without prior, express written consent from Analog Devices, Inc.
Printed in the USA.
Disclaimer
Analog Devices, Inc. reserves the right to change this product without prior notice. Information furnished by Analog Devices is believed to be accurate and reliable. However, no responsibility is assumed by Analog Devices for its use; nor for any infringement of patents or other rights of third parties which may result from its use. No license is granted by impli­cation or otherwise under the patent rights of Analog Devices, Inc.
Trademark and Service Mark Notice
The Analog Devices logo, VisualDSP++, the VisualDSP++ logo, Blackfin, and the Blackfin logo are registered trademarks of Analog Devices, Inc.
All other brand and product names are trademarks or service marks of their respective owners.

CONTENTS

PREFACE
Purpose of This Manual .................................................................. xv
Intended Audience ......................................................................... xvi
Manual Contents ........................................................................... xvi
What’s New in This Manual .......................................................... xvii
Technical or Customer Support .................................................... xviii
Supported Processors ...................................................................... xix
Product Information ....................................................................... xx
MyAnalog.com .......................................................................... xx
DSP Product Information .......................................................... xx
Related Documents .................................................................. xxi
Online Technical Documentation ............................................ xxii
From VisualDSP++ ............................................................. xxii
From Windows ................................................................. xxiii
From the Web ................................................................... xxiii
Printed Manuals ..................................................................... xxiv
VisualDSP++ Documentation Set ....................................... xxiv
Hardware Manuals ............................................................. xxiv
Data Sheets ........................................................................ xxiv
VisualDSP++ 3.5 Linker and Utilities Manual iii for 16-Bit Processors
CONTENTS
Contacting DSP Publications .................................................. xxv
Notation Conventions .................................................................. xxv
INTRODUCTION
Software Development Flow ......................................................... 1-2
Compiling and Assembling ........................................................... 1-3
Inputs – C/C++ and Assembly Sources .................................... 1-3
Input Section Directives in Assembly Code .............................. 1-4
Input Section Directives in C/C++ Source Files ........................ 1-4
Linking ........................................................................................ 1-6
Linker and Assembler Preprocessor .......................................... 1-7
Loading and Splitting ................................................................... 1-8
LINKER
Linker Operation .......................................................................... 2-2
Directing Linker Operation ..................................................... 2-3
Linking Process Rules .............................................................. 2-4
Linker Description File — Overview ....................................... 2-5
Linking Environment ................................................................... 2-6
Project Builds ......................................................................... 2-6
Expert Linker .......................................................................... 2-9
Linker Warning and Error Messages ...................................... 2-10
Link Target Description .............................................................. 2-11
Representing Memory Architecture ........................................ 2-11
ADSP-BF535 Processor Memory Architecture Overview .... 2-12
iv VisualDSP++ 3.5 Linker and Utilities Manual
for 16-Bit Processors
CONTENTS
ADSP-218x DSP Core Architecture Overview ................... 2-15
ADSP-219x DSP Architecture Overview ............................ 2-17
Specifying the Memory Map .................................................. 2-18
Memory Usage .................................................................. 2-18
Memory Characteristics ..................................................... 2-20
Linker MEMORY{} Command in .LDF File ...................... 2-24
Placing Code on the Target .................................................... 2-26
Passing Arguments for Simulation or Emulation: Blackfin Processors ONLY
2-29
Linker Command-Line Reference ................................................ 2-30
Linker Command-Line Syntax ............................................... 2-30
Command-Line Object Files ............................................. 2-31
Command-Line File Names ............................................... 2-32
Object File Types .............................................................. 2-34
Linker Command-Line Switches ............................................ 2-34
Linker Switch Summary .................................................... 2-36
@filename ......................................................................... 2-38
-Dprocessor ...................................................................... 2-38
-L path ............................................................................. 2-39
-M .................................................................................... 2-39
-MM ................................................................................ 2-39
-Map filename .................................................................. 2-39
-MDmacro[=def] .............................................................. 2-39
-Ovcse .............................................................................. 2-40
-S ..................................................................................... 2-40
VisualDSP++ 3.5 Linker and Utilities Manual v for 16-Bit Processors
CONTENTS
-T filename ...................................................................... 2-40
-Wwarn [number] ............................................................ 2-40
-e ..................................................................................... 2-41
-es sectionName ............................................................... 2-41
-ev ................................................................................... 2-41
-flags-meminit -opt1[,-opt2... .......................................... 2-41
-flags-pp -opt1[,-opt2...] .................................................. 2-42
-h[elp] .............................................................................. 2-42
-i|I directory ..................................................................... 2-42
-ip .................................................................................... 2-42
-jcs2l ................................................................................ 2-43
-jcs2l+ .............................................................................. 2-44
-keep symbolName ........................................................... 2-44
-meminit .......................................................................... 2-44
-o filename ....................................................................... 2-44
-od directory .................................................................... 2-45
-pp ................................................................................... 2-45
-proc processor ................................................................. 2-45
-s ..................................................................................... 2-46
-save-temps ...................................................................... 2-46
-si-revision version ............................................................ 2-46
-sp ................................................................................... 2-48
-t ..................................................................................... 2-48
-v[erbose] ......................................................................... 2-48
vi VisualDSP++ 3.5 Linker and Utilities Manual
for 16-Bit Processors
CONTENTS
-version ............................................................................ 2-48
-warnonce ......................................................................... 2-48
-xref filename .................................................................... 2-49
LINKER DESCRIPTION FILE
LDF File Overview ....................................................................... 3-3
Example 1 – Basic .LDF File for Blackfin Processors ................. 3-4
Example 2 - Basic .LDF File for ADSP-218/9x DSPs ................ 3-6
Notes on Basic .LDF File Examples .......................................... 3-7
LDF Structure ............................................................................ 3-11
Command Scoping ................................................................ 3-12
LDF Expressions ......................................................................... 3-13
LDF Keywords, Commands, and Operators ................................. 3-14
Miscellaneous LDF Keywords ................................................ 3-15
LDF Operators ........................................................................... 3-16
ABSOLUTE() Operator ........................................................ 3-16
ADDR() Operator ................................................................. 3-17
DEFINED() Operator ........................................................... 3-18
MEMORY_SIZEOF() Operator ............................................ 3-18
SIZEOF() Operator ............................................................... 3-19
Location Counter (.) .............................................................. 3-19
LDF Macros ............................................................................... 3-20
Built-In LDF Macros ............................................................. 3-21
User-Declared Macros ........................................................... 3-22
LDF Macros and Command-Line Interaction ......................... 3-22
VisualDSP++ 3.5 Linker and Utilities Manual vii for 16-Bit Processors
CONTENTS
LDF Commands ........................................................................ 3-23
ALIGN() .............................................................................. 3-24
ARCHITECTURE() ............................................................. 3-24
ELIMINATE() ...................................................................... 3-25
ELIMINATE_SECTIONS() ................................................. 3-26
INCLUDE() ......................................................................... 3-26
INPUT_SECTION_ALIGN() .............................................. 3-26
KEEP() ................................................................................. 3-27
LINK_AGAINST() ............................................................... 3-28
MAP() .................................................................................. 3-29
MEMORY{} ......................................................................... 3-29
Segment Declarations ....................................................... 3-30
MPMEMORY{} .................................................................... 3-32
OVERLAY_GROUP{} .......................................................... 3-33
PACKING() ......................................................................... 3-33
Packing in ADSP-218x and ADSP-219x DSPs ................. 3-34
Efficient Packing ........................................................... 3-35
Inefficient Packing: Null Bytes ...................................... 3-36
Overlay Packing Formats .............................................. 3-37
Trivial Packing: No Reordering ..................................... 3-37
PAGE_INPUT() ................................................................... 3-37
PAGE_OUTPUT() ............................................................... 3-38
PLIT{} .................................................................................. 3-38
PROCESSOR{} .................................................................... 3-39
viii VisualDSP++ 3.5 Linker and Utilities Manual
for 16-Bit Processors
CONTENTS
RESOLVE() .......................................................................... 3-40
SEARCH_DIR() ................................................................... 3-41
SECTIONS{} ........................................................................ 3-42
INPUT_SECTIONS() ...................................................... 3-45
expression ......................................................................... 3-45
FILL(hex number) ............................................................ 3-46
PLIT{plit_commands} ...................................................... 3-46
OVERLAY_INPUT{overlay_commands} ........................... 3-46
SHARED_MEMORY{} ......................................................... 3-48
EXPERT LINKER
Expert Linker Overview ................................................................ 4-2
Launching the Create LDF Wizard ................................................ 4-4
Step 1: Specifying Project Information ..................................... 4-5
Step 2: Specifying System Information ..................................... 4-6
Step 3: Completing the LDF Wizard ........................................ 4-9
Expert Linker Window Overview ................................................ 4-10
Input Sections Pane ..................................................................... 4-12
Input Sections Menu ............................................................. 4-12
Mapping an Input Section to an Output Section .................... 4-14
Viewing Icons and Colors ...................................................... 4-14
Sorting Objects ..................................................................... 4-17
Memory Map Pane ...................................................................... 4-18
Context Menu ....................................................................... 4-20
Tree View Memory Map Representation ................................. 4-22
VisualDSP++ 3.5 Linker and Utilities Manual ix for 16-Bit Processors
CONTENTS
Graphical View Memory Map Representation ........................ 4-23
Specifying Pre- and Post-Link Memory Map View ................. 4-27
Zooming In and Out on the Memory Map ............................ 4-28
Inserting a Gap into a Memory Segment ................................ 4-31
Working With Overlays ........................................................ 4-33
Viewing Section Contents ..................................................... 4-35
Viewing Symbols .................................................................. 4-39
Profiling Object Sections ....................................................... 4-40
Adding Shared Memory Segments and Linking Object Files ... 4-45
Managing Object Properties ........................................................ 4-50
Managing Global Properties .................................................. 4-51
Managing Processor Properties .............................................. 4-52
Managing PLIT Properties for Overlays ................................. 4-54
Managing Elimination Properties .......................................... 4-55
Managing Symbols Properties ................................................ 4-57
Managing Memory Segment Properties .................................. 4-61
Managing Output Section Properties ..................................... 4-62
Managing Packing Properties ................................................. 4-64
Managing Alignment and Fill Properties ................................ 4-65
Managing Overlay Properties ................................................. 4-67
Managing Stack and Heap in Processor Memory .................... 4-69
MEMORY OVERLAYS AND ADVANCED LDF
COMMANDS
Overview ...................................................................................... 5-2
x VisualDSP++ 3.5 Linker and Utilities Manual
for 16-Bit Processors
CONTENTS
Memory Management Using Overlays ........................................... 5-4
Introduction to Memory Overlays ............................................ 5-5
Overlay Managers .................................................................... 5-7
Breakpoints on Overlays ...................................................... 5-7
Memory Overlay Support ........................................................ 5-8
Example – Managing Two Overlays ....................................... 5-12
Linker-Generated Constants .................................................. 5-15
Overlay Word Sizes ................................................................ 5-15
Storing Overlay ID ................................................................ 5-16
Overlay Manager Function Summary ..................................... 5-17
Reducing Overlay Manager Overhead .................................... 5-17
Using PLIT{} and Overlay Manager ....................................... 5-22
Inter-Overlay Calls ............................................................ 5-24
Inter-Processor Calls ......................................................... 5-24
Advanced LDF Commands ......................................................... 5-27
MPMEMORY{} .................................................................... 5-28
OVERLAY_GROUP{} ........................................................... 5-29
Ungrouped Overlay Execution ........................................... 5-31
Grouped Overlay Execution .............................................. 5-33
PLIT{} .................................................................................. 5-34
PLIT Syntax ..................................................................... 5-34
Command Evaluation and Setup ................................... 5-35
Allocating Space for PLITs ................................................ 5-36
PLIT Example .................................................................. 5-37
VisualDSP++ 3.5 Linker and Utilities Manual xi for 16-Bit Processors
CONTENTS
PLIT – Summary .............................................................. 5-37
SHARED_MEMORY{} ........................................................ 5-38
ARCHIVER
Archiver Guide ............................................................................. 6-2
Creating a Library From VisualDSP++ ..................................... 6-3
Making Archived Functions Usable ......................................... 6-3
Writing Archive Routines: Creating Entry Points ................. 6-4
Accessing Archived Functions From Your Code ................... 6-5
Archiver File Searches ......................................................... 6-6
Tagging an Archive with Version Information ...................... 6-6
Basic Version Information ............................................... 6-6
User-Defined Version Information .................................. 6-7
Printing Version Information .......................................... 6-8
Removing Version Information from an Archive .............. 6-9
Checking Version Number .............................................. 6-9
Adding Text to Version Information .............................. 6-10
Archiver Command-Line Reference ............................................. 6-11
elfar Command Syntax .......................................................... 6-11
Archiver Parameters and Switches .......................................... 6-12
Command-Line Constraints .................................................. 6-14
Archiver Symbol Name Encryption ....................................... 6-15
FILE FORMATS
Source Files .................................................................................. A-2
xii VisualDSP++ 3.5 Linker and Utilities Manual
for 16-Bit Processors
C/C++ Source Files ................................................................. A-2
Assembly Source Files (.ASM) ................................................. A-3
Assembly Initialization Data Files (.DAT) ............................... A-3
Header Files (.H) .................................................................... A-4
Linker Description Files (.LDF) .............................................. A-4
Linker Command-Line Files (.TXT) ....................................... A-5
Build Files ................................................................................... A-5
Assembler Object Files (.DOJ) ................................................ A-5
Library Files (.DLB) ............................................................... A-6
Linker Output Files (.DXE, .SM, and .OVL) .......................... A-6
Memory Map Files (.XML) ..................................................... A-6
Loader Output Files in Intel Hex-32 Format (.LDR) ............... A-6
Splitter Output Files in ASCII Format (.LDR) ........................ A-8
Debugger Files ............................................................................. A-9
Format References ...................................................................... A-10
UTILITIES
elfdump – ELF File Dumper ........................................................ B-1
Disassembling a Library Member ............................................ B-3
Dumping Overlay Library Files ............................................... B-4
LDF PROGRAMMING EXAMPLES FOR BLACKFIN
PROCESSORS
Linking for a Single-Processor System ........................................... C-2
Linking Large Uninitialized or Zero-initialized Variables ............... C-4
VisualDSP++ 3.5 Linker and Utilities Manual xiii for 16-Bit Processors
Linking for Assembly Source File .................................................. C-6
Linking for C Source File – Example 1 .......................................... C-8
Linking for Complex C Source File – Example 2 ......................... C-11
Linking for Overlay Memory ...................................................... C-17
LDF PROGRAMMING EXAMPLES FOR ADSP-21XX DSPS
Linking for a Single-Processor ADSP-219x System ....................... D-3
Linking Large Uninitialized or Zero-initialized Variables ............... D-5
Linking an Assembly Source File .................................................. D-7
Linking a Simple C-Based Source File .......................................... D-9
Linking Overlay Memory for an ADSP-2191 System .................. D-16
Linking an ADSP-219x MP System With Shared Memory .......... D-19
Overlays Used With ADSP-218x DSPs ...................................... D-23
INDEX
xiv VisualDSP++ 3.5 Linker and Utilities Manual
for 16-Bit Processors

PREFACE

Thank you for purchasing Analog Devices development software for digi­tal signal processors (DSPs).

Purpose of This Manual

The VisualDSP++ 3.5 Linker and Utilities Manual for 16-Bit Processors contains information about the linker and utilities programs for 16-bit fixed-point Blackfin® processors and ADSP-21xx DSPs.
The Blackfin processors are 16-bit fixed-point embedded processors that support a Media Instruction Set Computing (MISC) architecture. This architecture is the natural merging of RISC, media functions, and digital signal processing (DSP) characteristics towards delivering signal process­ing performance in a microprocessor-like environment.
The ADSP-218x and ADSP-219x DSPs are low-cost 16-bit fixed-point DSPs for use in computing, communications, and consumer applications.
This manual provides information on the linking process and describes the syntax for the linker’s command language—a scripting language that the linker reads from the linker description file. The manual leads you through using the linker, archiver, and loader to produce DSP programs and provides reference information on the file utility software.
VisualDSP++ 3.5 Linker and Utilities Manual xv for 16-Bit Processors

Intended Audience

Intended Audience
The manual is primarily intended for programmers who are familiar with Analog Devices embedded processors and DSPs. This manual assumes that the audience has a working knowledge of the appropriate device architecture and instruction set. Programmers who are unfamiliar with Analog Devices DSPs can use this manual but should supplement it with other texts, such as Hardware Reference and Instruction Set Reference manu­als, that describe your target architecture.

Manual Contents

The manual contains:
Chapter 1, “Introduction” This chapter provides an overview of the linker and utilities.
Chapter 2, “Linker” This chapter describes how to combine object files into reusable library files to link routines referenced by other object files.
Chapter 3, “Linker Description File” This chapter describes how to write an .LDF file to define the target.
Chapter 4, “Expert Linker” This chapter describes Expert Linker, which is an interactive graphical tool to set up and map DSP memory.
Chapter 5, “Memory Overlays and Advanced LDF Commands” This chapter describes how overlays and advanced LDF commands are used for memory management.
xvi VisualDSP++ 3.5 Linker and Utilities Manual
for 16-Bit Processors
Preface
Chapter 6 “Archiver” This chapter describes the elfar archiver utility used to combine object files into library files, which serve as reusable resources for code development.
•Appendix A, “File Formats” This appendix lists and describes the file formats that the develop­ment tools use as inputs or produce as outputs.
•Appendix B, “Utilities” This appendix describes the utilities that provide legacy and file conversion support.
Appendix C, “LDF Programming Examples for Blackfin
Processors”
This appendix provides code examples of .LDF files used with Blackfin processors.
Appendix D, “LDF Programming Examples for ADSP-21xx
DSPs”
This appendix provides code examples of .LDF files used with ADSP-21xx DSPs.

What’s New in This Manual

This is a new manual that documents support for 16-bit fixed-point Blackfin processors and ADSP-21xx DSPs.
This manual now combines linker-related information for all ADI 16-bit fixed-point processors. The manual provides information for Blackfin processors, ADSP-218x DSPs and ADSP-219x DSPs.
Loader/splitter information is now available in separate Loader manuals for appropriate target processor families.
Refer to VisualDSP++ 3.5 Product Bulletin for 16-Bit Processors for infor­mation on all new and updated features and other release information.
VisualDSP++ 3.5 Linker and Utilities Manual xvii for 16-Bit Processors

Technical or Customer Support

Technical or Customer Support
You can reach DSP Tools Support in the following ways:
Visit the DSP Development Tools website at
http://www.analog.com/technology/dsp/developmentTools/index.html
E-mail questions to
dsptools.support@analog.com
Phone questions to 1-800-ANALOGD
Contact your ADI local sales office or authorized distributor
Send questions by mail to:
Analog Devices, Inc. One Technology Way P.O. Box 9106 Norwood, MA 02062-9106 USA
xviii VisualDSP++ 3.5 Linker and Utilities Manual
for 16-Bit Processors
Preface

Supported Processors

Blackfin Processors
The name “Blackfin” refers to a family of Analog Devices 16-bit, fixed-point embedded processors. VisualDSP++ currently supports the following processors:
ADSP-BF532 (formerly ADSP-21532)
ADSP-BF535 (formerly ADSP-21535)
ADSP-BF531
ADSP-BF533
ADSP-BF561
AD6532
AD90747
The ADSP-BF531 and ADSP-BF533 processors are memory variants of the ADSP-BF532 processor as well as a dual-core ADSP-BF561 processor.
ADSP-218x and ADSP-219x DSPs
The name “ADSP-21xx” refers to two families of Analog Devices 16-bit, fixed-point processors. VisualDSP++ currently supports the following processors:
ADSP-218x DSPs: ADSP-2181, ADSP-2183, ADSP-2184/84L/84N, ADSP-2185/85L/85M/85N, ADSP-2186/86L/86M/86N, ADSP-2187L/87N, ADSP-2188L/88N, and ADSP-2189M/89N
ADSP-219x DSPs: ADSP-2191, ADSP-2192-12, ADSP-2195, ADSP-2196, ADSP-21990, ADSP-21991, and ADSP-21992
VisualDSP++ 3.5 Linker and Utilities Manual xix for 16-Bit Processors

Product Information

Product Information
You can obtain product information from the Analog Devices website, from the product CD-ROM, or from the printed publications (manuals).
Analog Devices is online at www.analog.com. Our website provides infor­mation about a broad range of products—analog integrated circuits, amplifiers, converters, and digital signal processors.

MyAnalog.com

MyAnalog.com is a free feature of the Analog Devices website that allows
customization of a webpage to display only the latest information on products you are interested in. You can also choose to receive weekly e-mail notification containing updates to the webpages that meet your interests. MyAnalog.com provides access to books, application notes, data sheets, code examples, and more.
Registration:
Visit www.myanalog.com to sign up. Click Register to use MyAnalog.com. Registration takes about five minutes and serves as means for you to select the information you want to receive.
If you are already a registered user, simply log on. Your user name is your e-mail address.

DSP Product Information

For information on digital signal processors, visit our website at
www.analog.com/dsp, which provides access to technical publications, data
sheets, application notes, product overviews, and product announcements.
You may also obtain additional information about Analog Devices and its products in any of the following ways.
xx VisualDSP++ 3.5 Linker and Utilities Manual
for 16-Bit Processors
Preface
Email questions or requests for information to
dsp.support@analog.com
Fax questions or requests for information to
1-781-461-3010 (North America) 089/76 903-557 (Europe)
Access the Digital Signal Processing Division’s FTP website at
ftp ftp.analog.com or ftp 137.71.23.21 ftp://ftp.analog.com

Related Documents

For information on product related development software, see the follow­ing publications:
VisualDSP++ 3.5 Getting Started Guide for 16-Bit Processors
VisualDSP++ 3.5 User’s Guide for 16-Bit Processors
VisualDSP++ 3.5 Assembler and Preprocessor Manual for Blackfin Processors
VisualDSP++ 3.5 C Compiler and Library Manual for Blackfin Processors
VisualDSP++ 3.5 Product Bulletin for 16-Bit Processors
VisualDSP++ 3.5 Assembler and Preprocessor Manual for ADSP-21xx DSPs
VisualDSP++ 3.5 C Compiler and Library Manual for ADSP-218x DSPs
VisualDSP++ 3.5 C/C++ Compiler and Library Manual for ADSP-219x DSPs
VisualDSP++ 3.5 Loader Manual for 16-Bit Processors
VisualDSP++ Kernel (VDK) User’s Guide
VisualDSP++ Component Software Engineering User’s Guide
Quick Installation Reference Card
For hardware information, refer to your DSP’s Hardware Reference manual and datasheet.
VisualDSP++ 3.5 Linker and Utilities Manual xxi for 16-Bit Processors
Product Information

Online Technical Documentation

Online documentation comprises VisualDSP++ Help system and tools manuals, Dinkum Abridged C++ library and FlexLM network license manager software documentation. You can easily search across the entire VisualDSP++ documentation set for any topic of interest. For easy print­ing, supplementary
A description of each documentation file type is as follows.
File Description
.CHM Help system files and VisualDSP++ tools manuals.
.HTML Dinkum Abridged C++ library and FlexLM network license manager software doc-
umentation. Viewing and printing the net Explorer 4.0 (or higher).
.PDF VisualDSP++ tools manuals in Portable Documentation Format, one .PDF file for
each manual. Viewing and printing the Adobe Acrobat Reader (4.0 or higher).
.PDF files for the tools manuals are also provided.
.HTML files require a browser, such as Inter-
.PDF files require a PDF reader, such as
If documentation is not installed on your system as part of the software installation, you can add it from the VisualDSP++ CD-ROM at any time.
Access the online documentation from the VisualDSP++ environment, Windows® Explorer, or Analog Devices website.
From VisualDSP++
Access VisualDSP++ online Help from the Help menu’s Contents, Search, and Index commands.
Open online Help from context-sensitive user interface items (tool­bar buttons, menu commands, and windows).
xxii VisualDSP++ 3.5 Linker and Utilities Manual
for 16-Bit Processors
Preface
From Windows
In addition to any shortcuts you may have constructed, there are many ways to open VisualDSP++ online Help or the supplementary documenta­tion from Windows.
Help system files (.CHM files) are located in the Help folder, and .PDF files are located in the Docs folder of your VisualDSP++ installation. The Docs folder also contains the Dinkum Abridged C++ library and FlexLM net­work license manager software documentation.
Using Windows Explorer
Double-click any file that is part of the VisualDSP++ documenta­tion set.
Double-click the vdsp-help.chm file, which is the master Help sys­tem, to access all the other .CHM files.
Using the Windows Start Button
Access the VisualDSP++ online Help by clicking the Start button and choosing Programs, Analog Devices, VisualDSP++, and VisualDSP++ Documentation.
Access the .PDF files by clicking the Start button and choosing
Programs, Analog Devices,, VisualDSP++, Documentation for Printing, and the name of the book.
From the Web
To download the tools manuals, point your browser at
http://www.analog.com/technology/dsp/developmentTools/ gen_purpose.html
.
Select a DSP family and book title. Download archive (.ZIP) files, one for each manual. Use any archive management software, such as WinZip, to decompress downloaded files.
VisualDSP++ 3.5 Linker and Utilities Manual xxiii for 16-Bit Processors
Product Information

Printed Manuals

For general questions regarding literature ordering, call the Literature Center at 1-800-ANALOGD (1-800-262-5643) and follow the prompts.
VisualDSP++ Documentation Set
VisualDSP++ manuals may be purchased through Analog Devices Cus­tomer Service at 1-781-329-4700; ask for a Customer Service representative. The manuals can be purchased only as a kit. For additional information, call 1-603-883-2430.
If you do not have an account with Analog Devices, you will be referred to Analog Devices distributors. To get information on our distributors, log onto http://www.analog.com/salesdir/continent.asp.
Hardware Manuals
Hardware reference and instruction set reference manuals can be ordered through the Literature Center or downloaded from the Analog Devices website. The phone number is 1-800-ANALOGD (1-800-262-5643). The manuals can be ordered by a title or by product number located on the back cover of each manual.
Data Sheets
All data sheets can be downloaded from the Analog Devices website. As a general rule, any data sheet with a letter suffix (L, M, N) can be obtained from the Literature Center at 1-800-ANALOGD (1-800-262-5643) or downloaded from the website. Data sheets without the suffix can be downloaded from the website onlyno hard copies are available. You can ask for the data sheet by a part name or by product number.
xxiv VisualDSP++ 3.5 Linker and Utilities Manual
for 16-Bit Processors
Preface
If you want to have a data sheet faxed to you, the fax number for that service is 1-800-446-6212. Follow the prompts and a list of data sheet code numbers will be faxed to you. Call the Literature Center first to find out if requested data sheets are available.

Contacting DSP Publications

Please send your comments and recommendation on how to improve our manuals and online Help. You can contact us @
dsp.techpubs@analog.com

Notation Conventions

The following table identifies and describes text conventions used in this manual.
.
Example Description
Close command (File menu)
{this | that} Alternative required items in syntax descriptions appear within curly
[this | that] Optional items in syntax descriptions appear within brackets and sepa-
[this,…] Optional item lists in syntax descriptions appear within brackets
.SECTION Commands, directives, keywords, and feature names are in text with
filename Non-keyword placeholders appear in text with italic style format.
appear throughout this document.
Tex t in bold style indicates the location of an item within the VisualDSP++ environment’s menu system. For example, the Close command appears on the File menu.
brackets and separated by vertical bars; read the example as
that.
rated by vertical bars; read the example as an optional
delimited by commas and terminated with an ellipsis; read the example as an optional comma-separated list of
letter gothic font.
this or
this or that.
this.
Additional conventions, which apply only to specific chapters, may
VisualDSP++ 3.5 Linker and Utilities Manual xxv for 16-Bit Processors
Notation Conventions
Example Description
A note, providing information of special interest or identifying a related topic. In the online version of this book, the word Note appears instead of this symbol.
A caution, providing information about critical design or program­ming issues that influence operation of a product. In the online version of this book, the word Caution appears instead of this symbol.
xxvi VisualDSP++ 3.5 Linker and Utilities Manual
for 16-Bit Processors

1 INTRODUCTION

This chapter provides an overview of VisualDSP++ development tools and their use in DSP project development process.
This chapter includes:
“Software Development Flow on page 1-2 Shows how linking, loading, and splitting fit into the DSP project development process.
“Compiling and Assembling on page 1-3 Shows how compiling and assembling the code fits into the DSP project development process.
“Linking on page 1-6 Shows how linking fits into the DSP project development process.
“Loading and Splitting on page 1-8 Shows how loading and splitting fit into the DSP project develop­ment process.
VisualDSP++ 3.5 Linker and Utilities Manual 1-1 for 16-Bit Processors

Software Development Flow

Software Development Flow
The majority of this manual describes linking, a critical stage in the program development process for embedded applications.
The linker tool (linker.exe) consumes object and library files to produce executable files, which can be loaded onto a simulator or target processor. The linker also produces map files and other output that contain informa­tion used by the debugger. Debug information is embedded in the executable file.
After running the linker, you test the output with a simulator or emulator. Refer to the VisualDSP++ Users Guide of your target processors and online Help for information about debugging.
Finally, you process the debugged executable file(s) through the loader or splitter to create output for use on the actual processor. The output file may reside on another processor (host) or may be burned into a PROM. Separate Loader Manual for 16-Bit Processors describes loader/splitter func­tionality for the target processors.
The processor software development flow can be split into three phases:
1. Compiling and Assembling – Input source files C (.C), C++ (.CPP), and assembly (.ASM) yield object files (.DOJ)
2. Linking – Under the direction of the Linker Description File
.LDF), a linker command line, and VisualDSP++ Project Options
( dialog box settings, the linker utility consumes object files (.DOJ) to yield an executable (.DXE) file. If specified, shared memory (.SM) and overlay (
3. Loading or splitting – The executable (.DXE), as well as shared memory (.SM) and overlay (.OVL) files, are processed to yield output file(s). For Blackfin processors, these are boot-loadable (LDR) files or non-bootable PROM image files, which execute from the processors external memory.
1-2 VisualDSP++ 3.5 Linker and Utilities Manual
.OVL) files are also produced.
for 16-Bit Processors
Introduction

Compiling and Assembling

The process starts with source files written in C, C++, or assembly. The compiler (or a code developer who writes assembly code) organizes each distinct sequence of instructions or data into named sections, which become the main components acted upon by the linker.

Inputs – C/C++ and Assembly Sources

The first step towards producing an executable file is to compile or assem­ble C, C++, or assembly source files into object files. The VisualDSP++ development software assigns a .DOJ extension to object files (Figure 1-1).
Source Files
(.C, .CPP, .ASM)
Compiler and Assembler
Object Files
(.DOJ)
Figure 1-1. Compiling and Assembling
Object files produced by the compiler (via the assembler) and by the assembler itself consist of input sections. Each input section contains a particular type of compiled/assembled source code. For example, an input section may consist of program opcodes or data, such as variables of various widths.
Some input sections may contain information to enable source-level debugging and other VisualDSP++ features. The linker maps each input section (via a corresponding output section in the executable) to a memory segment, a contiguous range of memory addresses on the target system.
VisualDSP++ 3.5 Linker and Utilities Manual 1-3 for 16-Bit Processors
Compiling and Assembling
Each input section in the .LDF file requires a unique name, as specified in the source code. Depending on whether the source is C, C++, or assembly, different conventions are used to name an input section (see Chapter 3,
Linker Description File).

Input Section Directives in Assembly Code

A .SECTION directive defines a section in assembly source. This directive must precede its code or data.
Example (for Blackfin processors)
.SECTION Library_Code_Space; /* Section Directive */ .global _abs; _abs:
R0 = ABS R0; /* Take absolute value of input */ RTS;
_abc.end
In this example, the assembler places the global symbol/label _abs and the code after the label into the input section Library_Code_Space, as it pro­cesses this file into object code.

Input Section Directives in C/C++ Source Files

Typically, C/C++ code does not specify an input section name, so the compiler uses a default name. By default, the input section names program (for code) and are defined in
In C/C++ source files, you can use the optional section(“name”) C lan- guage extension to define sections.
Example 1
While processing the following code, the compiler stores the temp variable in the ext_data input section of the .DOJ file and also stores the code gen­erated from
1-4 VisualDSP++ 3.5 Linker and Utilities Manual
data1 (for data) are used. Additional input section names
.LDF files.
func1 in an input section named extern.
for 16-Bit Processors
Loading...
+ 308 hidden pages