Linux/64-bit /LARGEADDRESSAWARE equivalent

2.3k Views Asked by At

Windows enables you to restrict address-space usage to a 32-bit resolution by setting a flag in the PE header (/LARGEADDRESSAWARE). To elaborate: When set, this flag effectively emulates a 32-bit virtual address space environment (image is loaded at/allocations return- addresses <= 0xFFFFFFFF)

Does Linux have an equivalent feature?

2

There are 2 best solutions below

2
On BEST ANSWER

Allocating memory in 32-bit space on x86-64 can be done by performing mmap(2) with the MAP_32BIT flag.

1
On

/LARGEADDRESSAWARE allows an extended address space from 2 to 4 gigabytes for 32-bit Windows applications. Otherwise, a 32-bit application on Windows cannot reach those addresses. Linux from early on could reach them, so a /LARGEADRSSAWARE link flag is not needed.