Index: lib/Driver/CMakeLists.txt =================================================================== --- lib/Driver/CMakeLists.txt +++ lib/Driver/CMakeLists.txt @@ -1,11 +1,8 @@ -set(LLVM_TARGET_DEFINITIONS CoreOptions.td) -tablegen(LLVM CoreOptions.inc -gen-opt-parser-defs) set(LLVM_TARGET_DEFINITIONS DarwinLdOptions.td) tablegen(LLVM DarwinLdOptions.inc -gen-opt-parser-defs) add_public_tablegen_target(DriverOptionsTableGen) add_lld_library(lldDriver - CoreDriver.cpp DarwinLdDriver.cpp Driver.cpp Index: lib/Driver/CoreDriver.cpp =================================================================== --- lib/Driver/CoreDriver.cpp +++ /dev/null @@ -1,173 +0,0 @@ -//===- lib/Driver/CoreDriver.cpp ------------------------------------------===// -// -// The LLVM Linker -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "lld/Core/Reader.h" -#include "lld/Driver/Driver.h" -#include "lld/ReaderWriter/CoreLinkingContext.h" -#include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/Triple.h" -#include "llvm/Option/Arg.h" -#include "llvm/Option/Option.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/FileSystem.h" -#include "llvm/Support/Host.h" -#include "llvm/Support/ManagedStatic.h" -#include "llvm/Support/Path.h" -#include "llvm/Support/PrettyStackTrace.h" -#include "llvm/Support/Signals.h" -#include "llvm/Support/raw_ostream.h" - -using namespace lld; - -namespace { - -// Create enum with OPT_xxx values for each option in CoreOptions.td -enum { - OPT_INVALID = 0, -#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \ - HELP, META) \ - OPT_##ID, -#include "CoreOptions.inc" -#undef OPTION -}; - -// Create prefix string literals used in CoreOptions.td -#define PREFIX(NAME, VALUE) const char *const NAME[] = VALUE; -#include "CoreOptions.inc" -#undef PREFIX - -// Create table mapping all options defined in CoreOptions.td -static const llvm::opt::OptTable::Info infoTable[] = { -#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \ - HELPTEXT, METAVAR) \ - { PREFIX, NAME, HELPTEXT, METAVAR, OPT_##ID, llvm::opt::Option::KIND##Class, \ - PARAM, FLAGS, OPT_##GROUP, OPT_##ALIAS, ALIASARGS }, -#include "CoreOptions.inc" -#undef OPTION -}; - -// Create OptTable class for parsing actual command line arguments -class CoreOptTable : public llvm::opt::OptTable { -public: - CoreOptTable() : OptTable(infoTable) {} -}; - -} // namespace anonymous - - -namespace lld { - -static const Registry::KindStrings coreKindStrings[] = { - { CoreLinkingContext::TEST_RELOC_CALL32, "call32" }, - { CoreLinkingContext::TEST_RELOC_PCREL32, "pcrel32" }, - { CoreLinkingContext::TEST_RELOC_GOT_LOAD32, "gotLoad32" }, - { CoreLinkingContext::TEST_RELOC_GOT_USE32, "gotUse32" }, - { CoreLinkingContext::TEST_RELOC_LEA32_WAS_GOT, "lea32wasGot" }, - LLD_KIND_STRING_END -}; - -bool CoreDriver::link(llvm::ArrayRef args, - raw_ostream &diagnostics) { - CoreLinkingContext ctx; - - // Register possible input file parsers. - ctx.registry().addSupportYamlFiles(); - ctx.registry().addKindTable(Reference::KindNamespace::testing, - Reference::KindArch::all, coreKindStrings); - - if (!parse(args, ctx)) - return false; - return Driver::link(ctx); -} - -bool CoreDriver::parse(llvm::ArrayRef args, - CoreLinkingContext &ctx, raw_ostream &diagnostics) { - // Parse command line options using CoreOptions.td - CoreOptTable table; - unsigned missingIndex; - unsigned missingCount; - llvm::opt::InputArgList parsedArgs = - table.ParseArgs(args.slice(1), missingIndex, missingCount); - if (missingCount) { - diagnostics << "error: missing arg value for '" - << parsedArgs.getArgString(missingIndex) << "' expected " - << missingCount << " argument(s).\n"; - return false; - } - - // Set default options - ctx.setOutputPath("-"); - ctx.setDeadStripping(false); - ctx.setGlobalsAreDeadStripRoots(false); - ctx.setPrintRemainingUndefines(false); - ctx.setAllowRemainingUndefines(true); - ctx.setSearchArchivesToOverrideTentativeDefinitions(false); - - // Process all the arguments and create input files. - for (auto inputArg : parsedArgs) { - switch (inputArg->getOption().getID()) { - case OPT_mllvm: - ctx.appendLLVMOption(inputArg->getValue()); - break; - - case OPT_entry: - ctx.setEntrySymbolName(inputArg->getValue()); - break; - - case OPT_output: - ctx.setOutputPath(inputArg->getValue()); - break; - - case OPT_dead_strip: - ctx.setDeadStripping(true); - break; - - case OPT_keep_globals: - ctx.setGlobalsAreDeadStripRoots(true); - break; - - case OPT_undefines_are_errors: - ctx.setPrintRemainingUndefines(true); - ctx.setAllowRemainingUndefines(false); - break; - - case OPT_commons_search_archives: - ctx.setSearchArchivesToOverrideTentativeDefinitions(true); - break; - - case OPT_add_pass: - ctx.addPassNamed(inputArg->getValue()); - break; - - case OPT_INPUT: { - std::vector> files - = loadFile(ctx, inputArg->getValue(), false); - for (std::unique_ptr &file : files) - ctx.getNodes().push_back(llvm::make_unique(std::move(file))); - break; - } - - default: - break; - } - } - - parseLLVMOptions(ctx); - - if (ctx.getNodes().empty()) { - diagnostics << "No input files\n"; - return false; - } - - // Validate the combination of options used. - return ctx.validate(diagnostics); -} - -} // namespace lld Index: lib/Driver/CoreOptions.td =================================================================== --- lib/Driver/CoreOptions.td +++ /dev/null @@ -1,15 +0,0 @@ -include "llvm/Option/OptParser.td" - -def output : Separate<["-"], "o">; -def entry : Separate<["-"], "e">; - -def dead_strip : Flag<["--"], "dead-strip">; -def undefines_are_errors : Flag<["--"], "undefines-are-errors">; -def keep_globals : Flag<["--"], "keep-globals">; -def commons_search_archives : Flag<["--"], "commons-search-archives">; - -def add_pass : Separate<["--"], "add-pass">; - -def target : Separate<["-"], "target">, HelpText<"Target triple to link for">; -def mllvm : Separate<["-"], "mllvm">, HelpText<"Options to pass to LLVM">; - Index: test/core/Inputs/archive-basic.objtxt =================================================================== --- test/core/Inputs/archive-basic.objtxt +++ /dev/null @@ -1,21 +0,0 @@ ---- !archive -members: - - name: bar.o - content: !native - defined-atoms: - - name: bar - scope: global - type: code - - - name: bar2 - type: code - - - name: baz.o - content: !native - defined-atoms: - - name: baz - scope: global - type: code - - - name: baz2 - type: code Index: test/core/Inputs/archive-chain.objtxt =================================================================== --- test/core/Inputs/archive-chain.objtxt +++ /dev/null @@ -1,24 +0,0 @@ ---- !archive -members: - - name: bar1.o - content: !native - defined-atoms: - - name: bar1 - scope: global - type: code - - - name: bar1b - type: code - - undefined-atoms: - - name: baz1 - - - name: bar2.o - content: !native - defined-atoms: - - name: bar2 - scope: global - type: code - - - name: bar2b - type: code Index: test/core/Inputs/archive-chain2.objtxt =================================================================== --- test/core/Inputs/archive-chain2.objtxt +++ /dev/null @@ -1,21 +0,0 @@ ---- !archive -members: - - name: baz1.o - content: !native - defined-atoms: - - name: baz1 - scope: global - type: code - - - name: baz1b - type: code - - - name: baz2.o - content: !native - defined-atoms: - - name: baz2 - scope: global - type: code - - - name: baz2b - type: code Index: test/core/Inputs/archive-tentdef-search.objtxt =================================================================== --- test/core/Inputs/archive-tentdef-search.objtxt +++ /dev/null @@ -1,11 +0,0 @@ ---- !archive -members: - - name: bar.o - content: !native - defined-atoms: - - name: bar - scope: global - type: data - - - name: bar2 - type: data Index: test/core/Inputs/associates.objtxt =================================================================== --- test/core/Inputs/associates.objtxt +++ /dev/null @@ -1,8 +0,0 @@ -defined-atoms: - - name: f1 - merge: as-weak - scope: global - references: - - kind: associate - target: f2 - - name: f2 Index: test/core/Inputs/auto-hide-coalesce.objtxt =================================================================== --- test/core/Inputs/auto-hide-coalesce.objtxt +++ /dev/null @@ -1,20 +0,0 @@ -defined-atoms: - - name: _inlineFunc1 - scope: global - type: code - merge: as-weak - - - name: _inlineFunc2 - scope: global - type: code - merge: as-addressed-weak - - - name: _inlineFunc3 - scope: global - type: code - merge: as-weak - - - name: _inlineFunc4 - scope: global - type: code - merge: as-addressed-weak Index: test/core/Inputs/code-model-attributes.objtxt =================================================================== --- test/core/Inputs/code-model-attributes.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -defined-atoms: - - name: _none - code-model: none Index: test/core/Inputs/code-model-attributes2.objtxt =================================================================== --- test/core/Inputs/code-model-attributes2.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -defined-atoms: - - name: _mips_pic - code-model: mips-pic Index: test/core/Inputs/code-model-attributes3.objtxt =================================================================== --- test/core/Inputs/code-model-attributes3.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -defined-atoms: - - name: _mips_micro - code-model: mips-micro Index: test/core/Inputs/code-model-attributes4.objtxt =================================================================== --- test/core/Inputs/code-model-attributes4.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -defined-atoms: - - name: _mips_micro_pic - code-model: mips-micro-pic Index: test/core/Inputs/code-model-attributes5.objtxt =================================================================== --- test/core/Inputs/code-model-attributes5.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -defined-atoms: - - name: _mips_16 - code-model: mips-16 Index: test/core/Inputs/constants-coalesce.objtxt =================================================================== --- test/core/Inputs/constants-coalesce.objtxt +++ /dev/null @@ -1,9 +0,0 @@ ---- -defined-atoms: - - ref-name: L1 - type: constant - content: [ 01, 02 ] - - ref-name: L2 - type: constant - merge: by-content - content: [ 01, 02, 03, 04 ] Index: test/core/Inputs/constants-coalesce2.objtxt =================================================================== --- test/core/Inputs/constants-coalesce2.objtxt +++ /dev/null @@ -1,10 +0,0 @@ ---- -defined-atoms: - - ref-name: L2 - type: constant - merge: by-content - content: [ 01, 23, 45, 67, 89, AB, CD, EF ] - - ref-name: L3 - type: constant - merge: by-content - content: [ 01, 02, 03 ] Index: test/core/Inputs/cstring-coalesce.objtxt =================================================================== --- test/core/Inputs/cstring-coalesce.objtxt +++ /dev/null @@ -1,6 +0,0 @@ ---- -defined-atoms: - - ref-name: L2 - type: c-string - merge: by-content - content: [ 68, 65, 6c, 6c, 6f, 00 ] Index: test/core/Inputs/cstring-coalesce2.objtxt =================================================================== --- test/core/Inputs/cstring-coalesce2.objtxt +++ /dev/null @@ -1,6 +0,0 @@ ---- -defined-atoms: - - ref-name: L2 - type: c-string - merge: by-content - content: [ 74, 68, 65, 72, 65, 00 ] Index: test/core/Inputs/custom-section-coalesce.objtxt =================================================================== --- test/core/Inputs/custom-section-coalesce.objtxt +++ /dev/null @@ -1,15 +0,0 @@ ---- -defined-atoms: - - ref-name: L1 - type: constant - merge: by-content - content: [ 01, 02, 03, 04 ] - section-choice: custom-required - section-name: .mysection - - - ref-name: L2 - type: constant - merge: by-content - content: [ 01, 02, 03, 04 ] - section-choice: custom-required - section-name: .mysection2 Index: test/core/Inputs/custom-section-coalesce2.objtxt =================================================================== --- test/core/Inputs/custom-section-coalesce2.objtxt +++ /dev/null @@ -1,13 +0,0 @@ ---- -defined-atoms: - - ref-name: L1 - type: constant - merge: by-content - content: [ 05, 06, 07, 08 ] - section-choice: custom-required - section-name: .mysection - - - ref-name: L2 - type: constant - merge: by-content - content: [ 01, 02, 03, 04 ] Index: test/core/Inputs/dead-strip-attributes.objtxt =================================================================== --- test/core/Inputs/dead-strip-attributes.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -defined-atoms: - - name: _foo2 - dead-strip: never Index: test/core/Inputs/dead-strip-attributes2.objtxt =================================================================== --- test/core/Inputs/dead-strip-attributes2.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -defined-atoms: - - name: _foo3 - dead-strip: always Index: test/core/Inputs/dead-strip-basic.objtxt =================================================================== --- test/core/Inputs/dead-strip-basic.objtxt +++ /dev/null @@ -1,9 +0,0 @@ ---- -defined-atoms: - - name: mydead2 - scope: global - type: data - - - name: bar - scope: global - type: data Index: test/core/Inputs/dead-strip-basic2.objtxt =================================================================== --- test/core/Inputs/dead-strip-basic2.objtxt +++ /dev/null @@ -1,8 +0,0 @@ ---- -defined-atoms: - - name: baz - scope: global - type: code - - - name: mydead3 - type: code Index: test/core/Inputs/dead-strip-globals.objtxt =================================================================== --- test/core/Inputs/dead-strip-globals.objtxt +++ /dev/null @@ -1,9 +0,0 @@ ---- -defined-atoms: - - name: myglobal2 - scope: global - type: data - - - name: bar - scope: hidden - type: data Index: test/core/Inputs/dead-strip-globals2.objtxt =================================================================== --- test/core/Inputs/dead-strip-globals2.objtxt +++ /dev/null @@ -1,8 +0,0 @@ ---- -defined-atoms: - - name: baz - scope: hidden - type: code - - - name: mydead - type: code Index: test/core/Inputs/error-duplicate-absolutes.objtxt =================================================================== --- test/core/Inputs/error-duplicate-absolutes.objtxt +++ /dev/null @@ -1,5 +0,0 @@ ---- -absolute-atoms: - - name: absatom - value: 0 - scope: global Index: test/core/Inputs/gnulinkonce-remaining-undef2.objtxt =================================================================== --- test/core/Inputs/gnulinkonce-remaining-undef2.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -undefined-atoms: - - name: f3 - can-be-null: never Index: test/core/Inputs/gnulinkonce-simple.objtxt =================================================================== --- test/core/Inputs/gnulinkonce-simple.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -undefined-atoms: - - name: f1 - can-be-null: never Index: test/core/Inputs/inline-coalesce.objtxt =================================================================== --- test/core/Inputs/inline-coalesce.objtxt +++ /dev/null @@ -1,6 +0,0 @@ ---- -defined-atoms: - - name: _inlineFunc - scope: global - type: code - merge: as-weak Index: test/core/Inputs/inline-coalesce2.objtxt =================================================================== --- test/core/Inputs/inline-coalesce2.objtxt +++ /dev/null @@ -1,6 +0,0 @@ ---- -defined-atoms: - - name: _inlineFunc - scope: global - type: code - merge: as-weak Index: test/core/Inputs/multiple-def-error.objtxt =================================================================== --- test/core/Inputs/multiple-def-error.objtxt +++ /dev/null @@ -1,5 +0,0 @@ ---- -defined-atoms: - - name: _foo - scope: global - type: data Index: test/core/Inputs/sectiongroup-deadstrip.objtxt =================================================================== --- test/core/Inputs/sectiongroup-deadstrip.objtxt +++ /dev/null @@ -1,3 +0,0 @@ -undefined-atoms: - - name: f1 - can-be-null: never Index: test/core/Inputs/sectiongroup-remaining-undef2.objtxt =================================================================== --- test/core/Inputs/sectiongroup-remaining-undef2.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -undefined-atoms: - - name: f3 - can-be-null: never Index: test/core/Inputs/sectiongroup-simple.objtxt =================================================================== --- test/core/Inputs/sectiongroup-simple.objtxt +++ /dev/null @@ -1,4 +0,0 @@ ---- -undefined-atoms: - - name: f1 - can-be-null: never Index: test/core/Inputs/shared-library-coalesce.objtxt =================================================================== --- test/core/Inputs/shared-library-coalesce.objtxt +++ /dev/null @@ -1,28 +0,0 @@ ---- -shared-library-atoms: - - name: foo2 - load-name: libc.so - - - name: foo3 - load-name: libc.so - - - name: bar2 - load-name: libc.so - can-be-null: at-runtime - - - name: bar3 - load-name: libc.so - can-be-null: at-runtime - - - name: mismatchNull1 - load-name: libc.so - - - name: mismatchNull2 - load-name: libc.so - can-be-null: at-runtime - - - name: mismatchload1 - load-name: libb.so - - - name: mismatchload2 - load-name: liba.so Index: test/core/Inputs/tent-merge.objtxt =================================================================== --- test/core/Inputs/tent-merge.objtxt +++ /dev/null @@ -1,6 +0,0 @@ ---- -defined-atoms: - - name: _foo - scope: global - type: data - content: [ 00, 00, 00, 00 ] Index: test/core/Inputs/undef-coalesce-error.objtxt =================================================================== --- test/core/Inputs/undef-coalesce-error.objtxt +++ /dev/null @@ -1,8 +0,0 @@ ---- -defined-atoms: - - name: bar - type: code - -undefined-atoms: - - name: malloc - - name: myfunc Index: test/core/Inputs/undef-coalesce-error2.objtxt =================================================================== --- test/core/Inputs/undef-coalesce-error2.objtxt +++ /dev/null @@ -1,8 +0,0 @@ ---- -defined-atoms: - - name: myfunc - scope: global - type: code - -undefined-atoms: - - name: free Index: test/core/Inputs/undef-coalesce.objtxt =================================================================== --- test/core/Inputs/undef-coalesce.objtxt +++ /dev/null @@ -1,8 +0,0 @@ ---- -defined-atoms: - - name: bar - type: code - -undefined-atoms: - - name: malloc - - name: myfunc Index: test/core/Inputs/undef-coalesce2.objtxt =================================================================== --- test/core/Inputs/undef-coalesce2.objtxt +++ /dev/null @@ -1,8 +0,0 @@ ---- -defined-atoms: - - name: myfunc - scope: global - type: code - -undefined-atoms: - - name: free Index: test/core/Inputs/undef-fallback.objtxt =================================================================== --- test/core/Inputs/undef-fallback.objtxt +++ /dev/null @@ -1,7 +0,0 @@ -defined-atoms: - - name: fallback1 - -undefined-atoms: - - name: def1 - fallback: - name: fallback3 Index: test/core/Inputs/undef-weak-coalesce.objtxt =================================================================== --- test/core/Inputs/undef-weak-coalesce.objtxt +++ /dev/null @@ -1,20 +0,0 @@ ---- -undefined-atoms: - - name: bar1 - can-be-null: never - - name: bar2 - can-be-null: at-runtime - - name: bar3 - can-be-null: at-buildtime - - name: bar4 - can-be-null: at-runtime - - name: bar5 - can-be-null: at-buildtime - - name: bar6 - can-be-null: never - - name: bar7 - can-be-null: at-buildtime - - name: bar8 - can-be-null: never - - name: bar9 - can-be-null: at-runtime Index: test/core/Inputs/weak-coalesce.objtxt =================================================================== --- test/core/Inputs/weak-coalesce.objtxt +++ /dev/null @@ -1,5 +0,0 @@ ---- -defined-atoms: - - name: _foo - scope: global - type: data Index: test/core/Inputs/weak-coalesce2.objtxt =================================================================== --- test/core/Inputs/weak-coalesce2.objtxt +++ /dev/null @@ -1,6 +0,0 @@ ---- -defined-atoms: - - name: _foo - merge: as-weak - scope: global - type: data Index: test/core/absolute-basic.objtxt =================================================================== --- test/core/absolute-basic.objtxt +++ /dev/null @@ -1,23 +0,0 @@ -# RUN: lld -core --dead-strip %s | FileCheck %s - -# -# Test that absolute symbols are parsed and preserved -# - ---- -absolute-atoms: - - name: putchar - value: 0xFFFF0040 - - - name: reset - value: 0xFFFF0080 - -... - - -# CHECK: absolute-atoms: -# CHECK: name: putchar -# CHECK: value: 0x00000000FFFF0040 -# CHECK: name: reset -# CHECK: value: 0x00000000FFFF0080 -# CHECK: ... Index: test/core/absolute-local.objtxt =================================================================== --- test/core/absolute-local.objtxt +++ /dev/null @@ -1,25 +0,0 @@ -# RUN: lld -core %s | FileCheck %s - -# -# Test that absolute symbols with local scope do not cause name conflict -# ---- -absolute-atoms: - - name: putchar - ref-name: pc1 - value: 0xFFFF0040 - scope: static - - - name: putchar - ref-name: pc2 - value: 0xFFFF0040 - scope: static -... - -# CHECK: --- -# CHECK: absolute-atoms: -# CHECK: - name: putchar -# CHECK: value: 0x00000000FFFF0040 -# CHECK: - name: putchar -# CHECK: value: 0x00000000FFFF0040 -# CHECK: ... Index: test/core/archive-basic.objtxt =================================================================== --- test/core/archive-basic.objtxt +++ /dev/null @@ -1,23 +0,0 @@ -# RUN: lld -core %s %p/Inputs/archive-basic.objtxt | FileCheck %s - -# -# Tests archives in YAML. Tests that an undefined in a regular file will load -# all atoms in select archive members. -# - ---- !native -defined-atoms: - - name: foo - type: code - -undefined-atoms: - - name: bar - -... - -# CHECK: name: foo -# CHECK-NOT: undefined-atoms: -# CHECK: name: bar -# CHECK: name: bar2 -# CHECK-NOT: name: baz -# CHECK: ... Index: test/core/archive-chain.objtxt =================================================================== --- test/core/archive-chain.objtxt +++ /dev/null @@ -1,23 +0,0 @@ -# RUN: lld -core %s %p/Inputs/archive-chain.objtxt %p/Inputs/archive-chain2.objtxt | FileCheck %s - -# -# Tests that an undefine in one archive can force a load from another archive. -# - ---- !native -defined-atoms: - - name: foo - type: code - -undefined-atoms: - - name: bar1 -... - -# CHECK: name: foo -# CHECK: name: bar1 -# CHECK: name: bar1b -# CHECK-NOT: name: bar2 -# CHECK: name: baz1 -# CHECK: name: baz1b -# CHECK-NOT: name: baz2 -# CHECK: ... Index: test/core/archive-tentdef-search.objtxt =================================================================== --- test/core/archive-tentdef-search.objtxt +++ /dev/null @@ -1,30 +0,0 @@ -# RUN: lld -core %s %p/Inputs/archive-tentdef-search.objtxt | FileCheck -check-prefix=CHK1 %s -# RUN: lld -core --commons-search-archives %s %p/Inputs/archive-tentdef-search.objtxt | FileCheck -check-prefix=CHK2 %s - -# -# Tests that -commons-search-archives cause core linker to look for overrides -# of tentative definition in archives, and that not using that option -# does not search. -# - ---- !native -defined-atoms: - - name: foo - type: code - - - name: bar - scope: global - type: zero-fill - merge: as-tentative -... - -# CHK1: name: foo -# CHK1: name: bar -# CHK1: merge: as-tentative -# CHK1: ... - -# CHK2: name: foo -# CHK2: name: bar -# CHK2-NOT: merge: as-tentative -# CHK2: name: bar2 -# CHK2: ... Index: test/core/associates.objtxt =================================================================== --- test/core/associates.objtxt +++ /dev/null @@ -1,21 +0,0 @@ -# RUN: lld -core %s %p/Inputs/associates.objtxt | FileCheck %s - ---- -defined-atoms: - - name: f1 - merge: as-weak - scope: global - references: - - kind: associate - target: f2 - - name: f2 -... - -# CHECK: defined-atoms: -# CHECK: - name: f1 -# CHECK: scope: global -# CHECK: references: -# CHECK: - kind: associate -# CHECK: target: f2 -# CHECK: - name: f2 -# CHECK-NOT: - name: f2 Index: test/core/auto-hide-coalesce.objtxt =================================================================== --- test/core/auto-hide-coalesce.objtxt +++ /dev/null @@ -1,39 +0,0 @@ -# RUN: lld -core %s %p/Inputs/auto-hide-coalesce.objtxt | FileCheck %s - -# -# Tests auto-hide bit during coalescing -# - ---- -defined-atoms: - - name: _inlineFunc1 - scope: global - type: code - merge: as-weak - - - name: _inlineFunc2 - scope: global - type: code - merge: as-weak - - - name: _inlineFunc3 - scope: global - type: code - merge: as-addressed-weak - - - name: _inlineFunc4 - scope: global - type: code - merge: as-addressed-weak -... - - -# CHECK: name: _inlineFunc1 -# CHECK: merge: as-weak -# CHECK: name: _inlineFunc3 -# CHECK: merge: as-addressed-weak -# CHECK: name: _inlineFunc4 -# CHECK: merge: as-addressed-weak -# CHECK: name: _inlineFunc2 -# CHECK: merge: as-addressed-weak -# CHECK: ... Index: test/core/code-model-attributes.objtxt =================================================================== --- test/core/code-model-attributes.objtxt +++ /dev/null @@ -1,33 +0,0 @@ -# RUN: lld -core %s %p/Inputs/code-model-attributes.objtxt \ -# RUN: %p/Inputs/code-model-attributes2.objtxt \ -# RUN: %p/Inputs/code-model-attributes3.objtxt \ -# RUN: %p/Inputs/code-model-attributes4.objtxt \ -# RUN: %p/Inputs/code-model-attributes5.objtxt | FileCheck %s -# -# Test that code model attributes are preserved -# - ---- -defined-atoms: - - name: _def -... - -# CHECK: name: _def -# CHECK-NOT: code-model: mips-pic -# CHECK-NOT: code-model: mips-micro -# CHECK-NOT: code-model: mips-micro-pic -# CHECK-NOT: code-model: mips-16 -# CHECK: name: _none -# CHECK-NOT: code-model: mips-pic -# CHECK-NOT: code-model: mips-micro -# CHECK-NOT: code-model: mips-micro-pic -# CHECK-NOT: code-model: mips-16 -# CHECK: name: _mips_pic -# CHECK: code-model: mips-pic -# CHECK: name: _mips_micro -# CHECK: code-model: mips-micro -# CHECK: name: _mips_micro_pic -# CHECK: code-model: mips-micro-pic -# CHECK: name: _mips_16 -# CHECK: code-model: mips-16 -# CHECK: ... Index: test/core/constants-coalesce.objtxt =================================================================== --- test/core/constants-coalesce.objtxt +++ /dev/null @@ -1,42 +0,0 @@ -# RUN: lld -core %s %p/Inputs/constants-coalesce.objtxt \ -# RUN: %p/Inputs/constants-coalesce2.objtxt | FileCheck %s - -# -# Test that duplicate merge-by-content anonymous constants are coalesced -# and non-mergable duplicate constants are not coalesced. -# - ---- -defined-atoms: - - ref-name: L4-byte - type: constant - merge: by-content - content: [ 01, 02, 03, 04 ] - - - ref-name: L8-byte - type: constant - merge: by-content - content: [ 01, 23, 45, 67, 89, AB, CD, EF ] - - - ref-name: L1 - type: constant - content: [ 01, 02 ] -... - -# CHECK-NOT: name: -# CHECK: type: constant -# CHECK: content: [ 01, 02, 03, 04 ] -# CHECK: merge: by-content -# CHECK: type: constant -# CHECK: content: [ 01, 23, 45, 67, 89, AB, CD, EF ] -# CHECK: merge: by-content -# CHECK: type: constant -# CHECK: content: [ 01, 02 ] -# CHECK: type: constant -# CHECK: content: [ 01, 02 ] -# CHECK: type: constant -# CHECK: content: [ 01, 02, 03 ] -# CHECK: merge: by-content -# CHECK: ... - - Index: test/core/cstring-coalesce.objtxt =================================================================== --- test/core/cstring-coalesce.objtxt +++ /dev/null @@ -1,29 +0,0 @@ -# RUN: lld -core %s | FileCheck %s - -# -# Test that duplicate c-strings are coalesced -# - ---- -defined-atoms: - - ref-name: L0 - type: c-string - merge: by-content - content: [ 68, 65, 6c, 6c, 6f, 00 ] - - - ref-name: L1 - type: c-string - merge: by-content - content: [ 74, 68, 65, 72, 65, 00 ] -... - -# CHECK-NOT: name: -# CHECK: type: c-string -# CHECK: content: [ 68, 65, 6C, 6C, 6F, 00 ] -# CHECK: merge: by-content -# CHECK: type: c-string -# CHECK: content: [ 74, 68, 65, 72, 65, 00 ] -# CHECK: merge: by-content -# CHECK: ... - - Index: test/core/custom-section-coalesce.objtxt =================================================================== --- test/core/custom-section-coalesce.objtxt +++ /dev/null @@ -1,50 +0,0 @@ -# RUN: lld -core %s %p/Inputs/custom-section-coalesce.objtxt \ -# RUN: %p/Inputs/custom-section-coalesce2.objtxt | FileCheck %s - -# -# Test that custom sections are preserved when duplicate merge-by-content -# constants are coalesced. -# - ---- -defined-atoms: - - ref-name: L1 - type: constant - merge: by-content - content: [ 01, 02, 03, 04 ] - section-choice: custom-required - section-name: .mysection - - - ref-name: L2 - type: constant - merge: by-content - content: [ 05, 06, 07, 08 ] - section-choice: custom-required - section-name: .mysection - - - ref-name: L3 - type: constant - merge: by-content - content: [ 01, 02, 03, 04 ] -... - - -# CHECK:defined-atoms: -# CHECK: - type: constant -# CHECK: content: [ 01, 02, 03, 04 ] -# CHECK: merge: by-content -# CHECK: section-choice: custom-required -# CHECK: section-name: .mysection -# CHECK: - type: constant -# CHECK: content: [ 05, 06, 07, 08 ] -# CHECK: merge: by-content -# CHECK: section-choice: custom-required -# CHECK: section-name: .mysection -# CHECK: - type: constant -# CHECK: content: [ 01, 02, 03, 04 ] -# CHECK: merge: by-content -# CHECK: - type: constant -# CHECK: content: [ 01, 02, 03, 04 ] -# CHECK: merge: by-content -# CHECK: section-choice: custom-required -# CHECK: section-name: .mysection2 Index: test/core/custom-section.objtxt =================================================================== --- test/core/custom-section.objtxt +++ /dev/null @@ -1,34 +0,0 @@ -# RUN: lld -core %s | FileCheck %s - -# -# Test that custom sections are preserved -# - ---- -defined-atoms: - - name: _foo1 - scope: global - section-choice: content - - - name: _foo2 - scope: global - section-choice: custom - section-name: __foozle - - - name: _foo3 - scope: global - section-choice: custom-required - section-name: __boozle - -... - - -# CHECK: name: _foo1 -# CHECK-NOT: section-name: -# CHECK: name: _foo2 -# CHECK: section-choice: custom -# CHECK: section-name: __foozle -# CHECK: name: _foo3 -# CHECK: section-choice: custom-required -# CHECK: section-name: __boozle -# CHECK: ... Index: test/core/dead-strip-attributes.objtxt =================================================================== --- test/core/dead-strip-attributes.objtxt +++ /dev/null @@ -1,22 +0,0 @@ -# RUN: lld -core %s %p/Inputs/dead-strip-attributes.objtxt \ -# RUN: %p/Inputs/dead-strip-attributes2.objtxt | FileCheck %s - -# -# Test that dead strip attributes are preserved -# - ---- -defined-atoms: - - name: _foo1 - dead-strip: normal -... - - -# CHECK: name: _foo1 -# CHECK-NOT: dead-strip: never -# CHECK-NOT: dead-strip: always -# CHECK: name: _foo2 -# CHECK: dead-strip: never -# CHECK: name: _foo3 -# CHECK: dead-strip: always -# CHECK: ... Index: test/core/dead-strip-basic.objtxt =================================================================== --- test/core/dead-strip-basic.objtxt +++ /dev/null @@ -1,45 +0,0 @@ -# RUN: lld -core --dead-strip %s %p/Inputs/dead-strip-basic.objtxt %p/Inputs/dead-strip-basic2.objtxt | FileCheck -check-prefix=CHK1 %s -# RUN: lld -core %s %p/Inputs/dead-strip-basic.objtxt %p/Inputs/dead-strip-basic2.objtxt | FileCheck -check-prefix=CHK2 %s - -# -# Test that -dead-strip removes unreachable code and data -# and that not using that option leaves them. -# - ---- -defined-atoms: - - name: entry - dead-strip: never - references: - - offset: 1 - kind: pcrel32 - target: bar - - offset: 6 - kind: pcrel32 - target: baz - - - name: mydead1 - scope: global - -undefined-atoms: - - name: bar - - - name: baz -... - - -# CHK1: name: entry -# CHK1-NOT: name: mydead1 -# CHK1: name: bar -# CHK1-NOT: name: mydead2 -# CHK1: name: baz -# CHK1-NOT: name: mydead3 -# CHK1: ... - -# CHK2: name: entry -# CHK2: name: mydead1 -# CHK2: name: mydead2 -# CHK2: name: bar -# CHK2: name: baz -# CHK2: name: mydead3 -# CHK2: ... Index: test/core/dead-strip-globals.objtxt =================================================================== --- test/core/dead-strip-globals.objtxt +++ /dev/null @@ -1,43 +0,0 @@ -# RUN: lld -core --dead-strip --keep-globals %s %p/Inputs/dead-strip-globals.objtxt %p/Inputs/dead-strip-globals2.objtxt | FileCheck -check-prefix=CHK1 %s -# RUN: lld -core --dead-strip %s %p/Inputs/dead-strip-globals.objtxt %p/Inputs/dead-strip-globals2.objtxt | FileCheck -check-prefix=CHK2 %s - -# -# Test that -keep-globals prevents -dead-strip from removing globals. -# - ---- -defined-atoms: - - name: entry - dead-strip: never - references: - - offset: 1 - kind: pcrel32 - target: bar - - offset: 6 - kind: pcrel32 - target: baz - - - name: myglobal1 - scope: global - -undefined-atoms: - - name: bar - - name: baz -... - - -# CHK1: name: entry -# CHK1: name: myglobal1 -# CHK1: name: myglobal2 -# CHK1: name: bar -# CHK1: name: baz -# CHK1-NOT: name: mydead -# CHK1: ... - -# CHK2: name: entry -# CHK2-NOT: name: myglobal1 -# CHK2-NOT: name: myglobal2 -# CHK2: name: bar -# CHK2: name: baz -# CHK2-NOT: name: mydead -# CHK2: ... Index: test/core/dead-strip-reverse.objtxt =================================================================== --- test/core/dead-strip-reverse.objtxt +++ /dev/null @@ -1,25 +0,0 @@ -# RUN: lld -core --dead-strip %s | FileCheck -check-prefix=CHECK1 %s -# RUN: lld -core %s | FileCheck -check-prefix=CHECK2 %s - ---- -defined-atoms: - - name: entry - dead-strip: never - scope: global - references: - - kind: layout-after - offset: 0 - target: def - - name: def - scope: global - - name: dead - scope: global -... - -# CHECK1: name: entry -# CHECK1: name: def -# CHECK1-NOT: name: dead - -# CHECK2: name: entry -# CHECK2: name: def -# CHECK2: name: dead Index: test/core/error-atom-attribute.objtxt =================================================================== --- test/core/error-atom-attribute.objtxt +++ /dev/null @@ -1,19 +0,0 @@ -# RUN: not lld -core %s 2> %t.err -# RUN: FileCheck %s < %t.err - -# -# Test that unknown atom attribute produces a readable error. -# - ---- -defined-atoms: - - name: entry - scope: hidden - foobar: true - dead-strip: never - -... - - -# CHECK: error: unknown key 'foobar' -# CHECK: foobar Index: test/core/error-atom-content-byte-value.objtxt =================================================================== --- test/core/error-atom-content-byte-value.objtxt +++ /dev/null @@ -1,18 +0,0 @@ -# RUN: not lld -core %s 2> %t.err -# RUN: FileCheck %s < %t.err - -# -# Test that an invalid hex byte produces a readable error. -# - ---- -defined-atoms: - - name: entry - scope: hidden - content: [ A5, 00, 4G, 1F ] - -... - - -# CHECK: error: invalid two-digit-hex number -# CHECK: 4G Index: test/core/error-atom-content-bytes.objtxt =================================================================== --- test/core/error-atom-content-bytes.objtxt +++ /dev/null @@ -1,19 +0,0 @@ -# RUN: not lld -core %s 2> %t.err -# RUN: FileCheck %s < %t.err - -# -# Test that an out of range byte value produces a readable error. -# - ---- -defined-atoms: - - name: entry - scope: hidden - content: [ A5, 1234, 00, 4F ] - -... - - -# CHECK: error: out of range two-digit-hex number -# CHECK: 1234 - Index: test/core/error-atom-type.objtxt =================================================================== --- test/core/error-atom-type.objtxt +++ /dev/null @@ -1,19 +0,0 @@ -# RUN: not lld -core %s 2> %t.err -# RUN: FileCheck %s < %t.err - -# -# Test that an unknown content type produces a readable error. -# - ---- -defined-atoms: - - name: entry - scope: hidden - type: superluminal - dead-strip: never - -... - - -# CHECK: error: unknown enumerated scalar -# CHECK: superluminal Index: test/core/error-atom-undefined-wrong-attribue.objtxt =================================================================== --- test/core/error-atom-undefined-wrong-attribue.objtxt +++ /dev/null @@ -1,17 +0,0 @@ -# RUN: not lld -core %s 2> %t.err -# RUN: FileCheck %s < %t.err - -# -# Test that a defined attribute on an undefined atom produces a readable error. -# - ---- -undefined-atoms: - - name: foo - type: code - -... - - -# CHECK: error: unknown key 'type' - Index: test/core/error-duplicate-absolutes.objtxt =================================================================== --- test/core/error-duplicate-absolutes.objtxt +++ /dev/null @@ -1,19 +0,0 @@ -# RUN: not lld -core %s %p/Inputs/error-duplicate-absolutes.objtxt 2> %t.err -# RUN: FileCheck %s < %t.err - -# -# Test that duplicate absolute atoms produces a readable error. -# - ---- -absolute-atoms: - - name: absatom - value: 0 - scope: global -undefined-atoms: - - name: undefatom -... - - -# CHECK: SymbolTable: error while merging absatom -# CHECK: LLVM ERROR: duplicate symbol error Index: test/core/error-file-attribute.objtxt =================================================================== --- test/core/error-file-attribute.objtxt +++ /dev/null @@ -1,17 +0,0 @@ -# RUN: not lld -core %s 2> %t.err -# RUN: FileCheck %s < %t.err - -# -# Test that unknown file attribute produces a readable error. -# - ---- -aardvark: true -defined-atoms: - - name: entry - scope: hidden - -... - - -# CHECK: error: unknown key 'aardvark' Index: test/core/error-fixup-attribute.objtxt =================================================================== --- test/core/error-fixup-attribute.objtxt +++ /dev/null @@ -1,21 +0,0 @@ -# RUN: not lld -core %s 2> %t.err -# RUN: FileCheck %s < %t.err - -# -# Test that unknown fixup attribute produces a readable error. -# - ---- -defined-atoms: - - name: entry - scope: hidden - references: - - offset: 3 - kind: pcrel32 - weasel: bar - addend: 100 - -... - - -# CHECK: error: unknown key 'weasel' Index: test/core/error-fixup-target.objtxt =================================================================== --- test/core/error-fixup-target.objtxt +++ /dev/null @@ -1,26 +0,0 @@ -# RUN: not lld -core %s 2> %t.err -# RUN: FileCheck %s < %t.err - -# -# Test that unbindable target name produces a readable error. -# - ---- -defined-atoms: - - name: entry - scope: hidden - references: - - offset: 3 - kind: pcrel32 - target: bar - - offset: 5 - kind: pcrel32 - target: baz - -undefined-atoms: - - name: bar - -... - - -# CHECK: error: no such atom name: baz Index: test/core/fixups-addend.objtxt =================================================================== --- test/core/fixups-addend.objtxt +++ /dev/null @@ -1,50 +0,0 @@ -# RUN: lld -core %s | FileCheck %s - -# -# Test addends in references -# - ---- -defined-atoms: - - name: foo - type: code - content: [ 48, 8D, 3D, 00, 00, 00, 00, - 48, 8D, 3D, 00, 00, 00, 00 ] - references: - - offset: 3 - kind: pcrel32 - target: bar - addend: 100 - - offset: 10 - kind: pcrel32 - target: bar - addend: -50 - - - name: func - type: code - content: [ 48, 8D, 3D, 00, 00, 00, 00, - 48, 8D, 3D, 00, 00, 00, 00 ] - references: - - offset: 3 - kind: pcrel32 - target: bar - addend: 8000000000 - - offset: 10 - kind: pcrel32 - target: bar - addend: -50 - -undefined-atoms: - - name: bar - - -... - -# CHECK: name: foo -# CHECK: references: -# CHECK: addend: 100 -# CHECK: addend: -50 -# CHECK: name: func -# CHECK: references: -# CHECK: addend: 8000000000 -# CHECK: addend: -50 Index: test/core/fixups-dup-named.objtxt =================================================================== --- test/core/fixups-dup-named.objtxt +++ /dev/null @@ -1,31 +0,0 @@ -# RUN: lld -core %s | FileCheck %s - -# -# Test references referencing multiple atoms that have the same name -# - ---- -defined-atoms: - - name: foo - type: code - content: [ E8, 00, 00, 00, 00, E8, 00, 00, 00, 00 ] - references: - - offset: 1 - kind: pcrel32 - target: bar_1 - - offset: 6 - kind: pcrel32 - target: bar_2 - - - name: bar - ref-name: bar_1 - scope: static - - - name: bar - ref-name: bar_2 - scope: static - - -... - -# CHECK: ... Index: test/core/fixups-named.objtxt =================================================================== --- test/core/fixups-named.objtxt +++ /dev/null @@ -1,36 +0,0 @@ -# RUN: lld -core %s | FileCheck %s - -# -# Test references to simple named atoms -# - ---- -defined-atoms: - - name: foo - type: code - content: [ E8, 00, 00, 00, 00, - E8, 00, 00, 00, 00 ] - references: - - offset: 1 - kind: pcrel32 - target: bar - - offset: 6 - kind: pcrel32 - target: baz - - - name: baz - scope: static - type: code - -undefined-atoms: - - name: bar - - -... - -# CHECK: name: foo -# CHECK: references: -# CHECK: target: bar -# CHECK: target: baz -# CHECK: ... - Index: test/core/fixups-unnamed.objtxt =================================================================== --- test/core/fixups-unnamed.objtxt +++ /dev/null @@ -1,40 +0,0 @@ -# RUN: lld -core %s | FileCheck %s - -# -# Test references to unnamed atoms -# - ---- -defined-atoms: - - name: foo - type: code - content: [ 48, 8D, 3D, 00, 00, 00, 00, - 48, 8D, 3D, 00, 00, 00, 00 ] - references: - - offset: 3 - kind: pcrel32 - target: LC1 - - offset: 10 - kind: pcrel32 - target: LC2 - - - - ref-name: LC1 - type: c-string - merge: by-content - content: [ 68, 65, 6c, 6c, 6f, 00 ] - - - ref-name: LC2 - type: c-string - merge: by-content - content: [ 74, 68, 65, 72, 65, 00 ] - - -... - -# CHECK: name: foo -# CHECK: references: -# CHECK: offset: 3 -# CHECK: offset: 10 -# CHECK: ref-name: -# CHECK: ref-name: Index: test/core/inline-coalesce.objtxt =================================================================== --- test/core/inline-coalesce.objtxt +++ /dev/null @@ -1,19 +0,0 @@ -# RUN: lld -core %s %p/Inputs/inline-coalesce.objtxt %p/Inputs/inline-coalesce2.objtxt | FileCheck %s - -# -# Test that non-inlined inlined functions are silently coalesced -# - ---- -defined-atoms: - - name: _inlineFunc - scope: global - type: code - merge: as-weak -... - - -# CHECK: name: _inlineFunc -# CHECK: merge: as-weak -# CHECK-NOT: name: _inlineFunc -# CHECK: ... Index: test/core/multiple-def-error.objtxt =================================================================== --- test/core/multiple-def-error.objtxt +++ /dev/null @@ -1,14 +0,0 @@ -# RUN: not lld -core %s %p/Inputs/multiple-def-error.objtxt 2>&1 | FileCheck %s - -# -# Test that multiple definitions cause an error -# - -# CHECK: duplicate symbol - ---- -defined-atoms: - - name: _foo - scope: global - type: data -... Index: test/core/permissions.objtxt =================================================================== --- test/core/permissions.objtxt +++ /dev/null @@ -1,57 +0,0 @@ -# RUN: lld -core %s | FileCheck %s - -# -# Test permissions for known content types are implicit, but can be overridden. -# ---- -defined-atoms: - - name: one - type: code - - - name: two - type: data - permissions: rw- - - - name: three - type: const-data - - - name: four - type: unknown - - - name: oddCode - type: code - permissions: rwx - - - name: oddData - type: data - permissions: rwx - - - name: oddConstData - type: const-data - permissions: rw- - - - name: oddUnknown - type: unknown - permissions: rw- - -... - -# CHECK: --- -# CHECK: defined-atoms: -# CHECK: - name: one -# CHECK-NOT: permissions: -# CHECK: - name: two -# CHECK-NOT: permissions: -# CHECK: - name: three -# CHECK-NOT: permissions: -# CHECK: - name: four -# CHECK-NOT: permissions: -# CHECK: - name: oddCode -# CHECK: permissions: rwx -# CHECK: - name: oddData -# CHECK: permissions: rwx -# CHECK: - name: oddConstData -# CHECK: permissions: rw- -# CHECK: - name: oddUnknown -# CHECK: permissions: rw- -# CHECK: ... Index: test/core/shared-library-basic.objtxt =================================================================== --- test/core/shared-library-basic.objtxt +++ /dev/null @@ -1,40 +0,0 @@ -# RUN: lld -core %s | FileCheck %s - -# -# Test that shared-library symbols are parsed and preserved -# - ---- -shared-library-atoms: - - name: malloc - load-name: libc.so - type: code - size: 0 - - - name: free - load-name: libc.so - - - name: fast_malloc - load-name: libc.so - can-be-null: at-runtime - - - name: stdout - load-name: libc.so - type: data - size: 8 - -... - -# CHECK: shared-library-atoms: -# CHECK: name: malloc -# CHECK: load-name: libc.so -# CHECK: name: free -# CHECK: load-name: libc.so -# CHECK: name: fast_malloc -# CHECK: load-name: libc.so -# CHECK: can-be-null: at-runtime -# CHECK: name: stdout -# CHECK: load-name: libc.so -# CHECK: type: data -# CHECK: size: 8 -# CHECK: ... Index: test/core/shared-library-coalesce.objtxt =================================================================== --- test/core/shared-library-coalesce.objtxt +++ /dev/null @@ -1,55 +0,0 @@ -# RUN: lld -core %s %p/Inputs/shared-library-coalesce.objtxt | FileCheck %s - -# -# Test that shared library symbols preserve their attributes and merge properly -# - ---- -shared-library-atoms: - - name: foo1 - load-name: libc.so - - - name: foo2 - load-name: libc.so - - - name: bar1 - load-name: libc.so - can-be-null: at-runtime - - - name: bar2 - load-name: libc.so - can-be-null: at-runtime - - - name: mismatchNull1 - load-name: libc.so - can-be-null: at-runtime - - - name: mismatchNull2 - load-name: libc.so - - - name: mismatchload1 - load-name: liba.so - - - name: mismatchload2 - load-name: libb.so - -... - -# CHECK: name: foo1 -# CHECK: name: foo2 -# CHECK: name: bar1 -# CHECK: can-be-null: at-runtime -# CHECK: name: bar2 -# CHECK: can-be-null: at-runtime -# CHECK: name: mismatchNull1 -# CHECK: can-be-null: at-runtime -# CHECK: name: mismatchNull2 -# CHECK-NOT: can-be-null: at-runtime -# CHECK: name: mismatchload1 -# CHECK: load-name: liba.so -# CHECK: name: mismatchload2 -# CHECK: load-name: libb.so -# CHECK: name: foo3 -# CHECK: name: bar3 -# CHECK: can-be-null: at-runtime -# CHECK: ... Index: test/core/tent-merge.objtxt =================================================================== --- test/core/tent-merge.objtxt +++ /dev/null @@ -1,19 +0,0 @@ -# RUN: lld -core %s %p/Inputs/tent-merge.objtxt | FileCheck %s - -# -# Test that a tentative definition and a regular global are merged into -# one regular global -# - ---- -defined-atoms: - - name: _foo - merge: as-tentative - scope: global - type: zero-fill - size: 4 -... - - -# CHECK: name: _foo -# CHECK-NOT: merge: as-tentative Index: test/core/undef-coalesce-error.objtxt =================================================================== --- test/core/undef-coalesce-error.objtxt +++ /dev/null @@ -1,31 +0,0 @@ -# RUN: not lld -core --undefines-are-errors %s %p/Inputs/undef-coalesce-error.objtxt %p/Inputs/undef-coalesce-error2.objtxt 2> %t.err -# RUN: FileCheck -check-prefix=CHECKERR %s < %t.err -# RUN: lld -core %s %p/Inputs/undef-coalesce-error.objtxt %p/Inputs/undef-coalesce-error2.objtxt | FileCheck %s - -# -# Test that -undefines-are-errors triggers and error -# and that not using that option results in undefined atoms. -# - ---- -defined-atoms: - - name: foo - type: code - -undefined-atoms: - - name: malloc - - name: free -... - -# CHECKERR: free -# CHECKERR: malloc -# CHECKERR: symbol(s) not found - -# CHECK: defined-atoms: -# CHECK: name: foo -# CHECK: name: bar -# CHECK: name: myfunc -# CHECK: undefined-atoms: -# CHECK: name: malloc -# CHECK: name: free -# CHECK: ... Index: test/core/undef-coalesce.objtxt =================================================================== --- test/core/undef-coalesce.objtxt +++ /dev/null @@ -1,26 +0,0 @@ -# RUN: lld -core %s %p/Inputs/undef-coalesce.objtxt %p/Inputs/undef-coalesce2.objtxt | FileCheck %s - -# -# Test that undefined symbols are coalesced with other undefined symbols -# and definitions override them. -# - ---- -defined-atoms: - - name: foo - type: code - -undefined-atoms: - - name: malloc - - name: free -... - -# CHECK: defined-atoms: -# CHECK: name: foo -# CHECK: name: bar -# CHECK: name: myfunc -# CHECK: scope: global -# CHECK: undefined-atoms: -# CHECK: name: malloc -# CHECK: name: free -# CHECK: ... Index: test/core/undef-weak-coalesce.objtxt =================================================================== --- test/core/undef-weak-coalesce.objtxt +++ /dev/null @@ -1,52 +0,0 @@ -# RUN: lld -core %s %p/Inputs/undef-weak-coalesce.objtxt| FileCheck %s - -# -# Test that undefined symbols preserve their attributes and merge properly -# - ---- -undefined-atoms: - - name: regular_func - can-be-null: never - - name: weak_import_func - can-be-null: at-runtime - - name: weak_func - can-be-null: at-buildtime - - name: bar1 - can-be-null: never - - name: bar2 - can-be-null: at-runtime - - name: bar3 - can-be-null: at-buildtime - - name: bar4 - can-be-null: never - - name: bar5 - can-be-null: at-runtime - - name: bar6 - can-be-null: at-buildtime - - name: bar7 - can-be-null: never - - name: bar8 - can-be-null: at-runtime - - name: bar9 - can-be-null: at-buildtime -... - -# CHECK: - name: regular_func -# CHECK-NEXT: - name: weak_import_func -# CHECK-NEXT: can-be-null: at-runtime -# CHECK-NEXT: - name: weak_func -# CHECK-NEXT: can-be-null: at-buildtime -# CHECK-NEXT: - name: bar1 -# CHECK-NEXT: - name: bar2 -# CHECK-NEXT: can-be-null: at-runtime -# CHECK-NEXT: - name: bar3 -# CHECK-NEXT: can-be-null: at-buildtime -# CHECK-NEXT: - name: bar4 -# CHECK-NEXT: - name: bar5 -# CHECK-NEXT: can-be-null: at-runtime -# CHECK-NEXT: - name: bar7 -# CHECK-NEXT: - name: bar6 -# CHECK-NEXT: - name: bar8 -# CHECK-NEXT: - name: bar9 -# CHECK-NEXT: can-be-null: at-runtime Index: test/core/weak-coalesce.objtxt =================================================================== --- test/core/weak-coalesce.objtxt +++ /dev/null @@ -1,16 +0,0 @@ -# RUN: lld -core %s %p/Inputs/weak-coalesce.objtxt \ -# RUN: %p/Inputs/weak-coalesce2.objtxt | FileCheck %s - ---- -defined-atoms: - - name: _foo - merge: as-weak - scope: global - type: data -... - - -# CHECK: name: _foo -# CHECK-NOT: merge: as-weak -# CHECK-NOT: name: _foo -# CHECK: ... Index: tools/lld/lld.cpp =================================================================== --- tools/lld/lld.cpp +++ tools/lld/lld.cpp @@ -10,9 +10,9 @@ // This is the entry point to the lld driver. This is a thin wrapper which // dispatches to the given platform specific driver. // -// If there is -flavor option or -core option, it is dispatched according -// to the arguments. If the flavor parameter is not present, then it is -// dispatched according to argv[0]. +// If there is -flavor option, it is dispatched according to the arguments. +// If the flavor parameter is not present, then it is dispatched according +// to argv[0]. // //===----------------------------------------------------------------------===// @@ -36,7 +36,6 @@ Gnu, // -flavor gnu WinLink, // -flavor link Darwin, // -flavor darwin - Core // -flavor core or -core }; LLVM_ATTRIBUTE_NORETURN static void die(const Twine &S) { @@ -51,7 +50,6 @@ .Case("gnu", Gnu) .Case("link", WinLink) .Case("darwin", Darwin) - .Case("core", Core) .Default(Invalid); } @@ -78,12 +76,6 @@ } static Flavor parseFlavor(std::vector &V) { - // If the first argument is -core, then core driver. - if (V.size() > 1 && V[1] == StringRef("-core")) { - V.erase(V.begin() + 1); - return Core; - } - // Parse -flavor option. if (V.size() > 1 && V[1] == StringRef("-flavor")) { if (V.size() <= 2) @@ -118,8 +110,6 @@ return !coff::link(Args); case Darwin: return !DarwinLdDriver::linkMachO(Args); - case Core: - return !CoreDriver::link(Args); default: die("-flavor option is missing. Available flavors are " "gnu, darwin or link.");