ports/devel/llvm70/files/lld/patch-head-r339304.diff
Brooks Davis d38df13120 Add all patches from base llvm/clang/lld/lldb 7.0 to devel/llvm70
This adds all the patches that were applied in the past to the
clang700-import branch, under contrib/llvm. After these, there only
minimal diffs left between the port sources and the base sources.

Most of these remaining diffs are due to #ifdef shortcuts in the base
sources, because we don't compile certain features in. Other diffs are
because the port has applied a few changes that we don't have in base.

Also switch to the common LICENSE defintion in devel/llvm-devel and
chase new USE_GNOME requirements (for libxml2).

PR:	212343, 230604
Submitted by:	dim
MFH:		2018Q4
Differential Revision:	https://reviews.freebsd.org/D17709
2018-11-01 17:47:32 +00:00

38 lines
1.6 KiB
Diff

r339304 | emaste | 2018-10-11 15:19:17 +0200 (Thu, 11 Oct 2018) | 13 lines
lld: set sh_link and sh_info for .rela.plt sections
ELF spec says that for SHT_REL and SHT_RELA sh_link should reference the
associated string table and sh_info should reference the "section to
which the relocation applies." ELF Tool Chain's elfcopy / strip use
this (in part) to control whether or not the relocation entry is copied
to the output.
LLVM PR 37538 https://bugs.llvm.org/show_bug.cgi?id=37538
Approved by: re (kib)
Obtained from: llvm r344226 (backported for 6.0)
Index: tools/lld/ELF/SyntheticSections.cpp
===================================================================
--- tools/lld/ELF/SyntheticSections.cpp (revision 339303)
+++ tools/lld/ELF/SyntheticSections.cpp (revision 339304)
@@ -1213,11 +1213,13 @@ void RelocationBaseSection::addReloc(const Dynamic
void RelocationBaseSection::finalizeContents() {
// If all relocations are R_*_RELATIVE they don't refer to any
// dynamic symbol and we don't need a dynamic symbol table. If that
- // is the case, just use 0 as the link.
- Link = InX::DynSymTab ? InX::DynSymTab->getParent()->SectionIndex : 0;
+ // is the case, just use the index of the regular symbol table section.
+ getParent()->Link = InX::DynSymTab ?
+ InX::DynSymTab->getParent()->SectionIndex :
+ InX::SymTab->getParent()->SectionIndex;
- // Set required output section properties.
- getParent()->Link = Link;
+ if (InX::RelaIplt == this || InX::RelaPlt == this)
+ getParent()->Info = InX::GotPlt->getParent()->SectionIndex;
}
RelrBaseSection::RelrBaseSection()