hanchenye-llvm-project/lld/lib
Simon Atanasyan 2aae2b4609 [ELF] Fix incorrect sorting of .init_array / .fini_array sections.
The main problem is in the predicate passed to the `std::stable_sort()`.
This predicate always returns false if **both** section's names do not
start with `.init_array` or `.fini_array` prefixes. In short, it does not
define a strict weak orderng. Suppose we have the following sections:

  .A .init_array.1 .init_array.2

The predicate states that:

  not .init_array.1 < .A
  not .A < .init_array.2
  but .init_array.1 < .init_array.2 !!!

The second problem is that `.init_array` section without number should
go last in the list. Not it has the lowest priority '0' and goes first.

The patch fixes both of the problems.

llvm-svn: 209875
2014-05-30 05:29:46 +00:00
..
Core [mach-o] Support parsing of non-lazy-pointer sections 2014-05-28 01:16:35 +00:00
Driver Add -print_atoms options to DarwinLdDriver which dumps final state of all atoms in yaml 2014-05-14 21:32:21 +00:00
Passes [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 03:21:31 +00:00
ReaderWriter [ELF] Fix incorrect sorting of .init_array / .fini_array sections. 2014-05-30 05:29:46 +00:00
CMakeLists.txt Add the core architecture for the lld driver. 2012-12-08 00:47:36 +00:00