This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
as.exe: out of memory allocating 4294967280 bytes
- From: "Simonov, Vladimir" <Vladimir dot Simonov at acronis dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Fri, 26 Oct 2012 18:13:53 +0000
- Subject: as.exe: out of memory allocating 4294967280 bytes
Hi all,
I'm using host == build == mingw64, target x86_64-unknown-linux-gnu.
e:/cygwin/opt/crosstool64/x86_64-unknown-linux-gnu/gcc-4.7.2-glibc-2.16.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../x86_64-unknown-linux-gnu/bin/as.exe --gdwarf2 --64 -v -o msgstub.obj msgstub.s
GNU assembler version 2.23 (x86_64-unknown-linux-gnu) using BFD version (GNU Binutils) 2.23
e:\cygwin\opt\crosstool64\x86_64-unknown-linux-gnu\gcc-4.7.2-glibc-2.16.0\x86_64-unknown-linux-gnu\bin\as.exe: out of memory allocating 4294967280 bytes
IMO the problem is in gas\sb.c
static void
sb_check (sb *ptr, size_t len)
...
#if GCC_VERSION >= 3004
max = (size_t) 1 << (CHAR_BIT * sizeof (want) - __builtin_clzl (want));
#else
...
"want" size_t type which is 64-bit. Replace __builtin_clzl with __builtin_clzll fixes the problem.
CVS head has the same code. I'm not sure either it my cross tools mis-configuration or real bug in as.
If the second, it is strange - the code was committed 4 months ago...
Thank you
Vladimir Simonov