NASM来气:调用equ'd符号 [英] NASM to GAS: Calling equ'd symbols

查看:470
本文介绍了NASM来气:调用equ'd符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有有一些行NASM文件:

I have some NASM files which have a line:

%INCLUDE "bmdev.asm"

bmdev.asm 文件有EQU指令,例如:

The bmdev.asm file has equ directives such as:

b_print_newline         equ 0x0000000000100040

其中包括文件​​ bmdev.asm 然后便可以调用这些项目。即。

The files which include bmdev.asm then are able to call those items. I.e.

call b_print_newline

有没有办法将其转换为气体?当我尝试做的直接翻译,即

Is there a way to convert this to GAS? When I try to do the direct translation, i.e.

.set b_print_newline , 0x100040

call b_print_string

它似乎没有拆机正确的事情:

it doesn't appear to disassemble to the right thing:

callq  *0x100040

在NASM调用反汇编为:

The NASM call disassembles to:

callq  0xfffffffffff00040

这里的目标是产生通过燃气代替NASM BareMetal OS 二进制文件。

该工程的二进制文件的全拆装:

The full disassembly of the binary which works:

$ objdump -D -b binary -m i386:x86-64 test-nl.app 

test-nl.app:     file format binary


Disassembly of section .data:

0000000000000000 <.data>:
   0:   e8 3b 00 f0 ff          callq  0xfffffffffff00040
   5:   c3                      retq   

二进制的全拆装不工作:

The full disassembly of the binary which doesn't work:

$ objdump -D -b binary -m i386:x86-64 test-nl-a.app 

test-nl-a.app:     file format binary


Disassembly of section .data:

0000000000000000 <.data>:
   0:   ff 14 25 40 00 10 00    callq  *0x100040
   7:   c3                      retq   

我已经张贴了这个问题的(希望)更清晰的版本。关闭这一个。

I've posted a (hopefully) clearer version of this question. Closing this one.

推荐答案

我带来了binutils的邮件列表在这个问题上了。这似乎是一个错误。 有人建议我发送错误报告和的我已经这样做

I brought this issue up on the binutils mailing list. It appears to be a bug. It was suggested that I file a bug report and I've done so.

一个修复一直到binutils的树检查。

A fix has been checked in to the binutils tree.

这篇关于NASM来气:调用equ'd符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆