I have some NASM files which have a line:
%INCLUDE "bmdev.asm"
The bmdev.asm
file has equ directives such as:
b_print_newline equ 0x0000000000100040
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
The NASM call disassembles to:
callq 0xfffffffffff00040
The goal here is to generate binaries for BareMetal OS via GAS instead of NASM.
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.
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.
A fix has been checked in to the binutils tree.