开发者

SDL and nasm on 64bits linux

开发者 https://www.devze.com 2023-02-03 20:28 出处:网络
I am having trouble with nasm and ld here is what I do: source: EXTERN SDL_Init SECTION .text global _start

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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号