Skip to content
Commit d81a3eaf authored by Petr Tesarik's avatar Petr Tesarik
Browse files

Make sure that sorting does not change section order

Symbol files may contain multiple sections with the same name.
Section addresses specified by add-symbol-file are assigned to the
corresponding BFD sections in addr_info_make_relative using sorted
indexes of both vectors.  Since the sort algorithm is not inherently
stable, the comparison function uses sectindex to maintain the
original order.  However, add_symbol_file_command uses zero for all
sections, so if the user specifies multiple sections with the same
name, they will be assigned randomly to symbol file sections with
the same name.

gdb/ChangeLog:
2018-06-28  Petr Tesarik  <ptesarik@suse.cz>

	* symfile.c (add_symbol_file_command): Make sure that sections
parent ed6dfe51
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment