This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] Include alloca.h for bfd
Hi Thiemo, Hi Ian,
> In the past I did not permit alloca to be used in BFD, because on
> systems which do not have alloca the version in libiberty would call
> xmalloc, which might cause the program to crash when it ran out of
> memory. I believe that BFD should never crash because it runs out of
> memory; instead, it should return the appropriate error to the caller.
> (That's why I wrote the objalloc interface when obstacks were changed
> to no longer support a failure to allocate memory.) However, I do not
> know what the current thinking is on alloca in BFD.
I agree with your policy. I was unaware of the problems involved with
using alloca, which is why I did not enforce the rule as you used to
do. Now that I am aware of it I will try to enforce it in the future
and also remove the current uses of alloca.
Thiemo - rather than including alloca.h how about changing the code in
linker.c to use objalloc_alloc() instead ?
Cheers
Nick