I am attempting to assemble the assembly source file below using the following NASM command:nasm -f elf -o test.o test.asmThis completes without errors and I then try to link an executable with ld:ld -m elf_i386 -e main -o test test.o -lcThis also appears to succeed and I then try to run the executable:$ ./testbash: ./test: No such file or directoryUnfortunately, it doesn't seem to work. I tried running ldd on the executable:linux-gate.so.1 =>  (0xf777f000)libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7598000)/usr/lib/libc.so.1 => /lib/ld-linux.so.2 (0xf7780000)I installed the lsb-core package and verified that /lib/ld-linux.so.2 exists. How come I still can't run the executable?I'm attempting to do this on a machine running the 64-bit edition of Ubuntu 15.04.The source code:; This code has been generated by the 7Basic; compiler <http://launchpad.net/7basic>extern printfextern scanfextern readextern strlenextern strcatextern strcpyextern strcmpextern mallocextern free; Initialized data      SECTION .datas_0 db Hello, World!,0printf_i: db %d,10,0printf_s: db %s,10,0printf_f: db %f,10,0scanf_i: db %d,0scanf_f: db %lf,0; Uninitialized data      SECTION .bssv_12 resb 4v_0  resb 4v_4  resb 8      SECTION .text; Codeglobal main  main:finitpush ebpmov ebp,esppush 0pop eaxmov [v_12], eax    l_0:mov eax, [v_12]push eaxpush 5pop edxpop eaxcmp eax, edxjl l_2push 0jmp l_3    l_2:push 1    l_3:pop eaxcmp eax, 0je l_1push s_0push printf_scall printfadd esp, 8mov eax, [v_12]push eaxpush 1pop edxpop eaxadd eax, edxpush eaxpop eaxmov [v_12], eaxjmp l_0    l_1:mov esp,ebppop ebpmov eax,0retHere's the output of strings test:/usr/lib/libc.so.1libc.so.6strcpyprintfstrlenreadmallocstrcatscanfstrcmpfreeGLIBC_2.0t'hxHello, World!.symtab.strtab.shstrtab.interp.hash.dynsym.dynstr.gnu.version.gnu.version_r.rel.plt.text.eh_frame.dynamic.got.plt.data.bsstest.7b.outprintf_iprintf_sprintf_fscanf_iscanf_fv_12_DYNAMIC_GLOBAL_OFFSET_TABLE_strcmp@@GLIBC_2.0read@@GLIBC_2.0printf@@GLIBC_2.0free@@GLIBC_2.0_edatastrcat@@GLIBC_2.0strcpy@@GLIBC_2.0malloc@@GLIBC_2.0scanf@@GLIBC_2.0strlen@@GLIBC_2.0_end__bss_startmain
Unable to run an executable built with NASM
compiling;executable;linker;assembly
You need to also link start up fragments like crt1.o and others if you want to call libc functions.  The linking process can be very complicated, so you'd better use gcc for that.On amd64 Ubuntu, you can:sudo apt-get install gcc-multilibgcc -m32 -o test test.oYou can see files and commands for the link by adding -v option.