Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Tux

the asm version in linux needs some patching !

Recommended Posts

Posted (edited)

For me at least, the data segment suddenly stopped being executable, which crashed all the asm in raine. That's with the latest binutils update, 2.35, it's very likely related even if I didn't find any info about it.

You won't see any problem as long as you don't recompile the code with a linker from this 2.35 binutils release, so the released binaries will be ok. For the new ones, I just committed a patch to git, it was easier to make than what I had feared, just call mprotect on the data segment of 1 of these functions, and since all the asm functions are grouped in the same segment by the linker, there is just 1 mprotect call to make. It's very linux specific, but afaik no other os did that, except osx, but I don't care about osx anymore, and this patching wouldn't work in osx (unless they have /proc/pid/mappings, which I doubt !).

It took me a big part of the day to find this, I just wanted to test something else this morning and stumbled on this... it was a bad day starting ! Anyway, back to normal now !

Oh, by the way this new linker also emits some warnings about relocations, but they are just harmless warnings, so they will stay for now. I patched only 1 function with the problem because that makes it shorter and more readable, it's the contrary for all the other functions, so they will stay as they are for now !

Warning looks like that :

/usr/bin/ld: linux-gnu-sdl/objectd/68000/s68000.o: warning: relocation in read-only section `.text'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE

Edited by Tux

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...