OSDN Git Service

I hit a random failure in elf2flt (not elf2flt's fault, I was screwing with
authorDavid McCullough <davidm@snapgear.com>
Thu, 21 Feb 2008 01:09:05 +0000 (01:09 +0000)
committerDavid McCullough <davidm@snapgear.com>
Thu, 21 Feb 2008 01:09:05 +0000 (01:09 +0000)
commit29ba55b4e6ac0ceb6f96fbc967863eb6b72ff05b
treeab10e352bb93a735fba2f46a9408130aa0d9b393
parent6943182cb4dd22b0b3a5cede43b39c0886031370
I hit a random failure in elf2flt (not elf2flt's fault, I was screwing with
ELFs and LMAs/VMAs), but the resulting error message was useless:
malloc: Cannot allocate memory

Since I was executing `...-gcc` at the time, where exactly this error message
was coming from was hard to say.  So instead of using malloc() and then doing
a simple 'perror("malloc"); exit(1);' in the elf2flt.c code, it'd be better
for everyone if we used the xmalloc() funcs from libiberty.  We're already
linking elf2flt against libiberty, so there's no extra headers/libs to link
against.

Now the crash looks like:
bfin-uclinux-elf2flt: out of memory allocating 4221960244 bytes after a total of
 135168 bytes
So much nicer! :)

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
elf2flt.c