Date: Sat, 18 Aug 2018 08:27:24 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r338007 - in vendor/lld/dist-release_70: COFF ELF docs test/COFF test/COFF/Inputs test/ELF test/ELF/lto test/mach-o test/wasm/lto Message-ID: <201808180827.w7I8ROeG016284@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Sat Aug 18 08:27:24 2018 New Revision: 338007 URL: https://svnweb.freebsd.org/changeset/base/338007 Log: Vendor import of lld release_70 branch r339999: https://llvm.org/svn/llvm-project/lld/branches/release_70@339999 Added: vendor/lld/dist-release_70/test/COFF/Inputs/common-replacement.s (contents, props changed) vendor/lld/dist-release_70/test/COFF/common-replacement.s (contents, props changed) Modified: vendor/lld/dist-release_70/COFF/Driver.cpp vendor/lld/dist-release_70/ELF/SyntheticSections.cpp vendor/lld/dist-release_70/docs/ReleaseNotes.rst vendor/lld/dist-release_70/test/ELF/lto/cache.ll vendor/lld/dist-release_70/test/ELF/x86-64-reloc-error2.s vendor/lld/dist-release_70/test/mach-o/dependency_info.yaml vendor/lld/dist-release_70/test/wasm/lto/cache.ll Modified: vendor/lld/dist-release_70/COFF/Driver.cpp ============================================================================== --- vendor/lld/dist-release_70/COFF/Driver.cpp Sat Aug 18 08:27:21 2018 (r338006) +++ vendor/lld/dist-release_70/COFF/Driver.cpp Sat Aug 18 08:27:24 2018 (r338007) @@ -1551,11 +1551,11 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr continue; } + // If the symbol isn't common, it must have been replaced with a regular + // symbol, which will carry its own alignment. auto *DC = dyn_cast<DefinedCommon>(Sym); - if (!DC) { - warn("/aligncomm symbol " + Name + " of wrong kind"); + if (!DC) continue; - } CommonChunk *C = DC->getChunk(); C->Alignment = std::max(C->Alignment, Alignment); Modified: vendor/lld/dist-release_70/ELF/SyntheticSections.cpp ============================================================================== --- vendor/lld/dist-release_70/ELF/SyntheticSections.cpp Sat Aug 18 08:27:21 2018 (r338006) +++ vendor/lld/dist-release_70/ELF/SyntheticSections.cpp Sat Aug 18 08:27:24 2018 (r338007) @@ -2929,8 +2929,10 @@ void elf::mergeSections() { // We do not want to handle sections that are not alive, so just remove // them instead of trying to merge. - if (!MS->Live) + if (!MS->Live) { + S = nullptr; continue; + } StringRef OutsecName = getOutputSectionName(MS); uint32_t Alignment = std::max<uint32_t>(MS->Alignment, MS->Entsize); Modified: vendor/lld/dist-release_70/docs/ReleaseNotes.rst ============================================================================== --- vendor/lld/dist-release_70/docs/ReleaseNotes.rst Sat Aug 18 08:27:21 2018 (r338006) +++ vendor/lld/dist-release_70/docs/ReleaseNotes.rst Sat Aug 18 08:27:24 2018 (r338007) @@ -29,7 +29,13 @@ ELF Improvements COFF Improvements ----------------- -* Item 1. +* Improved correctness of exporting mangled stdcall symbols. + +* Completed support for ARM64 relocations. + +* Added support for outputting PDB debug info for MinGW targets. + +* Improved compatibility of output binaries with GNU binutils objcopy/strip. MachO Improvements ------------------ Added: vendor/lld/dist-release_70/test/COFF/Inputs/common-replacement.s ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist-release_70/test/COFF/Inputs/common-replacement.s Sat Aug 18 08:27:24 2018 (r338007) @@ -0,0 +1,5 @@ + .globl foo + .data + .p2align 2, 0 +foo: + .long 42 Added: vendor/lld/dist-release_70/test/COFF/common-replacement.s ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist-release_70/test/COFF/common-replacement.s Sat Aug 18 08:27:24 2018 (r338007) @@ -0,0 +1,35 @@ +# REQUIRES: x86 + +# RUN: llvm-mc -triple=x86_64-windows-gnu %s -filetype=obj -o %t1.obj +# RUN: llvm-mc -triple=x86_64-windows-gnu %S/Inputs/common-replacement.s -filetype=obj -o %t2.obj + +# RUN: lld-link -lldmingw -entry:main %t1.obj %t2.obj -out:%t.exe -verbose 2>&1 \ +# RUN: | FileCheck -check-prefix VERBOSE %s +# RUN: llvm-readobj -s %t.exe | FileCheck -check-prefix SECTIONS %s + +# VERBOSE: -aligncomm:"foo",2 + +# As long as the .comm symbol is replaced with actual data, RawDataSize +# below should be nonzero. + +# SECTIONS: Name: .data (2E 64 61 74 61 00 00 00) +# SECTIONS-NEXT: VirtualSize: 0x8 +# SECTIONS-NEXT: VirtualAddress: 0x2000 +# SECTIONS-NEXT: RawDataSize: 512 + + + .text + .def main; + .scl 2; + .type 32; + .endef + .globl main + .p2align 4, 0x90 +main: + movl foo(%rip), %eax + retq + +# This produces an aligncomm directive, but when linking in +# Inputs/common-replacement.s, this symbol is replaced by a normal defined +# symbol instead. + .comm foo, 4, 2 Modified: vendor/lld/dist-release_70/test/ELF/lto/cache.ll ============================================================================== --- vendor/lld/dist-release_70/test/ELF/lto/cache.ll Sat Aug 18 08:27:21 2018 (r338006) +++ vendor/lld/dist-release_70/test/ELF/lto/cache.ll Sat Aug 18 08:27:24 2018 (r338007) @@ -13,7 +13,7 @@ ; RUN: ls %t.cache | count 4 ; Create a file of size 64KB. -; RUN: "%python" -c "print(' ' * 65536)" > %t.cache/llvmcache-foo +; RUN: %python -c "print(' ' * 65536)" > %t.cache/llvmcache-foo ; This should leave the file in place. ; RUN: ld.lld --thinlto-cache-dir=%t.cache --thinlto-cache-policy cache_size_bytes=128k:prune_interval=0s -o %t3 %t2.o %t.o Modified: vendor/lld/dist-release_70/test/ELF/x86-64-reloc-error2.s ============================================================================== --- vendor/lld/dist-release_70/test/ELF/x86-64-reloc-error2.s Sat Aug 18 08:27:21 2018 (r338006) +++ vendor/lld/dist-release_70/test/ELF/x86-64-reloc-error2.s Sat Aug 18 08:27:24 2018 (r338007) @@ -1,14 +1,18 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o -# RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck %s +# RUN: not ld.lld --entry=func --gc-sections %t.o -o /dev/null 2>&1 | FileCheck %s ## Check we are able to find a function symbol that encloses ## a given location when reporting error messages. # CHECK: {{.*}}.o:(function func): relocation R_X86_64_32S out of range: -281474974609408 is not in [-2147483648, 2147483647] +# This mergeable section will be garbage collected. We had a crash issue in that case. Test it. +.section .rodata.str1,"aMS",@progbits,1 +.asciz "a" + .section .text.func, "ax", %progbits .globl func .type func,@function -.size func, 0x10 func: - movq func - 0x1000000000000, %rdx + movq $func - 0x1000000000000, %rdx +.size func, .-func Modified: vendor/lld/dist-release_70/test/mach-o/dependency_info.yaml ============================================================================== --- vendor/lld/dist-release_70/test/mach-o/dependency_info.yaml Sat Aug 18 08:27:21 2018 (r338006) +++ vendor/lld/dist-release_70/test/mach-o/dependency_info.yaml Sat Aug 18 08:27:24 2018 (r338007) @@ -9,7 +9,7 @@ # RUN: -F/Custom/Frameworks \ # RUN: -framework Bar \ # RUN: -framework Foo -# RUN: '%python' %p/Inputs/DependencyDump.py %t.info | FileCheck %s +# RUN: %python %p/Inputs/DependencyDump.py %t.info | FileCheck %s # CHECK: linker-vers: lld Modified: vendor/lld/dist-release_70/test/wasm/lto/cache.ll ============================================================================== --- vendor/lld/dist-release_70/test/wasm/lto/cache.ll Sat Aug 18 08:27:21 2018 (r338006) +++ vendor/lld/dist-release_70/test/wasm/lto/cache.ll Sat Aug 18 08:27:24 2018 (r338007) @@ -11,7 +11,7 @@ ; RUN: ls %t.cache | count 4 ; Create a file of size 64KB. -; RUN: "%python" -c "print(' ' * 65536)" > %t.cache/llvmcache-foo +; RUN: %python -c "print(' ' * 65536)" > %t.cache/llvmcache-foo ; This should leave the file in place. ; RUN: wasm-ld --thinlto-cache-dir=%t.cache --thinlto-cache-policy cache_size_bytes=128k:prune_interval=0s -o %t.wasm %t2.o %t.o
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808180827.w7I8ROeG016284>