I am trying to create a pe loader that loads a pe file on windows and linux and links it to internal functions, different on each platform. Thus, making the pe executable cross operating system. The way I compile these special pe files are just like an operating system. I build it using -fno-builtin to prevent it from linking to builtin functions. It links to an import library which should import from a non existent dll. However, when I try to read the imports for the file, my loader can't read it. objdump can't really do it either. My loader can read other files correctly. I have attached the code. Run it on windows.
Thanks
the def file for the importer
Code: Select all
LIBRARY libxpal.dll
EXPORTS
xpaks
Code: Select all
all:libxpal.a
libxpal.a : xpal.def
dlltool --input-def=xpal.def -l libxpal.a
ranlib libxpal.a