whi*_*ger 4 assembly x86-64 gnu-assembler
嗨,我有以下汇编代码,
.export __ls__11NSDOM_EncapFf
.text
__ls__11NSDOM_EncapFf:
/* first load the symbolic constant*/
movq _IEEE_FP@GOTPCREL(%rip), %r8 /*%r8 is a scratch register*/
movq (%r8), %r9 /* %r9 and %r11 are scratch registers*/
movl (%r9), %r11d
/* second, see if it is zero and branch accordingly */
test %r11d, %r11d /* zero call TNS procedure */
/* non-zero call IEEE procedure */
je ____ls__11NSDOM_EncapFf_tns/* constant equals 0 */
jmp ____ls__11NSDOM_EncapFf_ieee/* constant not equal to 0 */
ret
Run Code Online (Sandbox Code Playgroud)
我将 .s 文件编译为 .o 文件(编译很好),但是当我将此 .o 与其他 .o 文件链接时,由于未解析对 _ ls _11NSDOM_EncapFf 的引用而失败。我在 HP Non stop 系统、X86-64 位架构上使用 GNU 汇编程序 2.19.1。请帮我解决这个问题。
您需要将您的符号设置为全局,以使其可外部链接;
.text
.global __ls__11NSDOM_EncapFf /* Sets the symbol externally linkable */
__ls__11NSDOM_EncapFf:
/* first load the symbolic constant*/
...
Run Code Online (Sandbox Code Playgroud)