|author||Dimitry Andric <email@example.com>||Tue Oct 23 05:53:15 2018 +0000|
|committer||Dimitry Andric <firstname.lastname@example.org>||Tue Oct 23 05:53:15 2018 +0000|
Don't mess up RelIplt symbols during relocatable processing Summary: During upgrading of the FreeBSD source tree with lld 7.0.0, I noticed that it started complaining about `crt1.o` having an "index past the end of the symbol table". Such a symbol table looks approximately like this, viewed with `readelf -s` (note the `Ndx` field being messed up): ``` Symbol table '.symtab' contains 4 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 SECTION LOCAL DEFAULT 1 2: 00000000 0 NOTYPE WEAK HIDDEN RSV[0xffff] __rel_iplt_end 3: 00000000 0 NOTYPE WEAK HIDDEN RSV[0xffff] __rel_iplt_start ``` At first, it seemed that recent ifunc relocation work had caused this: <https://reviews.freebsd.org/rS339351>, but it turned out that it was due to incorrect processing of the object files by lld, when using `-r` (a.k.a. --relocatable). Bisecting showed that rL324421 ("Convert a use of Config->Static") was the commit where this new behavior began. Simply reverting it solved the issue, and the `__rel_iplt` symbols had an index of `UND` again. Looking at Rafael's commit message, I think he simply missed the possibility of `--relocatable` being in effect, so I have added an additional check for it. I also added a simple regression test case. Reviewers: grimar, ruiu, emaste, espindola Reviewed By: ruiu Subscribers: arichardson, krytarowski, llvm-commits Differential Revision: https://reviews.llvm.org/D53515 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@345002 91177308-0d34-0410-b5e6-96231b3b80d8
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.
In order to make sure various developers can evaluate patches over the same tests, we create a collection of self contained programs.
The current sha256 is 10eec685463d5a8bbf08d77f4ca96282161d396c65bd97dc99dbde644a31610f.