This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Fix objdump -S with unit-at-a-time II
Hi Andi,
2007-06-01 Andi Kleen <ak@suse.de>
* objdump.c: Include sys/mman.h
(print_file_list): Remove f, add map, mapsize, linemap, maxline,
last_line, first fields.
(slurp_file): Add.
(index_file): Add
(print_file_open): Call slurp_file and index_file. Initialize new
fields.
(skip_to_line): Rename to print_line and write only single line.
(dump_line): Add.
(show_line): Change to new algorithm.
Approved and applied.
Note - I fixed a small bug in the index_file() code. It was possible
for the calculation that computes the new value for line_map_size to
return a value that was less than 'lineno + 1', so that you would then
corrupt memory when writing to linemap[lineno].
Cheers
Nick