I don't get the meaning of a RVA export but I know that Pelles-C linker supports what I'm asking for. What I want is to eliminate the naming restrictions and name the export and the target anything I want to. Let's say I don't want to use _snprintf in the default library, I want to use the one in NTDLL instead so I write this code:
#include <stdio.h>
int __declspec(dllimport) __cdecl frobozz_snprintf(char *szDest,unsigned cchDest,char *szFormat,...);
int main(int argc,char *argv[]) {
char str[64];
frobozz_snprintf(str,sizeof(str),"Kingdom of Frobozz");
printf("Result=%s\n",str);
return 0;
}
I can map frobozz_snprintf to a snprintf of my choosing without some meddling librarian telling me what I should and shouldn't do:
#Compile with c:\WATCOM\binnt\wlib.exe -q -b -n -ic FROBOZZ-WC.LIB @FROBOZZ-WC.TXT
++_snprintf.NTDLL.._frobozz_snprintf
Microsoft tools require that the function be named _snprintf which conflicts with other DLL's and the default libraries. Why must I go to the "other brand" to accomplish something this simple?
The IMPORTS section in the DEF file was able to do this easily but support for IMPORTS only persists in DMC and just barely in BC.
What I want is for POLIB to add a switch "-LeaveMyExportsExactlyAsTheyAre" switch and let me produce libs just as it's specified in the help. Being Microsoft compatible is bad when what Microsoft does is wrong.
Here's the complete project so you can see how it works with no effort.