I am having trouble with nasm and ld here is what I do:
source:
EXTERN SDL_Init
SECTION .text
global _start
_start:
push 0x20
call SDL_Init
mov eax, 1
mov ebx, 0
int 0x80
compile:
nasm -f elf64 sdlini.asm
link:
ld -dynamic-linker /lib/ld-linux.so.2 -lSDL sdlini.o -o sdlini.exe
and here is what I get when I ru开发者_如何转开发n sdlini.exe
bash: ./sdlini.exe: Accessing a corrupted shared library
Any ideas what is happening here?
fixed it with this
ld -dynamic-linker /lib/ld-linux-x86-64.so.2 -lSDL sdlini.o -o sdlini.exe
精彩评论