0

I have a library that compiled in 64 bit and aligned to it.

The problem is that this library should work with 32 bit processes as well (now it will link only with 64 bit processes) and should be aligned to 32 bit as well.

is there a way to make it be aligned to both 32 and 64 bit?

user1120875
  • 21
  • 1
  • 3

2 Answers2

2

Basically no, not without a recompile.

A DLL compiled in 64-bit uses CPU features (extra instructions/extra registers/...) available in 64-bit mode only, which means a CPU in 32-bit mode cannot execute the code.

Joachim Isaksson
  • 176,943
  • 25
  • 281
  • 294
1

There is something called FatELF... But I don't know how much far it went. Basically in an executable/library you put multiple versions of the program (one for 32 bits, one for 64 bits, one for Arm, ...) (the "technique" is called Fat binary)

Sadly I think it's dead... The last commit to their repository is Thu, 22 Nov 2012 12:39:53 -0500...

xanatos
  • 109,618
  • 12
  • 197
  • 280