From owner-svn-src-vendor@freebsd.org Fri Feb 15 20:49:33 2019 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08BFF14E8C71; Fri, 15 Feb 2019 20:49:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E10468467A; Fri, 15 Feb 2019 20:49:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C39B823EBD; Fri, 15 Feb 2019 20:49:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x1FKnQL5050040; Fri, 15 Feb 2019 20:49:26 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x1FKnMLu050020; Fri, 15 Feb 2019 20:49:22 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201902152049.x1FKnMLu050020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 15 Feb 2019 20:49:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r344173 - in vendor/lld/dist-release_80: COFF ELF docs test/COFF test/ELF test/wasm test/wasm/lto wasm X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/lld/dist-release_80: COFF ELF docs test/COFF test/ELF test/wasm test/wasm/lto wasm X-SVN-Commit-Revision: 344173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E10468467A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Feb 2019 20:49:33 -0000 Author: dim Date: Fri Feb 15 20:49:22 2019 New Revision: 344173 URL: https://svnweb.freebsd.org/changeset/base/344173 Log: Vendor import of lld release_80 branch r354130: https://llvm.org/svn/llvm-project/lld/branches/release_80@354130 Added: vendor/lld/dist-release_80/test/wasm/import-module.ll vendor/lld/dist-release_80/test/wasm/import-names.ll vendor/lld/dist-release_80/test/wasm/lto/relocatable-undefined.ll Modified: vendor/lld/dist-release_80/COFF/PDB.cpp vendor/lld/dist-release_80/ELF/Driver.cpp vendor/lld/dist-release_80/ELF/ScriptParser.cpp vendor/lld/dist-release_80/docs/ReleaseNotes.rst vendor/lld/dist-release_80/docs/index.rst vendor/lld/dist-release_80/docs/missingkeyfunction.rst vendor/lld/dist-release_80/test/COFF/pdb-relative-source-lines.test vendor/lld/dist-release_80/test/ELF/emulation-mips.s vendor/lld/dist-release_80/test/ELF/emulation-ppc.s vendor/lld/dist-release_80/test/wasm/data-layout.ll vendor/lld/dist-release_80/test/wasm/init-fini.ll vendor/lld/dist-release_80/test/wasm/locals-duplicate.test vendor/lld/dist-release_80/test/wasm/weak-alias.ll vendor/lld/dist-release_80/wasm/Driver.cpp vendor/lld/dist-release_80/wasm/InputChunks.cpp vendor/lld/dist-release_80/wasm/InputFiles.cpp vendor/lld/dist-release_80/wasm/LTO.cpp vendor/lld/dist-release_80/wasm/LTO.h vendor/lld/dist-release_80/wasm/MarkLive.cpp vendor/lld/dist-release_80/wasm/SymbolTable.cpp vendor/lld/dist-release_80/wasm/SymbolTable.h vendor/lld/dist-release_80/wasm/Symbols.h vendor/lld/dist-release_80/wasm/Writer.cpp vendor/lld/dist-release_80/wasm/Writer.h Modified: vendor/lld/dist-release_80/COFF/PDB.cpp ============================================================================== --- vendor/lld/dist-release_80/COFF/PDB.cpp Fri Feb 15 20:49:19 2019 (r344172) +++ vendor/lld/dist-release_80/COFF/PDB.cpp Fri Feb 15 20:49:22 2019 (r344173) @@ -288,18 +288,24 @@ static void pdbMakeAbsolute(SmallVectorImpl &Fil // It's not absolute in any path syntax. Relative paths necessarily refer to // the local file system, so we can make it native without ending up with a // nonsensical path. - sys::path::native(FileName); if (Config->PDBSourcePath.empty()) { + sys::path::native(FileName); sys::fs::make_absolute(FileName); return; } - // Only apply native and dot removal to the relative file path. We want to - // leave the path the user specified untouched since we assume they specified - // it for a reason. - sys::path::remove_dots(FileName, /*remove_dot_dots=*/true); + // Try to guess whether /PDBSOURCEPATH is a unix path or a windows path. + // Since PDB's are more of a Windows thing, we make this conservative and only + // decide that it's a unix path if we're fairly certain. Specifically, if + // it starts with a forward slash. SmallString<128> AbsoluteFileName = Config->PDBSourcePath; - sys::path::append(AbsoluteFileName, FileName); + sys::path::Style GuessedStyle = AbsoluteFileName.startswith("/") + ? sys::path::Style::posix + : sys::path::Style::windows; + sys::path::append(AbsoluteFileName, GuessedStyle, FileName); + sys::path::native(AbsoluteFileName, GuessedStyle); + sys::path::remove_dots(AbsoluteFileName, true, GuessedStyle); + FileName = std::move(AbsoluteFileName); } Modified: vendor/lld/dist-release_80/ELF/Driver.cpp ============================================================================== --- vendor/lld/dist-release_80/ELF/Driver.cpp Fri Feb 15 20:49:19 2019 (r344172) +++ vendor/lld/dist-release_80/ELF/Driver.cpp Fri Feb 15 20:49:22 2019 (r344173) @@ -130,7 +130,7 @@ static std::tuple parseEmu .Cases("elf32btsmip", "elf32btsmipn32", {ELF32BEKind, EM_MIPS}) .Cases("elf32ltsmip", "elf32ltsmipn32", {ELF32LEKind, EM_MIPS}) .Case("elf32lriscv", {ELF32LEKind, EM_RISCV}) - .Case("elf32ppc", {ELF32BEKind, EM_PPC}) + .Cases("elf32ppc", "elf32ppclinux", {ELF32BEKind, EM_PPC}) .Case("elf64btsmip", {ELF64BEKind, EM_MIPS}) .Case("elf64ltsmip", {ELF64LEKind, EM_MIPS}) .Case("elf64lriscv", {ELF64LEKind, EM_RISCV}) Modified: vendor/lld/dist-release_80/ELF/ScriptParser.cpp ============================================================================== --- vendor/lld/dist-release_80/ELF/ScriptParser.cpp Fri Feb 15 20:49:19 2019 (r344172) +++ vendor/lld/dist-release_80/ELF/ScriptParser.cpp Fri Feb 15 20:49:22 2019 (r344173) @@ -392,10 +392,11 @@ static std::pair parseBfdName(Strin .Case("elf32-x86-64", {ELF32LEKind, EM_X86_64}) .Case("elf64-aarch64", {ELF64LEKind, EM_AARCH64}) .Case("elf64-littleaarch64", {ELF64LEKind, EM_AARCH64}) + .Case("elf32-powerpc", {ELF32BEKind, EM_PPC}) .Case("elf64-powerpc", {ELF64BEKind, EM_PPC64}) .Case("elf64-powerpcle", {ELF64LEKind, EM_PPC64}) .Case("elf64-x86-64", {ELF64LEKind, EM_X86_64}) - .Case("elf32-tradbigmips", {ELF32BEKind, EM_MIPS}) + .Cases("elf32-tradbigmips", "elf32-bigmips", {ELF32BEKind, EM_MIPS}) .Case("elf32-ntradbigmips", {ELF32BEKind, EM_MIPS}) .Case("elf32-tradlittlemips", {ELF32LEKind, EM_MIPS}) .Case("elf32-ntradlittlemips", {ELF32LEKind, EM_MIPS}) Modified: vendor/lld/dist-release_80/docs/ReleaseNotes.rst ============================================================================== --- vendor/lld/dist-release_80/docs/ReleaseNotes.rst Fri Feb 15 20:49:19 2019 (r344172) +++ vendor/lld/dist-release_80/docs/ReleaseNotes.rst Fri Feb 15 20:49:22 2019 (r344173) @@ -13,11 +13,13 @@ lld 8.0.0 Release Notes Introduction ============ -This document contains the release notes for the lld linker, release 8.0.0. -Here we describe the status of lld, including major improvements -from the previous release. All lld releases may be downloaded -from the `LLVM releases web site `_. +lld is a high-performance linker that supports ELF (Unix), COFF (Windows), +Mach-O (macOS), MinGW and WebAssembly. lld is command-line-compatible with +GNU linkers and Microsoft link.exe and is significantly faster than the +system default linkers. +nlld 8.0.0 has lots of feature improvements and bug fixes. + Non-comprehensive list of changes in this release ================================================= @@ -33,28 +35,67 @@ ELF Improvements non-superpages to a superpage if they are aligned to the superpage size. (`r342746 `_) +* lld now attempts to place a ``.note`` segment in the first page of a + generated file, so that you can find some important information + (``.note.gnu.build-id`` in particular) in a core file even if a core + file is truncated by ulimit. + (`r349524 `_) + +* lld now reports an error if ``_GLOBAL_OFFSET_TABLE_`` symbol is + defined by an input object file, as the symbol is supposed to be + synthesized by the linker. + (`r347854 `_) + * lld/Hexagon can now link Linux kernel and musl libc for Qualcomm Hexagon ISA. * Initial MSP430 ISA support has landed. -* The following flags have been added: ``-z interpose``, ``-z global`` - * lld now uses the ``sigrie`` instruction as a trap instruction for MIPS targets. +* lld now creates a TLS segment for AArch64 with a slightly larger + alignment requirement, so that the loader makes a few bytes room + before each TLS segment at runtime. The aim of this change is to + make room to accomodate nonstandard Android TLS slots while keeping + the compatibility with the standard AArch64 ABI. + (`r350681 `_) + +* The following flags have been added: ``--call-graph-profile``, + ``--no-call-graph-profile``, ``--warn-ifunc-textrel``, + ``-z interpose``, ``-z global``, ``-z nodefaultlib`` + COFF Improvements ----------------- * PDB GUID is set to hash of PDB contents instead to a random byte sequence for build reproducibility. +* ``/pdbsourcepath:`` is now also used to make ``"cwd"``, ``"exe"``, ``"pdb"`` + in the env block of PDB outputs absolute if they are relative, and to make + paths to obj files referenced in PDB outputs absolute if they are relative. + Together with the previous item, this makes it possible to generate + executables and PDBs that are fully deterministic and independent of the + absolute path to the build directory, so that different machines building + the same code in different directories can produce exactly the same output. + * The following flags have been added: ``/force:multiple`` * lld now can link against import libraries produced by GNU tools. -* lld can create thunks for ARM, to allow linking images over 16 MB. +* lld can create thunks for ARM and ARM64, to allow linking larger images + (over 16 MB for ARM and over 128 MB for ARM64) +* Several speed and memory usage improvements. + +* lld now creates debug info for typedefs. + +* lld can now link obj files produced by ``cl.exe /Z7 /Yc``. + +* lld now understands ``%_PDB%`` and ``%_EXT%`` in ``/pdbaltpath:``. + +* Undefined symbols are now printed in demangled form in addition to raw form. + MinGW Improvements ------------------ @@ -75,11 +116,6 @@ MinGW Improvements * Actually generate a codeview build id signature, even if not creating a PDB. Previously, the ``--build-id`` option did not actually generate a build id unless ``--pdb`` was specified. - -MachO Improvements ------------------- - -* Item 1. WebAssembly Improvements ------------------------ Modified: vendor/lld/dist-release_80/docs/index.rst ============================================================================== --- vendor/lld/dist-release_80/docs/index.rst Fri Feb 15 20:49:19 2019 (r344172) +++ vendor/lld/dist-release_80/docs/index.rst Fri Feb 15 20:49:22 2019 (r344173) @@ -173,4 +173,5 @@ document soon. AtomLLD WebAssembly windows_support + missingkeyfunction ReleaseNotes Modified: vendor/lld/dist-release_80/docs/missingkeyfunction.rst ============================================================================== --- vendor/lld/dist-release_80/docs/missingkeyfunction.rst Fri Feb 15 20:49:19 2019 (r344172) +++ vendor/lld/dist-release_80/docs/missingkeyfunction.rst Fri Feb 15 20:49:22 2019 (r344173) @@ -1,5 +1,5 @@ -Missing Key Method -================== +Missing Key Function +==================== If your build failed with a linker error something like this:: Modified: vendor/lld/dist-release_80/test/COFF/pdb-relative-source-lines.test ============================================================================== --- vendor/lld/dist-release_80/test/COFF/pdb-relative-source-lines.test Fri Feb 15 20:49:19 2019 (r344172) +++ vendor/lld/dist-release_80/test/COFF/pdb-relative-source-lines.test Fri Feb 15 20:49:22 2019 (r344173) @@ -37,26 +37,26 @@ RUN: llvm-pdbutil pdb2yaml -modules -module-files -mod RUN: ./lld-link -debug "-pdbsourcepath:/usr/src" -entry:main -nodefaultlib -out:out.exe -pdb:out.pdb pdb_lines_1_relative.obj pdb_lines_2_relative.obj RUN: llvm-pdbutil pdb2yaml -modules -module-files -module-syms -subsections=lines,fc %t/out.pdb | FileCheck --check-prefix=POSIX %s -CHECK-LABEL: - Module: 'c:\src{{[\\/]}}pdb_lines_1_relative.obj' -CHECK-NEXT: ObjFile: 'c:\src{{[\\/]}}pdb_lines_1_relative.obj' +CHECK-LABEL: - Module: 'c:\src\pdb_lines_1_relative.obj' +CHECK-NEXT: ObjFile: 'c:\src\pdb_lines_1_relative.obj' CHECK: SourceFiles: -CHECK-NEXT: - 'c:\src{{[\\/]}}pdb_lines_1.c' -CHECK-NEXT: - 'c:\src{{[\\/]}}foo.h' +CHECK-NEXT: - 'c:\src\pdb_lines_1.c' +CHECK-NEXT: - 'c:\src\foo.h' CHECK: Subsections: -CHECK: - FileName: 'c:\src{{[\\/]}}pdb_lines_1.c' -CHECK: - FileName: 'c:\src{{[\\/]}}foo.h' +CHECK: - FileName: 'c:\src\pdb_lines_1.c' +CHECK: - FileName: 'c:\src\foo.h' CHECK: - !FileChecksums -CHECK: - FileName: 'c:\src{{[\\/]}}pdb_lines_1.c' -CHECK: - FileName: 'c:\src{{[\\/]}}foo.h' +CHECK: - FileName: 'c:\src\pdb_lines_1.c' +CHECK: - FileName: 'c:\src\foo.h' -CHECK-LABEL: - Module: 'c:\src{{[\\/]}}pdb_lines_2_relative.obj' -CHECK-NEXT: ObjFile: 'c:\src{{[\\/]}}pdb_lines_2_relative.obj' +CHECK-LABEL: - Module: 'c:\src\pdb_lines_2_relative.obj' +CHECK-NEXT: ObjFile: 'c:\src\pdb_lines_2_relative.obj' CHECK: SourceFiles: -CHECK-NEXT: - 'c:\src{{[\\/]}}pdb_lines_2.c' +CHECK-NEXT: - 'c:\src\pdb_lines_2.c' CHECK: Subsections: -CHECK: - FileName: 'c:\src{{[\\/]}}pdb_lines_2.c' +CHECK: - FileName: 'c:\src\pdb_lines_2.c' CHECK: - !FileChecksums -CHECK: - FileName: 'c:\src{{[\\/]}}pdb_lines_2.c' +CHECK: - FileName: 'c:\src\pdb_lines_2.c' CHECK-LABEL: - Kind: S_ENVBLOCK CHECK-NEXT: EnvBlockSym: @@ -64,33 +64,33 @@ CHECK-NEXT: Entries: CHECK-NEXT: - cwd CHECK-NEXT: - 'c:\src' CHECK-NEXT: - exe -CHECK-NEXT: - 'c:\src{{[\\/]}}lld-link' +CHECK-NEXT: - 'c:\src\lld-link' CHECK-NEXT: - pdb -CHECK-NEXT: - 'c:\src{{[\\/]}}out.pdb' +CHECK-NEXT: - 'c:\src\out.pdb' CHECK-NEXT: - cmd CHECK-NEXT: - '-debug -pdbsourcepath:c:\src -entry:main -nodefaultlib -out:out.exe -pdb:out.pdb pdb_lines_1_relative.obj pdb_lines_2_relative.obj' -POSIX-LABEL: - Module: '/usr/src{{[\\/]}}pdb_lines_1_relative.obj' -POSIX-NEXT: ObjFile: '/usr/src{{[\\/]}}pdb_lines_1_relative.obj' +POSIX-LABEL: - Module: '/usr/src/pdb_lines_1_relative.obj' +POSIX-NEXT: ObjFile: '/usr/src/pdb_lines_1_relative.obj' POSIX: SourceFiles: -POSIX-NEXT: - '/usr/src{{[\\/]}}pdb_lines_1.c' -POSIX-NEXT: - '/usr/src{{[\\/]}}foo.h' +POSIX-NEXT: - '/usr/src/pdb_lines_1.c' +POSIX-NEXT: - '/usr/src/foo.h' POSIX: Subsections: -POSIX: - FileName: '/usr/src{{[\\/]}}pdb_lines_1.c' -POSIX: - FileName: '/usr/src{{[\\/]}}foo.h' +POSIX: - FileName: '/usr/src/pdb_lines_1.c' +POSIX: - FileName: '/usr/src/foo.h' POSIX: - !FileChecksums -POSIX: - FileName: '/usr/src{{[\\/]}}pdb_lines_1.c' -POSIX: - FileName: '/usr/src{{[\\/]}}foo.h' +POSIX: - FileName: '/usr/src/pdb_lines_1.c' +POSIX: - FileName: '/usr/src/foo.h' -POSIX-LABEL: - Module: '/usr/src{{[\\/]}}pdb_lines_2_relative.obj' -POSIX-NEXT: ObjFile: '/usr/src{{[\\/]}}pdb_lines_2_relative.obj' +POSIX-LABEL: - Module: '/usr/src/pdb_lines_2_relative.obj' +POSIX-NEXT: ObjFile: '/usr/src/pdb_lines_2_relative.obj' POSIX: SourceFiles: -POSIX-NEXT: - '/usr/src{{[\\/]}}pdb_lines_2.c' +POSIX-NEXT: - '/usr/src/pdb_lines_2.c' POSIX: Subsections: -POSIX: - FileName: '/usr/src{{[\\/]}}pdb_lines_2.c' +POSIX: - FileName: '/usr/src/pdb_lines_2.c' POSIX: - !FileChecksums -POSIX: - FileName: '/usr/src{{[\\/]}}pdb_lines_2.c' +POSIX: - FileName: '/usr/src/pdb_lines_2.c' POSIX-LABEL: - Kind: S_ENVBLOCK POSIX-NEXT: EnvBlockSym: @@ -98,8 +98,8 @@ POSIX-NEXT: Entries: POSIX-NEXT: - cwd POSIX-NEXT: - '/usr/src' POSIX-NEXT: - exe -POSIX-NEXT: - '/usr/src{{[\\/]}}lld-link' +POSIX-NEXT: - '/usr/src/lld-link' POSIX-NEXT: - pdb -POSIX-NEXT: - '/usr/src{{[\\/]}}out.pdb' +POSIX-NEXT: - '/usr/src/out.pdb' POSIX-NEXT: - cmd POSIX-NEXT: - '-debug -pdbsourcepath:/usr/src -entry:main -nodefaultlib -out:out.exe -pdb:out.pdb pdb_lines_1_relative.obj pdb_lines_2_relative.obj' Modified: vendor/lld/dist-release_80/test/ELF/emulation-mips.s ============================================================================== --- vendor/lld/dist-release_80/test/ELF/emulation-mips.s Fri Feb 15 20:49:19 2019 (r344172) +++ vendor/lld/dist-release_80/test/ELF/emulation-mips.s Fri Feb 15 20:49:22 2019 (r344173) @@ -7,6 +7,9 @@ # RUN: echo 'OUTPUT_FORMAT(elf32-tradbigmips)' > %tmips.script # RUN: ld.lld %tmips.script -e _start %tmips -o %t4mips # RUN: llvm-readobj -file-headers %t4mips | FileCheck --check-prefix=MIPS %s +# RUN: echo 'OUTPUT_FORMAT(elf32-bigmips)' > %tmips2.script +# RUN: ld.lld %tmips2.script -e _start %tmips -o %t5mips +# RUN: llvm-readobj -file-headers %t5mips | FileCheck --check-prefix=MIPS %s # MIPS: ElfHeader { # MIPS-NEXT: Ident { # MIPS-NEXT: Magic: (7F 45 4C 46) Modified: vendor/lld/dist-release_80/test/ELF/emulation-ppc.s ============================================================================== --- vendor/lld/dist-release_80/test/ELF/emulation-ppc.s Fri Feb 15 20:49:19 2019 (r344172) +++ vendor/lld/dist-release_80/test/ELF/emulation-ppc.s Fri Feb 15 20:49:22 2019 (r344173) @@ -103,5 +103,42 @@ # PPC64LE-NEXT: StringTableSectionIndex: # PPC64LE-NEXT: } +# RUN: llvm-mc -filetype=obj -triple=powerpc-unknown-linux %s -o %tppc32 +# RUN: ld.lld -m elf32ppc %tppc32 -o %t2ppc32 +# RUN: llvm-readobj -file-headers %t2ppc32 | FileCheck --check-prefix=PPC32 %s +# RUN: ld.lld %tppc32 -o %t3ppc32 +# RUN: llvm-readobj -file-headers %t3ppc32 | FileCheck --check-prefix=PPC32 %s +# RUN: echo 'OUTPUT_FORMAT(elf32-powerpc)' > %tppc32.script +# RUN: ld.lld %tppc32.script %tppc32 -o %t4ppc32 +# RUN: llvm-readobj -file-headers %t4ppc32 | FileCheck --check-prefix=PPC32 %s +# RUN: ld.lld -m elf32ppclinux %tppc32 -o %t5ppc32 +# RUN: llvm-readobj -file-headers %t5ppc32 | FileCheck --check-prefix=PPC32 %s + +# PPC32: ElfHeader { +# PPC32-NEXT: Ident { +# PPC32-NEXT: Magic: (7F 45 4C 46) +# PPC32-NEXT: Class: 32-bit (0x1) +# PPC32-NEXT: DataEncoding: BigEndian (0x2) +# PPC32-NEXT: FileVersion: 1 +# PPC32-NEXT: OS/ABI: SystemV (0x0) +# PPC32-NEXT: ABIVersion: 0 +# PPC32-NEXT: Unused: (00 00 00 00 00 00 00) +# PPC32-NEXT: } +# PPC32-NEXT: Type: Executable (0x2) +# PPC32-NEXT: Machine: EM_PPC (0x14) +# PPC32-NEXT: Version: 1 +# PPC32-NEXT: Entry: +# PPC32-NEXT: ProgramHeaderOffset: 0x34 +# PPC32-NEXT: SectionHeaderOffset: +# PPC32-NEXT: Flags [ (0x0) +# PPC32-NEXT: ] +# PPC32-NEXT: HeaderSize: 52 +# PPC32-NEXT: ProgramHeaderEntrySize: 32 +# PPC32-NEXT: ProgramHeaderCount: +# PPC32-NEXT: SectionHeaderEntrySize: 40 +# PPC32-NEXT: SectionHeaderCount: +# PPC32-NEXT: StringTableSectionIndex: +# PPC32-NEXT: } + .globl _start _start: Modified: vendor/lld/dist-release_80/test/wasm/data-layout.ll ============================================================================== --- vendor/lld/dist-release_80/test/wasm/data-layout.ll Fri Feb 15 20:49:19 2019 (r344172) +++ vendor/lld/dist-release_80/test/wasm/data-layout.ll Fri Feb 15 20:49:22 2019 (r344173) @@ -85,10 +85,10 @@ target triple = "wasm32-unknown-unknown" ; RELOC: - Type: DATA ; RELOC-NEXT: Relocations: ; RELOC-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_I32 -; RELOC-NEXT: Index: 6 +; RELOC-NEXT: Index: 3 ; RELOC-NEXT: Offset: 0x00000018 ; RELOC-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_I32 -; RELOC-NEXT: Index: 3 +; RELOC-NEXT: Index: 4 ; RELOC-NEXT: Offset: 0x0000002E ; RELOC-NEXT: Addend: 4 ; RELOC-NEXT: Segments: @@ -148,7 +148,7 @@ target triple = "wasm32-unknown-unknown" ; RELOC-NEXT: Flags: [ ] ; RELOC-NEXT: Segment: 2 ; RELOC-NEXT: Size: 4 -; RELOC: - Index: 6 +; RELOC-NEXT: - Index: 3 ; RELOC-NEXT: Kind: DATA ; RELOC-NEXT: Name: hello_str ; RELOC-NEXT: Flags: [ ] Added: vendor/lld/dist-release_80/test/wasm/import-module.ll ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist-release_80/test/wasm/import-module.ll Fri Feb 15 20:49:22 2019 (r344173) @@ -0,0 +1,21 @@ +; RUN: llc -filetype=obj %s -o %t.o +; RUN: wasm-ld --allow-undefined -o %t.wasm %t.o +; RUN: obj2yaml %t.wasm | FileCheck %s + +target triple = "wasm32-unknown-unknown-wasm" + +define void @_start() { + call void @foo(); + ret void +} + +declare void @foo() #0 + +attributes #0 = { "wasm-import-module"="bar" } + +; CHECK: - Type: IMPORT +; CHECK-NEXT: Imports: +; CHECK-NEXT: - Module: bar +; CHECK-NEXT: Field: foo +; CHECK-NEXT: Kind: FUNCTION +; CHECK-NEXT: SigIndex: 0 Added: vendor/lld/dist-release_80/test/wasm/import-names.ll ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist-release_80/test/wasm/import-names.ll Fri Feb 15 20:49:22 2019 (r344173) @@ -0,0 +1,27 @@ +; RUN: llc -filetype=obj %s -o %t.o +; RUN: wasm-ld --allow-undefined -o %t.wasm %t.o +; RUN: obj2yaml %t.wasm | FileCheck %s + +target triple = "wasm32-unknown-unknown" + +declare void @f0() #0 + +define void @_start() { + call void @f0() + ret void +} + +attributes #0 = { "wasm-import-module"="somewhere" "wasm-import-name"="something" } + +; CHECK: - Type: IMPORT +; CHECK-NEXT: Imports: +; CHECK-NEXT: - Module: somewhere +; CHECK-NEXT: Field: something +; CHECK-NEXT: Kind: FUNCTION +; CHECK-NEXT: SigIndex: 0 + +; CHECK: - Type: CUSTOM +; CHECK-NEXT: Name: name +; CHECK-NEXT: FunctionNames: +; CHECK-NEXT: - Index: 0 +; CHECK-NEXT: Name: f0 Modified: vendor/lld/dist-release_80/test/wasm/init-fini.ll ============================================================================== --- vendor/lld/dist-release_80/test/wasm/init-fini.ll Fri Feb 15 20:49:19 2019 (r344172) +++ vendor/lld/dist-release_80/test/wasm/init-fini.ll Fri Feb 15 20:49:22 2019 (r344173) @@ -163,64 +163,64 @@ entry: ; RELOC-NEXT: Flags: [ VISIBILITY_HIDDEN ] ; RELOC-NEXT: Function: 7 ; RELOC-NEXT: - Index: 6 +; RELOC-NEXT: Kind: DATA +; RELOC-NEXT: Name: __dso_handle +; RELOC-NEXT: Flags: [ BINDING_WEAK, VISIBILITY_HIDDEN, UNDEFINED ] +; RELOC-NEXT: - Index: 7 ; RELOC-NEXT: Kind: FUNCTION +; RELOC-NEXT: Name: externDtor +; RELOC-NEXT: Flags: [ VISIBILITY_HIDDEN, UNDEFINED ] +; RELOC-NEXT: Function: 0 +; RELOC-NEXT: - Index: 8 +; RELOC-NEXT: Kind: FUNCTION +; RELOC-NEXT: Name: externCtor +; RELOC-NEXT: Flags: [ VISIBILITY_HIDDEN, UNDEFINED ] +; RELOC-NEXT: Function: 1 +; RELOC-NEXT: - Index: 9 +; RELOC-NEXT: Kind: FUNCTION +; RELOC-NEXT: Name: myctor +; RELOC-NEXT: Flags: [ VISIBILITY_HIDDEN ] +; RELOC-NEXT: Function: 14 +; RELOC-NEXT: - Index: 10 +; RELOC-NEXT: Kind: FUNCTION +; RELOC-NEXT: Name: mydtor +; RELOC-NEXT: Flags: [ VISIBILITY_HIDDEN ] +; RELOC-NEXT: Function: 15 +; RELOC-NEXT: - Index: 11 +; RELOC-NEXT: Kind: GLOBAL +; RELOC-NEXT: Name: __stack_pointer +; RELOC-NEXT: Flags: [ UNDEFINED ] +; RELOC-NEXT: Global: 0 +; RELOC-NEXT: - Index: 12 +; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: .Lcall_dtors.101 ; RELOC-NEXT: Flags: [ BINDING_LOCAL ] ; RELOC-NEXT: Function: 8 -; RELOC-NEXT: - Index: 7 +; RELOC-NEXT: - Index: 13 ; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: .Lregister_call_dtors.101 ; RELOC-NEXT: Flags: [ BINDING_LOCAL ] ; RELOC-NEXT: Function: 9 -; RELOC-NEXT: - Index: 8 -; RELOC-NEXT: Kind: DATA -; RELOC-NEXT: Name: __dso_handle -; RELOC-NEXT: Flags: [ BINDING_WEAK, VISIBILITY_HIDDEN, UNDEFINED ] -; RELOC-NEXT: - Index: 9 +; RELOC-NEXT: - Index: 14 ; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: .Lcall_dtors.1001 ; RELOC-NEXT: Flags: [ BINDING_LOCAL ] ; RELOC-NEXT: Function: 10 -; RELOC-NEXT: - Index: 10 +; RELOC-NEXT: - Index: 15 ; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: .Lregister_call_dtors.1001 ; RELOC-NEXT: Flags: [ BINDING_LOCAL ] ; RELOC-NEXT: Function: 11 -; RELOC-NEXT: - Index: 11 +; RELOC-NEXT: - Index: 16 ; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: .Lcall_dtors.4000 ; RELOC-NEXT: Flags: [ BINDING_LOCAL ] ; RELOC-NEXT: Function: 12 -; RELOC-NEXT: - Index: 12 +; RELOC-NEXT: - Index: 17 ; RELOC-NEXT: Kind: FUNCTION -; RELOC-NEXT: Name: externDtor -; RELOC-NEXT: Flags: [ VISIBILITY_HIDDEN, UNDEFINED ] -; RELOC-NEXT: Function: 0 -; RELOC-NEXT: - Index: 13 -; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: .Lregister_call_dtors.4000 ; RELOC-NEXT: Flags: [ BINDING_LOCAL ] ; RELOC-NEXT: Function: 13 -; RELOC-NEXT: - Index: 14 -; RELOC-NEXT: Kind: FUNCTION -; RELOC-NEXT: Name: externCtor -; RELOC-NEXT: Flags: [ VISIBILITY_HIDDEN, UNDEFINED ] -; RELOC-NEXT: Function: 1 -; RELOC-NEXT: - Index: 15 -; RELOC-NEXT: Kind: FUNCTION -; RELOC-NEXT: Name: myctor -; RELOC-NEXT: Flags: [ VISIBILITY_HIDDEN ] -; RELOC-NEXT: Function: 14 -; RELOC-NEXT: - Index: 16 -; RELOC-NEXT: Kind: FUNCTION -; RELOC-NEXT: Name: mydtor -; RELOC-NEXT: Flags: [ VISIBILITY_HIDDEN ] -; RELOC-NEXT: Function: 15 -; RELOC-NEXT: - Index: 17 -; RELOC-NEXT: Kind: GLOBAL -; RELOC-NEXT: Name: __stack_pointer -; RELOC-NEXT: Flags: [ UNDEFINED ] -; RELOC-NEXT: Global: 0 ; RELOC-NEXT: - Index: 18 ; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: .Lcall_dtors.101 @@ -251,36 +251,36 @@ entry: ; RELOC-NEXT: Name: .Lregister_call_dtors.2002 ; RELOC-NEXT: Flags: [ BINDING_LOCAL ] ; RELOC-NEXT: Function: 21 -; RELOC-NEXT: InitFunctions: +; RELOC-NEXT: InitFunctions: ; RELOC-NEXT: - Priority: 101 ; RELOC-NEXT: Symbol: 0 ; RELOC-NEXT: - Priority: 101 ; RELOC-NEXT: Symbol: 1 ; RELOC-NEXT: - Priority: 101 -; RELOC-NEXT: Symbol: 7 +; RELOC-NEXT: Symbol: 13 ; RELOC-NEXT: - Priority: 101 -; RELOC-NEXT: Symbol: 15 +; RELOC-NEXT: Symbol: 9 ; RELOC-NEXT: - Priority: 101 ; RELOC-NEXT: Symbol: 19 ; RELOC-NEXT: - Priority: 202 -; RELOC-NEXT: Symbol: 15 +; RELOC-NEXT: Symbol: 9 ; RELOC-NEXT: - Priority: 202 ; RELOC-NEXT: Symbol: 21 ; RELOC-NEXT: - Priority: 1001 ; RELOC-NEXT: Symbol: 0 ; RELOC-NEXT: - Priority: 1001 -; RELOC-NEXT: Symbol: 10 -; RELOC-NEXT: - Priority: 2002 ; RELOC-NEXT: Symbol: 15 ; RELOC-NEXT: - Priority: 2002 +; RELOC-NEXT: Symbol: 9 +; RELOC-NEXT: - Priority: 2002 ; RELOC-NEXT: Symbol: 23 ; RELOC-NEXT: - Priority: 4000 -; RELOC-NEXT: Symbol: 14 +; RELOC-NEXT: Symbol: 8 ; RELOC-NEXT: - Priority: 4000 -; RELOC-NEXT: Symbol: 13 +; RELOC-NEXT: Symbol: 17 ; RELOC-NEXT: - Type: CUSTOM ; RELOC-NEXT: Name: name -; RELOC-NEXT: FunctionNames: +; RELOC-NEXT: FunctionNames: ; RELOC-NEXT: - Index: 0 ; RELOC-NEXT: Name: externDtor ; RELOC-NEXT: - Index: 1 Modified: vendor/lld/dist-release_80/test/wasm/locals-duplicate.test ============================================================================== --- vendor/lld/dist-release_80/test/wasm/locals-duplicate.test Fri Feb 15 20:49:19 2019 (r344172) +++ vendor/lld/dist-release_80/test/wasm/locals-duplicate.test Fri Feb 15 20:49:22 2019 (r344173) @@ -270,40 +270,40 @@ ; RELOC-NEXT: - Type: CODE ; RELOC-NEXT: Relocations: ; RELOC-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_SLEB -; RELOC-NEXT: Index: 4 +; RELOC-NEXT: Index: 18 ; RELOC-NEXT: Offset: 0x00000013 ; RELOC-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_SLEB -; RELOC-NEXT: Index: 6 +; RELOC-NEXT: Index: 3 ; RELOC-NEXT: Offset: 0x0000001C ; RELOC-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_SLEB -; RELOC-NEXT: Index: 8 +; RELOC-NEXT: Index: 19 ; RELOC-NEXT: Offset: 0x00000025 ; RELOC-NEXT: - Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB -; RELOC-NEXT: Index: 0 +; RELOC-NEXT: Index: 16 ; RELOC-NEXT: Offset: 0x0000002E ; RELOC-NEXT: - Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB -; RELOC-NEXT: Index: 1 +; RELOC-NEXT: Index: 0 ; RELOC-NEXT: Offset: 0x00000037 ; RELOC-NEXT: - Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB -; RELOC-NEXT: Index: 2 +; RELOC-NEXT: Index: 17 ; RELOC-NEXT: Offset: 0x00000040 ; RELOC-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_SLEB -; RELOC-NEXT: Index: 16 +; RELOC-NEXT: Index: 10 ; RELOC-NEXT: Offset: 0x00000058 ; RELOC-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_SLEB -; RELOC-NEXT: Index: 18 +; RELOC-NEXT: Index: 22 ; RELOC-NEXT: Offset: 0x00000061 ; RELOC-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_SLEB -; RELOC-NEXT: Index: 20 +; RELOC-NEXT: Index: 23 ; RELOC-NEXT: Offset: 0x0000006A ; RELOC-NEXT: - Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB -; RELOC-NEXT: Index: 12 +; RELOC-NEXT: Index: 8 ; RELOC-NEXT: Offset: 0x00000073 ; RELOC-NEXT: - Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB -; RELOC-NEXT: Index: 13 +; RELOC-NEXT: Index: 20 ; RELOC-NEXT: Offset: 0x0000007C ; RELOC-NEXT: - Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB -; RELOC-NEXT: Index: 14 +; RELOC-NEXT: Index: 21 ; RELOC-NEXT: Offset: 0x00000085 ; RELOC-NEXT: Functions: ; RELOC-NEXT: - Index: 0 @@ -386,133 +386,133 @@ ; RELOC-NEXT: SymbolTable: ; RELOC-NEXT: - Index: 0 ; RELOC-NEXT: Kind: FUNCTION -; RELOC-NEXT: Name: colliding_func1 -; RELOC-NEXT: Flags: [ BINDING_LOCAL ] -; RELOC-NEXT: Function: 0 -; RELOC-NEXT: - Index: 1 -; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: colliding_func2 ; RELOC-NEXT: Flags: [ ] ; RELOC-NEXT: Function: 1 -; RELOC-NEXT: - Index: 2 +; RELOC-NEXT: - Index: 1 ; RELOC-NEXT: Kind: FUNCTION -; RELOC-NEXT: Name: colliding_func3 -; RELOC-NEXT: Flags: [ BINDING_LOCAL ] -; RELOC-NEXT: Function: 2 -; RELOC-NEXT: - Index: 3 -; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: get_global1A ; RELOC-NEXT: Flags: [ ] ; RELOC-NEXT: Function: 3 -; RELOC-NEXT: - Index: 4 -; RELOC-NEXT: Kind: DATA -; RELOC-NEXT: Name: colliding_global1 -; RELOC-NEXT: Flags: [ BINDING_LOCAL ] -; RELOC-NEXT: Segment: 0 -; RELOC-NEXT: Size: 4 -; RELOC-NEXT: - Index: 5 +; RELOC-NEXT: - Index: 2 ; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: get_global2A ; RELOC-NEXT: Flags: [ ] ; RELOC-NEXT: Function: 4 -; RELOC-NEXT: - Index: 6 +; RELOC-NEXT: - Index: 3 ; RELOC-NEXT: Kind: DATA ; RELOC-NEXT: Name: colliding_global2 ; RELOC-NEXT: Flags: [ ] ; RELOC-NEXT: Segment: 1 ; RELOC-NEXT: Size: 4 -; RELOC-NEXT: - Index: 7 +; RELOC-NEXT: - Index: 4 ; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: get_global3A ; RELOC-NEXT: Flags: [ ] ; RELOC-NEXT: Function: 5 -; RELOC-NEXT: - Index: 8 -; RELOC-NEXT: Kind: DATA -; RELOC-NEXT: Name: colliding_global3 -; RELOC-NEXT: Flags: [ BINDING_LOCAL ] -; RELOC-NEXT: Segment: 2 -; RELOC-NEXT: Size: 4 -; RELOC-NEXT: - Index: 9 +; RELOC-NEXT: - Index: 5 ; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: get_func1A ; RELOC-NEXT: Flags: [ ] ; RELOC-NEXT: Function: 6 -; RELOC-NEXT: - Index: 10 +; RELOC-NEXT: - Index: 6 ; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: get_func2A ; RELOC-NEXT: Flags: [ ] ; RELOC-NEXT: Function: 7 -; RELOC-NEXT: - Index: 11 +; RELOC-NEXT: - Index: 7 ; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: get_func3A ; RELOC-NEXT: Flags: [ ] ; RELOC-NEXT: Function: 8 -; RELOC-NEXT: - Index: 12 +; RELOC-NEXT: - Index: 8 ; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: colliding_func1 ; RELOC-NEXT: Flags: [ ] ; RELOC-NEXT: Function: 9 -; RELOC-NEXT: - Index: 13 +; RELOC-NEXT: - Index: 9 ; RELOC-NEXT: Kind: FUNCTION -; RELOC-NEXT: Name: colliding_func2 -; RELOC-NEXT: Flags: [ BINDING_LOCAL ] -; RELOC-NEXT: Function: 10 -; RELOC-NEXT: - Index: 14 -; RELOC-NEXT: Kind: FUNCTION -; RELOC-NEXT: Name: colliding_func3 -; RELOC-NEXT: Flags: [ BINDING_LOCAL ] -; RELOC-NEXT: Function: 11 -; RELOC-NEXT: - Index: 15 -; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: get_global1B ; RELOC-NEXT: Flags: [ ] ; RELOC-NEXT: Function: 12 -; RELOC-NEXT: - Index: 16 +; RELOC-NEXT: - Index: 10 ; RELOC-NEXT: Kind: DATA ; RELOC-NEXT: Name: colliding_global1 ; RELOC-NEXT: Flags: [ ] ; RELOC-NEXT: Segment: 0 ; RELOC-NEXT: Offset: 4 ; RELOC-NEXT: Size: 4 -; RELOC-NEXT: - Index: 17 +; RELOC-NEXT: - Index: 11 ; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: get_global2B ; RELOC-NEXT: Flags: [ ] ; RELOC-NEXT: Function: 13 -; RELOC-NEXT: - Index: 18 -; RELOC-NEXT: Kind: DATA -; RELOC-NEXT: Name: colliding_global2 -; RELOC-NEXT: Flags: [ BINDING_LOCAL ] -; RELOC-NEXT: Segment: 1 -; RELOC-NEXT: Offset: 4 -; RELOC-NEXT: Size: 4 -; RELOC-NEXT: - Index: 19 +; RELOC-NEXT: - Index: 12 ; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: get_global3B ; RELOC-NEXT: Flags: [ ] ; RELOC-NEXT: Function: 14 -; RELOC-NEXT: - Index: 20 -; RELOC-NEXT: Kind: DATA -; RELOC-NEXT: Name: colliding_global3 -; RELOC-NEXT: Flags: [ BINDING_LOCAL ] -; RELOC-NEXT: Segment: 2 -; RELOC-NEXT: Offset: 4 -; RELOC-NEXT: Size: 4 -; RELOC-NEXT: - Index: 21 +; RELOC-NEXT: - Index: 13 ; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: get_func1B ; RELOC-NEXT: Flags: [ ] ; RELOC-NEXT: Function: 15 -; RELOC-NEXT: - Index: 22 +; RELOC-NEXT: - Index: 14 ; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: get_func2B ; RELOC-NEXT: Flags: [ ] ; RELOC-NEXT: Function: 16 -; RELOC-NEXT: - Index: 23 +; RELOC-NEXT: - Index: 15 ; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: get_func3B ; RELOC-NEXT: Flags: [ ] ; RELOC-NEXT: Function: 17 +; RELOC-NEXT: - Index: 16 +; RELOC-NEXT: Kind: FUNCTION +; RELOC-NEXT: Name: colliding_func1 +; RELOC-NEXT: Flags: [ BINDING_LOCAL ] +; RELOC-NEXT: Function: 0 +; RELOC-NEXT: - Index: 17 +; RELOC-NEXT: Kind: FUNCTION +; RELOC-NEXT: Name: colliding_func3 +; RELOC-NEXT: Flags: [ BINDING_LOCAL ] +; RELOC-NEXT: Function: 2 +; RELOC-NEXT: - Index: 18 +; RELOC-NEXT: Kind: DATA +; RELOC-NEXT: Name: colliding_global1 +; RELOC-NEXT: Flags: [ BINDING_LOCAL ] +; RELOC-NEXT: Segment: 0 +; RELOC-NEXT: Size: 4 +; RELOC-NEXT: - Index: 19 +; RELOC-NEXT: Kind: DATA +; RELOC-NEXT: Name: colliding_global3 +; RELOC-NEXT: Flags: [ BINDING_LOCAL ] +; RELOC-NEXT: Segment: 2 +; RELOC-NEXT: Size: 4 +; RELOC-NEXT: - Index: 20 +; RELOC-NEXT: Kind: FUNCTION +; RELOC-NEXT: Name: colliding_func2 +; RELOC-NEXT: Flags: [ BINDING_LOCAL ] +; RELOC-NEXT: Function: 10 +; RELOC-NEXT: - Index: 21 +; RELOC-NEXT: Kind: FUNCTION +; RELOC-NEXT: Name: colliding_func3 +; RELOC-NEXT: Flags: [ BINDING_LOCAL ] +; RELOC-NEXT: Function: 11 +; RELOC-NEXT: - Index: 22 +; RELOC-NEXT: Kind: DATA +; RELOC-NEXT: Name: colliding_global2 +; RELOC-NEXT: Flags: [ BINDING_LOCAL ] +; RELOC-NEXT: Segment: 1 +; RELOC-NEXT: Offset: 4 +; RELOC-NEXT: Size: 4 +; RELOC-NEXT: - Index: 23 +; RELOC-NEXT: Kind: DATA +; RELOC-NEXT: Name: colliding_global3 +; RELOC-NEXT: Flags: [ BINDING_LOCAL ] +; RELOC-NEXT: Segment: 2 +; RELOC-NEXT: Offset: 4 +; RELOC-NEXT: Size: 4 ; RELOC-NEXT: SegmentInfo: ; RELOC-NEXT: - Index: 0 ; RELOC-NEXT: Name: .bss.colliding_global1 Added: vendor/lld/dist-release_80/test/wasm/lto/relocatable-undefined.ll ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lld/dist-release_80/test/wasm/lto/relocatable-undefined.ll Fri Feb 15 20:49:22 2019 (r344173) @@ -0,0 +1,36 @@ +; RUN: llvm-as %s -o %t.o +; RUN: wasm-ld -r -o %t.wasm %t.o +; RUN: obj2yaml %t.wasm | FileCheck %s + +target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" +target triple = "wasm32-unknown-unknown" + +@missing_data = external global i32 +declare i32 @missing_func() local_unnamed_addr + +define i32 @foo() { +entry: + %0 = call i32 @missing_func() + %1 = load i32, i32* @missing_data, align 4 + ret i32 %1 +} + + +; CHECK: - Type: CUSTOM +; CHECK-NEXT: Name: linking +; CHECK-NEXT: Version: 2 +; CHECK-NEXT: SymbolTable: +; CHECK-NEXT: - Index: 0 +; CHECK-NEXT: Kind: FUNCTION +; CHECK-NEXT: Name: missing_func +; CHECK-NEXT: Flags: [ UNDEFINED ] +; CHECK-NEXT: Function: 0 +; CHECK-NEXT: - Index: 1 +; CHECK-NEXT: Kind: FUNCTION +; CHECK-NEXT: Name: foo +; CHECK-NEXT: Flags: [ ] +; CHECK-NEXT: Function: 1 +; CHECK-NEXT: - Index: 2 +; CHECK-NEXT: Kind: DATA +; CHECK-NEXT: Name: missing_data +; CHECK-NEXT: Flags: [ UNDEFINED ] Modified: vendor/lld/dist-release_80/test/wasm/weak-alias.ll ============================================================================== --- vendor/lld/dist-release_80/test/wasm/weak-alias.ll Fri Feb 15 20:49:19 2019 (r344172) +++ vendor/lld/dist-release_80/test/wasm/weak-alias.ll Fri Feb 15 20:49:22 2019 (r344173) @@ -187,13 +187,13 @@ entry: ; RELOC-NEXT: - Type: CODE ; RELOC-NEXT: Relocations: ; RELOC-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB -; RELOC-NEXT: Index: 4 +; RELOC-NEXT: Index: 1 ; RELOC-NEXT: Offset: 0x00000004 ; RELOC-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB -; RELOC-NEXT: Index: 1 +; RELOC-NEXT: Index: 2 ; RELOC-NEXT: Offset: 0x00000013 ; RELOC-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB -; RELOC-NEXT: Index: 4 +; RELOC-NEXT: Index: 1 ; RELOC-NEXT: Offset: 0x0000001C ; RELOC-NEXT: - Type: R_WEBASSEMBLY_GLOBAL_INDEX_LEB ; RELOC-NEXT: Index: 6 @@ -202,10 +202,10 @@ entry: ; RELOC-NEXT: Index: 6 ; RELOC-NEXT: Offset: 0x00000032 ; RELOC-NEXT: - Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB -; RELOC-NEXT: Index: 4 +; RELOC-NEXT: Index: 1 ; RELOC-NEXT: Offset: 0x0000003A ; RELOC-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB -; RELOC-NEXT: Index: 4 +; RELOC-NEXT: Index: 1 ; RELOC-NEXT: Offset: 0x00000043 ; RELOC-NEXT: - Type: R_WEBASSEMBLY_GLOBAL_INDEX_LEB ; RELOC-NEXT: Index: 6 @@ -217,10 +217,10 @@ entry: ; RELOC-NEXT: Index: 6 ; RELOC-NEXT: Offset: 0x00000068 ; RELOC-NEXT: - Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB -; RELOC-NEXT: Index: 1 +; RELOC-NEXT: Index: 2 ; RELOC-NEXT: Offset: 0x00000070 ; RELOC-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB -; RELOC-NEXT: Index: 1 +; RELOC-NEXT: Index: 2 ; RELOC-NEXT: Offset: 0x00000079 ; RELOC-NEXT: - Type: R_WEBASSEMBLY_GLOBAL_INDEX_LEB ; RELOC-NEXT: Index: 6 @@ -259,24 +259,24 @@ entry: ; RELOC-NEXT: Function: 0 ; RELOC-NEXT: - Index: 1 ; RELOC-NEXT: Kind: FUNCTION +; RELOC-NEXT: Name: alias_fn +; RELOC-NEXT: Flags: [ BINDING_WEAK ] +; RELOC-NEXT: Function: 1 +; RELOC-NEXT: - Index: 2 +; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: direct_fn ; RELOC-NEXT: Flags: [ ] ; RELOC-NEXT: Function: 1 -; RELOC-NEXT: - Index: 2 +; RELOC-NEXT: - Index: 3 ; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: call_direct ; RELOC-NEXT: Flags: [ ] ; RELOC-NEXT: Function: 2 -; RELOC-NEXT: - Index: 3 +; RELOC-NEXT: - Index: 4 ; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: call_alias ; RELOC-NEXT: Flags: [ ] ; RELOC-NEXT: Function: 3 -; RELOC-NEXT: - Index: 4 -; RELOC-NEXT: Kind: FUNCTION -; RELOC-NEXT: Name: alias_fn -; RELOC-NEXT: Flags: [ BINDING_WEAK ] -; RELOC-NEXT: Function: 1 ; RELOC-NEXT: - Index: 5 ; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: call_alias_ptr Modified: vendor/lld/dist-release_80/wasm/Driver.cpp ============================================================================== --- vendor/lld/dist-release_80/wasm/Driver.cpp Fri Feb 15 20:49:19 2019 (r344172) +++ vendor/lld/dist-release_80/wasm/Driver.cpp Fri Feb 15 20:49:22 2019 (r344173) @@ -434,7 +434,9 @@ static Symbol *handleUndefined(StringRef Name) { static UndefinedGlobal * createUndefinedGlobal(StringRef Name, llvm::wasm::WasmGlobalType *Type) { auto *Sym = - cast(Symtab->addUndefinedGlobal(Name, 0, nullptr, Type)); + cast(Symtab->addUndefinedGlobal(Name, Name, + DefaultModule, 0, + nullptr, Type)); Config->AllowUndefinedSymbols.insert(Sym->getName()); Sym->IsUsedInRegularObj = true; return Sym; Modified: vendor/lld/dist-release_80/wasm/InputChunks.cpp ============================================================================== --- vendor/lld/dist-release_80/wasm/InputChunks.cpp Fri Feb 15 20:49:19 2019 (r344172) +++ vendor/lld/dist-release_80/wasm/InputChunks.cpp Fri Feb 15 20:49:22 2019 (r344173) @@ -23,7 +23,7 @@ using namespace llvm::support::endian; using namespace lld; using namespace lld::wasm; -static StringRef ReloctTypeToString(uint8_t RelocType) { +static StringRef reloctTypeToString(uint8_t RelocType) { switch (RelocType) { #define WASM_RELOC(NAME, REL) \ case REL: \ @@ -77,7 +77,7 @@ void InputChunk::verifyRelocTargets() const { warn("expected LEB at relocation site be 5-byte padded"); uint32_t ExpectedValue = File->calcExpectedValue(Rel); if (ExpectedValue != ExistingValue) - warn("unexpected existing value for " + ReloctTypeToString(Rel.Type) + + warn("unexpected existing value for " + reloctTypeToString(Rel.Type) + ": existing=" + Twine(ExistingValue) + " expected=" + Twine(ExpectedValue)); } @@ -103,7 +103,7 @@ void InputChunk::writeTo(uint8_t *Buf) const { for (const WasmRelocation &Rel : Relocations) { uint8_t *Loc = Buf + Rel.Offset + Off; uint32_t Value = File->calcNewValue(Rel); - LLVM_DEBUG(dbgs() << "apply reloc: type=" << ReloctTypeToString(Rel.Type) + LLVM_DEBUG(dbgs() << "apply reloc: type=" << reloctTypeToString(Rel.Type) << " addend=" << Rel.Addend << " index=" << Rel.Index << " value=" << Value << " offset=" << Rel.Offset << "\n"); Modified: vendor/lld/dist-release_80/wasm/InputFiles.cpp ============================================================================== --- vendor/lld/dist-release_80/wasm/InputFiles.cpp Fri Feb 15 20:49:19 2019 (r344172) +++ vendor/lld/dist-release_80/wasm/InputFiles.cpp Fri Feb 15 20:49:22 2019 (r344173) @@ -377,11 +377,15 @@ Symbol *ObjFile::createUndefined(const WasmSymbol &Sym switch (Sym.Info.Kind) { case WASM_SYMBOL_TYPE_FUNCTION: - return Symtab->addUndefinedFunction(Name, Flags, this, Sym.Signature); + return Symtab->addUndefinedFunction(Name, Sym.Info.ImportName, + Sym.Info.ImportModule, Flags, this, + Sym.Signature); case WASM_SYMBOL_TYPE_DATA: return Symtab->addUndefinedData(Name, Flags, this); case WASM_SYMBOL_TYPE_GLOBAL: - return Symtab->addUndefinedGlobal(Name, Flags, this, Sym.GlobalType); + return Symtab->addUndefinedGlobal(Name, Sym.Info.ImportName, + Sym.Info.ImportModule, Flags, this, + Sym.GlobalType); case WASM_SYMBOL_TYPE_SECTION: llvm_unreachable("section symbols cannot be undefined"); } @@ -445,7 +449,8 @@ static Symbol *createBitcodeSymbol(const lto::InputFil if (ObjSym.isUndefined()) { if (ObjSym.isExecutable()) - return Symtab->addUndefinedFunction(Name, Flags, &F, nullptr); + return Symtab->addUndefinedFunction(Name, Name, DefaultModule, Flags, &F, + nullptr); return Symtab->addUndefinedData(Name, Flags, &F); *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***