TI C2800 DSP:排除 C++ 之间的链接器问题和汇编代码

发布于 2024-08-15 20:16:48 字数 697 浏览 2 评论 0原文

我在汇编文件 sincos_p5sh.asm 中有一个函数 sincos_Q15_asm() ,其指令如下:

.sect   ".text"
.global _sincos_Q15_asm
.sym    _sincos_Q15_asm,_sincos_Q15_asm, 36, 2, 0
.func   1

当我单独测试它时(仅汇编),该函数工作正常,但是当我尝试链接到它时,我收到链接器错误:

undefined                   first referenced
symbol                         in file
---------                   ----------------
sincos_Q15_asm(int, int *) build\pwm3phase.obj

error: unresolved symbols remain

这对我来说非常令人困惑,因为我在链接器命令中包含了组装文件 build\blocks\sincos_p5sh.obj ,并且我使用了绝对列表器 abs2000 在此 obj 文件上,它显示有一个符号 _sincos_Q15_asm。 (下划线前缀是它在装配中的工作原理)

有什么建议我接下来应该排除故障吗?

I have a function sincos_Q15_asm() in assembly, in file sincos_p5sh.asm with directives as follows:

.sect   ".text"
.global _sincos_Q15_asm
.sym    _sincos_Q15_asm,_sincos_Q15_asm, 36, 2, 0
.func   1

The function works fine when I test it by itself (assembly only), but when I try to link to it, I get a linker error:

undefined                   first referenced
symbol                         in file
---------                   ----------------
sincos_Q15_asm(int, int *) build\pwm3phase.obj

error: unresolved symbols remain

This is very puzzling to me, as I am including the assembled file build\blocks\sincos_p5sh.obj in my linker command, and I've used the absolute lister abs2000 on this obj file and it says there is a symbol _sincos_Q15_asm. (the underscore prefix is how it works for assembly)

Any suggestions what I should troubleshoot next?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我的痛♀有谁懂 2024-08-22 20:16:49

噢!我发现了——我使用的是 C++,但忘记为我的函数包含 extern "C" 声明:

extern "C" {
extern void sincos_Q15_asm(int16_t theta, int16_t* cs);
}

D'oh! I figured it out -- I was using C++ and forgot to include the extern "C" declaration for my function:

extern "C" {
extern void sincos_Q15_asm(int16_t theta, int16_t* cs);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文