surenyi
6 years ago
9 changed files with 149 additions and 17 deletions
@ -0,0 +1,111 @@ |
|||||
|
%%{ |
||||
|
/* |
||||
|
* Copyright (c) 2008 Texas Instruments and others. |
||||
|
* All rights reserved. This program and the accompanying materials |
||||
|
* are made available under the terms of the Eclipse Public License v1.0 |
||||
|
* which accompanies this distribution, and is available at |
||||
|
* http://www.eclipse.org/legal/epl-v10.html |
||||
|
* |
||||
|
* Contributors: |
||||
|
* Texas Instruments - initial implementation |
||||
|
* |
||||
|
* */ |
||||
|
%%} |
||||
|
%/* |
||||
|
% * ======== linkcmd.xdt ======== |
||||
|
% * This is template file is used to generate a linker command file for |
||||
|
% * executables. It provides a single place where we can embed information |
||||
|
% * necessary to load/run executables. |
||||
|
% * |
||||
|
% * This template is expanded after the configuration script runs and the |
||||
|
% * results placed in a file (with extension .xdl) associated with the |
||||
|
% * executable. |
||||
|
% * |
||||
|
% * Linker templates are passed the following arguments: |
||||
|
% * $out - an open file stream for the generated linker |
||||
|
% * command file |
||||
|
% * $args[] - an array of zero or more libraries that should be linked |
||||
|
% * with (in the order they appear in the argument list) |
||||
|
% * |
||||
|
% * In addition to these arguments, there is a global variable named |
||||
|
% * 'this' that is set as follows: |
||||
|
% * this - the program object |
||||
|
% */ |
||||
|
%var _utils = xdc.loadCapsule("ti/targets/linkUtils.xs"); |
||||
|
%var prog = this; /* meaningful alias for this (== xdc.cfg.Program) */ |
||||
|
/* |
||||
|
* Do not modify this file; it is automatically generated from the template |
||||
|
* linkcmd.xdt in the ti.targets.elf package and will be overwritten. |
||||
|
*/ |
||||
|
|
||||
|
/* |
||||
|
* put '"'s around paths because, without this, the linker |
||||
|
* considers '-' as minus operator, not a file name character. |
||||
|
*/ |
||||
|
|
||||
|
--diag_suppress=10068 |
||||
|
%for (var i = 0; i < prog.$$asmvec.length; i++) { |
||||
|
"`prog.$$asmvec[i]`" |
||||
|
%} |
||||
|
|
||||
|
%for (var i = 0; i < $args.length; i++) { |
||||
|
-l"`$args[i]`" |
||||
|
%} |
||||
|
|
||||
|
--retain="*(xdc.meta)" |
||||
|
--retain="*(.c66x_driver)" |
||||
|
|
||||
|
%if (prog.$$isasm) { |
||||
|
% return; |
||||
|
%} |
||||
|
|
||||
|
--args `utils.toHex(prog.argSize)` |
||||
|
-heap `utils.toHex(prog.heap)` |
||||
|
-stack `utils.toHex(prog.stack)` |
||||
|
%if (prog.build.target.isa[0] == "5" && prog.build.target.isa[1] != '4') { |
||||
|
-sysstack `utils.toHex(prog.sysStack)` |
||||
|
%} |
||||
|
|
||||
|
MEMORY |
||||
|
{ |
||||
|
%for (var i = 0; i < prog.cpu.memoryMap.length; i++) { |
||||
|
%var mem = prog.cpu.memoryMap[i]; |
||||
|
%var page = (mem.page != null) ? ("PAGE " + mem.page + ": ") : ""; |
||||
|
%var org = utils.toHex(mem.base); |
||||
|
%var len = utils.toHex(mem.len); |
||||
|
%var access = (mem.access != null) ? (" (" + mem.access + ")") : ""; |
||||
|
`page``mem.name``access` : org = `org`, len = `len` |
||||
|
%} |
||||
|
} |
||||
|
|
||||
|
/* |
||||
|
* Linker command file contributions from all loaded packages: |
||||
|
*/ |
||||
|
`_utils.genContributions($args)` |
||||
|
|
||||
|
/* |
||||
|
* symbolic aliases for static instance objects |
||||
|
*/ |
||||
|
%for (var sym in Program.symbol) { |
||||
|
%var inst = Program.symbol[sym]; |
||||
|
%if (typeof(inst) == 'number') { |
||||
|
`this.build.target.asmName(sym)` = `inst`; |
||||
|
%} |
||||
|
%else { |
||||
|
%var objTab = inst.$module.$name.replace(/\./g, '_') + '_Object__table__V'; |
||||
|
%var off = Program.$capsule.instSize(inst) * inst.$index; |
||||
|
`this.build.target.asmName(sym)` = `this.build.target.asmName(objTab)` + `off`; |
||||
|
%} |
||||
|
%} |
||||
|
|
||||
|
SECTIONS |
||||
|
{ |
||||
|
`xdc.loadCapsule("ti/targets/elf/linkUtils.xs").genElfSections(prog)` |
||||
|
} |
||||
|
%%{ |
||||
|
/* |
||||
|
* @(#) ti.targets.elf; 1, 0, 0,373; 11-4-2012 21:21:33; /db/ztree/library/trees/xdctargets/xdctargets-f40x/src/ xlibrary |
||||
|
|
||||
|
*/ |
||||
|
|
||||
|
%%} |
@ -0,0 +1,9 @@ |
|||||
|
% // this = Program, args[0] = sectMap |
||||
|
%var sectMap = $args[0]; |
||||
|
%var stack = sectMap[".stack"]; |
||||
|
`$args[1]` |
||||
|
.c66x_drivers: fill=0x0, align = 0x4 { |
||||
|
__c66x_drivers_begin = .; |
||||
|
*(.c66x_driver) |
||||
|
__c66x_drivers_end = .; |
||||
|
} > `stack.loadSegment` |
Loading…
Reference in new issue