Correct constructor priority ordering
Ian Lance Taylor
iant@google.com
Sat Mar 29 08:13:00 GMT 2008
After a lot of thought, I still managed to misread the GNU linker file
and mess up the ordering of constructors with priorities compared to
constructors without priorities. This patch fixes that and updates
the test case. This makes the code a little bit simpler.
Ian
2008-03-29 Ian Lance Taylor <iant@google.com>
* output.cc
(Output_section::Input_section_sort_entry::has_priority): New
function.
(Output_section::Input_section_sort_entry::match_file_name): New
function.
(Output_section::Input_section_sort_entry::match_section_name):
Remove.
(Output_section::Input_section_sort_entry::match_section_name_prefix):
Remove.
(Output_section::Input_section_sort_entry::match_section_file):
Remove.
(Output_section::Input_section_sort_compare::operator()): Rewrite
using new Input_section_sort_entry functions. Sort crtbegin and
crtend first. Sort sections with no priority before sections with
a priority.
* testsuite/initpri1.c (d3): Check j != 4.
(cd5): New constructor/destructor function.
(main): Check j != 2.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-patch
Size: 6529 bytes
Desc: Correct constructor ordering
URL: <https://sourceware.org/pipermail/binutils/attachments/20080329/b3c2b7e8/attachment.bin>
More information about the Binutils
mailing list