1

I have a Linux x86 application built as a shared library(.so) . I see that addresses of global variables and structures in my code are all 48 bit since x86_64 uses 48 bit virtual addresses.

I have certain structures in my code that can only accommodate 40 bits to store an address. It is done this way to align to certain specific requirements.

Having said this, is there any way to limit my application to use 40 bit virtual addresses instead of 48 bit ?

hektor
  • 1,017
  • 3
  • 14
  • 28
  • `.so` is a *shared* (dynamic) library. A static library would be `.a`. – Peter Cordes Jan 29 '20 at 05:45
  • AFAIK, there's no way to limit to 40-bit, other than limiting to 32-bit (in 64-bit mode) with `mmap(MAP_32BIT)` for dynamic allocations, or using [the x32 ABI](https://en.wikipedia.org/wiki/X32_ABI) to make sure everything is 32-bit. – Peter Cordes Jan 29 '20 at 05:46

0 Answers0