Microsoft says :The short answer is : there are bugs in your code.
Stack-maintenance responsibility : Calling function pops the arguments from the stack.
In a __cdecl call to external assembly code, do I need to pop values by myself ?
Microsoft says :The short answer is : there are bugs in your code.
The linker hasn't run yet. When you link it into the final binary the jump should point to the correct address.devc1 wrote:Intermediate object files.
Perhaps you should implement memset so the reference can be resolved. I don't know anything about Microsoft's compiler, but GCC and Clang require you to provide memset, memcpy, memove, and memcmp.devc1 wrote:I also disable intrinsics, because enabling them and removing my functions makes some : "unresolved reference to symbol : memset"
Maybe disabling intrinsics is the reason ?
Microsoft's compiler silently ignores __cdecl when compiling x64 code. You need to follow the appropriate ABI for your compiler.devc1 wrote:Microsoft says :
Stack-maintenance responsibility : Calling function pops the arguments from the stack.
In a __cdecl call to external assembly code, do I need to pop values by myself ?
Code: Select all
if(ExtensionLevel == EXTENSION_LEVEL_SSE) {
while(1);
return _SSE_ComputeBezier(...);
}
Code: Select all
else if(ExtensionLevel == EXTENSION_LEVEL_AVX) {
return _AVX_ComputeBezier(beta, NumCordinates, percent);
}
Huh? I don't understand, why would you need to wait for anything?devc1 wrote:I am too lazy to wait for WSL each time, I just don't really like the idea from the start.
Agreed; a bad workman and all that.AndrewAPrice wrote:Every time something broke from changing optimization options, it ended up being something wrong with my code or linker scripts and never the compiler.
kernel.dll in Windows really isn't the kernel at all. It's just an interface DLL in userspace that interface the kernel. I don't think Windows support DLLs in kernel space, but I could be wrong.devc1 wrote:I follow the calling convention of Microsoft, it's fine.
I've chosen MSVC to generate PE images instead of ELF, and be able to use DLLs and relocate easily. I've stolen the concept of my kernel being a DLL (like Windows ntoskrnl.exe) and linking it using oskrnlx64.lib (my krnl). The kernel detects it, reads it's own export table and sets the relative address of the imported symbols for the driver. In the past I had a huge table containing the addresses of the functions, in each new function I need to manually append the name and the address to that table.
Of course, Linux achieves the same thing at the syscall level, by simply only ever appending to the syscall table. No dynamic linking required. Only one architecture ever experienced an update to the syscall mechanism, and the update remains optional to this day, you just get worse performance.devc1 wrote:What a DLL has to do with system calls ?
A DLL (Dynamic link library) is just like the static library you link to your programs using ld. But the dynamic library does not get linked on compile time, it gets linked by the OS in runtime.
How is that beneficial ? Well this solves a lot of problems, for example security updates or syscalls and other changes in the kernel will make other apps unusable. Instead of recompiling all the apps, I can just edit and recompile the DLL on My new OS version and every app will just work fine as previous.
Notice how the NT Kernel changes its tables, system calls and functions in almost each version. Without that, applications will become unusable on the new version.
Does any OS use system calls for a (user process) malloc? Other than extending heap space, if it runs out, why would you need a system call for this?devc1 wrote:for e.g. instead of a syscall at every malloc, the DLL will contain the tables (at an isolated area) and if it needs more pages then it will syscall.