This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
reserving memory below 16MB
- From: "R. Matthew Emerson" <rme at clozure dot com>
- To: binutils at sourceware dot org
- Date: Mon, 5 Oct 2009 20:29:50 -0400
- Subject: reserving memory below 16MB
On 32-bit x86 systems, I would like to ensure that no dynamically
allocated block of memory (obtained via malloc or mmap) will start
below 2^24 (16 MB). See [1] below for why I want to do this.
I wonder if there is some way (assembler directives, linker commands)
that I could do this. That is, is there a way to say "make the text
section 16MB long" or some other way to say "take up the rest of the
space below 16MB."
If I have to use a custom linker script, then I suppose I must, but
I'm a little worried that would make it harder to compile the program
on different Linux distributions with potentially different library
search paths.
I would be grateful for any suggestions.
[1] This is for a Common Lisp compiler and runtime. If I can
guarantee that lisp objects will never be found below 16MB, then the
garbage collector will know that any value less than 2^24 is just some
unboxed value. This would allow me to store such values in registers
that are treated as gc roots---this would be helpful on 32-bit x86
systems, where registers are scarce.