问题描述:假定为a.lib和b.lib,a.lib没有源代码,b.lib有源代码。应用时,需要将a.lib和b.lib合并为一个库文件,方便管理和调用。其正确的合并步骤为:
合并步骤:
- 通过b.lib的源代码,可以(通过CCS等)生成若干obj文件,假设为d.obj,e.obj,f.obj。
- ar6x –xt a.lib – 解压a.lib, 其中的obj文件会解压到当前的目录中,假设解压出来的文件有g.obj,h.obj。
- ar6x –at c.lib d.obj e.obj f.obj g.obj h.obj --将组成b.lib的所有obj文件和组成a.lib的所有obj文件压缩为一个名为c.lib的库文件。
[Note]
根据编译器(compiler)版本,从TI官网上下载对应版本文档。假设此版本为v7.4
则可参考文档: TMS320C6000 Assembly Language Tools v7.4 User’s Guide 第6章Archiver Description
http://www.ti.com/lit/ug/spru186w/spru186w.pdf
ar6x -h
TMS320C6000 Archiver v7.5.0I12333 (TI INTERNAL - Nov 28 2012)
Tools Copyright (c) 1996-2012 Texas Instruments Incorporated
Syntax : ar6x [arxdt][quvsh][012] archive files ...
ar6x @command_file
Commands : (only one may be selected)
a - Add file r - Replace file
x - Extract file d - Delete file
t - Print table of contents
Options :
q - Quiet mode - Normal status messages suppressed
u - Update with newer files (use with 'r' command)
s - Print symbol table contents
v - Verbose
h - This help
Output format options:
0 - Original AR format
1 - TI long-name format (obsolescent)
2 - POSIX format (default for newly created files)