Skip to content

Commit

Permalink
plt: mask flags instead of shifting
Browse files Browse the repository at this point in the history
Otherwise we get a mess because dosemu2 adds its own flags
in an unshifted manner. Also this will help to use the currently
reserved flags easier.
  • Loading branch information
stsp committed Feb 4, 2025
1 parent 4b91cea commit e0b68a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/djdev64/djdev64.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ static void *emu_dlmopen(int handle, const char *filename, int flags,
return NULL;
}

#define FLG_STATIC 1
#define FLG_STATIC 0x40

static int _djdev64_open(const char *path, const struct dj64_api *api,
int api_ver, unsigned flags)
Expand Down
4 changes: 1 addition & 3 deletions src/libc/dj64/plt.S
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ SHM_EXCL = 2
SHM_NEW_NS = 4
SHM_NS = 8
SHM_FLG_MASK = (SHM_NOEXEC | SHM_EXCL | SHM_NEW_NS | SHM_NS)
/* leave bits 4 and 5 reserved */
OPEN_FLG_SHIFT = 6

.data

Expand Down Expand Up @@ -176,7 +174,7 @@ plt_init:
movw shm_block + SHM_HANDLE, %di
movw shm_block + SHM_HANDLE + 2, %si
movzbl %fs:STUBINFO_FLAGS, %ecx
shrl $OPEN_FLG_SHIFT, %ecx
andl $~SHM_FLG_MASK, %ecx
lcalll *__plt_open
jc 2f
movl %eax, __plt_handle
Expand Down

0 comments on commit e0b68a8

Please sign in to comment.