llvm-project/lld
Fangrui Song 56d81104f1 [ELF] -r: fix crash when processing a SHT_REL[A] that relocates a SHF_MERGE after D67504/r372734
Fix PR43767

In -r mode, when processing a SHT_REL[A] that relocates a SHF_MERGE, sec->getRelocatedSection() is a
MergeInputSection and its parent is an OutputSection but is asserted to
be a SyntheticSection (MergeSyntheticSection) in LinkerScript.cpp:addInputSec().
 ##
The code path is not exercised in non -r mode because the relocated
section changed from MergeInputSection to InputSection.

Reorder the code to make the non -r logic apply to -r as well, thus fix
the crash.

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D69364
2019-10-24 11:35:29 -07:00
..
COFF [LLD] [COFF] Fix use of uninitialized memory since SVN r375390 2019-10-21 09:35:34 +00:00
Common [LLD] Move duplicated dwarf parsing code to the Common library. NFC. 2019-10-21 08:01:52 +00:00
ELF [ELF] -r: fix crash when processing a SHT_REL[A] that relocates a SHF_MERGE after D67504/r372734 2019-10-24 11:35:29 -07:00
MinGW Use error instead of fatal to report usage errors 2019-10-10 09:46:41 +00:00
cmake/modules [CMake] Properly conditionalize installation of lld libraries 2018-03-09 13:09:36 +00:00
docs Update release notes 2019-10-18 06:11:16 +00:00
include/lld typo fix test commit 2019-10-22 21:32:11 +00:00
lib Move endian constant from Host.h to SwapByteOrder.h, prune include 2019-10-19 00:48:11 +00:00
test [ELF] -r: fix crash when processing a SHT_REL[A] that relocates a SHF_MERGE after D67504/r372734 2019-10-24 11:35:29 -07:00
tools/lld Move endian constant from Host.h to SwapByteOrder.h, prune include 2019-10-19 00:48:11 +00:00
unittests Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
utils Python 2/3 compatibility 2019-03-20 07:42:13 +00:00
wasm [lld][WebAssebmly] Preserve custom import attributes with LTO 2019-10-17 05:16:54 +00:00
.arcconfig
.clang-format
.gitignore
CMakeLists.txt [CMake] Don't set Python_ADDITIONAL_VERSIONS 2019-07-18 15:17:42 +00:00
CODE_OWNERS.TXT
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +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.

Benchmarking

In order to make sure various developers can evaluate patches over the same tests, we create a collection of self contained programs.

It is hosted at https://s3-us-west-2.amazonaws.com/linker-tests/lld-speed-test.tar.xz

The current sha256 is 10eec685463d5a8bbf08d77f4ca96282161d396c65bd97dc99dbde644a31610f.