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]
Other format: [Raw text]

Re: [Bug] Between and glibc causes ld to segfault.


"Stefan Jones" <cretin at gentoo dot org> writes:

> Dear Sirs,
> 
> As I have said before, if you call ld with excessive -l() arguments you
> get the following segfault:
> ( see http://bugs.gentoo.org/show_bug.cgi?id=16577 for examples, also
> works  on redhat beta 8.1 )
> #0  new_statement (type=lang_group_statement_enum, size=13, list=0xd)
>     at ldlang.c:516
> #1  0x080543e6 in lang_enter_group () at ldlang.c:4758
> #2  0x08049f34 in yyparse () at ldgram.y:338
> #3  0x0805055c in load_symbols (entry=0x0, place=0x0) at ldlang.c:1576
> #4  0x08050d2f in open_input_bfds (s=0x0, force=0) at ldlang.c:2043
> #5  0x08053b00 in lang_process () at ldlang.c:4277
> #6  0x080567e5 in main (argc=0, argv=0x0) at ldmain.c:438
> #7  0x4003c747 in __libc_start_main () from /lib/libc.so.6

Here is a patch:

2003-03-19  Andreas Schwab  <schwab at suse dot de>

	* ldfile.c (ldfile_try_open_bfd): Pop lexer start condition after
	eof.

--- ld/ldfile.c.~1.26.~	2003-03-04 22:48:32.000000000 +0100
+++ ld/ldfile.c	2003-03-19 00:08:38.000000000 +0100
@@ -220,6 +220,7 @@ ldfile_try_open_bfd (attempt, entry)
 		        }
 		      token = yylex ();
 		    }
+		  ldlex_popstate ();
 		  ldfile_assumed_script = FALSE;
 		  fclose (yyin);
 		  yyin = NULL;

Andreas.


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