Home

ANALOG DEVICES VisualDSP 5.0 Linker Utilities Manual (Revision 3.2 March 2009)

image

Contents

1. Multiproc memory 0x0008 0000 to Ox003f ffff 0x0008 0000 to Ox000f ffff SHARC ID 00 terna emory 0x0010 0000 to Ox0017 ffff SHARC ID 010 terna emory 0x0018 0000 to OxO00l1f ffff SHARC ID 01 terna emory 0x0020 0000 to Ox0027 ffff SHARC ID 100 terna emory 0x0028 0000 to Ox002f ffff SHARC ID 10 terna emory 0x0030 0000 to Ox0037 ffff SHARC ID 110 terna emory 0x0038 0000 to Ox003f ffff SHARC ID al terna emory External memory 0Ox0040 0000 to Oxffff ffff This architecture file allocates I E nternal xternal SEARCH_DIR ADI_DSP 21k 1ib LIB 0BJ MA BOTS P ffton2 emory a 256 48 reset 5888 48 2048 48 for code RARIES 1ib060 d1b COMMAND_LINE_OBJECTS pe map chitecture description for FFT example on a 21062 bit words for interrupt vector table vector location bit words of program memory for code storage bit words of second segment of program memory storage VisualDSP 5 0 Linker and Utilities Manual LDF Programming Examples for SHARC Processors 20 32 bit words of internal program memory for data storage 32 32 bit words of internal data memory for data storage 4k 32 bit words of first segment of external data memory for data storage 4k 32 bit words of second segment of external data memory for data storage isr_tabl TYPECPM RAM START 0x00020000 END Ox000200FF DTH
2. 2 46 VisualDSP 5 0 Linker and Utilities Manual Linker e An executable dxe file to be linked against Refer to COMMAND_LINE_LINK_AGAINST in Built In LDF Macros on page 3 30 Object File Names An object file name may include e The drive directory path file name and file extension e The directory path may be an absolute path or a path relative to the directory from which the linker is invoked e Long file names enclosed within straight quotes If the file exists before the link begins the linker opens the file to verify its type before processing the file Table 2 6 lists valid file extensions used by the linker Command Line File Names Some linker switches take a file name as a parameter Table 2 6 lists the types of files names and extensions that the linker expects on file name arguments The linker follows the conventions for file extensions in Table 2 6 Table 2 6 File Extension Conventions Extension File Description dlb Library archive file doj Object file dxe Executable file ldf Linker Description File ov Overlay file sm Shared memory file VisualDSP 5 0 Linker and Utilities Manual 2 47 Linker Command Line Reference The linker supports relative and absolute directory names default directo ries and user selected directories for file search paths File searches occur in the following order 1 Specified path If the command lin
3. Set prefetch flag to 1 to indicate a load call fft_middle_stages Pre loads the function into the overlay run memory The code executes the first function and transfers the second function and so on In this implementation each function resides in a unique overlay and requires two run time locations While one overlay loads into one run time location a second overlay function executes in another run time location The following code segment allocates the functions to overlays and forces two run time locations OVERLAY_GROUPI1 OVERLAY_INPUT ALGORITHM ALL_FIT OVERLAY_OUTPUT fft_one ovl INPUT_SECTIONS Fft_ovl doj program gt ovl_code Overlay to live in section ovl_code OVERLAY_INPUT ALGORITHM ALL_FIT 5 22 VisualDSP 5 0 Linker and Utilities Manual Memory Overlays and Advanced LDF Commands OVERLAY_OUTPUT fft_three ovl INPUT_SECTIONS Fft_ovl doj program gt ovl_code Overlay to live in section ovl_code gt mem_code OVERLAY_MGR INPUT_SECTIONS Covly_mgr doj program gt mem_code OVERLAY_GROUP2 OVERLAY_INPUT ALGORITHM ALL_FIT OVERLAY_OUTPUT fft_two ovl INPUT_SECTIONS Fft_ovl doj program gt ovl_code Overlay to live in section ovl_code OVERLAY_INPUT ALGORITHM ALL_FIT OVERLAY_OUTPUT fft_last ovl INPUT_SECTIONS Fft_ovl doj program gt ovl_code Overlay to live in section ovl_code gt mem_code The first and third over
4. gt MEM_HEAP argv Allocate argv space for the application ldf_argv_space ldf_argv_end ldf_argv_space MEMORY_SIZEOF MEM_ARGV 1 ldf_argv_length ldf_argv_end ldf_argv_space gt MEM_ARGV end SECTIONS Specifying Two Buffers in Different Memory Segments On TigerSHARC processors the linker supports optimized memory placement using the SEPARATE_MEM_SEGMENTS assembler directive e The SEPARATE_MEM_SEGMENTS assembler directive or the compiler pragma pragma separate_mem_segments specifies two buffers directing the linker to place the buffers into different memory segments For example SECTION datal VAR bufl VAR buf2 2 40 VisualDSP 5 0 Linker and Utilities Manual Linker EXTERN buf3 SEPARATE_MEM_SEGMENTS bufl buf2 SEPARATE_MEM_SEGMENTS bufl buf3 The set of available memory segments for each buffer is defined by using the linker s one to many feature mapping input sec tion s that contain the buffer into multiple memory segments For example data2 INPUT_SECTIONS OBJECTS datal gt M2DataA data4 INPUT_SECTIONS OBJECTS datal gt M4DataA VisualDSP 5 0 Linker and Utilities Manual 2 41 Link Target Desc ription e The linker tries to satisfy placement constraint requirements by allocating the buffers to different memory segments a If the linker fails to satisfy any or all of the requirements the linker produc
5. 907800 ffal3ffc ffal3fff Expert Linker Move this box to adjust the size of the memory segment Figure 4 20 Adjusting the Size of a Memory Segment When the mouse pointer is on top of the box the resize cursor appears as at F When an object is selected in the memory map it is highlighted as shown in Figure 4 21 on page 4 28 If you move the mouse pointer over an object in the graphical memory map a yellow tooltip dis plays the information about the object such as name address and size VisualDSP 5 0 Linker and Utilities Manual 4 27 Memory Map Pane n n C 804a Highlighted mem_stack R192 eRe m gt otc 832c Figure 4 21 A Highlighted Memory Segment in the Memory Map 4 28 VisualDSP 5 0 Linker and Utilities Manual Expert Linker Specifying Pre and Post Link Memory Map View View the memory map from two perspectives pre link view and post link view Pre link view is typically used to place input sections Post link view is typically used to view where the input sections are placed after linking the project Other information such as the sizes of each section symbols and the contents of each section is available after linking e To enable pre link view from the Memory Map pane right click and choose View and Mapping Strategy Pre Link Figure 4 22 on page 4 29 illustrates a memory map before linking Memory Map RIAIQ 0000000 MEM_PROGRAM 0000000 MEM_PCI
6. An overlay manager s main objective is to transfer overlays to a run time location when required Overlay managers may also e Set up a stack to store register values e Check whether a referenced symbol has already been transferred into its run time space as a result of a previous reference If the overlay is already in internal memory the overlay transfer is bypassed and execution of the overlay routine begins immediately e Load an overlay while executing a function from a second overlay or a non overlay function You may require an overlay manager to perform other specialized tasks to satisfy the special needs of a given application Overlay managers are application specific and must be developed by the user Breakpoints on Overlays The debugger relies on the presence of the _ov_start and _ov_end symbols to support breakpoints on overlays These symbols should appear in the user s overlay manager for debugger support of overlays The symbol manager sets a silent breakpoint at each symbol The more important of the two symbols is the breakpoint at _ov_end Code execution in the overlay manager passes through this location once an overlay is fully swapped in At this point the debugger may probe the target to determine which overlays are in context The symbol manager now sets any breakpoints requested on the overlays and resumes execution VisualDSP 5 0 Linker and Utilities Manual 5 7 Memory Management Using Overla
7. Figure 4 55 Global Properties Selecting Stack and Heap Usage e Search the heap and stack for the highest memory locations written to by the DSP program This action occurs when the target halts after running the program assume the unused portion of the stack or heap starts here The Expert Linker updates the memory map to show how much of the stack and heap are unused Use this information to adjust the size of your stack and heap This infor mation helps make better use of the processor memory so the stack and heap segments do not use too much memory Use the graphical view View Mode gt Graphical Memory Map to dis play stack and heap memory map blocks Figure 4 56 shows a possible memory map after running a project program 4 70 VisualDSP 5 0 Linker and Utilities Manual Expert Linker Expert Linker x Input Sections Memory Map IVint10 Mint 1 mem_data2 I intl2 I int13 I int1 4 Wini IVint4 mem_heap Wing Wing Vint Iing IVint9 IVkermnel mem_stack l pwrdwn I reset l stackint datal data mem_datal program Ge Ge Ge 2 Figure 4 56 Graphical Memory Map Showing Stack and Heap Usage VisualDSP 5 0 Linker and Utilities Manual 4 71 Managing Object Properties Managing Shared Memory Properties Specify the path and name of the file used by shared memory This proce dure assumes the Expert Linker window is open To specify shared memory
8. Outputs an overlay 0VL file for the overlay with the specified name The OVERLAY_OUTPUT in an OVERLAY_INPUT command must appear before any INPUT_SECTIONS for that overlay INPUT_SECTIONS Has the same syntax within an OVERLAY_INPUT command as when it appears within an output_section_command except that a PLIT section may not be placed in overlay memory For more information see INPUT_SECTIONS on page 3 65 OVERLAY_ID Returns the overlay ID NUMBER_OF_OVERLAYS Returns the number of overlays that the current link generates when the FIRST_FIT or BEST_FIT overlay placement for ALGO RITHM is used Note Not currently available ALGORITHM Directs the linker to use the specified overlay linking algorithm The only currently available linking algorithm is ALL_FIT For ALL_FIT the linker tries to fit all the OVERLAY_INPUT into a single overlay that can overlay into the output section s run time memory segment FIRST_FIT Not currently available 3 72 VisualDSP 5 0 Linker and Utilities Manual Linker Description File For FIRST_FIT the linker splits the input sections listed in OVERLAY_INPUT into a set of overlays that can each overlay the output section s run time memory segment according to First In First Out FIFO order BEST_FIT Not currently available For BEST_FIT the linker splits the input sections listed in OVERLAY_INPUT into a set of overlays th
9. VisualDSP 5 0 Linker and Utilities Manual 2 29 Link Target Description External Memory Although the processor s internal memory is divided into blocks the processor s external memory spaces are divided into banks The internal memory blocks and the external memory spaces may be addressed by either data address generator DAG External memory banks are fixed sizes that can be configured for various waitstate and access configurations The processor can address 254 Mwords of external memory space External memory connects to the processor s external port which extends the processor s 24 bit address and 32 bit data buses off the processor The processor can make 8 16 32 or 48 bit accesses to external memory for instructions and 8 16 or 32 bit accesses for data Table 2 4 shows the access types and words for processor s external memory accesses The pro cessor s DMA controller automatically packs external data into the appropriate word width during data transfer The external data bus can be expanded to 48 bits if the link ports are disabled and the corresponding full width instruction packing mode IPACK is enabled in the SYSCON register Ensure that link ports are disabled when executing code from external 48 bit memory Table 2 4 Internal to External Memory Word Transfers Word Type Transfer Type Packed instruction 32 16 or 8 to 48 bit packing Normal word data 32 bit word in 32 bit t
10. 1dr or others Error and warning messages appear in the Output window Project Builds The linker runs from an operating system command line issued from the VisualDSP IDDE or a command prompt window The VisualDSP IDDE provides an intuitive interface for processor programming When you open VisualDSP a work area contains everything needed to build manage and debug a DSP project You can easily create or edit an 1df file which maps code or data to specific memory segments on the target For information about the VisualDSP environment refer to the VisualDSP User s Guide or online Help Online Help provides powerful search capabilities To obtain information on a code item parameter or error select text in an VisualDSP IDDE editor window or Output window and press the keyboard s F1 key Within VisualDSP specify tool settings for project builds Use the Project menu to open the Project Options dialog box The dialog box pages allow you to select the target processor type and name of the exe cutable file as well as VisualDSP tools available for use with the selected processor 2 6 VisualDSP 5 0 Linker and Utilities Manual Linker When using the VisualDSP IDDE use the Link page from the Project Options dialog box to select and or set linker functional options Project Options for NewProject1 Project Link General Assemble Link ee General By Pre build Figure 2 2 Project
11. Located in seg_dmda VisualDSP 5 0 Linker and Utilities Manual 2 15 Link Target Description In the default non VDK LDFs for the 21020 2106x 2116x and 2126x processors the run time stack and heap are also allocated from this section seg heap In the default LDFs for 2136x and 2137x processors this section is the area from which memory allocation functions and operators new mal loc and so on allocate memory In the default LDFs for ADSP 21020 ADSP 2106x ADSP 2116x and ADSP 2126x processors the memory allocation functions and operators allocate memory from seg_dmda In the VDK LDFs this section is the area from which memory allocation functions and operators allocate memory seg_stack VDK only The run time stack is located in this section Local variables function parameters and so on are stored here seg_stak not VDK In the LDFs for ADSP 2136x and ADSP 2137x processors this section is the area where the run time stack is located Local variables function parameters and so on are stored here In the LDFs for ADSP 21020 ADSP 2106x ADSP 2116x and ADSP 2126x processors the run time stack is located in seg_dmda seg_vtbl This section contains C virtual function tables The default 1af files place the virtual function tables into the default data memory area but this can be re mapped as required You can also direct the compiler to use a different section for C virtual fu
12. NoErase on page 7 17 e Section Sectionname on page 7 18 This ensures the integrity of the code and data from each callback execut able file in the callback initialization stream the code can be executed independently and successfully regardless of memory initializer com mand line switches By taking multiple input files the memory initializer supports systems that have to run a number of independent service applications before starting the primary application 7 4 VisualDSP 5 0 Linker and Utilities Manual Memory Initializer Initialization Steam Structure An initialization stream made from the memory initializer has three major portions e The header of the initialization stream which holds basic informa tion for the run time library RTL routine such as the number of data blocks in the initialization stream e The callback executable file which itself may have a number of the sub portions each containing a piece of the callback executable e The initialization data and code from the primary application Figure 7 1 shows the basic structure of the initialization stream Initialization Stream Header First Callback Code optional Second Callback Code optional Additional Callback Code optional Code and Data for the Primary Executable Figure 7 1 Memory Initializer Basic Initialization Stream Structure VisualDSP 5 0 Linker and Utilities Manual 7 5 Run Time
13. The linker expands this macro into the name s of the the object s doj files and libraries dlb files that appear on the command line In this example COMMAND_LINE_OBJECTS single doj 6l1_hdr doj is the standard initialization file for 2116x OBJS COMMAND_LINE_OBJECTS 161_hdr doj A linker project to generate a dxe file PROCESSOR PO OUTPUT SINGLE dxe The name of the output file MEMORY Processor specific memory command INCLUDE 21161l_memory h SECTIONS Specify the output sections INCLUDE 21161_sections h end PO sections end PO processor VisualDSP 5 0 Linker and Utilities Manual D 3 Linking Large Uninitialized Variables Linking Large Uninitialized Vanables When linking an executable file that contains large uninitialized variables use the NO_INIT equivalent to SHT_NOBITS legacy qualifier or ZERO_INIT section qualifier to reduce the file size A variable defined in a source file normally takes up space in an object and executable file even if that variable is not explicitly initialized when defined For large buffers this action can result in large executables filled mostly with zeros Such files take up excess disk space and can incur long download times when used with an emulator This situation also may occur when you boot from a loader file because of the increased file size Listing D 2 shows an example of assembly source c
14. memory map representations VisualDSP 5 0 Linker and Utilities Manual 4 23 Memory Map Pane Memory Map SY RQ ey fO000000 MEM_PROGRAM f0000000 N output sections Unused FO002ffef MEM_PCI_IO FNO02FfOO MFM_HFAF FOORO0g00 0037 f fE user defined intput sections memory MEM _STAICK 0038000 segments fFOOSdE LF MEM_SY SSTACK f 003e000 FOOSEd FE MEM_ARGY f 003fe00 ee rooorrere Figure 4 17 Graphical Memory Map Representation 4 24 VisualDSP 5 0 Linker and Utilities Manual Expert Linker In graphical view the memory map comprises blocks of different colors that represent memory segments output sections objects and so on The memory map is drawn with these rules An output section is represented as a vertical header with a group of objects to the right of it A memory segment s border and text change to red from its nor mal black color to indicate that it is invalid When moving the mouse pointer over the invalid memory segment a tooltip displays a message describing why the segment is invalid The height of the memory segments is not scaled as a percentage of the total memory space However the width of the memory seg ments is scaled as a percentage of the widest memory Object sections are drawn as horizontal blocks stacked on top of each other Before linking the object section sizes are not known and are displayed in equal sizes within the memory s
15. 4 49 Managing Object Properties Managing Object Properties You can display different properties for each type of object Since different objects may share certain properties their Properties dialog boxes share pages The following procedures assume the Expert Linker window is open To display a Properties dialog box right click an object and choose Properties You may choose these functions e Managing General Global Properties on page 4 51 e Managing Processor Properties on page 4 52 e Managing PLIT Properties for Overlays on page 4 53 e Managing Elimination Properties on page 4 54 e Managing Symbols Properties on page 4 56 e Managing Memory Segment Properties on page 4 59 e Managing Output Section Properties on page 4 60 e Managing Packing Properties on page 4 63 e Managing Alignment and Fill Properties on page 4 65 e Managing Overlay Properties on page 4 67 e Managing Stack and Heap in Processor Memory on page 4 69 e Managing Shared Memory Properties on page 4 72 4 50 VisualDSP 5 0 Linker and Utilities Manual Expert Linker Managing General Global Properties To access Global Properties right click in the Input Sections pane and choose Properties The Global Properties dialog box appears The General tab of the Global Properties dialog box provides these selec tions Figure 4 42 e Linker map file displays the map file generate
16. 5 0 Linker and Utilities Manual 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 toward 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 Object Files c cpp asm doj Compiler and Assembler 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 5 0 Linker and Utilities Manual 1 3 Compiling and Assembling Each input section in the 1df file requires a unique name as specified
17. CONTENTS BP a E E EA NE AA AAE E AAA AE EEE EE 3 43 KEKORI testrascirscernionincemsca named 3 43 See DOU sncusicennynmmnnamnusmanias 3 45 ee eee 3 45 START address Number saisescsraneiscicstasswipaneicdiedwiiaes 3 45 TIPE cites 3 45 LENGTH length_number END address_number 3 47 WIDTH width_mumber sss veesescesarcisacsevconntsaccscabanranvataas 3 47 PAPE cenana dni 3 47 OYERLAY GROUPI sacraro T 3 47 PSC RINGI grorennirioipe ini 3 48 Packing in SHARC Processors niin 3 50 Overlay Packing Formats in SHARC Processors 3 52 External Execution Packing in SHARC Processors 3 53 PETTAI aeann SRR 3 54 PROCESSORI percara hanan n 3 55 RESERVE sepercrciniion neea Ea 3 57 Linker Error Resolution cri eee 3 58 RR aa a 3 58 RESERVE EXPANDI sensorin aean N 3 59 RESOL T apnena EN 3 60 Potential Problem with Symbol Definition eee 3 60 SARCA DIRU siscinieiiniaieisnsebnaiewiniadicncaliciees 3 61 SECTIONS onani n cadens 3 61 xii VisualDSP 5 0 Linker and Utilities Manual CONTENTS INPUT cee orenen onnon S nN 3 65 Using an Optional Filter Expression ssrsssiiscrsssniisn 3 66 INPUT_SECTIONS_PIN INPUT_SECTIONS_PIN_EXCLUSIV ECOmMENdS srinspedispsmi oia Aa aa 3 68 CXPrESSION ariii A 3 70 FILL hex number sosrrisensnononrenpusdn an 3 70 PLEN OIE SRR oak 3 71 OVERLAY_INPUT overlay_commands s ccccccscesnccccersetes 3 71 FORCE_CONTIGUITY NOFORCE_CONTIGUITY 3 73 SHARED MEMORY ticctitioscsdisescaniei
18. Table 2 7 briefly describes each linker switch Each individual switch is described in detail following this table See Project Builds on page 2 6 for information on the VisualDSP Project Options dialog box Table 2 7 Linker Command Line Switches Summary Switch Description More Info file Uses the specified file as input on the command line on page 2 53 DprocessorID Specifies the target processor ID The use of on page 2 54 proc processorID is recommended L path Adds the path name to search libraries for objects on page 2 54 Produces dependencies on page 2 54 MM Builds and produces dependencies on page 2 54 Map file Outputs a map of link symbol information to a file on page 2 55 MDmacrol def Defines and assigns value def to a preprocessor on page 2 56 macro MUDmacro Undefines the preprocessor macro on page 2 56 S Omits debugging symbols from the output file on page 2 56 T filename Identifies the LDF to be used on page 2 56 Wwarn number Demotes the specified error message to a warning on page 2 57 Wnumber Selectively disables warnings by one or more mes on page 2 57 sage numbers For example W1010 disables warn ing message 111010 e Eliminates unused symbols from the executable on page 2 57 ek secName Specifies a section name in which elimination on page 2 57 should not take place VisualDSP 5 0 Linker and Utilities Manual 2 51
19. The ALIGN number command aligns the address of the current location counter to the next address that is a multiple of number where number is a power of 2 The number is a word boundary address that depends on the word size of the memory segment in which the ALIGN takes action ARC HITEC TURE The ARCHI An 1df fi EC The ARCHI EC URE command specifies the target system s processor le may contain one ARCHITECTURE command only URE command must appear with global LDF scope applying to the entire 1df file The command s syntax is ARCHITECTURE processor The ARCHITECTURE command is case sensitive For example a valid entry is ADSP BF533 Thus ADSP BF533 is valid but adsp BF533 is not VisualDSP 5 0 Linker and Utilities Manual 3 37 LDF Keywords Commands and Operators If the ARCHITECTURE command does not specify the target processor you must identify the target processor via the linker command line linker proc processor Otherwise the linker cannot link the program If processor specific MEMORY commands in the df file conflict with the processor type the linker issues an error message and halts Test whether your VisualDSP installation accommodates a particular processor by typing the following linker command linker proc processor If the architecture is not installed the linker prints a message to that effect COMMON_MEMORY The COMMON_M
20. W SUN DSP 5 0 Linker and Utilities Manual Analog Devices Inc One Technology Way Norwood Mass 02062 9106 Revision 3 2 March 2009 Part Number 82 000420 03 ANALOG DEVICES Copynght Information 2009 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 the CROSSCORE logo VisualDSP Blackfin SHARC TigerSHARC and EZ KIT Lite are registered trade marks of Analog Devices Inc All other brand and product names are trademarks or service marks of their respective owners CONTENTS PREFACE Parposeot This Manwal ccicincscisscnniratioaaiamnsieuartieeaiunuanndiniaind xxi Diended a e a xxi me EEE xxii Thats Mew in This Manual deondrorsnnenoineni xxiii Technical or Customer SUpport siesena iaeei xxiv Supp rted PIES caieisccieisciadianisiigndeseadibnnniaueliednlentisiedanaidans X
21. ldr on page A 8 Assembler Object Files doj Assembler output object doj files are in binary executable and linkable file ELF format Object files contain relocatable code and debugging information for a DSP program s memory segments The linker processes object files into an executable dxe file For information on the object file s ELF format see Format References on page A 10 VisualDSP 5 0 Linker and Utilities Manual A 5 Build Files Library Files dlb Library files the archiver s output are in binary executable and linkable file ELF format Library files called archive files in previous software releases contain one or more object files archive elements The linker searches through library files for library members used by the code For information on the ELF format used for executable files refer to Format References on page A 10 Linker Output Files dxe sm and ovl The linker s output files are in binary executable and linkable file ELF format These executable files contain program code and debugging information The linker fully resolves addresses in executable files For information on the ELF format used for executable files see the TIS Com mittee texts cited in Format References on page A 10 The archiver automatically converts legacy input objects from COFF to ELF format Memory Map Files xml The linker can output memory map files that contain
22. 080000 090000 Oxc0000 Oxd0000 0100000 0110000 02140000 0150000 030000000 038000000 040000000 050000000 0x60000000 m7ANANANA Ox1 FSF Ox tiff Dx5ffff DxSffff Oxgffff Oxcffff Dxdffff Ox Offff 0x11ffff Ox 4ffff O11 Stfff Ow37 fFF On Sttefftt On Stfftff OxS3rffttf OxB3tffff Phe EF FFE VisualDSP 5 0 Linker and Utilities Manual 4 11 Input Sections Pane The main menu functions include Sort by Sorts objects by input sections or LDF macros These selections are mutually exclusive Add Adds input sections object library files and LDF macros Appropriate menu selections are grayed out when right clicking on a position area in which you cannot create a corresponding object Create an input section as a shell without object library files or LDF macros in it You can even map this section to an output sec tion However input sections without data are grayed out Delete Deletes the selected object input section object library file or LDF macro Remove Removes an LDF macro from another LDF macro but does not delete the input section mappings that contain the removed macro The difference between Delete and Remove is that Delete completely deletes the input section macros that contain the deleted macro NOTE The Remove option becomes available only if you right click on an LDF macro that is part of another LDF macro Expand All LDF Macros Expands all the LDF macros in the inpu
23. 4 0 or higher xxvi VisualDSP 5 0 Linker and Utilities Manual Preface Technical Library CD The technical library CD contains seminar materials product highlights a selection guide and documentation files of processor manuals Visu alDSP software manuals and hardware tools manuals for the following processor families Blackfin SHARC TigerSsHARC ADSP 218x and ADSP 219x To order the technical library CD go to http www analog com proces sors technical_library navigate to the manuals page for your processor click the request CD check mark and fill out the order form Data sheets which can be downloaded from the Analog Devices Web site change rapidly and therefore are not included on the technical library CD Technical manuals change periodically Check the Web site for the latest manual revisions and associated documentation errata Notation Conventions Text conventions used in this manual are identified and described as follows Additional conventions which apply only to specific chapters may appear throughout this document Example Description Close command Titles in bold style reference sections indicate the location of an item File menu within the VisualDSP environment s menu system for example the Close command appears on the File menu this that Alternative required items in syntax descriptions appear within curly brackets and separated by vertical bars rea
24. 5 0 Linker and Utilities Manual B 7 plinker Library 1ib1 a will be searched only for references encountered in inl o and in2 o It will not be searched again after in3 0 and library lib2 a have been read If either in3 0 or 1ib2 a has refer ences that should be resolved by libl a the 1ib1 a must be specified a second time later in the command line If invoked with no arguments or with h or help the partial linker prints command line information The info switch provides additional details including current anomalies and limitations Tracing of linker actions can be enabled and finely controlled with the t tr and ntr switches B 8 VisualDSP 5 0 Linker and Utilities Manual C LDF PROGRAMMING EXAMPLES FOR TIG ERSHARC PRO C ESSO RS This appendix provides several typical 1df file used with TigerSsHARC processors As you modify these examples refer to the syntax descriptions in LDF Commands on page 3 36 This appendix provides information about the following e Linking a Single Processor System on page C 2 e Linking Large Uninitialized or Zero Initialized Variables on page C 4 e Linking an ADSP TS101 MP Shared Memory System on page C 6 The source code for several programs is bundled with your devel opment software Each program includes an 1df file For working examples of the linking process examine the 1df files t
25. A non deterministic example is an application with calls to overlay functions within an interrupt service routine ISR where the interrupt occurs randomly The example provided by the software contains deterministic overlay function calls The time of overlay function execution requests are known as the number of cycles required to transfer an overlay Therefore an over lay function load request can be placed to complete the transfer by the time the execution request is made The next overlay transfer from a load request can be enabled by the core and the core can execute the instruc tions leading up to the function execution request Since the linker handles all overlay symbol references in the same way jump to PLIT table and then overlay manager the overlay manager must distinguish between a symbol reference requesting the load of an overlay 5 20 VisualDSP 5 0 Linker and Utilities Manual Memory Overlays and Advanced LDF Commands function and a symbol reference requesting the execution of an overlay function In the example the overlay manager uses a buffer in memory as a flag to indicate whether the function call symbol reference is a load or an execute request The overlay manager first determines whether the referenced symbol is in internal memory If not it sets up the DMA transfer If the symbol is not in internal memory and the flag is set for execution the core waits for the transfer to complete if necessary a
26. Declare the start label of each routine and each variable as a global symbol with the assembler s GLOBAL directive This defines the entry point 6 4 VisualDSP 5 0 Linker and Utilities Manual Archiver The following code fragment has a visible entry point for the func tion dIriir and creates a visible symbol for the variable FAE global dlriir section datal byte2 FAE 0x1234 0x4321 section program global FAE dIriir RO N 2 P2 FAE 2 Assemble the files into object files containing the global segments 3 You can also write library functions in C and C Functions declared in your C C file will be given globally visible symbols that can be referenced by other programs Use the C C compiler to create objects files and use the compiler driver and its build 1ib switch to create the library Accessing Archived Functions From Your Code Programs that call a library routine must use the assembler s EXTERN directive to specify the routine s start label as an external label When link ing the program specify one or more library d1b files to the linker along with the names of the object doj files to link The linker then searches the library files to resolve symbols and links the appropriate routines into the executable file Any file containing a label referenced by your program is linked into the executable output file Linking libraries is faster than using individual object files and you
27. If there are no callback executables to be executed the RTL routine immediately starts the process of initializing memory for the primary application 7 6 VisualDSP 5 0 Linker and Utilities Manual Memory Initializer Using the Memory Initializer There are several reasons why it may be beneficial to use the memory initializer e The system needs to initialize RAM memory from data stored in ROM e It is desirable to reduce the overall size of the executable e Initialization executable files need to run to configure the system before the primary application starts If it is decided to use the memory initializer the preparation starts from the linker description file 1df and the source files of the project Preparing the Linker Description File ldf If a section is to be processed by the memory initializer in order to create the initialization stream the section must be marked in the 1df file to indicate the kind of initialization required This is done using initializa tion qualifiers ZERO_INIT and RUNTIME_INIT Sections marked with ZERO_INIT may contain only zero initialized data and sections marked with RUNTIME_INIT may contain the data with any initialization values Refer to the SECTIONS description on page 3 61 for detailed information on these qualifiers The following example shows how to use the ZERO_INIT and RUNTIME_INIT qualifiers in an 1df file to set up the section type my_zero_section Z
28. The callback executable file must exist before the memory initializer is run All the code and data from callback executable files are extracted to make up the initialization stream This is an optional switch 7 16 VisualDSP 5 0 Linker and Utilities Manual Memory Initalizer InputFile dxe The InputFile dxe parameter is used to specify a primary input file The memory initializer issues an error message if no primary input file is specified NoAuto The NoAuto switch directs the memory initializer to not process sections in the primary input file based on the section header flags the section specified as either ZERO_INIT and RUNTIME_INIT qualifier in the 1df file but to only process sections specified on the command line using the section SectionName switch By default the memory initializer automatically processes only the sec tions with ZERO_INIT and RUNTIME_INIT qualifiers in the 1df file This switch has no effect on the code and data of callback executable files spec ified using the init switch All the code and data sections of a callback executable file are processed by the memory initializer regardless whether this switch is used This switch is optional NoErase The NoErase switch directs the memory initializer not to erase the data of the processed sections By default the memory initializer empties the sec tions from which the data are extracted to create the initialization stream This switch is va
29. You may either use the KEEP_SECTIONS command or the ek switch on page 2 57 LINK_AGAINST The LINK_AGAINST command checks specific executables to resolve variables and labels that have not been resolved locally To link programs for multiprocessor systems a LINK_AGAINST command must be present in the 1af file This command is an optional part of the PROCESSOR