commit | bd884098ac66859b2151d928c3f45b8959fccae5 | [log] [tgz] |
---|---|---|
author | Reid Kleckner <rnk@google.com> | Thu Jun 22 23:33:04 2017 |
committer | Reid Kleckner <rnk@google.com> | Thu Jun 22 23:33:04 2017 |
tree | d5e417258e1b089481907a5943378a5f6a35de2a | |
parent | 56cd0435f7b1f7bc41711c87ac4e4663883b7810 [diff] |
[COFF] Fix SECTION and SECREL relocation handling for absolute symbols Summary: For SECTION relocations against absolute symbols, MSVC emits the largest output section index plus one. I've implemented that by threading a global variable through DefinedAbsolute that is filled in by the Writer. A more library-oriented approach would be to thread the Writer through Chunk::writeTo and SectionChunk::applyRel*, but Rui seems to prefer doing it this way. MSVC rejects SECREL relocations against absolute symbols, but only when the relocation is in a real output section. When the relocation is in a CodeView debug info section destined for the PDB, it seems that this relocation error is suppressed, and absolute symbols become zeros in the object file. This is easily implemented by checking the input section from which we're applying relocations. This should fix errors about __safe_se_handler_table and __guard_fids_table when linking the CRT and generating a PDB. Reviewers: ruiu Subscribers: aprantl, llvm-commits Differential Revision: https://reviews.llvm.org/D34541 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@306071 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.