Skip to content

Commit

Permalink
move plt.S to dj64dev
Browse files Browse the repository at this point in the history
  • Loading branch information
stsp committed Mar 24, 2024
1 parent 7938125 commit b0b2172
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 56 deletions.
3 changes: 2 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ LINK_OPT = $(shell pkg-config --libs dj64) -shared -Wl,-Bsymbolic \
-Wl,-rpath=/usr/local/i386-pc-dj64/lib64 \
-Wl,-rpath=/usr/i386-pc-dj64/lib64
DOSLDFLAGS = --whole-archive $(shell pkg-config --static --libs dj64static)
CPPFLAGS = -I. $(shell pkg-config --cflags dj64)
SRCS = command.c cmdbuf.c ms.c env.c psp.c umb.c ae0x.c compl.c \
version.c thunks_a.c thunks_c.c
OBJS = $(SRCS:.c=.o)
Expand Down Expand Up @@ -89,7 +90,7 @@ plt.o: plt.asm
$(HOST_AS) -o $@

plt.asm: $(srcdir)/plt.S plt.inc $(SRC)/glob_asm.h
$(CPP) -I . -P $< >$@ || ($(RM) $@ ; false)
$(CPP) $(CPPFLAGS) -P $< >$@ || ($(RM) $@ ; false)

thunks_c.o: thunk_calls.h

Expand Down
56 changes: 1 addition & 55 deletions src/plt.S
Original file line number Diff line number Diff line change
@@ -1,55 +1 @@
/*
* comcom64 - 64bit command.com
* Copyright (C) 2023-2024 @stsp
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

.text

.macro asmcfunc_n nm,num
.global _\nm
_\nm:
push %ebp
mov %esp, %ebp
pushal
mov $\num, %ecx
mov %esp, %edx
call dj64_plt_call
popal
pop %ebp
ret
.endm

#include "plt.inc"

.macro asmsym nm
.long _\nm
.endm

#define __ASM(t, n) asmsym n
#define __ASM_FAR(t, n) asmsym n
#define __ASM_NEAR(t, n) asmsym n
#define __ASM_ARR(t, n, l) asmsym n
#define __ASM_ARRI(t, n) asmsym n
#define __ASM_ARRI_F(t, n) asmsym n
#define __ASM_FUNC(n) asmsym n
#define SEMIC
__asm_symtab_start:
#include <glob_asm.h>
__asm_symtab_end:

#ifdef __ELF__
.section .note.GNU-stack,"",%progbits
#endif
#include <dj64/plt.S.inc>

0 comments on commit b0b2172

Please sign in to comment.