This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: gas alpha-linux segfault with .prologue outside .ent
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Luke Deller <luked at cse dot unsw dot EDU dot AU>
- Cc: bug-gnu-utils at gnu dot org, binutils at sources dot redhat dot com
- Date: Tue, 19 Nov 2002 18:03:20 +1030
- Subject: Re: gas alpha-linux segfault with .prologue outside .ent
- References: <20021118060716.GE997@bubble.sa.bigpond.net.au> <Pine.LNX.4.44.0211190332180.23100-200000@wagner.orchestra.cse.unsw.EDU.AU>
On Tue, Nov 19, 2002 at 03:35:40AM +1100, Luke Deller wrote:
> On Mon, 18 Nov 2002, Alan Modra wrote:
> > True. Care to submit a patch?
>
> Sure. Here's a little patch which adds the error check to this function.
> The patch is against binutils-2.13.1 .
Thanks. In the interests of training another binutils contributor
(hopefully), here's what I actually applied, and how to present
patches. Note: ChangeLog entry as plain text (ie. not a diff),
diff using -up or -cp, preferably against mainline CVS, formatting!
See http://www.gnu.org/prep/standards_toc.html
gas/ChangeLog
* config/tc-alpha.c (s_alpha_prologue): as_bad when sym is NULL.
Index: gas/config/tc-alpha.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-alpha.c,v
retrieving revision 1.49
diff -u -p -r1.49 tc-alpha.c
--- gas/config/tc-alpha.c 7 Nov 2002 00:42:18 -0000 1.49
+++ gas/config/tc-alpha.c 19 Nov 2002 07:20:45 -0000
@@ -4521,7 +4521,12 @@ s_alpha_prologue (ignore)
sym = ecoff_get_cur_proc_sym ();
else
sym = alpha_cur_ent_sym;
- know (sym != NULL);
+
+ if (sym == NULL)
+ {
+ as_bad (_(".prologue directive without a preceding .ent directive"));
+ return;
+ }
switch (arg)
{
--
Alan Modra
IBM OzLabs - Linux Technology Centre