This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] Include alloca.h for bfd


Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de> writes:

> Ian Lance Taylor wrote:
> > Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de> writes:
> > 
> > > this checks for inclusion of alloca.h, which is required on IRIX6.5
> > > to compile e.g. linker.c.
> > 
> > This patch is incorrect.  Any declaration of alloca or inclusions of
> > alloca.h must be done as in gas/as.h.
> 
> Uh, that's a really ugly piece of code.

It's a really ugly problem.

Your suggested patch would have broken the build on a few systems
which have alloca.h when using gcc to compile.

> > 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.
> 
> Well, alloca() is called in BFD:

Yes, I know.  Those were all added since I was the chief maintainer.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]