maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   NASM for Maemo - What Object File Format? (https://talk.maemo.org/showthread.php?t=17298)

OSEmuTech 2008-02-27 22:35

NASM for Maemo - What Object File Format?
 
I was excited that the latest Netwide Assembler source was able to build in Scratchbox and then when nasm assembled a source file on my N800.

But when I went to link the file using ld I realized I was probably not thinking ahead: Nasm can only assemble to the following object code, while ld is expecting some other format (armel)?

bin flat-form binary files (e.g. DOS .COM, .SYS)
aout Linux a.out object files
aoutb NetBSD/FreeBSD a.out object files
coff COFF (i386) object files (e.g. DJGPP for DOS)
elf32 ELF32 (i386) object files (e.g. Linux)
elf ELF (short name for ELF32)
elf64 ELF64 (x86_64) object files (e.g. Linux)
as86 Linux as86 (bin86 version 0.3) object files
obj MS-DOS 16-bit/32-bit OMF object files
win32 Microsoft Win32 (i386) object files
win64 Microsoft Win64 (x86-64) object files
rdf Relocatable Dynamic Object File Format v2.0
ieee IEEE-695 (LADsoft variant) object file format
macho NeXTstep/OpenStep/Rhapsody/Darwin/MacOS X object files

OSEmuTech 2008-02-28 00:06

Re: NASM for Maemo - What Object File Format?
 
Hum. I looked at the help output of ld. A small flat binary file format might work, but Nasm doesn't output the other file formats.

ld: supported targets: elf32-littlearm elf32-bigarm elf32-little elf32-big srec symbolsrec tekhex binary ihex
ld: supported emulations: armelf_linux_eabi

Duncan 2008-02-28 18:14

Re: NASM for Maemo - What Object File Format?
 
The documentation for NASM says it targets x86 processors so even if it runs on an ARM processor the code it outputs won't.

OSEmuTech 2008-02-28 23:18

Re: NASM for Maemo - What Object File Format?
 
That's true. I wasn't thinking things out. Thank you.

I did a -S output of a C source file using gcc last night and saw that the (g)as code generated was for ARM of course. So besides the AT&T syntax, I would need to learn ARM directives, opcodes, etc. to develop using assembly on the NIT.


All times are GMT. The time now is 06:47.

vBulletin® Version 3.8.8