hanchenye-llvm-project/lld
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
..
cmake/modules
docs Add support for building Sphinx documentation when being built inside LLVM source tree and using CMake. 2014-04-18 21:59:05 +00:00
include/lld Add make_dynamic_error_code(). 2014-05-27 19:35:41 +00:00
lib [ELF] Fix incorrect sorting of .init_array / .fini_array sections. 2014-05-30 05:29:46 +00:00
test [ELF] Fix incorrect sorting of .init_array / .fini_array sections. 2014-05-30 05:29:46 +00:00
tools [PECOFF] Rename link.exe -> lld-link.exe. 2014-03-21 20:41:48 +00:00
unittests Add observers to Input Graph 2014-05-14 05:31:54 +00:00
utils Replace OwningPtr with std::unique_ptr. 2014-03-13 16:20:38 +00:00
.arcconfig Update Phabricator server. 2014-04-07 04:52:24 +00:00
.clang-format Add .clang-format file to ensure C++11 LLVM coding style. 2013-12-11 22:39:33 +00:00
.gitignore
CMakeLists.txt Add support for building Sphinx documentation when being built inside LLVM source tree and using CMake. 2014-04-18 21:59:05 +00:00
LICENSE.TXT Update the copyright credits -- Happy new year 2014! 2014-01-01 08:27:31 +00:00
README.md

README.md

LLVM Linker (lld)

This directory and its subdirectories contain source code for the LLVM Linker, a modular cross platform linker which is built as part of the LLVM compiler infrastructure project.

lld is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt.