--- binutils-2.20.1/gas/listing.c.old 2010-01-14 05:48:31.000000000 -0500 +++ binutils-2.20.1/gas/listing.c 2013-03-18 14:35:22.000000000 -0400 @@ -544,7 +544,6 @@ rebuffer_line (file_info_type * file, unsigned int size) { unsigned int count = 0; - unsigned int current_line = 1; char * p = buffer; long pos; int c; @@ -577,14 +576,8 @@ rebuffer_line (file_info_type * file, fseek (last_open_file, file->pos, SEEK_SET); } - /* Remember where we are in the current file. */ - pos = ftell (last_open_file); - - /* Go back to the beginning. */ - fseek (last_open_file, 0, SEEK_SET); - /* Skip lines prior to the one we are interested in. */ - while (current_line < linenum) + while (file->linenum < linenum) { /* fgets only stops on newlines and has a size limit, so we read one character at a time instead. */ @@ -594,7 +587,7 @@ rebuffer_line (file_info_type * file, } while (c != EOF && c != '\n' && c != '\r'); - ++ current_line; + ++ file->linenum; if (c == '\r' || c == '\n') {