From: Ian Lance Taylor <ian@airs.com>
To: hillman_97@yahoo.com
Cc: binutils@sourceware.cygnus.com
Subject: Re: binutils 2.9.1 gas problem (growing frags)
Date: Thu, 01 Jul 1999 00:00:00 -0000 [thread overview]
Message-ID: <19990610185655.6055.qmail@daffy.airs.com> (raw)
In-Reply-To: <19990610184019.22715.rocketmail@web113.yahoomail.com>
Date: Thu, 10 Jun 1999 11:40:19 -0700 (PDT)
From: Vaughan Hillman <hillman_97@yahoo.com>
It appears that the assembler is reading in the stab
entries from file.s and putting them into an obstack.
Initially it allocates a frag with 4096 bytes to
start off with. When line 184 of file.s is read in
the function frag_grow() is called to see if this line
can be read into the current frag. frag_grow is told
to grow by 91 bytes. The current obstack has 88 bytes
free (chunk_limit-next_free). frag_new() goes and
takes care of the allocation by calling frag_alloc().
Here obstack_alloc() is called. It goes and
allocates a frag for the stack. Since obstack_alloc
is told to allocate SIZEOF_STRUCT_FRAG (which happens
to be 84 bytes) bytes, obstack_blank returns saying
that there was enough space for the 84 bytes (as we
have 88 bytes free) and adds in the new frag header
leaving 4 bytes. We return to frag_grow() having not
allocated a larger frag and the code calls frag_new()
again. This time obstack_blank() allows
_obstack_newchunk() to be called since we are asking
for 84 bytes and have 4 bytes free.
It returns with 168 bytes and the 84 byte header is
taken out again leaving us with 84 bytes. The code in
frag_grow then exits saying that it was unsucessfull
at getting any more memory added to the obstack.
I think this problem has been fixed since the 2.9.1 release. Look at
the current version of frag_grow in frags.c.
If you can't get CVS to work for you, use the cvsweb interface. For
example, the current frags.c can be seen at
http://sourceware.cygnus.com/cgi-bin/cvsweb.cgi/binutils/gas/frags.c?rev=1.1.1.1 &content-type=text/x-cvsweb-markup&cvsroot=binutils
Ian
prev parent reply other threads:[~1999-07-01 0:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-07-01 0:00 Vaughan Hillman
1999-07-01 0:00 ` Ian Lance Taylor [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=19990610185655.6055.qmail@daffy.airs.com \
--to=ian@airs.com \
--cc=binutils@sourceware.cygnus.com \
--cc=hillman_97@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).