Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

64 bit linking of an object file

I am developing JNI DLL files in Delphi 7. The resulting files will be 32 bit DLLs, which do not work on a 64bit Java VM.

Delphi 7 has the possibility to generate c or c++ object files. Is it possible to create a 64bit DLL from these object files with a third party linker?

like image 295
vbence Avatar asked Jun 24 '11 10:06

vbence


People also ask

What is object file and linking?

A shared object file holds code and data suitable to be linked in two contexts. First, the link-editor can process it with other relocatable and shared object files to create other object files. Second, the runtime linker combines it with a dynamic executable file and other shared objects to create a process image.

What is object file example?

These files can be loaded into read/write memory, or stored in read-only memory. For example, the Motorola 6800 MIKBUG monitor contains a routine to read an absolute object file (SREC Format) from paper tape. DOS COM files are a more recent example of absolute object files.

What is linking in assembly?

Linking is a process of collecting and maintaining piece of code and data into a single file. Linker also links a particular module into system library. It takes object modules from assembler as input and forms an executable file as output for the loader.

What is a library object file?

Object libraries are collections of related object (. obj) files, such as a set of graphics functions, or the run-time libraries supplied with this compiler. Object libraries are useful for linking them as a single, convenient file, rather than as many separate files.


1 Answers

The Delphi compiler emits 32 bit object code. It doesn't matter how you slice it, that code cannot be linked into a 64 bit module.

At the moment your best bet is to use FreePascal which can produce 64 bit DLLs. There is an upcoming 64 bit version of Delphi but its release date is unknown.

Another option would be to enforce the use of the 32 bit version of the JVM, if that is possible for you.

like image 150
David Heffernan Avatar answered Sep 21 '22 00:09

David Heffernan