From 2a4e4c3398264ccec7c9d392f631adbf56fda85f Mon Sep 17 00:00:00 2001 From: Shankar Easwaran Date: Tue, 10 Mar 2026 17:05:56 -0500 Subject: [PATCH] [hexagon] Add linux emulation Add hexagonlinux emulation, and enable hexagon linux tests. This change also removes the special casing for hexagon-linux-link/x86_64-link. Signed-off-by: Shankar Easwaran --- include/eld/Driver/HexagonLinkDriver.h | 3 ++ lib/LinkerWrapper/HexagonLinkDriver.cpp | 38 ++++++++++++++++++- lib/Target/Hexagon/HexagonEmulation.cpp | 33 ++++++++-------- .../linux/BssLinkOrder/BssLinkOrder.test | 2 +- test/Hexagon/linux/CommentGC/commentgc.test | 2 +- test/Hexagon/linux/CommonsGC/CommonsGC.test | 2 +- .../CommonsGCSharedLib.test | 2 +- .../linux/CommonsGnuHash/CommonsGnuHash.test | 2 +- test/Hexagon/linux/CrefTable/CrefTable.test | 2 +- .../linux/DebugRelocs/debugRelocs.test | 2 +- test/Hexagon/linux/DefSym/defsym.test | 2 +- .../DiscardWithDebug/DiscardWithDebug.test | 2 +- .../DontOverrideTriple.test | 2 +- .../linux/DynExHiddenSym/DynExHiddenSym.test | 4 +- .../linux/DynExeWithAr/DynExeWithAr.test | 2 +- .../dynamiclistexecutable.test | 2 +- .../dynamiclistundefgcsections.test | 2 +- .../linux/ExcludeArchieve/Exclude.test | 2 +- .../linux/ExportFromExe/ExportFromExe.test | 4 +- test/Hexagon/linux/ExternList/externList.test | 2 +- .../linux/ExternListUndef/externList.test | 2 +- .../linux/ForceDynPerm/ForceDynPerm.test | 2 +- test/Hexagon/linux/GCCref/GCCref.test | 2 +- .../GCFailOnNoEntry/GCFailOnNoEntry.test | 4 +- .../linux/GCexternList/GCexternList.test | 2 +- .../linux/HiddenSharedLibrary/hidden.test | 2 +- test/Hexagon/linux/LNamespec/lnamespec.test | 10 ++--- .../linux/LTO/CommonSymbols/commonsyms.test | 2 +- .../GetSetSectionName/GetSetSectionName.test | 2 +- .../linux/LTO/LTOBitCode/ltobitcode.test | 2 +- .../ltochangescopefunctions.test | 2 +- .../LTO/LTOCommonDefine/ltocommondefine.test | 2 +- .../LTOCommonSymbols/ltocommonsymbols.test | 2 +- .../LTODontPreserveUndef/ltodontpreserve.test | 2 +- .../linux/LTO/LTOGroups/ltogroups.test | 2 +- .../LTO/LTOGroupsBitCode/ltogroupbitcode.test | 2 +- .../LTOGroupsNoMerge/ltogroupsnomerge.test | 2 +- .../linux/LTO/LTOGroupsObj/ltogroupobj.test | 2 +- .../ltonogrouparchives.test | 2 +- .../LTO/LTONoGroupObjs/ltonogroupobjs.test | 2 +- .../LTOPreserveCommon/ltopreservecommon.test | 2 +- .../ltoundefinbitcodeandelf.test | 4 +- .../linux/LTO/PreserveFile/preservefile.test | 2 +- .../linux/LTO/PreserveSym/preservesym.test | 2 +- test/Hexagon/linux/LTO/Verbose/verbose.test | 2 +- .../linux/LinuxTriples/LinuxTriples.test | 4 +- test/Hexagon/linux/Loader/loader-name.test | 4 +- .../ImageStartAddress/ImageStartAddress.test | 4 +- .../linux/MapGroupAction/MapGroupAction.test | 2 +- .../MatchCommonType/MatchCommonType.test | 2 +- test/Hexagon/linux/NewDTags/newdtags.test | 6 +-- test/Hexagon/linux/OrphanSection/Orphan.test | 4 +- .../orphanSectionOrder.test | 2 +- .../OverrideDefineFromCommon1.test | 2 +- .../OverrideDefineFromCommon2.test | 2 +- .../OverrideDefineFromCommon3.test | 2 +- .../partiallinkAndGroup.test | 2 +- test/Hexagon/linux/RelocTrace/RelocTrace.test | 2 +- .../SDataByScript/sdata-linkerscript.test | 2 +- test/Hexagon/linux/SegAlign/segalign.test | 2 +- .../linux/SharedLibPerm/SharedLibPerm.test | 2 +- .../DynamicLibraryStartAddress.test | 2 +- .../SharedLibraries/dynrelocs/dynrelocs.test | 2 +- test/Hexagon/linux/TLS/GDGOT/gdgot.test | 2 +- test/Hexagon/linux/TLS/GDLDEx/GDLDEx.test | 4 +- test/Hexagon/linux/TLS/GDLDMix/gdldmix.test | 2 +- .../GDTransformLinkerScript.test | 2 +- test/Hexagon/linux/TLS/GDtoIE/gdie.test | 2 +- test/Hexagon/linux/TLS/IE/ie.test | 4 +- test/Hexagon/linux/TLS/IEGOT/iegot.test | 4 +- .../Hexagon/linux/TLS/IEStatic/ie-static.test | 2 +- test/Hexagon/linux/TLS/LDtoLE/ldle.test | 2 +- .../TLS/LocalSymbolsGD/LocalSymbolsGD.test | 4 +- .../RecompileWithFpicErr.test | 8 ++-- .../linux/TLS/TBSSOffset/TBSSOffset.test | 2 +- .../TBSSOffsetLinkerScript.test | 2 +- .../linux/TLS/TLSNonTLSMix/TLSNonTLSMix.test | 8 ++-- test/Hexagon/linux/TLS/TPREL/tprel.test | 4 +- .../trampolinesToStub/simple-trampoline.test | 2 +- test/Hexagon/linux/Visibility/Visibility.test | 24 ++++++------ test/Hexagon/linux/ZRelRO/FullRelRO.test | 2 +- test/Hexagon/linux/ZRelRO/PartialRelRO.test | 2 +- .../alignSegmentsTriple/alignSegment.test | 4 +- .../linux/commonsInMap/commonsInMap.test | 12 +++--- .../elfsegment/helloworld-segment-align.test | 2 +- test/Hexagon/linux/etext/etext.test | 2 +- .../forceDynamicTriple.test | 2 +- .../AddressMapEmptySection.test | 2 +- .../createEmptySections.test | 4 +- ...delaycreatingsegmentsforemptysections.test | 8 ++-- .../EmptySection/emptysection.test | 2 +- .../linkerscript/ExternCmd/ExternCmd.test | 2 +- .../ExternCmdLongForm/ExternCmd.test | 2 +- .../ForceDynPerm/ForceDynPerm.test | 2 +- .../linkerscript/GCExternCmd/GCExternCmd.test | 2 +- .../handle_empty_sections.test | 2 +- .../Hexagon/linux/linkerscript/Keep/Keep.test | 2 +- .../LinkerScriptExpressions.test | 8 ++-- .../partiallinkmovecommon.test | 2 +- .../linkerscript/assertcmd/assertcmd.test | 8 ++-- .../excludeFile/excludeFiles.test | 2 +- .../excludePatternOne.test | 2 +- .../excludePatternTwo.test | 2 +- .../includeFileExpression/includeLpath.test | 2 +- .../includefileLPath/includeLpath.test | 4 +- .../nonAllocfixup/nonAllocfixup.test | 2 +- .../nonAllocfixupPHDRS.test | 2 +- .../linkerscript/phdrnoload/phdr-noload.test | 2 +- .../linkerscript/sectionsEndExpr/expr.test | 2 +- .../linkerscript/spaceInFile/spaceInFile.test | 2 +- test/Hexagon/linux/lit.local.cfg | 6 +-- .../mergeCommonStrings/mergestrings.test | 2 +- .../mergestrings-partiallink.test | 2 +- .../linux/mergeROData/mergeROData.test | 4 +- .../linux/mergeRODataAlign/rodataalign.test | 4 +- .../mergeROWithEntSize/rodata_withent.test | 4 +- .../linux/nonAllocRelocs/nonAllocRelocs.test | 2 +- .../linux/notrampolines/no-trampoline.test | 2 +- .../scommonWithoutGP/scommonWithoutGP.test | 2 +- .../linux/trampolines/simple-trampoline.test | 2 +- .../copy-instead-of-trampolines.test | 2 +- .../local-trampoline.test | 2 +- .../trampolinesWithAlign.test | 2 +- test/Hexagon/linux/zNow/zNow.test | 4 +- test/lit.cfg | 25 ++---------- tools/eld/CMakeLists.txt | 14 +------ 126 files changed, 241 insertions(+), 232 deletions(-) diff --git a/include/eld/Driver/HexagonLinkDriver.h b/include/eld/Driver/HexagonLinkDriver.h index 788a5cb21..3213b8fa2 100644 --- a/include/eld/Driver/HexagonLinkDriver.h +++ b/include/eld/Driver/HexagonLinkDriver.h @@ -77,6 +77,9 @@ class HexagonLinkDriver : public GnuLdDriver { static bool isValidEmulation(llvm::StringRef Emulation); + static std::optional + ParseEmulation(std::string pEmulation, eld::DiagnosticEngine *DiagEngine); + static std::string getInferredArch(llvm::StringRef Emulation) { return "hexagon"; } diff --git a/lib/LinkerWrapper/HexagonLinkDriver.cpp b/lib/LinkerWrapper/HexagonLinkDriver.cpp index 51d5fe709..5dccd54bd 100644 --- a/lib/LinkerWrapper/HexagonLinkDriver.cpp +++ b/lib/LinkerWrapper/HexagonLinkDriver.cpp @@ -207,7 +207,41 @@ bool HexagonLinkDriver::createInputActions( template bool HexagonLinkDriver::processTargetOptions(llvm::opt::InputArgList &Args) { - return GnuLdDriver::processTargetOptions(Args); + bool result = GnuLdDriver::processTargetOptions(Args); + std::string emulation = Config.options().getEmulation().str(); + // If a specific emulation was requested, apply it now. + if (!emulation.empty()) { + llvm::Triple TheTriple = Config.targets().triple(); + std::optional OptEmulationTriple = + ParseEmulation(emulation, Config.getDiagEngine()); + // Report invalid emulation error for unknown emulation. + if (!OptEmulationTriple) { + DiagEngine->raise(eld::Diag::err_invalid_emulation) << emulation; + return false; + } + Triple EmulationTriple = OptEmulationTriple.value(); + if (EmulationTriple.getArch() != Triple::UnknownArch) + TheTriple.setArch(EmulationTriple.getArch()); + if (EmulationTriple.getOS() != Triple::OSType::UnknownOS) + TheTriple.setOS(EmulationTriple.getOS()); + if (EmulationTriple.getEnvironment() != Triple::UnknownEnvironment) + TheTriple.setEnvironment(EmulationTriple.getEnvironment()); + Config.targets().setTriple(TheTriple); + } + return result; +} + +std::optional +HexagonLinkDriver::ParseEmulation(std::string pEmulation, + eld::DiagnosticEngine *DiagEngine) { + std::optional result = + StringSwitch>(pEmulation) + .Case("hexagonlinux", Triple("hexagon", "", "linux", "gnu")) + .Cases({"hexagonelf", "v68", "v69", "v71", "v71t", "v73", "v75", + "v77", "v79", "v81", "v83", "v85", "v87", "v89", "v91"}, + Triple("hexagon", "", "", "")) + .Default(std::nullopt); + return result; } template @@ -217,7 +251,7 @@ bool HexagonLinkDriver::processLLVMOptions(llvm::opt::InputArgList &Args) { bool HexagonLinkDriver::isValidEmulation(llvm::StringRef Emulation) { return llvm::StringSwitch(Emulation) - .Cases({"hexagonelf", "v68", "v69", "v71", "v71t"}, true) + .Cases({"hexagonelf", "hexagonlinux", "v68", "v69", "v71", "v71t"}, true) .Cases({"v73", "v75", "v77", "v79", "v81", "v83", "v85", "v87", "v89", "v91"}, true) diff --git a/lib/Target/Hexagon/HexagonEmulation.cpp b/lib/Target/Hexagon/HexagonEmulation.cpp index 26228c0da..ab9cdbe85 100644 --- a/lib/Target/Hexagon/HexagonEmulation.cpp +++ b/lib/Target/Hexagon/HexagonEmulation.cpp @@ -23,22 +23,23 @@ static bool ELDEmulateHexagonELF(LinkerScript &pScript, LinkerConfig &pConfig) { pConfig.targets().setBitClass(32); llvm::StringRef Emulation = pConfig.options().getEmulation(); if (!Emulation.empty()) { - llvm::StringRef flag = llvm::StringSwitch(Emulation) - .Cases({"v68", "hexagonelf"}, "hexagonv68") - .Case("v69", "hexagonv69") - .Case("v71", "hexagonv71") - .Case("v71t", "hexagonv71t") - .Case("v73", "hexagonv73") - .Case("v75", "hexagonv75") - .Case("v77", "hexagonv77") - .Case("v79", "hexagonv79") - .Case("v81", "hexagonv81") - .Case("v83", "hexagonv83") - .Case("v85", "hexagonv85") - .Case("v87", "hexagonv87") - .Case("v89", "hexagonv89") - .Case("v91", "hexagonv91") - .Default("invalid"); + llvm::StringRef flag = + llvm::StringSwitch(Emulation) + .Cases({"v68", "hexagonelf", "hexagonlinux"}, "hexagonv68") + .Case("v69", "hexagonv69") + .Case("v71", "hexagonv71") + .Case("v71t", "hexagonv71t") + .Case("v73", "hexagonv73") + .Case("v75", "hexagonv75") + .Case("v77", "hexagonv77") + .Case("v79", "hexagonv79") + .Case("v81", "hexagonv81") + .Case("v83", "hexagonv83") + .Case("v85", "hexagonv85") + .Case("v87", "hexagonv87") + .Case("v89", "hexagonv89") + .Case("v91", "hexagonv91") + .Default("invalid"); if (flag == "deprecated") { pConfig.raise(Diag::deprecated_emulation) << pConfig.options().getEmulation(); diff --git a/test/Hexagon/linux/BssLinkOrder/BssLinkOrder.test b/test/Hexagon/linux/BssLinkOrder/BssLinkOrder.test index c27699ab1..b5bad0d00 100644 --- a/test/Hexagon/linux/BssLinkOrder/BssLinkOrder.test +++ b/test/Hexagon/linux/BssLinkOrder/BssLinkOrder.test @@ -2,7 +2,7 @@ RUN: %clang %clangopts -c %clangg0opts %p/Inputs/1.c -o %t1.o RUN: %clang %clangopts -c %clangg0opts %p/Inputs/2.c -o %t2.o RUN: %clang %clangopts -c %clangg0opts %p/Inputs/3.c -o %t3.o RUN: %clang %clangopts -c %clangg0opts %p/Inputs/4.c -o %t4.o -RUN: %link %linkopts %linkg0opts %t1.o %t2.o %t3.o %t4.o -o %t.out +RUN: %link %emulation %linkopts %linkg0opts %t1.o %t2.o %t3.o %t4.o -o %t.out RUN: %nm -n %t.out | %filecheck %s #CHECK: B b diff --git a/test/Hexagon/linux/CommentGC/commentgc.test b/test/Hexagon/linux/CommentGC/commentgc.test index ec631e83e..2b498d524 100644 --- a/test/Hexagon/linux/CommentGC/commentgc.test +++ b/test/Hexagon/linux/CommentGC/commentgc.test @@ -1,6 +1,6 @@ # Check that the .comment section is not garbage collected. RUN: %clang %clangopts -c %p/Inputs/1.s -o %t1.o -RUN: %link %linkopts %t1.o -o %t2.out -e main --gc-sections +RUN: %link %emulation %linkopts %t1.o -o %t2.out -e main --gc-sections RUN: %readelf -S %t2.out | %filecheck %s #CHECK: .comment diff --git a/test/Hexagon/linux/CommonsGC/CommonsGC.test b/test/Hexagon/linux/CommonsGC/CommonsGC.test index b254351c6..ea8a29c50 100644 --- a/test/Hexagon/linux/CommonsGC/CommonsGC.test +++ b/test/Hexagon/linux/CommonsGC/CommonsGC.test @@ -1,5 +1,5 @@ RUN: %clang %clangopts -c -ffunction-sections -fdata-sections %p/Inputs/1.c -o %t1.o -RUN: %link %linkopts %t1.o -o %t.out --gc-sections --entry=main 2>&1 +RUN: %link %emulation %linkopts %t1.o -o %t.out --gc-sections --entry=main 2>&1 RUN: %readelf -s %t.out | %grep 'common' | %filecheck %s #CHECK: 1 OBJECT GLOBAL DEFAULT 2 commonChar diff --git a/test/Hexagon/linux/CommonsGCSharedLib/CommonsGCSharedLib.test b/test/Hexagon/linux/CommonsGCSharedLib/CommonsGCSharedLib.test index 2d529f0d7..79cb927ea 100644 --- a/test/Hexagon/linux/CommonsGCSharedLib/CommonsGCSharedLib.test +++ b/test/Hexagon/linux/CommonsGCSharedLib/CommonsGCSharedLib.test @@ -1,5 +1,5 @@ RUN: %clang %clangopts -c -ffunction-sections -fdata-sections %p/Inputs/1.c -fpic -o %t1.o -RUN: %link %linkopts %t1.o -o %t.out -dy -shared --gc-sections --entry=main 2>&1 +RUN: %link %emulation %linkopts %t1.o -o %t.out -dy -shared --gc-sections --entry=main 2>&1 RUN: %readelf -s %t.out | %filecheck %s #CHECK-DAG: 4 OBJECT GLOBAL DEFAULT 9 commonInt diff --git a/test/Hexagon/linux/CommonsGnuHash/CommonsGnuHash.test b/test/Hexagon/linux/CommonsGnuHash/CommonsGnuHash.test index cff715de8..d268ce0f2 100644 --- a/test/Hexagon/linux/CommonsGnuHash/CommonsGnuHash.test +++ b/test/Hexagon/linux/CommonsGnuHash/CommonsGnuHash.test @@ -9,7 +9,7 @@ #START_TEST RUN: %clang %clangopts -c -fpic %p/Inputs/1.c -o %t.o -RUN: %link %linkopts -shared -hash-style=gnu -o %t.so %t.o +RUN: %link %emulation %linkopts -shared -hash-style=gnu -o %t.so %t.o RUN: %readelf -I %t.so CHECK: Histogram for `.gnu.hash' bucket list length (total of 3 buckets): diff --git a/test/Hexagon/linux/CrefTable/CrefTable.test b/test/Hexagon/linux/CrefTable/CrefTable.test index b3c7c0426..68fac103b 100644 --- a/test/Hexagon/linux/CrefTable/CrefTable.test +++ b/test/Hexagon/linux/CrefTable/CrefTable.test @@ -1,7 +1,7 @@ RUN: %clang %clangopts -c -ffunction-sections -fdata-sections %p/Inputs/1.c -o %t1.o RUN: %clang %clangopts -c -ffunction-sections -fdata-sections %p/Inputs/2.c -o %t2.o RUN: %clang %clangopts -c -ffunction-sections -fdata-sections %p/Inputs/3.c -o %t3.o -RUN: %link %linkopts %t1.o %t2.o %t3.o --cref -o %t.out --gc-sections --entry=main | %filecheck %s +RUN: %link %emulation %linkopts %t1.o %t2.o %t3.o --cref -o %t.out --gc-sections --entry=main | %filecheck %s #CHECK: bar {{.*tmp2.o}} #CHECK: {{.*tmp3.o}} diff --git a/test/Hexagon/linux/DebugRelocs/debugRelocs.test b/test/Hexagon/linux/DebugRelocs/debugRelocs.test index 35a68f3c9..d91391a4b 100644 --- a/test/Hexagon/linux/DebugRelocs/debugRelocs.test +++ b/test/Hexagon/linux/DebugRelocs/debugRelocs.test @@ -1,7 +1,7 @@ # Check that Debug sections are fixed up properly. RUN: %clang %clangopts -c %p/Inputs/crap.c -o %t1.o -g RUN: %clang %clangopts -c %p/Inputs/hello.c -o %t2.o -g -RUN: %link %linkopts %t1.o %t2.o -o %t.out --noinhibit-exec +RUN: %link %emulation %linkopts %t1.o %t2.o -o %t.out --noinhibit-exec RUN: %dwarfdump -debug-info %t.out | %filecheck %s #CHECK: DW_AT_producer ("{{.*}}{{[cC]}}lang diff --git a/test/Hexagon/linux/DefSym/defsym.test b/test/Hexagon/linux/DefSym/defsym.test index 3ad8a225b..d1486b678 100644 --- a/test/Hexagon/linux/DefSym/defsym.test +++ b/test/Hexagon/linux/DefSym/defsym.test @@ -1,6 +1,6 @@ # This tests defsym functionality by adding two symbols. RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o %clangg0opts -RUN: %link %linkopts --defsym B=10 --defsym A=20 %t1.o -o %t2 +RUN: %link %emulation %linkopts --defsym B=10 --defsym A=20 %t1.o -o %t2 RUN: %nm -n %t2 | %filecheck %s #CHECK: 0000000a A B diff --git a/test/Hexagon/linux/DiscardWithDebug/DiscardWithDebug.test b/test/Hexagon/linux/DiscardWithDebug/DiscardWithDebug.test index 707cbd309..524b6aaaf 100644 --- a/test/Hexagon/linux/DiscardWithDebug/DiscardWithDebug.test +++ b/test/Hexagon/linux/DiscardWithDebug/DiscardWithDebug.test @@ -5,7 +5,7 @@ #END_COMMENT # RUN: %clang %clangopts -c -g %p/Inputs/1.c -ffunction-sections -o %t1.o -RUN: %link %linkopts -o %t.out %t1.o -T %p/Inputs/script.t +RUN: %link %emulation %linkopts -o %t.out %t1.o -T %p/Inputs/script.t RUN: %readelf -s %t.out | %filecheck %s CHECK-NOT: {{ baz}} diff --git a/test/Hexagon/linux/DontOverrideTriple/DontOverrideTriple.test b/test/Hexagon/linux/DontOverrideTriple/DontOverrideTriple.test index 97e3354a2..cac9fa161 100644 --- a/test/Hexagon/linux/DontOverrideTriple/DontOverrideTriple.test +++ b/test/Hexagon/linux/DontOverrideTriple/DontOverrideTriple.test @@ -5,7 +5,7 @@ # the march is not the same as the arch from the triple. #END_COMMENT RUN: %clang %clangopts -c %p/Inputs/1.c -ffunction-sections -o %t1.o -RUN: %link %linkopts -march hexagon-unknown-linux-elf -o %t.out %t1.o +RUN: %link %emulation %linkopts -march hexagon-unknown-linux-elf -o %t.out %t1.o RUN: %readelf -l -W %t.out | %filecheck %s #CHECK: LOAD 0x000000 {{.*}} 0x10000 diff --git a/test/Hexagon/linux/DynExHiddenSym/DynExHiddenSym.test b/test/Hexagon/linux/DynExHiddenSym/DynExHiddenSym.test index 8d33cdfab..baaf0afc3 100644 --- a/test/Hexagon/linux/DynExHiddenSym/DynExHiddenSym.test +++ b/test/Hexagon/linux/DynExHiddenSym/DynExHiddenSym.test @@ -3,8 +3,8 @@ RUN: %clang %clangopts -c %clangg0opts %p/Inputs/1.c -o %t1.o -fPIC RUN: %clang %clangopts -c %clangg0opts %p/Inputs/2.c -o %t2.o -fPIC RUN: %clang %clangopts -c %clangg0opts %p/Inputs/3.c -o %t3.o -fPIC -RUN: %link %linkopts -shared %t3.o -o %t3.so -RUN: %link %linkopts -Bdynamic %t1.o %t2.o %t3.so -o %t.out +RUN: %link %emulation %linkopts -shared %t3.o -o %t3.so +RUN: %link %emulation %linkopts -Bdynamic %t1.o %t2.o %t3.so -o %t.out RUN: %readelf -r -W %t.out | %filecheck %s CHECK: R_HEX_RELATIVE diff --git a/test/Hexagon/linux/DynExeWithAr/DynExeWithAr.test b/test/Hexagon/linux/DynExeWithAr/DynExeWithAr.test index e53ea0a89..cf2508db3 100644 --- a/test/Hexagon/linux/DynExeWithAr/DynExeWithAr.test +++ b/test/Hexagon/linux/DynExeWithAr/DynExeWithAr.test @@ -7,7 +7,7 @@ RUN: rm -rf %t4 RUN: mkdir %t4 RUN: %ar cr %aropts %t4/libfn.a %t3.o RUN: %ar cr %aropts %t4/libfn1.a %t2.o -RUN: %link %linkopts -dy -Bdynamic %t1.o -L%t4 --start-group -lfn -lfn1 --end-group --force-dynamic -o %t.out +RUN: %link %emulation %linkopts -dy -Bdynamic %t1.o -L%t4 --start-group -lfn -lfn1 --end-group --force-dynamic -o %t.out RUN: %readelf -s %t.out | %filecheck %s CHECK: fn1 diff --git a/test/Hexagon/linux/DynamicListExecutable/dynamiclistexecutable.test b/test/Hexagon/linux/DynamicListExecutable/dynamiclistexecutable.test index 61c8f679f..1186b1079 100644 --- a/test/Hexagon/linux/DynamicListExecutable/dynamiclistexecutable.test +++ b/test/Hexagon/linux/DynamicListExecutable/dynamiclistexecutable.test @@ -4,7 +4,7 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.1.o RUN: %clang %clangopts -c %p/Inputs/2.c -o %t1.2.o RUN: %ar cr %aropts %t1.lib2.a %t1.2.o -RUN: %link %linkopts --force-dynamic %t1.1.o %t1.lib2.a --dynamic-list=%p/Inputs/dynamicList --force-dynamic -t -o %t2.out 2>&1 | %filecheck %s -check-prefix=PULL +RUN: %link %emulation %linkopts --force-dynamic %t1.1.o %t1.lib2.a --dynamic-list=%p/Inputs/dynamicList --force-dynamic -t -o %t2.out 2>&1 | %filecheck %s -check-prefix=PULL RUN: %readelf --dyn-syms -W %t2.out | %filecheck %s #PULL-NOT: lib2.a diff --git a/test/Hexagon/linux/DynamicListUndefGCSections/dynamiclistundefgcsections.test b/test/Hexagon/linux/DynamicListUndefGCSections/dynamiclistundefgcsections.test index 836420eba..9f1dabf3c 100644 --- a/test/Hexagon/linux/DynamicListUndefGCSections/dynamiclistundefgcsections.test +++ b/test/Hexagon/linux/DynamicListUndefGCSections/dynamiclistundefgcsections.test @@ -1,6 +1,6 @@ # Test that GC works when dynamic list contains undefined symbols. RUN: %clang %clangopts -c %p/Inputs/1.c -fPIC -o %t1.1.o -RUN: %link %linkopts --dynamic-list=%p/Inputs/dynList %t1.1.o --force-dynamic -o %t2.out +RUN: %link %emulation %linkopts --dynamic-list=%p/Inputs/dynList %t1.1.o --force-dynamic -o %t2.out RUN: %readelf --dyn-symbols %t2.out | %filecheck %s #CHECK-NOT: foo diff --git a/test/Hexagon/linux/ExcludeArchieve/Exclude.test b/test/Hexagon/linux/ExcludeArchieve/Exclude.test index 03b3480ce..2be91b5b3 100644 --- a/test/Hexagon/linux/ExcludeArchieve/Exclude.test +++ b/test/Hexagon/linux/ExcludeArchieve/Exclude.test @@ -2,7 +2,7 @@ RUN: %clang %clangopts -c %p/1.c -w -ffunction-sections -o %t1.o RUN: %clang %clangopts -c %p/2.c -w -ffunction-sections -o %t2.o RUN: %ar cr %aropts %tlib2.a %t2.o -RUN: %link %linkopts %t1.o %tlib2.a -T %p/script.t -o %t.out +RUN: %link %emulation %linkopts %t1.o %tlib2.a -T %p/script.t -o %t.out RUN: %readelf -a %t.out | %filecheck %s CHECK: .mybar PROGBITS diff --git a/test/Hexagon/linux/ExportFromExe/ExportFromExe.test b/test/Hexagon/linux/ExportFromExe/ExportFromExe.test index f94e650ce..7e810baa8 100644 --- a/test/Hexagon/linux/ExportFromExe/ExportFromExe.test +++ b/test/Hexagon/linux/ExportFromExe/ExportFromExe.test @@ -5,8 +5,8 @@ #END_COMMENT RUN: %clang %clangopts -c -fpic -O2 %p/Inputs/dso.c -ffunction-sections -fdata-sections -o %t1.o RUN: %clang %clangopts -c %p/Inputs/test.c -ffunction-sections -fdata-sections -o %t2.o -RUN: %link %linkopts -shared -o %t.dso.so %t1.o -RUN: %link %linkopts -Bdynamic %t2.o %t.dso.so -o %t.out +RUN: %link %emulation %linkopts -shared -o %t.dso.so %t1.o +RUN: %link %emulation %linkopts -Bdynamic %t2.o %t.dso.so -o %t.out RUN: %readelf --dyn-syms %t.out | %filecheck %s #CHECK-NOT: COM diff --git a/test/Hexagon/linux/ExternList/externList.test b/test/Hexagon/linux/ExternList/externList.test index a7223d3f1..506557a94 100644 --- a/test/Hexagon/linux/ExternList/externList.test +++ b/test/Hexagon/linux/ExternList/externList.test @@ -2,7 +2,7 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o RUN: %clang %clangopts -c %p/Inputs/2.c -o %t2.o RUN: %ar cr %tlib.a %t2.o -RUN: %link %linkopts %t1.o %tlib.a -o %t.out --extern-list=%p/Inputs/list --force-dynamic 2>&1 +RUN: %link %emulation %linkopts %t1.o %tlib.a -o %t.out --extern-list=%p/Inputs/list --force-dynamic 2>&1 RUN: %readelf -s %t.out | %filecheck %s #CHECK: {{[0-9a-f]+}}: {{[0-9a-f]+}} 12 FUNC GLOBAL DEFAULT 5 foo diff --git a/test/Hexagon/linux/ExternListUndef/externList.test b/test/Hexagon/linux/ExternListUndef/externList.test index 4b5af2af6..fb5bc151e 100644 --- a/test/Hexagon/linux/ExternListUndef/externList.test +++ b/test/Hexagon/linux/ExternListUndef/externList.test @@ -1,7 +1,7 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o RUN: %clang %clangopts -c %p/Inputs/2.c -o %t2.o RUN: %ar cr %tlib.a %t2.o -RUN: %link %linkopts %t1.o %tlib.a -o %t.out --extern-list=%p/Inputs/list 2>&1 +RUN: %link %emulation %linkopts %t1.o %tlib.a -o %t.out --extern-list=%p/Inputs/list 2>&1 RUN: %readelf -s %t.out | %filecheck %s #CHECK: UND externSym diff --git a/test/Hexagon/linux/ForceDynPerm/ForceDynPerm.test b/test/Hexagon/linux/ForceDynPerm/ForceDynPerm.test index 90f5f61f9..796367e22 100644 --- a/test/Hexagon/linux/ForceDynPerm/ForceDynPerm.test +++ b/test/Hexagon/linux/ForceDynPerm/ForceDynPerm.test @@ -1,6 +1,6 @@ # Test that hidden symbols are not exported. RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o -RUN: %link %linkopts --rosegment -force-dynamic %t1.o -o %t.out -z max-page-size=4096 2>&1 +RUN: %link %emulation %linkopts --rosegment -force-dynamic %t1.o -o %t.out -z max-page-size=4096 2>&1 RUN: %readelf -l -W %t.out | %filecheck %s # CHECK: PHDR {{[x0-9a-z]+}} {{[x0-9a-z]+}} {{[x0-9a-z]+}} {{[x0-9a-z]+}} {{[x0-9a-z]+}} R E {{[x0-9a-z]+}} diff --git a/test/Hexagon/linux/GCCref/GCCref.test b/test/Hexagon/linux/GCCref/GCCref.test index add2593ce..a6847c2a8 100644 --- a/test/Hexagon/linux/GCCref/GCCref.test +++ b/test/Hexagon/linux/GCCref/GCCref.test @@ -1,5 +1,5 @@ RUN: %clang %clangopts -c -ffunction-sections -fdata-sections %p/Inputs/1.c -fpic %clangg0opts -o %t1.o -RUN: %link %linkopts %t1.o -o %t.out --gc-sections --entry=main --gc-cref=.text.bar --trace=garbage-collection 2>&1 | %filecheck %s +RUN: %link %emulation %linkopts %t1.o -o %t.out --gc-sections --entry=main --gc-cref=.text.bar --trace=garbage-collection 2>&1 | %filecheck %s #CHECK-DAG: .text.main _GLOBAL_OFFSET_TABLE_ (Symbol) #CHECK-DAG: commonChar (Symbol) diff --git a/test/Hexagon/linux/GCFailOnNoEntry/GCFailOnNoEntry.test b/test/Hexagon/linux/GCFailOnNoEntry/GCFailOnNoEntry.test index ba70d3db4..340afe7db 100644 --- a/test/Hexagon/linux/GCFailOnNoEntry/GCFailOnNoEntry.test +++ b/test/Hexagon/linux/GCFailOnNoEntry/GCFailOnNoEntry.test @@ -1,9 +1,9 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o -ffunction-sections -fdata-sections RUN: %clang %clangopts -c %p/Inputs/2.c -o %t2.o -ffunction-sections -fdata-sections RUN: %ar cr %tlib.a %t2.o -RUN: %link %linkopts %t1.o %tlib.a -o %t.out --extern-list=%p/Inputs/list --gc-sections -e FOO -u FOO 2>&1 | %filecheck -check-prefix=GCWARN %s +RUN: %link %emulation %linkopts %t1.o %tlib.a -o %t.out --extern-list=%p/Inputs/list --gc-sections -e FOO -u FOO 2>&1 | %filecheck -check-prefix=GCWARN %s RUN: %clang %clangopts -c %p/Inputs/3.c -o %t3.o -ffunction-sections -fdata-sections -RUN: %not %link %linkopts %t3.o -o %t3.out --gc-sections -u main 2>&1 | %filecheck %s -check-prefix=GCERR +RUN: %not %link %emulation %linkopts %t3.o -o %t3.out --gc-sections -u main 2>&1 | %filecheck %s -check-prefix=GCERR #GCWARN: Warning: FOO Entry symbol not found diff --git a/test/Hexagon/linux/GCexternList/GCexternList.test b/test/Hexagon/linux/GCexternList/GCexternList.test index 82e070cd9..71fdf1507 100644 --- a/test/Hexagon/linux/GCexternList/GCexternList.test +++ b/test/Hexagon/linux/GCexternList/GCexternList.test @@ -2,7 +2,7 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o -ffunction-sections -fdata-sections RUN: %clang %clangopts -c %p/Inputs/2.c -o %t2.o -ffunction-sections -fdata-sections RUN: %ar cr %aropts %tlib.a %t2.o -RUN: %link %linkopts %t1.o %tlib.a --entry main -o %t.out --extern-list=%p/Inputs/list --gc-sections 2>&1 +RUN: %link %emulation %linkopts %t1.o %tlib.a --entry main -o %t.out --extern-list=%p/Inputs/list --gc-sections 2>&1 RUN: %nm -n %t.out | %filecheck %s #CHECK: U externSym diff --git a/test/Hexagon/linux/HiddenSharedLibrary/hidden.test b/test/Hexagon/linux/HiddenSharedLibrary/hidden.test index 8191bb8fe..485456b4b 100644 --- a/test/Hexagon/linux/HiddenSharedLibrary/hidden.test +++ b/test/Hexagon/linux/HiddenSharedLibrary/hidden.test @@ -1,6 +1,6 @@ # Test that hidden symbols are not exported. RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o -fPIC -RUN: %link %linkopts -shared %t1.o -o %t.out 2>&1 +RUN: %link %emulation %linkopts -shared %t1.o -o %t.out 2>&1 RUN: %readelf --dyn-symbols %t.out | %filecheck %s --check-prefix="SYMS" RUN: %readelf --section-headers %t.out | %filecheck %s --check-prefix="INTERP" diff --git a/test/Hexagon/linux/LNamespec/lnamespec.test b/test/Hexagon/linux/LNamespec/lnamespec.test index b3fe09b6a..6d29eb3c5 100644 --- a/test/Hexagon/linux/LNamespec/lnamespec.test +++ b/test/Hexagon/linux/LNamespec/lnamespec.test @@ -5,11 +5,11 @@ RUN: %clang %clangopts -c %p/Inputs/2.c -fPIC -o %t2.o RUN: mkdir -p temp RUN: %ar cr %aropts temp/mylib.a %t2.o RUN: %ar cr %aropts temp/mylib.random %t2.o -RUN: %link --no-emit-relocs %linkopts -shared %t2.o -o temp/myshlib.so -RUN: %link --no-emit-relocs %linkopts %t1.o -Ltemp -l:mylib.a -o %t3 -RUN: %link --no-emit-relocs %linkopts %t1.o -dy -Ltemp -l:myshlib.so -o %t4 -RUN: %link --no-emit-relocs %linkopts %t1.o -static -dy -Ltemp -l:myshlib.so -o %t5 -RUN: %link --no-emit-relocs %linkopts %t1.o -Ltemp -l:mylib.random -o %t6 +RUN: %link %emulation --no-emit-relocs %linkopts -shared %t2.o -o temp/myshlib.so +RUN: %link %emulation --no-emit-relocs %linkopts %t1.o -Ltemp -l:mylib.a -o %t3 +RUN: %link %emulation --no-emit-relocs %linkopts %t1.o -dy -Ltemp -l:myshlib.so -o %t4 +RUN: %link %emulation --no-emit-relocs %linkopts %t1.o -static -dy -Ltemp -l:myshlib.so -o %t5 +RUN: %link %emulation --no-emit-relocs %linkopts %t1.o -Ltemp -l:mylib.random -o %t6 RUN: %readelf -s -W %t3 | %filecheck %s -check-prefix=AR RUN: %readelf -a %t4 | %filecheck %s -check-prefix=SO RUN: %readelf -a %t5 | %filecheck %s -check-prefix=SO diff --git a/test/Hexagon/linux/LTO/CommonSymbols/commonsyms.test b/test/Hexagon/linux/LTO/CommonSymbols/commonsyms.test index 177b4fe24..da645092c 100644 --- a/test/Hexagon/linux/LTO/CommonSymbols/commonsyms.test +++ b/test/Hexagon/linux/LTO/CommonSymbols/commonsyms.test @@ -1,6 +1,6 @@ # Tests that common symbols are preserved. RUN: %clang %clangopts -c -flto %p/Inputs/1.c -o %t1.o RUN: %clang %clangopts -c %p/Inputs/2.c -o %t2.o -RUN: %link %linkopts -M %t1.o %t2.o -o %t3.out --trace=lto 2>&1 | %filecheck %s +RUN: %link %emulation %linkopts -M %t1.o %t2.o -o %t3.out --trace=lto 2>&1 | %filecheck %s #CHECK: common diff --git a/test/Hexagon/linux/LTO/GetSetSectionName/GetSetSectionName.test b/test/Hexagon/linux/LTO/GetSetSectionName/GetSetSectionName.test index ca09fd669..375cd7e6d 100644 --- a/test/Hexagon/linux/LTO/GetSetSectionName/GetSetSectionName.test +++ b/test/Hexagon/linux/LTO/GetSetSectionName/GetSetSectionName.test @@ -7,7 +7,7 @@ RUN: %clang %clangopts -c %p/Inputs/c.c -o %t4 RUN: %ar cr %aropts %t5 %t2 RUN: %ar cr %aropts %t6 %t3 RUN: %ar cr %aropts %t7 %t4 -RUN: %link %linkopts -M -flto-options=preserveall %t1 --start-group %t5 %t7 %t6 --end-group -o %t8 +RUN: %link %emulation %linkopts -M -flto-options=preserveall %t1 --start-group %t5 %t7 %t6 --end-group -o %t8 RUN: %readelf -s %t8 | %grep "foo" | %filecheck %s -check-prefix YES RUN: %readelf -s %t8 | %grep "bar" | %filecheck %s -check-prefix YES RUN: %readelf -s %t8 | %grep "baz" | %filecheck %s -check-prefix YES diff --git a/test/Hexagon/linux/LTO/LTOBitCode/ltobitcode.test b/test/Hexagon/linux/LTO/LTOBitCode/ltobitcode.test index 63ad2840d..129cada3c 100644 --- a/test/Hexagon/linux/LTO/LTOBitCode/ltobitcode.test +++ b/test/Hexagon/linux/LTO/LTOBitCode/ltobitcode.test @@ -2,7 +2,7 @@ RUN: %clang %clangopts -c %p/Inputs/main.c -o %t1.main.o RUN: %clang %clangopts -c -flto %p/Inputs/foo.c -o %t1.foo.o RUN: %clang %clangopts -c -flto %p/Inputs/bar.c -o %t1.bar.o -RUN: %link %linkopts %t1.main.o %t1.foo.o %t1.bar.o -o %t2.out --trace=lto 2>&1 | %filecheck %s -check-prefix=PRESERVE +RUN: %link %emulation %linkopts %t1.main.o %t1.foo.o %t1.bar.o -o %t2.out --trace=lto 2>&1 | %filecheck %s -check-prefix=PRESERVE #PRESERVE-NOT: bar #PRESERVE: foo diff --git a/test/Hexagon/linux/LTO/LTOChangeScopeFunctions/ltochangescopefunctions.test b/test/Hexagon/linux/LTO/LTOChangeScopeFunctions/ltochangescopefunctions.test index f8a743958..a581dd14d 100644 --- a/test/Hexagon/linux/LTO/LTOChangeScopeFunctions/ltochangescopefunctions.test +++ b/test/Hexagon/linux/LTO/LTOChangeScopeFunctions/ltochangescopefunctions.test @@ -3,6 +3,6 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.1.o -flto RUN: %clang %clangopts -c %p/Inputs/2.c -o %t1.2.o -flto RUN: %clang %clangopts -c %p/Inputs/3.c -o %t1.3.o -flto RUN: %clang %clangopts -c %p/Inputs/4.c -o %t1.4.o -RUN: %link %linkopts %t1.1.o %t1.2.o %t1.3.o %t1.4.o -o %t3.out --trace=symbol=baz --trace=lto 2>&1 | %filecheck %s +RUN: %link %emulation %linkopts %t1.1.o %t1.2.o %t1.3.o %t1.4.o -o %t3.out --trace=symbol=baz --trace=lto 2>&1 | %filecheck %s #CHECK: Symbol `baz' from Input file `{{[ -\(\)_A-Za-z0-9.~\\/:]+}}' with info `(ELF)(FUNCTION)(DEFINE)[Local]{DEFAULT}' being added to Namepool diff --git a/test/Hexagon/linux/LTO/LTOCommonDefine/ltocommondefine.test b/test/Hexagon/linux/LTO/LTOCommonDefine/ltocommondefine.test index 33c41702f..ed3fa9147 100644 --- a/test/Hexagon/linux/LTO/LTOCommonDefine/ltocommondefine.test +++ b/test/Hexagon/linux/LTO/LTOCommonDefine/ltocommondefine.test @@ -5,6 +5,6 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.1.o -flto RUN: %clang %clangopts -c %p/Inputs/2.c -o %t1.2.o -flto RUN: %clang %clangopts -c %p/Inputs/3.c -o %t1.3.o -RUN: %link -o %t1.out.1 %linkopts %t1.1.o %t1.2.o %t1.3.o --trace=lto 2>&1 | %filecheck %s +RUN: %link %emulation -o %t1.out.1 %linkopts %t1.1.o %t1.2.o %t1.3.o --trace=lto 2>&1 | %filecheck %s #CHECK: a diff --git a/test/Hexagon/linux/LTO/LTOCommonSymbols/ltocommonsymbols.test b/test/Hexagon/linux/LTO/LTOCommonSymbols/ltocommonsymbols.test index 0c4d2a89b..d9c218067 100644 --- a/test/Hexagon/linux/LTO/LTOCommonSymbols/ltocommonsymbols.test +++ b/test/Hexagon/linux/LTO/LTOCommonSymbols/ltocommonsymbols.test @@ -1,7 +1,7 @@ # Checks that commons are selected from the right files even after LTO. RUN: %clang %clangopts -c -flto -ffunction-sections -fdata-sections %p/Inputs/1.c -o %t1.1.o RUN: %clang %clangopts -c -flto -ffunction-sections -fdata-sections %p/Inputs/2.c -o %t1.2.o -RUN: %link %linkopts %t1.1.o %t1.2.o -flto-options=codegen="-function-sections -data-sections" -T %p/Inputs/script.t -o %t2.out +RUN: %link %emulation %linkopts %t1.1.o %t1.2.o -flto-options=codegen="-function-sections -data-sections" -T %p/Inputs/script.t -o %t2.out RUN: %readelf -S -W %t2.out | %filecheck %s #CHECK-NOT: mysmallcommons1 PROGBITS diff --git a/test/Hexagon/linux/LTO/LTODontPreserveUndef/ltodontpreserve.test b/test/Hexagon/linux/LTO/LTODontPreserveUndef/ltodontpreserve.test index 38ff98fea..24b14dee5 100644 --- a/test/Hexagon/linux/LTO/LTODontPreserveUndef/ltodontpreserve.test +++ b/test/Hexagon/linux/LTO/LTODontPreserveUndef/ltodontpreserve.test @@ -2,6 +2,6 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -flto -o %t1.1.o RUN: %clang %clangopts -c %p/Inputs/2.c -o %t1.2.o RUN: %clang %clangopts -c %p/Inputs/3.c -o %t1.3.o -RUN: %link %linkopts %t1.1.o %t1.2.o %t1.3.o -o %t3.out --trace=lto 2>&1 | %filecheck %s -check-prefix=PRESERVE +RUN: %link %emulation %linkopts %t1.1.o %t1.2.o %t1.3.o -o %t3.out --trace=lto 2>&1 | %filecheck %s -check-prefix=PRESERVE #PRESERVE-NOT: Preserving symbol baz diff --git a/test/Hexagon/linux/LTO/LTOGroups/ltogroups.test b/test/Hexagon/linux/LTO/LTOGroups/ltogroups.test index ca09fd669..375cd7e6d 100644 --- a/test/Hexagon/linux/LTO/LTOGroups/ltogroups.test +++ b/test/Hexagon/linux/LTO/LTOGroups/ltogroups.test @@ -7,7 +7,7 @@ RUN: %clang %clangopts -c %p/Inputs/c.c -o %t4 RUN: %ar cr %aropts %t5 %t2 RUN: %ar cr %aropts %t6 %t3 RUN: %ar cr %aropts %t7 %t4 -RUN: %link %linkopts -M -flto-options=preserveall %t1 --start-group %t5 %t7 %t6 --end-group -o %t8 +RUN: %link %emulation %linkopts -M -flto-options=preserveall %t1 --start-group %t5 %t7 %t6 --end-group -o %t8 RUN: %readelf -s %t8 | %grep "foo" | %filecheck %s -check-prefix YES RUN: %readelf -s %t8 | %grep "bar" | %filecheck %s -check-prefix YES RUN: %readelf -s %t8 | %grep "baz" | %filecheck %s -check-prefix YES diff --git a/test/Hexagon/linux/LTO/LTOGroupsBitCode/ltogroupbitcode.test b/test/Hexagon/linux/LTO/LTOGroupsBitCode/ltogroupbitcode.test index 1c853abfb..24a7f27e2 100644 --- a/test/Hexagon/linux/LTO/LTOGroupsBitCode/ltogroupbitcode.test +++ b/test/Hexagon/linux/LTO/LTOGroupsBitCode/ltogroupbitcode.test @@ -7,4 +7,4 @@ RUN: %clang %clangopts -c -flto %p/Inputs/crap.c -o %t1.crap.o RUN: %ar crs %t2.libb1.a %t1.b1.o RUN: %ar crs %t2.libb2.a %t1.b2.o RUN: %ar crs %t2.libc.a %t1.c.o -RUN: %link -o %t1.out.1 %linkopts -M %t1.a.o --start-group %t2.libb1.a %t2.libb2.a %t2.libc.a %t1.crap.o --end-group --trace=lto +RUN: %link %emulation -o %t1.out.1 %linkopts -M %t1.a.o --start-group %t2.libb1.a %t2.libb2.a %t2.libc.a %t1.crap.o --end-group --trace=lto diff --git a/test/Hexagon/linux/LTO/LTOGroupsNoMerge/ltogroupsnomerge.test b/test/Hexagon/linux/LTO/LTOGroupsNoMerge/ltogroupsnomerge.test index a7ed987b5..f57e178ad 100644 --- a/test/Hexagon/linux/LTO/LTOGroupsNoMerge/ltogroupsnomerge.test +++ b/test/Hexagon/linux/LTO/LTOGroupsNoMerge/ltogroupsnomerge.test @@ -8,7 +8,7 @@ RUN: %clang %clangopts -c %p/Inputs/crap.c -o %t1.crap.o RUN: %ar cr %t2.libb1.a %t1.b1.o RUN: %ar cr %aropts %t2.libb2.a %t1.b2.o RUN: %ar cr %aropts %t2.libc.a %t1.c.o -RUN: %link %linkopts -flto-options=no-merge-modules -M %t1.a.o --start-group %t2.libb1.a %t2.libb2.a %t2.libc.a %t1.crap.o --end-group --trace=lto -t 2>&1 | %filecheck %s +RUN: %link %emulation %linkopts -flto-options=no-merge-modules -M %t1.a.o --start-group %t2.libb1.a %t2.libb2.a %t2.libc.a %t1.crap.o --end-group --trace=lto -t 2>&1 | %filecheck %s #CHECK: {{[ -\(\)_A-Za-z0-9.\\/:]+}}crap diff --git a/test/Hexagon/linux/LTO/LTOGroupsObj/ltogroupobj.test b/test/Hexagon/linux/LTO/LTOGroupsObj/ltogroupobj.test index 8d6750055..5b49cd070 100644 --- a/test/Hexagon/linux/LTO/LTOGroupsObj/ltogroupobj.test +++ b/test/Hexagon/linux/LTO/LTOGroupsObj/ltogroupobj.test @@ -8,7 +8,7 @@ RUN: %clang %clangopts -c %p/Inputs/crap.c -o %t1.crap.o RUN: %ar cr %t2.libb1.a %t1.b1.o RUN: %ar cr %aropts %t2.libb2.a %t1.b2.o RUN: %ar cr %aropts %t2.libc.a %t1.c.o -RUN: %link -o %t1.out.2 %linkopts -M %t1.a.o --start-group %t2.libb1.a %t2.libb2.a %t2.libc.a %t1.crap.o --end-group --trace=lto -t 2>&1 | %filecheck %s +RUN: %link %emulation -o %t1.out.2 %linkopts -M %t1.a.o --start-group %t2.libb1.a %t2.libb2.a %t2.libc.a %t1.crap.o --end-group --trace=lto -t 2>&1 | %filecheck %s #CHECK: {{[ -\(\)_A-Za-z0-9.\\/:]+}}crap diff --git a/test/Hexagon/linux/LTO/LTONoGroupArchives/ltonogrouparchives.test b/test/Hexagon/linux/LTO/LTONoGroupArchives/ltonogrouparchives.test index 60770cb08..1ffd20aae 100644 --- a/test/Hexagon/linux/LTO/LTONoGroupArchives/ltonogrouparchives.test +++ b/test/Hexagon/linux/LTO/LTONoGroupArchives/ltonogrouparchives.test @@ -7,7 +7,7 @@ RUN: %clang %clangopts -c %p/Inputs/c.c -o %t4 RUN: %ar cr %aropts %t5 %t2 RUN: %ar cr %aropts %t6 %t3 RUN: %ar cr %aropts %t7 %t4 -RUN: %link %linkopts -M -flto-options=preserveall %t1 %t5 %t7 %t6 -o %t8 +RUN: %link %emulation %linkopts -M -flto-options=preserveall %t1 %t5 %t7 %t6 -o %t8 RUN: %readelf -s %t8 | %grep "foo" | %filecheck %s -check-prefix YES RUN: %readelf -s %t8 | %grep "bar" | %filecheck %s -check-prefix YES RUN: %readelf -s %t8 | %grep "baz" | %filecheck %s -check-prefix YES diff --git a/test/Hexagon/linux/LTO/LTONoGroupObjs/ltonogroupobjs.test b/test/Hexagon/linux/LTO/LTONoGroupObjs/ltonogroupobjs.test index c69ee5b79..a2206918a 100644 --- a/test/Hexagon/linux/LTO/LTONoGroupObjs/ltonogroupobjs.test +++ b/test/Hexagon/linux/LTO/LTONoGroupObjs/ltonogroupobjs.test @@ -3,7 +3,7 @@ RUN: %clang %clangopts -c %p/Inputs/a.c -flto -o %t1 RUN: %clang %clangopts -c %p/Inputs/b1.c -o %t2 RUN: %clang %clangopts -c %p/Inputs/b2.c -o %t3 RUN: %clang %clangopts -c %p/Inputs/c.c -o %t4 -RUN: %link %linkopts -M -flto-options=preserveall %t1 %t2 %t4 %t3 -o %t5 +RUN: %link %emulation %linkopts -M -flto-options=preserveall %t1 %t2 %t4 %t3 -o %t5 RUN: %readelf -s %t5 | %grep "foo" | %filecheck %s -check-prefix YES RUN: %readelf -s %t5 | %grep "bar" | %filecheck %s -check-prefix YES RUN: %readelf -s %t5 | %grep "baz" | %filecheck %s -check-prefix YES diff --git a/test/Hexagon/linux/LTO/LTOPreserveCommon/ltopreservecommon.test b/test/Hexagon/linux/LTO/LTOPreserveCommon/ltopreservecommon.test index 26ec90c3e..0ea6f5b59 100644 --- a/test/Hexagon/linux/LTO/LTOPreserveCommon/ltopreservecommon.test +++ b/test/Hexagon/linux/LTO/LTOPreserveCommon/ltopreservecommon.test @@ -2,7 +2,7 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -flto -o %t1.o RUN: %clang %clangopts -c %p/Inputs/2.c -o %t2.o RUN: %clang %clangopts -c %p/Inputs/3.c -o %t3.o -RUN: %link %linkopts %t1.o %t2.o %t3.o -o %t3.out --trace=symbol=a --trace=lto 2>&1 | %filecheck %s -check-prefix=LTO +RUN: %link %emulation %linkopts %t1.o %t2.o %t3.o -o %t3.out --trace=symbol=a --trace=lto 2>&1 | %filecheck %s -check-prefix=LTO RUN: %readelf -s %t3.out | %filecheck %s #LTO: Symbol `a' from Input file `{{[ -\(\)_A-Za-z0-9.\\/:]+}}' with info `(BITCODE)(OBJECT)(COMMON)[Global]{DEFAULT}' being added to Namepool diff --git a/test/Hexagon/linux/LTO/LTOUndefInBitCodeAndELF/ltoundefinbitcodeandelf.test b/test/Hexagon/linux/LTO/LTOUndefInBitCodeAndELF/ltoundefinbitcodeandelf.test index 8f60899c7..f5a238376 100644 --- a/test/Hexagon/linux/LTO/LTOUndefInBitCodeAndELF/ltoundefinbitcodeandelf.test +++ b/test/Hexagon/linux/LTO/LTOUndefInBitCodeAndELF/ltoundefinbitcodeandelf.test @@ -4,7 +4,7 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.1.o -flto RUN: %clang %clangopts -c %p/Inputs/2.c -o %t1.2.o -flto RUN: %clang %clangopts -c %p/Inputs/3.c -o %t1.3.o RUN: %clang %clangopts -c %p/Inputs/4.c -o %t1.4.o -RUN: %link -o %t1.out.1 %linkopts %t1.1.o %t1.3.o %t1.2.o %t1.4.o --trace=symbol=baz --trace=lto 2>&1 | %filecheck %s -RUN: %link -o %t1.out.2 %linkopts %t1.3.o %t1.1.o %t1.2.o %t1.4.o --trace=symbol=baz --trace=lto 2>&1 | %filecheck %s +RUN: %link %emulation -o %t1.out.1 %linkopts %t1.1.o %t1.3.o %t1.2.o %t1.4.o --trace=symbol=baz --trace=lto 2>&1 | %filecheck %s +RUN: %link %emulation -o %t1.out.2 %linkopts %t1.3.o %t1.1.o %t1.2.o %t1.4.o --trace=symbol=baz --trace=lto 2>&1 | %filecheck %s #CHECK: Preserving symbol baz diff --git a/test/Hexagon/linux/LTO/PreserveFile/preservefile.test b/test/Hexagon/linux/LTO/PreserveFile/preservefile.test index 9df42d12e..8d1dad7da 100644 --- a/test/Hexagon/linux/LTO/PreserveFile/preservefile.test +++ b/test/Hexagon/linux/LTO/PreserveFile/preservefile.test @@ -1,7 +1,7 @@ # Check if LTO works for no groups and only archives and bitcodes RUN: %clang %clangopts -c %p/Inputs/a.c -flto -o %t1 RUN: %clang %clangopts -c %p/Inputs/b.c -flto -o %t2 -RUN: %link %linkopts -M -flto-options preserve-file=%p/Inputs/preserve1 %t1 %t2 -o %t3 +RUN: %link %emulation %linkopts -M -flto-options preserve-file=%p/Inputs/preserve1 %t1 %t2 -o %t3 RUN: %readelf -s %t3 | %grep "boo" | wc -l | %filecheck %s -check-prefix YES YES: 1 diff --git a/test/Hexagon/linux/LTO/PreserveSym/preservesym.test b/test/Hexagon/linux/LTO/PreserveSym/preservesym.test index 60393bdb7..7caad501d 100644 --- a/test/Hexagon/linux/LTO/PreserveSym/preservesym.test +++ b/test/Hexagon/linux/LTO/PreserveSym/preservesym.test @@ -7,7 +7,7 @@ RUN: %clang %clangopts -c %p/Inputs/c.c -o %t4 RUN: %ar cr %aropts %t5 %t2 RUN: %ar cr %aropts %t6 %t3 RUN: %ar cr %aropts %t7 %t4 -RUN: %link %linkopts -M -flto-options preserve-sym=foo %t1 %t5 %t7 %t6 -o %t8 +RUN: %link %emulation %linkopts -M -flto-options preserve-sym=foo %t1 %t5 %t7 %t6 -o %t8 RUN: %readelf -s %t8 | %grep "foo" | %filecheck %s -check-prefix YES YES: 1 diff --git a/test/Hexagon/linux/LTO/Verbose/verbose.test b/test/Hexagon/linux/LTO/Verbose/verbose.test index 541ff9b02..616ede471 100644 --- a/test/Hexagon/linux/LTO/Verbose/verbose.test +++ b/test/Hexagon/linux/LTO/Verbose/verbose.test @@ -1,7 +1,7 @@ # Check if LTO works for no groups and only archives and bitcodes RUN: %clang %clangopts -c %p/Inputs/a.c -flto -o %t1 RUN: %clang %clangopts -c %p/Inputs/b.c -flto -o %t2 -RUN: %link %linkopts --save-temps -M -flto-options verbose %t1 %t2 -o %t3 2>&1\ +RUN: %link %emulation %linkopts --save-temps -M -flto-options verbose %t1 %t2 -o %t3 2>&1\ RUN: | %filecheck %s -check-prefix YES YES: Note: Beginning LTO Phase 1 diff --git a/test/Hexagon/linux/LinuxTriples/LinuxTriples.test b/test/Hexagon/linux/LinuxTriples/LinuxTriples.test index 07754aaef..6b49bd077 100644 --- a/test/Hexagon/linux/LinuxTriples/LinuxTriples.test +++ b/test/Hexagon/linux/LinuxTriples/LinuxTriples.test @@ -5,8 +5,8 @@ #END_COMMENT RUN: %clang %clangopts -c %clangg0opts %p/Inputs/1.c -o %t1.o -fPIC RUN: %clang %clangopts -c %clangg0opts %p/Inputs/2.c -o %t2.o -fPIC -RUN: %link %linkopts -shared %t2.o -o %t2.so -RUN: %link %linkopts -mtriple hexagon-unknown-linux-musl -Map %tmusl.map %t1.o %t2.so -o %tmusl.out +RUN: %link %emulation %linkopts -shared %t2.o -o %t2.so +RUN: %link -mtriple hexagon-unknown-linux-musl -Map %tmusl.map %t1.o %t2.so -o %tmusl.out RUN: %readelf -l -W %tmusl.out | %filecheck %s --check-prefix="MUSL" RUN: %filecheck %s --check-prefix="MUSLMAP" < %tmusl.map diff --git a/test/Hexagon/linux/Loader/loader-name.test b/test/Hexagon/linux/Loader/loader-name.test index 49ab41abd..6464f2036 100644 --- a/test/Hexagon/linux/Loader/loader-name.test +++ b/test/Hexagon/linux/Loader/loader-name.test @@ -1,7 +1,7 @@ RUN: %clang %clangopts -c %p/Inputs/hello.c -o %t1.o RUN: %clang %clangopts -c -fpic %p/Inputs/bye.c -o %t2.o -RUN: %link %linkopts -shared %t2.o -o %t2.so -RUN: %link %linkopts -mtriple=hexagon-unknown-linux-musl %t1.o %t2.so -o %t1.out +RUN: %link %emulation %linkopts -shared %t2.o -o %t2.so +RUN: %link %emulation %linkopts -mtriple=hexagon-unknown-linux-musl %t1.o %t2.so -o %t1.out RUN: %readelf -l %t1.out | %filecheck --check-prefix=CHECK-MUSL %s CHECK-MUSL: INTERP {{[0x1-9a-f]+}} {{[0x1-9a-f]+}} {{[0x1-9a-f]+}} {{[0x1-9a-f]+}} {{[0x1-9a-f]+}} R 0x1 diff --git a/test/Hexagon/linux/Map/ImageStartAddress/ImageStartAddress.test b/test/Hexagon/linux/Map/ImageStartAddress/ImageStartAddress.test index dc7e94e51..d6437bc59 100644 --- a/test/Hexagon/linux/Map/ImageStartAddress/ImageStartAddress.test +++ b/test/Hexagon/linux/Map/ImageStartAddress/ImageStartAddress.test @@ -4,9 +4,9 @@ #END_COMMENT #START_TEST RUN: %clang %clangopts -o %t1.1.o -c %p/Inputs/1.c -RUN: %link -MapStyle txt %linkopts -mtriple hexagon-unknown-linux-elf -o %t1.1.elf %t1.1.o -Map %t1.1.1.map.txt +RUN: %link %emulation -MapStyle txt %linkopts -mtriple hexagon-unknown-linux-elf -o %t1.1.elf %t1.1.o -Map %t1.1.1.map.txt RUN: %filecheck %s < %t1.1.1.map.txt -RUN: %link -MapStyle txt %linkopts -mtriple hexagon-unknown-linux-elf -o %t1.1.elf %t1.1.o -T %p/Inputs/1.linker.script -Map %t1.1.2.map.txt +RUN: %link %emulation -MapStyle txt %linkopts -mtriple hexagon-unknown-linux-elf -o %t1.1.elf %t1.1.o -T %p/Inputs/1.linker.script -Map %t1.1.2.map.txt RUN: %filecheck %s --check-prefix=WITHPHDRS < %t1.1.2.map.txt #END_TEST CHECK: # Image start address: ~ 0x400000 diff --git a/test/Hexagon/linux/MapGroupAction/MapGroupAction.test b/test/Hexagon/linux/MapGroupAction/MapGroupAction.test index 29f13c922..57c86e424 100644 --- a/test/Hexagon/linux/MapGroupAction/MapGroupAction.test +++ b/test/Hexagon/linux/MapGroupAction/MapGroupAction.test @@ -4,7 +4,7 @@ RUN: %clang %clangopts -c %p/Inputs/2.c -o %t2.o RUN: %ar cr %aropts %tlib2.a %t2.o RUN: %clang %clangopts -c %p/Inputs/3.c -o %t3.o RUN: %ar cr %aropts %tlib3.a %t3.o -RUN: %link %linkopts %t1.o -o %t.out -M --start-group %tlib3.a %tlib2.a --end-group 2>&1 | %filecheck %s +RUN: %link %emulation %linkopts %t1.o -o %t.out -M --start-group %tlib3.a %tlib2.a --end-group 2>&1 | %filecheck %s #CHECK: START GROUP #CHECK: LOAD {{.*}}lib2.a diff --git a/test/Hexagon/linux/MatchCommonType/MatchCommonType.test b/test/Hexagon/linux/MatchCommonType/MatchCommonType.test index 8f45ce3a4..52311a886 100644 --- a/test/Hexagon/linux/MatchCommonType/MatchCommonType.test +++ b/test/Hexagon/linux/MatchCommonType/MatchCommonType.test @@ -6,7 +6,7 @@ RUN: %clang %clangopts -c %p/Inputs/3.c -o %t3.o RUN: %clang %clangopts -c %p/Inputs/empty.c -o %tempty.o RUN: %ar cr %aropts %tlib1.a %t2.o %t3.o RUN: %ar cr %aropts %tlibempty.a %tempty.o -RUN: %link %linkopts %t1.o %tlibempty.a %tlib1.a -t -o %t.out 2>&1 | %filecheck %s +RUN: %link %emulation %linkopts %t1.o %tlibempty.a %tlib1.a -t -o %t.out 2>&1 | %filecheck %s #CHECK: {{.*.test.tmp1.*}} #CHECK-NOT: {{.*lib1.a.*tmp2.*}} diff --git a/test/Hexagon/linux/NewDTags/newdtags.test b/test/Hexagon/linux/NewDTags/newdtags.test index 1eb60fde5..9797fb2f5 100644 --- a/test/Hexagon/linux/NewDTags/newdtags.test +++ b/test/Hexagon/linux/NewDTags/newdtags.test @@ -2,9 +2,9 @@ # ignores related options when disables # This also checks new flags DF_1_NODELETE RUN: %clang %clangopts -c -fPIC %p/Inputs/a.c -o %t1.o -RUN: %link %linkopts -shared %t1.o -z nodelete -z now --enable-new-dtags -o %t1.so -RUN: %link %linkopts -shared %t1.o -z nodelete -z now --disable-new-dtags -o %t2.so -RUN: %link %linkopts -shared %t1.o -z now --disable-new-dtags -o %t3.so +RUN: %link %emulation %linkopts -shared %t1.o -z nodelete -z now --enable-new-dtags -o %t1.so +RUN: %link %emulation %linkopts -shared %t1.o -z nodelete -z now --disable-new-dtags -o %t2.so +RUN: %link %emulation %linkopts -shared %t1.o -z now --disable-new-dtags -o %t3.so RUN: %readelf -d %t1.so | %filecheck %s --check-prefix="NEWFLAGS" RUN: %readelf -d %t2.so | %filecheck %s --check-prefix="NEW" RUN: %readelf -d %t3.so | %filecheck %s --check-prefix="NEW" diff --git a/test/Hexagon/linux/OrphanSection/Orphan.test b/test/Hexagon/linux/OrphanSection/Orphan.test index 3b77bf79e..31add7e34 100644 --- a/test/Hexagon/linux/OrphanSection/Orphan.test +++ b/test/Hexagon/linux/OrphanSection/Orphan.test @@ -1,6 +1,6 @@ -RUN: %link %linkopts %p/t.o -T %p/t.t -o %t.out +RUN: %link %emulation %linkopts %p/t.o -T %p/t.t -o %t.out RUN: %readelf -l %t.out | %filecheck %s -RUN: %not %link %linkopts %p/t.o -T %p/n.t -o %t.out -G0 2>&1 | %filecheck -check-prefix=NOLOAD %s +RUN: %not %link %emulation %linkopts %p/t.o -T %p/n.t -o %t.out -G0 2>&1 | %filecheck -check-prefix=NOLOAD %s CHECK: 00 .text .bss diff --git a/test/Hexagon/linux/OrphanSectionOrder/orphanSectionOrder.test b/test/Hexagon/linux/OrphanSectionOrder/orphanSectionOrder.test index a1b2506cc..76a1e0bd7 100644 --- a/test/Hexagon/linux/OrphanSectionOrder/orphanSectionOrder.test +++ b/test/Hexagon/linux/OrphanSectionOrder/orphanSectionOrder.test @@ -1,5 +1,5 @@ RUN: %clang %clangopts -c %clangg0opts %p/Inputs/1.c -o %t1.o -RUN: %link %linkopts %t1.o -T %p/Inputs/script.t -o %t1.out -z max-page-size=4096 +RUN: %link %emulation %linkopts %t1.o -T %p/Inputs/script.t -o %t1.out -z max-page-size=4096 RUN: %readelf -S %t1.out | %filecheck %s #CHECK: [ 1] .text PROGBITS 00000000 001000 000014 00 AX 0 0 16 diff --git a/test/Hexagon/linux/OverrideDefineFromCommon1/OverrideDefineFromCommon1.test b/test/Hexagon/linux/OverrideDefineFromCommon1/OverrideDefineFromCommon1.test index 0a0633f2e..1d6f1508c 100644 --- a/test/Hexagon/linux/OverrideDefineFromCommon1/OverrideDefineFromCommon1.test +++ b/test/Hexagon/linux/OverrideDefineFromCommon1/OverrideDefineFromCommon1.test @@ -7,7 +7,7 @@ RUN: %clang %clangopts -c %p/Inputs/3.c -o %t3.o RUN: %clang %clangopts -c %p/Inputs/empty.c -o %tempty.o RUN: %ar cr %aropts %tlib1.a %t2.o %t3.o RUN: %ar cr %aropts %tlibempty.a %tempty.o -RUN: %link %linkopts %t1.o %tlibempty.a %tlib1.a -t -o %t.out 2>&1 | %filecheck %s +RUN: %link %emulation %linkopts %t1.o %tlibempty.a %tlib1.a -t -o %t.out 2>&1 | %filecheck %s #CHECK: {{.*.test.tmp1.*}} #CHECK-NOT: {{.*lib1.a.*tmp2.*}} diff --git a/test/Hexagon/linux/OverrideDefineFromCommon2/OverrideDefineFromCommon2.test b/test/Hexagon/linux/OverrideDefineFromCommon2/OverrideDefineFromCommon2.test index e5dc0cabf..ca59e94e3 100644 --- a/test/Hexagon/linux/OverrideDefineFromCommon2/OverrideDefineFromCommon2.test +++ b/test/Hexagon/linux/OverrideDefineFromCommon2/OverrideDefineFromCommon2.test @@ -5,7 +5,7 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o RUN: %clang %clangopts -c %p/Inputs/2.c -o %t2.o RUN: %clang %clangopts -c %p/Inputs/3.c -o %t3.o RUN: %ar cr %aropts %tlib1.a %t2.o %t3.o -RUN: %link %linkopts %t1.o %tlib1.a -t -o %t.out 2>&1 | %filecheck %s +RUN: %link %emulation %linkopts %t1.o %tlib1.a -t -o %t.out 2>&1 | %filecheck %s #CHECK: {{.*.test.tmp1.*}} #CHECK: {{.*lib1.a.*tmp3.*}} diff --git a/test/Hexagon/linux/OverrideDefineFromCommon3/OverrideDefineFromCommon3.test b/test/Hexagon/linux/OverrideDefineFromCommon3/OverrideDefineFromCommon3.test index 49d35224c..bf530218c 100644 --- a/test/Hexagon/linux/OverrideDefineFromCommon3/OverrideDefineFromCommon3.test +++ b/test/Hexagon/linux/OverrideDefineFromCommon3/OverrideDefineFromCommon3.test @@ -5,7 +5,7 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o RUN: %clang %clangopts -c %p/Inputs/2.s -o %t2.o RUN: %clang %clangopts -c %p/Inputs/3.s -o %t3.o RUN: %ar cr %aropts %tlib1.a %t2.o %t3.o -RUN: %link %linkopts %t1.o %tlib1.a -t -o %t.out 2>&1 | %filecheck %s +RUN: %link %emulation %linkopts %t1.o %tlib1.a -t -o %t.out 2>&1 | %filecheck %s #CHECK: {{.*.test.tmp1.*}} #CHECK: {{.*lib1.a.*tmp3.*}} diff --git a/test/Hexagon/linux/PartialLinkAndGroups/partiallinkAndGroup.test b/test/Hexagon/linux/PartialLinkAndGroups/partiallinkAndGroup.test index 789829ac9..088f59ae5 100644 --- a/test/Hexagon/linux/PartialLinkAndGroups/partiallinkAndGroup.test +++ b/test/Hexagon/linux/PartialLinkAndGroups/partiallinkAndGroup.test @@ -2,7 +2,7 @@ # group during partial linking. # Using a assembly file here because someday clang %clangopts may change :) RUN: %clang %clangopts -c %p/Inputs/g.s -o %t1.o -RUN: %link %linkopts -r %t1.o -o %t2.o -T %p/Inputs/script.t +RUN: %link %emulation %linkopts -r %t1.o -o %t2.o -T %p/Inputs/script.t RUN: %readelf -S -W %t2.o | %filecheck %s #CHECK: .text diff --git a/test/Hexagon/linux/RelocTrace/RelocTrace.test b/test/Hexagon/linux/RelocTrace/RelocTrace.test index a87df2804..898e2bc2a 100644 --- a/test/Hexagon/linux/RelocTrace/RelocTrace.test +++ b/test/Hexagon/linux/RelocTrace/RelocTrace.test @@ -1,6 +1,6 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o RUN: %clang %clangopts -c %p/Inputs/2.c -o %t2.o RUN: %clang %clangopts -c %p/Inputs/3.c -o %t3.o -RUN: %link %linkopts --no-align-segments --section-start=main2=0x20 %t1.o %t2.o %t3.o -o %t.out --trace=symbol=main_1 2>&1 | %filecheck %s +RUN: %link %emulation %linkopts --no-align-segments --section-start=main2=0x20 %t1.o %t2.o %t3.o -o %t.out --trace=symbol=main_1 2>&1 | %filecheck %s CHECK: Symbol main_1, application site: 0x24 diff --git a/test/Hexagon/linux/SDataByScript/sdata-linkerscript.test b/test/Hexagon/linux/SDataByScript/sdata-linkerscript.test index 93ee53767..1842fea97 100644 --- a/test/Hexagon/linux/SDataByScript/sdata-linkerscript.test +++ b/test/Hexagon/linux/SDataByScript/sdata-linkerscript.test @@ -1,7 +1,7 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.1.o RUN: %clang %clangopts -c %p/Inputs/2.c -o %t2.2.o RUN: %clang %clangopts -c %p/Inputs/3.c -o %t3.3.o -RUN: %link %linkopts %t1.1.o %t2.2.o %t3.3.o -T %p/Inputs/script -o %t.out +RUN: %link %emulation %linkopts %t1.1.o %t2.2.o %t3.3.o -T %p/Inputs/script -o %t.out RUN: %nm -n %t.out | %filecheck %s #CHECK: 00000018 B y diff --git a/test/Hexagon/linux/SegAlign/segalign.test b/test/Hexagon/linux/SegAlign/segalign.test index 562fb263b..a7c57965d 100644 --- a/test/Hexagon/linux/SegAlign/segalign.test +++ b/test/Hexagon/linux/SegAlign/segalign.test @@ -1,6 +1,6 @@ # Check that segment alignment is what is set by the ABI. RUN: %clang %clangopts -c %p/Inputs/bss.c -o %t.o -RUN: %link %linkopts %t.o -o %t.out -z max-page-size=4096 +RUN: %link %emulation %linkopts %t.o -o %t.out -z max-page-size=4096 RUN: %readelf -l %t.out | %filecheck %s #CHECK: LOAD {{.*}} RW 0x1000 diff --git a/test/Hexagon/linux/SharedLibPerm/SharedLibPerm.test b/test/Hexagon/linux/SharedLibPerm/SharedLibPerm.test index 5be7519e1..6fb367963 100644 --- a/test/Hexagon/linux/SharedLibPerm/SharedLibPerm.test +++ b/test/Hexagon/linux/SharedLibPerm/SharedLibPerm.test @@ -1,6 +1,6 @@ # Test that hidden symbols are not exported. RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o -fPIC -RUN: %link %linkopts --rosegment -shared %t1.o -o %t.out 2>&1 +RUN: %link %emulation %linkopts --rosegment -shared %t1.o -o %t.out 2>&1 RUN: %readelf -l -W %t.out | %filecheck %s # CHECK: LOAD {{[x0-9a-z]+}} {{[x0-9a-z]+}} {{[x0-9a-z]+}} {{[x0-9a-z]+}} {{[x0-9a-z]+}} R {{[x0-9a-z]+}} diff --git a/test/Hexagon/linux/SharedLibraries/DynamicLibraryStartAddress/DynamicLibraryStartAddress.test b/test/Hexagon/linux/SharedLibraries/DynamicLibraryStartAddress/DynamicLibraryStartAddress.test index cb0d75201..7cf572e00 100644 --- a/test/Hexagon/linux/SharedLibraries/DynamicLibraryStartAddress/DynamicLibraryStartAddress.test +++ b/test/Hexagon/linux/SharedLibraries/DynamicLibraryStartAddress/DynamicLibraryStartAddress.test @@ -4,7 +4,7 @@ #END_COMMENT #START_TEST RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.1.o -fPIC -RUN: %link %linkopts -shared %t1.1.o -o %t2.lib1.so -shared +RUN: %link %emulation %linkopts -shared %t1.1.o -o %t2.lib1.so -shared RUN: %readelf -l -W %t2.lib1.so | %filecheck %s #CHECK: LOAD 0x000000 0x00000000 #END_TEST diff --git a/test/Hexagon/linux/SharedLibraries/dynrelocs/dynrelocs.test b/test/Hexagon/linux/SharedLibraries/dynrelocs/dynrelocs.test index 3821c9ccb..491257c34 100644 --- a/test/Hexagon/linux/SharedLibraries/dynrelocs/dynrelocs.test +++ b/test/Hexagon/linux/SharedLibraries/dynrelocs/dynrelocs.test @@ -1,6 +1,6 @@ # Test that linker is able to create a PLT entry for the symbol. RUN: %clang %clangopts -c -fPIC %p/Inputs/a.s -o %t1.o -RUN: %link %linkopts -shared %t1.o -o %t2.so +RUN: %link %emulation %linkopts -shared %t1.o -o %t2.so RUN: %objdump -d %t2.so | %filecheck %s RUN: %readelf -l -W %t2.so | %filecheck %s -check-prefix=STARTADDR diff --git a/test/Hexagon/linux/TLS/GDGOT/gdgot.test b/test/Hexagon/linux/TLS/GDGOT/gdgot.test index da121a944..664583b91 100644 --- a/test/Hexagon/linux/TLS/GDGOT/gdgot.test +++ b/test/Hexagon/linux/TLS/GDGOT/gdgot.test @@ -1,7 +1,7 @@ # Test that hidden symbols are not exported. RUN: %clang %clangopts %clangg0opts -c -fpic %p/Inputs/1.c -ftls-model=global-dynamic -o %t1.o RUN: %clang %clangopts %clangg0opts -c -fpic %p/Inputs/2.c -ftls-model=global-dynamic -o %t2.o -RUN: %link %linkopts %linkg0opts -shared %t1.o %t2.o -o %t.so +RUN: %link %emulation %linkopts %linkg0opts -shared %t1.o %t2.o -o %t.so RUN: %readelf -l -r -S -s -W %t.so | %filecheck %s # CHECK-NOT: TPREL diff --git a/test/Hexagon/linux/TLS/GDLDEx/GDLDEx.test b/test/Hexagon/linux/TLS/GDLDEx/GDLDEx.test index 057c1fe2e..c44586f83 100644 --- a/test/Hexagon/linux/TLS/GDLDEx/GDLDEx.test +++ b/test/Hexagon/linux/TLS/GDLDEx/GDLDEx.test @@ -3,8 +3,8 @@ # Add two more relocations with GD and LD PLT calls for stub #END_COMMENT RUN: %clang %clangopts %clangg0opts -c -fpic %p/Inputs/1.cpp -mlong-calls -std=c++11 -o %t1.o -RUN: %link %linkopts -shared %t1.o -o %t.out +RUN: %link %emulation %linkopts -shared %t1.o -o %t.out RUN: %readelf -r %t.out | %filecheck %s #CHECK: __tls_get_addr -RUN: %link %linkopts -shared %t1.o --gc-sections -o %t1.out --trace=symbol=__tls_get_addr 2>&1 | %filecheck %s --check-prefix="NOGC" +RUN: %link %emulation %linkopts -shared %t1.o --gc-sections -o %t1.out --trace=symbol=__tls_get_addr 2>&1 | %filecheck %s --check-prefix="NOGC" #NOGC: Symbol __tls_get_addr, application site: diff --git a/test/Hexagon/linux/TLS/GDLDMix/gdldmix.test b/test/Hexagon/linux/TLS/GDLDMix/gdldmix.test index cd2b3c5bb..ff1409c1e 100644 --- a/test/Hexagon/linux/TLS/GDLDMix/gdldmix.test +++ b/test/Hexagon/linux/TLS/GDLDMix/gdldmix.test @@ -3,7 +3,7 @@ RUN: %clang %clangopts %clangg0opts -c -fpic %p/Inputs/1.c -ftls-model=global-dy RUN: %clang %clangopts %clangg0opts -c -fpic %p/Inputs/2.s -o %t2.o # The symbols that are created may change order, due to threading behavior. # Switch off threads to just make the test output consistent. -RUN: %link %linkopts %linkg0opts -static %t1.o %t2.o -o %t.out -M 2>&1 | %filecheck %s --check-prefix="MAP" +RUN: %link %emulation %linkopts %linkg0opts -static %t1.o %t2.o -o %t.out -M 2>&1 | %filecheck %s --check-prefix="MAP" RUN: %readelf -l -r -S -s -W %t.out | %filecheck %s #MAP: Linker created TLS transformation stubs diff --git a/test/Hexagon/linux/TLS/GDTransformLinkerScript/GDTransformLinkerScript.test b/test/Hexagon/linux/TLS/GDTransformLinkerScript/GDTransformLinkerScript.test index ed5544f88..09f428a2d 100644 --- a/test/Hexagon/linux/TLS/GDTransformLinkerScript/GDTransformLinkerScript.test +++ b/test/Hexagon/linux/TLS/GDTransformLinkerScript/GDTransformLinkerScript.test @@ -4,7 +4,7 @@ # even in presence of linker script #END_COMMENT RUN: %clang %clangopts -c -fpic %p/Inputs/1.c -o %t1.o -RUN: %link %linkopts %t1.o -T %p/Inputs/script.t -o %t.out +RUN: %link %emulation %linkopts %t1.o -T %p/Inputs/script.t -o %t.out RUN: %readelf -s -S %t.out | %filecheck %s #CHECK: .stubs diff --git a/test/Hexagon/linux/TLS/GDtoIE/gdie.test b/test/Hexagon/linux/TLS/GDtoIE/gdie.test index d09903bd5..f82c1b67c 100644 --- a/test/Hexagon/linux/TLS/GDtoIE/gdie.test +++ b/test/Hexagon/linux/TLS/GDtoIE/gdie.test @@ -1,7 +1,7 @@ # Test that hidden symbols are not exported. RUN: %clang %clangopts %clangg0opts -c -fpic %p/Inputs/1.c -ftls-model=global-dynamic -o %t1.o RUN: %clang %clangopts %clangg0opts -c -fpic %p/Inputs/2.c -ftls-model=global-dynamic -o %t2.o -RUN: %link %linkopts %linkg0opts -static %t1.o %t2.o -o %t.so +RUN: %link %emulation %linkopts %linkg0opts -static %t1.o %t2.o -o %t.so RUN: %readelf -l -r -S -s -W %t.so | %filecheck %s # CHECK-NOT: TPREL diff --git a/test/Hexagon/linux/TLS/IE/ie.test b/test/Hexagon/linux/TLS/IE/ie.test index bbec9a6d0..36094f241 100644 --- a/test/Hexagon/linux/TLS/IE/ie.test +++ b/test/Hexagon/linux/TLS/IE/ie.test @@ -1,8 +1,8 @@ # Test that hidden symbols are not exported. RUN: %clang %clangopts -c %p/Inputs/1.s -o %t1.o RUN: %clang %clangopts -c -fpic %p/Inputs/2.s -o %t2.o -RUN: %link %linkopts -G0 -shared %t2.o -o %t2.so -RUN: %link %linkopts -G0 -dy %t1.o %t2.so -o %t.out +RUN: %link %emulation %linkopts -G0 -shared %t2.o -o %t2.so +RUN: %link %emulation %linkopts -G0 -dy %t1.o %t2.so -o %t.out RUN: %readelf -l -r -S -s -W %t.out | %filecheck %s # CHECK: TLS {{[x0-9a-z]+}} {{[x0-9a-z]+}} {{[x0-9a-z]+}} 0x00004 0x00008 R 0x8 diff --git a/test/Hexagon/linux/TLS/IEGOT/iegot.test b/test/Hexagon/linux/TLS/IEGOT/iegot.test index 3cc55ccdd..48b22a3b9 100644 --- a/test/Hexagon/linux/TLS/IEGOT/iegot.test +++ b/test/Hexagon/linux/TLS/IEGOT/iegot.test @@ -1,8 +1,8 @@ # Test R_HEX_IE* relocations RUN: %clang %clangopts -c -fpic %p/Inputs/1.s -o %t1.o RUN: %clang %clangopts -c -fpic %p/Inputs/2.s -o %t2.o -RUN: %link %linkopts -shared %t2.o -o %t2.so -RUN: %link %linkopts -G0 --force-dynamic -Bdynamic %t1.o %t2.so -o %t.out +RUN: %link %emulation %linkopts -shared %t2.o -o %t2.so +RUN: %link %emulation %linkopts -G0 --force-dynamic -Bdynamic %t1.o %t2.so -o %t.out RUN: %readelf -l -r -S -s -W %t.out | %filecheck %s # CHECK-DAG: TLS {{[x0-9a-z]+}} {{[x0-9a-z]+}} {{[x0-9a-z]+}} 0x00004 0x00008 R 0x8 diff --git a/test/Hexagon/linux/TLS/IEStatic/ie-static.test b/test/Hexagon/linux/TLS/IEStatic/ie-static.test index 4c08415cc..5ba994b22 100644 --- a/test/Hexagon/linux/TLS/IEStatic/ie-static.test +++ b/test/Hexagon/linux/TLS/IEStatic/ie-static.test @@ -1,7 +1,7 @@ # Test that hidden symbols are not exported. RUN: %clang %clangopts -ftls-model=initial-exec -c -fpic %p/Inputs/1.s -o %t1.o RUN: %clang %clangopts -ftls-model=initial-exec -c -fpic %p/Inputs/2.s -o %t2.o -RUN: %link %linkopts -G0 %t1.o %t2.o -o %t.out +RUN: %link %emulation %linkopts -G0 %t1.o %t2.o -o %t.out RUN: %readelf -l -r -S -s -W -x .got %t.out | %filecheck %s # CHECK: TLS {{[x0-9a-z]+}} {{[x0-9a-z]+}} {{[x0-9a-z]+}} 0x0000c 0x00010 R 0x8 diff --git a/test/Hexagon/linux/TLS/LDtoLE/ldle.test b/test/Hexagon/linux/TLS/LDtoLE/ldle.test index 2bf0bd87b..bd500fbbf 100644 --- a/test/Hexagon/linux/TLS/LDtoLE/ldle.test +++ b/test/Hexagon/linux/TLS/LDtoLE/ldle.test @@ -1,7 +1,7 @@ # Test that hidden symbols are not exported. RUN: %clang %clangopts %clangg0opts -c -fpic %p/Inputs/1.s -o %t1.o RUN: %clang %clangopts %clangg0opts -c -fpic %p/Inputs/2.s -o %t2.o -RUN: %link %linkopts %linkg0opts -static %t1.o %t2.o -o %t.so +RUN: %link %emulation %linkopts %linkg0opts -static %t1.o %t2.o -o %t.so RUN: %readelf -l -r -S -s -W %t.so | %filecheck %s # CHECK-NOT: TPREL diff --git a/test/Hexagon/linux/TLS/LocalSymbolsGD/LocalSymbolsGD.test b/test/Hexagon/linux/TLS/LocalSymbolsGD/LocalSymbolsGD.test index d9b1843ab..b8855c7b1 100644 --- a/test/Hexagon/linux/TLS/LocalSymbolsGD/LocalSymbolsGD.test +++ b/test/Hexagon/linux/TLS/LocalSymbolsGD/LocalSymbolsGD.test @@ -10,9 +10,9 @@ # START_TEST RUN: %clang %clangopts -c -fpic %p/Inputs/1.c -o %t1.o RUN: %clang %clangopts -c -fpic %p/Inputs/2.c -o %t2.o -RUN: %link %linkopts -shared %t2.o -o %tlib.so +RUN: %link %emulation %linkopts -shared %t2.o -o %tlib.so #Not using -dy will transform the GD to IE -RUN: %link %linkopts %t1.o -dy %tlib.so -o %t.out +RUN: %link %emulation %linkopts %t1.o -dy %tlib.so -o %t.out RUN: %readelf --dyn-syms %t.out | %filecheck %s #CHECK: __tls_get_addr diff --git a/test/Hexagon/linux/TLS/RecompileWithFpicErr/RecompileWithFpicErr.test b/test/Hexagon/linux/TLS/RecompileWithFpicErr/RecompileWithFpicErr.test index 8e1eccb7c..ab8790088 100644 --- a/test/Hexagon/linux/TLS/RecompileWithFpicErr/RecompileWithFpicErr.test +++ b/test/Hexagon/linux/TLS/RecompileWithFpicErr/RecompileWithFpicErr.test @@ -12,10 +12,10 @@ RUN: %clang %clangopts -c %clangg0opts %p/Inputs/1.c -ftls-model=initial-exec -o RUN: %clang %clangopts -c %clangg0opts %p/Inputs/2.c -ftls-model=initial-exec -o %t2IE.o RUN: %clang %clangopts -c %clangg0opts %p/Inputs/2.c -ftls-model=local-exec -o %t2LE.o RUN: %clang %clangopts -c %clangg0opts -fpic %p/Inputs/2.c -ftls-model=initial-exec -o %t2pic.o -RUN: %not %link %linkopts -shared %t2IE.o -o %tlib.so.1 2>&1 | %filecheck %s --check-prefix="IEERR" -RUN: %not %link %linkopts -shared %t2LE.o -o %tlib.so.2 2>&1 | %filecheck %s --check-prefix="LEERR" -RUN: %link %linkopts -shared %t2pic.o -o %tlib.so.3 2>&1 -RUN: %link %linkopts -Bdynamic %t1.o %tlib.so.3 -o %t.out 2>&1 +RUN: %not %link %emulation %linkopts -shared %t2IE.o -o %tlib.so.1 2>&1 | %filecheck %s --check-prefix="IEERR" +RUN: %not %link %emulation %linkopts -shared %t2LE.o -o %tlib.so.2 2>&1 | %filecheck %s --check-prefix="LEERR" +RUN: %link %emulation %linkopts -shared %t2pic.o -o %tlib.so.3 2>&1 +RUN: %link %emulation %linkopts -Bdynamic %t1.o %tlib.so.3 -o %t.out 2>&1 RUN: %readelf -r %t.out #IEERR: recompile with -fPIC diff --git a/test/Hexagon/linux/TLS/TBSSOffset/TBSSOffset.test b/test/Hexagon/linux/TLS/TBSSOffset/TBSSOffset.test index 46456b16f..fa9231b45 100644 --- a/test/Hexagon/linux/TLS/TBSSOffset/TBSSOffset.test +++ b/test/Hexagon/linux/TLS/TBSSOffset/TBSSOffset.test @@ -2,7 +2,7 @@ # previous section is TBSS and a regular PROGBITS section follows it. # Make sure file size is same as memory size. RUN: %clang %clangopts -c %p/Inputs/tls.c %clangg0opts -o %t1.tls.o -RUN: %link %linkopts %t1.tls.o -o %t2.out +RUN: %link %emulation %linkopts %t1.tls.o -o %t2.out RUN: %readelf -l -W %t2.out | %filecheck %s #CHECK: LOAD {{[0-9a-fx]+}} {{[0-9a-fx]+}} {{[0-9a-fx]+}} [[FILESZ:[xa-f0-9]+]] [[FILESZ]] diff --git a/test/Hexagon/linux/TLS/TBSSOffsetLinkerScript/TBSSOffsetLinkerScript.test b/test/Hexagon/linux/TLS/TBSSOffsetLinkerScript/TBSSOffsetLinkerScript.test index c60cccb3d..776d49d4e 100644 --- a/test/Hexagon/linux/TLS/TBSSOffsetLinkerScript/TBSSOffsetLinkerScript.test +++ b/test/Hexagon/linux/TLS/TBSSOffsetLinkerScript/TBSSOffsetLinkerScript.test @@ -3,7 +3,7 @@ # Make sure file size is same as memory size. The test additionally tests that # all TBSS section still use the same offset and offset is not incremented. RUN: %clang %clangopts -c %p/Inputs/tls.c %clangg0opts -o %t1.tls.o -fdata-sections -RUN: %link %linkopts %t1.tls.o -o %t2.out -T %p/Inputs/tls.t +RUN: %link %emulation %linkopts %t1.tls.o -o %t2.out -T %p/Inputs/tls.t RUN: %readelf -l -W %t2.out | %filecheck %s #CHECK: LOAD {{[0-9a-fx]+}} {{[0-9a-fx]+}} {{[0-9a-fx]+}} [[FILESZ:[xa-f0-9]+]] [[FILESZ]] diff --git a/test/Hexagon/linux/TLS/TLSNonTLSMix/TLSNonTLSMix.test b/test/Hexagon/linux/TLS/TLSNonTLSMix/TLSNonTLSMix.test index 6f4161afc..ebd36cba6 100644 --- a/test/Hexagon/linux/TLS/TLSNonTLSMix/TLSNonTLSMix.test +++ b/test/Hexagon/linux/TLS/TLSNonTLSMix/TLSNonTLSMix.test @@ -12,10 +12,10 @@ RUN: %clang %clangopts -c %clangg0opts %p/Inputs/1.c -o %t1.o RUN: %clang %clangopts -c %clangg0opts %p/Inputs/2.c -o %t2.o RUN: %clang %clangopts -c %clangg0opts %p/Inputs/3.c -o %t3.o RUN: %clang %clangopts -c %clangg0opts %p/Inputs/4.c -o %t4.o -RUN: %not %link %linkopts %t1.o %t2.o -o %t.out 2>&1 | %filecheck %s --check-prefix="REFREF" -RUN: %not %link %linkopts %t1.o %t3.o -o %t.out 2>&1 | %filecheck %s --check-prefix="DEFREF" -RUN: %not %link %linkopts %t2.o %t4.o -o %t.out 2>&1 | %filecheck %s --check-prefix="REFDEF" -RUN: %not %link %linkopts %t3.o %t4.o -o %t.out 2>&1 | %filecheck %s --check-prefix="DEFDEF" +RUN: %not %link %emulation %linkopts %t1.o %t2.o -o %t.out 2>&1 | %filecheck %s --check-prefix="REFREF" +RUN: %not %link %emulation %linkopts %t1.o %t3.o -o %t.out 2>&1 | %filecheck %s --check-prefix="DEFREF" +RUN: %not %link %emulation %linkopts %t2.o %t4.o -o %t.out 2>&1 | %filecheck %s --check-prefix="REFDEF" +RUN: %not %link %emulation %linkopts %t3.o %t4.o -o %t.out 2>&1 | %filecheck %s --check-prefix="DEFDEF" #REFREF: bar: TLS reference in {{[ -\(\)_A-Za-z0-9.\\/:]+}}tmp2.o mismatches non-TLS reference in {{[ -\(\)_A-Za-z0-9.\\/:]+}}tmp1.o #DEFREF: bar: TLS definition in {{[ -\(\)_A-Za-z0-9.\\/:]+}}tmp3.o mismatches non-TLS reference in {{[ -\(\)_A-Za-z0-9.\\/:]+}}tmp1.o diff --git a/test/Hexagon/linux/TLS/TPREL/tprel.test b/test/Hexagon/linux/TLS/TPREL/tprel.test index f53d09a06..db0c39a02 100644 --- a/test/Hexagon/linux/TLS/TPREL/tprel.test +++ b/test/Hexagon/linux/TLS/TPREL/tprel.test @@ -3,8 +3,8 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -ftls-model=local-exec -o %t1.o RUN: %clang %clangopts -c %p/Inputs/2.c -ftls-model=local-exec -o %t2.o RUN: %clang %clangopts -c %p/Inputs/1.c -ftls-model=local-exec -fpic -o %t1.pic.o RUN: %clang %clangopts -c %p/Inputs/2.c -ftls-model=local-exec -fpic -o %t2.pic.o -RUN: %link %linkopts -o %t.out %t1.o %t2.o -G0 2>&1 -RUN: %not %link %linkopts -shared -o %t.so %t1.pic.o %t2.pic.o -G0 2>&1 | %filecheck %s --check-prefix="ERR" +RUN: %link %emulation %linkopts -o %t.out %t1.o %t2.o -G0 2>&1 +RUN: %not %link %emulation %linkopts -shared -o %t.so %t1.pic.o %t2.pic.o -G0 2>&1 | %filecheck %s --check-prefix="ERR" RUN: %readelf -l -S -s -W %t.out | %filecheck %s #ERR: recompile with -fPIC diff --git a/test/Hexagon/linux/TLS/trampolinesToStub/simple-trampoline.test b/test/Hexagon/linux/TLS/trampolinesToStub/simple-trampoline.test index 5ff22d458..efdcdc393 100644 --- a/test/Hexagon/linux/TLS/trampolinesToStub/simple-trampoline.test +++ b/test/Hexagon/linux/TLS/trampolinesToStub/simple-trampoline.test @@ -1,5 +1,5 @@ RUN: %clang %clangopts -c -fpic %p/Inputs/trampoline.s -o %t.o -RUN: %link %linkopts %t.o -static -o %t.out -T %p/Inputs/trampoline.script +RUN: %link %emulation %linkopts %t.o -static -o %t.out -T %p/Inputs/trampoline.script RUN: %readelf -s -W %t.out | %filecheck %s CHECK: trampoline_for___hexagon_ie_tls_get_addr_from_.text_{{[0-9]+}} diff --git a/test/Hexagon/linux/Visibility/Visibility.test b/test/Hexagon/linux/Visibility/Visibility.test index 68003c135..f1347e157 100644 --- a/test/Hexagon/linux/Visibility/Visibility.test +++ b/test/Hexagon/linux/Visibility/Visibility.test @@ -8,15 +8,15 @@ #Try linking an application with reference to such symbol. It must fail RUN: %clang %clangopts -c %p/Inputs/1.c %clangg0opts -o %t1.o RUN: %clang %clangopts -c %p/Inputs/2.c -fpic -o %t2.o -RUN: %link %linkopts -shared -o %t1.so %t2.o -RUN: %not %link %linkopts --warn-once -dy %t1.o %t1.so 2>&1 | %filecheck --check-prefix="HIDDEN1" %s +RUN: %link %emulation %linkopts -shared -o %t1.so %t2.o +RUN: %not %link %emulation %linkopts --warn-once -dy %t1.o %t1.so 2>&1 | %filecheck --check-prefix="HIDDEN1" %s # HIDDEN1: undefined reference to `a' # #Try making a shared library with a hidden reference. Shared lib #must not link %linkopts since it expects it in same module RUN: %clang %clangopts -c %p/Inputs/3.c -fpic -o %t3.o -RUN: %not %link %linkopts -shared %t3.o -o %t3.so 2>&1 | %filecheck --check-prefix="HIDDEN2" %s +RUN: %not %link %emulation %linkopts -shared %t3.o -o %t3.so 2>&1 | %filecheck --check-prefix="HIDDEN2" %s # HIDDEN2: undefined hidden symbol `a' cannot be used when making a shared object # @@ -25,7 +25,7 @@ HIDDEN2: undefined hidden symbol `a' cannot be used when making a shared object #linker to pick up and preserve the symbol in object # RUN: %clang %clangopts -c %p/Inputs/4.c -flto -o %t6.bc -RUN: %link %linkopts -dy %t1.o %t1.so %t6.bc --trace=lto -o %t7.out 2>&1 | %filecheck --check-prefix="HIDDEN3" %s +RUN: %link %emulation %linkopts -dy %t1.o %t1.so %t6.bc --trace=lto -o %t7.out 2>&1 | %filecheck --check-prefix="HIDDEN3" %s # HIDDEN3: Preserving symbol a # @@ -33,11 +33,11 @@ HIDDEN3: Preserving symbol a RUN: %clang %clangopts -c %p/Inputs/5.c %clangg0opts -o %t7.o RUN: %clang %clangopts -c %p/Inputs/6.c %clangg0opts -o %t8.o RUN: %ar cr %aropts %t.eight.a %t2.o -RUN: %link %linkopts %t1.o %t.eight.a %linkg0opts -o %t41.out -t 2>&1 | %grep eight | wc -l | %filecheck --check-prefix="HIDDEN41" %s +RUN: %link %emulation %linkopts %t1.o %t.eight.a %linkg0opts -o %t41.out -t 2>&1 | %grep eight | wc -l | %filecheck --check-prefix="HIDDEN41" %s RUN: %ar cr %aropts %t.nine.a %t7.o -RUN: %link %linkopts %t1.o %t.nine.a %linkg0opts -o %t42.out -t 2>&1 | %grep nine | wc -l | %filecheck --check-prefix="HIDDEN42" %s +RUN: %link %emulation %linkopts %t1.o %t.nine.a %linkg0opts -o %t42.out -t 2>&1 | %grep nine | wc -l | %filecheck --check-prefix="HIDDEN42" %s RUN: %ar cr %aropts %t.ten.a %t8.o -RUN: %link %linkopts %t1.o %t.ten.a %t.eight.a %t.nine.a %linkg0opts -o %t43.out -t 2>&1 | %grep ten | wc -l | %filecheck --check-prefix="HIDDEN43" %s +RUN: %link %emulation %linkopts %t1.o %t.ten.a %t.eight.a %t.nine.a %linkg0opts -o %t43.out -t 2>&1 | %grep ten | wc -l | %filecheck --check-prefix="HIDDEN43" %s HIDDEN41: 1 HIDDEN42: 1 @@ -46,14 +46,14 @@ HIDDEN43: 1 #Check that a protected reference from an application must result in undefined #reference if the definition is in a shared object RUN: %clang %clangopts -c %p/Inputs/7.c -o %t10.o -RUN: not %link -o %t1err.out %linkopts -dy %t10.o %t1.so 2>&1 | %filecheck --check-prefix="PROTECTED1" %s +RUN: not %link %emulation -o %t1err.out %linkopts -dy %t10.o %t1.so 2>&1 | %filecheck --check-prefix="PROTECTED1" %s PROTECTED1: undefined reference to `a' #Try making a shared library with a protected reference. Shared lib #must not link %linkopts since it expects definition in same module RUN: %clang %clangopts -c %p/Inputs/8.c -fpic -o %t11.o -RUN: %not %link %linkopts -shared %t11.o -o %t11.so 2>&1 | %filecheck --check-prefix="PROTECTED2" %s +RUN: %not %link %emulation %linkopts -shared %t11.o -o %t11.so 2>&1 | %filecheck --check-prefix="PROTECTED2" %s # PROTECTED2: undefined protected symbol `a' cannot be used when making a shared object @@ -61,16 +61,16 @@ PROTECTED2: undefined protected symbol `a' cannot be used when making a shared o #A library with protected symbol and an object with symbol, should cause the #linker to pick up and preserve the symbol in object # -RUN: %link %linkopts -dy %t10.o %t1.so %t6.bc --trace=lto -o %t7.out 2>&1 | %filecheck --check-prefix="PROTECTED3" %s +RUN: %link %emulation %linkopts -dy %t10.o %t1.so %t6.bc --trace=lto -o %t7.out 2>&1 | %filecheck --check-prefix="PROTECTED3" %s PROTECTED3: Preserving symbol a #Make sure the section magic symbols are also supported ith proper visibility. #These symbols are always defined by linker per module. So they should not be #flagged as undefined RUN: %clang %clangopts -c %p/Inputs/9.c %clangg0opts -fpic -o %t11.o -RUN: %link %linkopts -shared %t11.o -o %t11.so +RUN: %link %emulation %linkopts -shared %t11.o -o %t11.so RUN: %readelf -s %t11.so | %filecheck --check-prefix="MAGIC1" %s MAGIC1: __start_foo RUN: %clang %clangopts -c %p/Inputs/10.c %clangg0opts -fpic -o %t12.o -RUN: %not %link %linkopts -shared %t12.o -o %t12.so 2>&1 | %filecheck --check-prefix="MAGIC2" %s +RUN: %not %link %emulation %linkopts -shared %t12.o -o %t12.so 2>&1 | %filecheck --check-prefix="MAGIC2" %s MAGIC2: undefined reference to `__start_bar' diff --git a/test/Hexagon/linux/ZRelRO/FullRelRO.test b/test/Hexagon/linux/ZRelRO/FullRelRO.test index 3c5653572..324834e45 100644 --- a/test/Hexagon/linux/ZRelRO/FullRelRO.test +++ b/test/Hexagon/linux/ZRelRO/FullRelRO.test @@ -6,7 +6,7 @@ # that are part of the RELRO segment. #END_COMMENT RUN: %clang %clangopts -c %p/Inputs/1.c -fPIC -o %t1.1.o -fno-use-init-array -RUN: %link %linkopts %t1.1.o -shared -o %t1.so -z relro -z now +RUN: %link %emulation %linkopts %t1.1.o -shared -o %t1.so -z relro -z now RUN: %readelf -l -W %t1.so | %filecheck %s #CHECK: 03 .ctors .dtors .dynamic .got diff --git a/test/Hexagon/linux/ZRelRO/PartialRelRO.test b/test/Hexagon/linux/ZRelRO/PartialRelRO.test index 3fef84451..d43f520da 100644 --- a/test/Hexagon/linux/ZRelRO/PartialRelRO.test +++ b/test/Hexagon/linux/ZRelRO/PartialRelRO.test @@ -6,7 +6,7 @@ # PT_GNU_RELRO segment. #END_COMMENT RUN: %clang %clangopts -c %p/Inputs/1.c -fPIC -o %t1.1.o -fno-use-init-array -RUN: %link %linkopts %t1.1.o -shared -o %t1.so -z relro +RUN: %link %emulation %linkopts %t1.1.o -shared -o %t1.so -z relro RUN: %readelf -l -W %t1.so | %filecheck %s #CHECK-NOT: 03 .dynamic .got diff --git a/test/Hexagon/linux/alignSegmentsTriple/alignSegment.test b/test/Hexagon/linux/alignSegmentsTriple/alignSegment.test index ca7e1beab..b663aff45 100644 --- a/test/Hexagon/linux/alignSegmentsTriple/alignSegment.test +++ b/test/Hexagon/linux/alignSegmentsTriple/alignSegment.test @@ -2,9 +2,9 @@ REQUIRES: hexagon-linux-env RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o -RUN: %link %linkopts %t1.o -o %t2 -z max-page-size=4096 +RUN: %link %emulation %linkopts %t1.o -o %t2 -z max-page-size=4096 RUN: %readelf -l -W %t2 | %filecheck %s -RUN: %link %linkopts %t1.o -o %t2.phdr -T %p/Inputs/phdr_test.t -z max-page-size=4096 +RUN: %link %emulation %linkopts %t1.o -o %t2.phdr -T %p/Inputs/phdr_test.t -z max-page-size=4096 RUN: %readelf -l -W %t2.phdr | %filecheck %s -check-prefix=PHDR #CHECK: LOAD 0x000000 {{.*}} 0x0008c 0x0008c R E 0x1000 diff --git a/test/Hexagon/linux/commonsInMap/commonsInMap.test b/test/Hexagon/linux/commonsInMap/commonsInMap.test index 9257ebe99..79abb7440 100644 --- a/test/Hexagon/linux/commonsInMap/commonsInMap.test +++ b/test/Hexagon/linux/commonsInMap/commonsInMap.test @@ -2,13 +2,13 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o.g0 %clangg0opts RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o # Test G0 with and without linker scripts -RUN: %link -o %t1.out.1 %linkopts %t1.o.g0 -z max-page-size=4096 -M 2>&1 | %filecheck -check-prefix=COMMONSWITHOUTLSG0 %s -RUN: %link -o %t1.out.2 %linkopts %t1.o.g0 -z max-page-size=4096 -T %p/Inputs/script.t -M 2>&1| %filecheck -check-prefix=COMMONSWITHLSG0 %s -RUN: %link -o %t1.out.3 %linkopts %t1.o.g0 -z max-page-size=4096 %linkg0opts -M 2>&1 | %filecheck -check-prefix=COMMONSWITHOUTLSLINKG0 %s -RUN: %link -o %t1.out.4 %linkopts %t1.o.g0 -z max-page-size=4096 %linkg0opts -T %p/Inputs/script.t -M 2>&1| %filecheck -check-prefix=COMMONSWITHLSLINKG0 %s +RUN: %link %emulation -o %t1.out.1 %linkopts %t1.o.g0 -z max-page-size=4096 -M 2>&1 | %filecheck -check-prefix=COMMONSWITHOUTLSG0 %s +RUN: %link %emulation -o %t1.out.2 %linkopts %t1.o.g0 -z max-page-size=4096 -T %p/Inputs/script.t -M 2>&1| %filecheck -check-prefix=COMMONSWITHLSG0 %s +RUN: %link %emulation -o %t1.out.3 %linkopts %t1.o.g0 -z max-page-size=4096 %linkg0opts -M 2>&1 | %filecheck -check-prefix=COMMONSWITHOUTLSLINKG0 %s +RUN: %link %emulation -o %t1.out.4 %linkopts %t1.o.g0 -z max-page-size=4096 %linkg0opts -T %p/Inputs/script.t -M 2>&1| %filecheck -check-prefix=COMMONSWITHLSLINKG0 %s # Test G8 with linker scripts -RUN: %link -o %t1.out.5 %linkopts %t1.o -z max-page-size=4096 -M 2>&1| %filecheck -check-prefix=COMMONSWITHOUTLS %s -RUN: %link -o %t1.out.6 %linkopts %t1.o -z max-page-size=4096 -T %p/Inputs/script.t -M 2>&1| %filecheck -check-prefix=COMMONSWITHLS %s +RUN: %link %emulation -o %t1.out.5 %linkopts %t1.o -z max-page-size=4096 -M 2>&1| %filecheck -check-prefix=COMMONSWITHOUTLS %s +RUN: %link %emulation -o %t1.out.6 %linkopts %t1.o -z max-page-size=4096 -T %p/Inputs/script.t -M 2>&1| %filecheck -check-prefix=COMMONSWITHLS %s #COMMONSWITHOUTLSG0:common1 0x4 #COMMONSWITHOUTLSG0:common2 0x4 diff --git a/test/Hexagon/linux/elfsegment/helloworld-segment-align.test b/test/Hexagon/linux/elfsegment/helloworld-segment-align.test index 722057f2f..e7edbe445 100644 --- a/test/Hexagon/linux/elfsegment/helloworld-segment-align.test +++ b/test/Hexagon/linux/elfsegment/helloworld-segment-align.test @@ -1,5 +1,5 @@ RUN: %clang %clangopts -c %p/Inputs/hello.c -o %t.o -RUN: %link %linkopts --rosegment --no-align-segments %t.o -o %t.out --noinhibit-exec +RUN: %link %emulation %linkopts --rosegment --no-align-segments %t.o -o %t.out --noinhibit-exec RUN: %readelf -l -W %t.out | %filecheck %s CHECK: LOAD {{[0x1-9a-f]+}} {{[0x1-9a-f]+}} {{[0x1-9a-f]+}} {{[0x1-9a-f]+}} {{[0x1-9a-f]+}} R E 0x1000 diff --git a/test/Hexagon/linux/etext/etext.test b/test/Hexagon/linux/etext/etext.test index 0f5899682..8d0834f61 100644 --- a/test/Hexagon/linux/etext/etext.test +++ b/test/Hexagon/linux/etext/etext.test @@ -1,6 +1,6 @@ # Checks that the value of etext has been set appropriately. RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o -RUN: %link %linkopts %t1.o -o %t2.out +RUN: %link %emulation %linkopts %t1.o -o %t2.out RUN: %readelf -s %t2.out | %grep etext | %filecheck %s #CHECK: {{[0-9]+}}: {{.*}} 0 NOTYPE GLOBAL DEFAULT ABS __etext diff --git a/test/Hexagon/linux/forceDynamicTriple/forceDynamicTriple.test b/test/Hexagon/linux/forceDynamicTriple/forceDynamicTriple.test index 2be9c61d0..5b5792bea 100644 --- a/test/Hexagon/linux/forceDynamicTriple/forceDynamicTriple.test +++ b/test/Hexagon/linux/forceDynamicTriple/forceDynamicTriple.test @@ -2,7 +2,7 @@ REQUIRES: hexagon-linux-env RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o -RUN: %link %linkopts --rosegment %t1.o -o %t2 --force-dynamic -z max-page-size=4096 +RUN: %link %emulation %linkopts --rosegment %t1.o -o %t2 --force-dynamic -z max-page-size=4096 RUN: %readelf -l -W %t2 | %filecheck %s #CHECK: LOAD 0x000000 {{[xa-f0-9]*}} {{[xa-f0-9]*}} {{[xa-f0-9]*}} {{[xa-f0-9]*}} R E 0x1000 diff --git a/test/Hexagon/linux/linkerscript/AddressMapEmptySection/AddressMapEmptySection.test b/test/Hexagon/linux/linkerscript/AddressMapEmptySection/AddressMapEmptySection.test index e4aee95a7..453be7843 100644 --- a/test/Hexagon/linux/linkerscript/AddressMapEmptySection/AddressMapEmptySection.test +++ b/test/Hexagon/linux/linkerscript/AddressMapEmptySection/AddressMapEmptySection.test @@ -1,5 +1,5 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o %clangg0opts -ffunction-sections -fdata-sections -RUN: %link %linkopts %t1.o -o %t.out --section-start=.my_start=0x1000 -T=%p/Inputs/script 2>&1 +RUN: %link %emulation %linkopts %t1.o -o %t.out --section-start=.my_start=0x1000 -T=%p/Inputs/script 2>&1 RUN: %readelf -S %t.out | %filecheck %s #CHECK: .text PROGBITS 00001000 001000 000014 diff --git a/test/Hexagon/linux/linkerscript/CreateEmptySections/createEmptySections.test b/test/Hexagon/linux/linkerscript/CreateEmptySections/createEmptySections.test index fcfff674a..13ec3da99 100644 --- a/test/Hexagon/linux/linkerscript/CreateEmptySections/createEmptySections.test +++ b/test/Hexagon/linux/linkerscript/CreateEmptySections/createEmptySections.test @@ -1,7 +1,7 @@ # This test checks that the linker is able to create empty sections. RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o %clangg0opts -RUN: %link %linkopts %t1.o -T %p/Inputs/s.t -o %t2.out.nophdr -RUN: %link %linkopts %t1.o -T %p/Inputs/p.t -o %t2.out.phdr +RUN: %link %emulation %linkopts %t1.o -T %p/Inputs/s.t -o %t2.out.nophdr +RUN: %link %emulation %linkopts %t1.o -T %p/Inputs/p.t -o %t2.out.phdr RUN: %readelf -l -W %t2.out.nophdr | %filecheck %s RUN: %readelf -l -W %t2.out.phdr | %filecheck %s diff --git a/test/Hexagon/linux/linkerscript/DelayCreatingSegmentsForEmptySections/delaycreatingsegmentsforemptysections.test b/test/Hexagon/linux/linkerscript/DelayCreatingSegmentsForEmptySections/delaycreatingsegmentsforemptysections.test index 4ef3e1f53..d5d5067c8 100644 --- a/test/Hexagon/linux/linkerscript/DelayCreatingSegmentsForEmptySections/delaycreatingsegmentsforemptysections.test +++ b/test/Hexagon/linux/linkerscript/DelayCreatingSegmentsForEmptySections/delaycreatingsegmentsforemptysections.test @@ -2,10 +2,10 @@ # for sections that are empty. RUN: %clang %clangopts -c %clangg0opts %p/Inputs/1.c -o %t1.o RUN: %clang %clangopts -c %clangg0opts %p/Inputs/2.c -o %t2.o -RUN: %link %linkopts %t1.o -T %p/Inputs/script1.t -o %t1.out.1 -RUN: %link %linkopts %t2.o -T %p/Inputs/script2.t -o %t1.out.2 -RUN: %link %linkopts %t2.o -T %p/Inputs/script3.t -o %t1.out.3 -RUN: %link %linkopts %t1.o -T %p/Inputs/script4.t -o %t1.out.4 +RUN: %link %emulation %linkopts %t1.o -T %p/Inputs/script1.t -o %t1.out.1 +RUN: %link %emulation %linkopts %t2.o -T %p/Inputs/script2.t -o %t1.out.2 +RUN: %link %emulation %linkopts %t2.o -T %p/Inputs/script3.t -o %t1.out.3 +RUN: %link %emulation %linkopts %t1.o -T %p/Inputs/script4.t -o %t1.out.4 RUN: %readelf -l %t1.out.1 | %filecheck %s -check-prefix=CASEA RUN: %readelf -l %t1.out.2 | %filecheck %s -check-prefix=CASEB RUN: %readelf -l %t1.out.3 | %filecheck %s -check-prefix=CASEB diff --git a/test/Hexagon/linux/linkerscript/EmptySection/emptysection.test b/test/Hexagon/linux/linkerscript/EmptySection/emptysection.test index bcd72219b..0f9984945 100644 --- a/test/Hexagon/linux/linkerscript/EmptySection/emptysection.test +++ b/test/Hexagon/linux/linkerscript/EmptySection/emptysection.test @@ -1,7 +1,7 @@ # Check symbol assignments when there is an empty section. RUN: %clang %clangopts -c -ffunction-sections %p/Inputs/foo.c %clangg0opts -o %t0.foo.o RUN: %clang %clangopts -c -ffunction-sections %p/Inputs/bar.c %clangg0opts -o %t0.bar.o -RUN: %link %linkopts -T %p/Inputs/script.t %t0.foo.o %t0.bar.o -o %t1 -z max-page-size=4096 +RUN: %link %emulation %linkopts -T %p/Inputs/script.t %t0.foo.o %t0.bar.o -o %t1 -z max-page-size=4096 RUN: %readelf -S %t1 | %filecheck %s #CHECK: [ 1] .candidate_compress_section PROGBITS d0000000 001000 00000c 00 AX 0 0 16 diff --git a/test/Hexagon/linux/linkerscript/ExternCmd/ExternCmd.test b/test/Hexagon/linux/linkerscript/ExternCmd/ExternCmd.test index 1a5a090d7..b12fed619 100644 --- a/test/Hexagon/linux/linkerscript/ExternCmd/ExternCmd.test +++ b/test/Hexagon/linux/linkerscript/ExternCmd/ExternCmd.test @@ -1,7 +1,7 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o RUN: %clang %clangopts -c %p/Inputs/2.c -o %t2.o RUN: %ar cr %tlib.a %t2.o -RUN: %link %linkopts %t1.o %tlib.a -o %t.out -T=%p/Inputs/list 2>&1 +RUN: %link %emulation %linkopts %t1.o %tlib.a -o %t.out -T=%p/Inputs/list 2>&1 RUN: %nm -n %t.out | %filecheck %s #CHECK: U externSym diff --git a/test/Hexagon/linux/linkerscript/ExternCmdLongForm/ExternCmd.test b/test/Hexagon/linux/linkerscript/ExternCmdLongForm/ExternCmd.test index 065ac018e..3f599a8ec 100644 --- a/test/Hexagon/linux/linkerscript/ExternCmdLongForm/ExternCmd.test +++ b/test/Hexagon/linux/linkerscript/ExternCmdLongForm/ExternCmd.test @@ -1,7 +1,7 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o RUN: %clang %clangopts -c %p/Inputs/2.c -o %t2.o RUN: %ar cr %tlib.a %t2.o -RUN: %link %linkopts %t1.o %tlib.a -o %t.out -T=%p/Inputs/list 2>&1 +RUN: %link %emulation %linkopts %t1.o %tlib.a -o %t.out -T=%p/Inputs/list 2>&1 RUN: %nm -n %t.out | %filecheck %s #CHECK: U externSym diff --git a/test/Hexagon/linux/linkerscript/ForceDynPerm/ForceDynPerm.test b/test/Hexagon/linux/linkerscript/ForceDynPerm/ForceDynPerm.test index 600d2dcca..af6acf032 100644 --- a/test/Hexagon/linux/linkerscript/ForceDynPerm/ForceDynPerm.test +++ b/test/Hexagon/linux/linkerscript/ForceDynPerm/ForceDynPerm.test @@ -1,6 +1,6 @@ # Test that hidden symbols are not exported. RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o -RUN: %link %linkopts --rosegment -force-dynamic -T %p/Inputs/script.t %t1.o -o %t.out 2>&1 +RUN: %link %emulation %linkopts --rosegment -force-dynamic -T %p/Inputs/script.t %t1.o -o %t.out 2>&1 RUN: %readelf -l -W %t.out | %filecheck %s # CHECK: PHDR {{[x0-9a-z]+}} {{[x0-9a-z]+}} {{[x0-9a-z]+}} {{[x0-9a-z]+}} {{[x0-9a-z]+}} R E {{[x0-9a-z]+}} diff --git a/test/Hexagon/linux/linkerscript/GCExternCmd/GCExternCmd.test b/test/Hexagon/linux/linkerscript/GCExternCmd/GCExternCmd.test index 70afe4973..3ff6dd47b 100644 --- a/test/Hexagon/linux/linkerscript/GCExternCmd/GCExternCmd.test +++ b/test/Hexagon/linux/linkerscript/GCExternCmd/GCExternCmd.test @@ -1,7 +1,7 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o -ffunction-sections -fdata-sections RUN: %clang %clangopts -c %p/Inputs/2.c -o %t2.o -ffunction-sections -fdata-sections RUN: %ar cr %tlib.a %t2.o -RUN: %link %linkopts %t1.o %tlib.a --entry main -o %t.out -T=%p/Inputs/list --gc-sections 2>&1 +RUN: %link %emulation %linkopts %t1.o %tlib.a --entry main -o %t.out -T=%p/Inputs/list --gc-sections 2>&1 RUN: %readelf -s %t.out | %filecheck %s --check-prefix=EXTERN RUN: %readelf -s %t.out | %filecheck %s --check-prefix=CHAR diff --git a/test/Hexagon/linux/linkerscript/HandleEmptySections/handle_empty_sections.test b/test/Hexagon/linux/linkerscript/HandleEmptySections/handle_empty_sections.test index 4cd4fc7c3..64fee9786 100644 --- a/test/Hexagon/linux/linkerscript/HandleEmptySections/handle_empty_sections.test +++ b/test/Hexagon/linux/linkerscript/HandleEmptySections/handle_empty_sections.test @@ -1,6 +1,6 @@ # This tests empty sections that for they get proper permissions. RUN: %clang %clangopts -c %p/Inputs/main.c -o %t1.o -RUN: %link %linkopts --rosegment --script %p/Inputs/linker_script.t %t1.o -o %t1 -z max-page-size=4096 +RUN: %link %emulation %linkopts --rosegment --script %p/Inputs/linker_script.t %t1.o -o %t1 -z max-page-size=4096 RUN: %readelf -l -W %t1 | %filecheck %s #CHECK: LOAD 0x001000 0x00000000 0x00000000 0x00004 0x00004 R 0x1000 diff --git a/test/Hexagon/linux/linkerscript/Keep/Keep.test b/test/Hexagon/linux/linkerscript/Keep/Keep.test index bfcc7becb..3f9acd27f 100644 --- a/test/Hexagon/linux/linkerscript/Keep/Keep.test +++ b/test/Hexagon/linux/linkerscript/Keep/Keep.test @@ -1,7 +1,7 @@ RUN: %clang %clangopts -c %p/Inputs/1.c %clangg0opts -ffunction-sections -fdata-sections -o %t1.o RUN: %clang %clangopts -c %p/Inputs/2.c %clangg0opts -ffunction-sections -fdata-sections -o %t2.o RUN: %ar cr %tliba.a %t2.o -RUN: %link %linkopts %t1.o --whole-archive %tliba.a --no-whole-archive -o %t.out -T=%p/Inputs/script --gc-sections --entry=main 2>&1 +RUN: %link %emulation %linkopts %t1.o --whole-archive %tliba.a --no-whole-archive -o %t.out -T=%p/Inputs/script --gc-sections --entry=main 2>&1 RUN: %nm -n %t.out | %filecheck %s #CHECK: 00000000 D foo diff --git a/test/Hexagon/linux/linkerscript/LinkerScriptExpressions/LinkerScriptExpressions.test b/test/Hexagon/linux/linkerscript/LinkerScriptExpressions/LinkerScriptExpressions.test index b46f9140d..a84fe94ee 100644 --- a/test/Hexagon/linux/linkerscript/LinkerScriptExpressions/LinkerScriptExpressions.test +++ b/test/Hexagon/linux/linkerscript/LinkerScriptExpressions/LinkerScriptExpressions.test @@ -1,10 +1,10 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o -RUN: %link %linkopts %t1.o -o %t.out --section-start=.my_start=0x1000 -T=%p/Inputs/script.t 2>&1 +RUN: %link %emulation %linkopts %t1.o -o %t.out --section-start=.my_start=0x1000 -T=%p/Inputs/script.t 2>&1 RUN: %readelf -s %t.out | %filecheck %s -RUN: %not %link %linkopts %t1.o -o %t.out --section-start=.my_start=0x1000 -T=%p/Inputs/errorexpn.t 2>&1 | %filecheck -check-prefix=ERR %s -RUN: %link %linkopts %t1.o -o %t.out --section-start=.my_start=0x1000 -T=%p/Inputs/addr.t 2>&1 +RUN: %not %link %emulation %linkopts %t1.o -o %t.out --section-start=.my_start=0x1000 -T=%p/Inputs/errorexpn.t 2>&1 | %filecheck -check-prefix=ERR %s +RUN: %link %emulation %linkopts %t1.o -o %t.out --section-start=.my_start=0x1000 -T=%p/Inputs/addr.t 2>&1 RUN: %readelf -s %t.out | %filecheck --check-prefix=ADDR %s -RUN: %not %link %linkopts %t1.o -o %t.out --section-start=.my_start=0x1000 -T=%p/Inputs/addr_error.t 2>&1 | %filecheck -check-prefix=ERR2 %s +RUN: %not %link %emulation %linkopts %t1.o -o %t.out --section-start=.my_start=0x1000 -T=%p/Inputs/addr_error.t 2>&1 | %filecheck -check-prefix=ERR2 %s #CHECK-DAG: {{[0-9]+}}: {{[0-9]+}} 0 NOTYPE GLOBAL DEFAULT ABS _myvar2 #CHECK-DAG: {{[0-9]+}}: {{[0-9]+}} 0 NOTYPE GLOBAL DEFAULT ABS _myvar3 diff --git a/test/Hexagon/linux/linkerscript/PartialLinkMoveCommonToBSS/partiallinkmovecommon.test b/test/Hexagon/linux/linkerscript/PartialLinkMoveCommonToBSS/partiallinkmovecommon.test index 293c617c3..633fa4c6e 100644 --- a/test/Hexagon/linux/linkerscript/PartialLinkMoveCommonToBSS/partiallinkmovecommon.test +++ b/test/Hexagon/linux/linkerscript/PartialLinkMoveCommonToBSS/partiallinkmovecommon.test @@ -1,7 +1,7 @@ # Tests the functionality of moving common symbols to bss with linker script and # partial linking. RUN: %clang %clangopts -c %p/Inputs/1.c %clangg0opts -o %t1.o -RUN: %link %linkopts -r -d %linkg0opts -T %p/Inputs/script.t %t1.o -o %t.out 2>&1 +RUN: %link %emulation %linkopts -r -d %linkg0opts -T %p/Inputs/script.t %t1.o -o %t.out 2>&1 RUN: %readelf -S %t.out | %filecheck %s #CHECK: .bss NOBITS 00000000 000034 000004 00 WA 0 0 4 diff --git a/test/Hexagon/linux/linkerscript/assertcmd/assertcmd.test b/test/Hexagon/linux/linkerscript/assertcmd/assertcmd.test index 9e7850149..5f4362a02 100644 --- a/test/Hexagon/linux/linkerscript/assertcmd/assertcmd.test +++ b/test/Hexagon/linux/linkerscript/assertcmd/assertcmd.test @@ -1,9 +1,9 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o RUN: %clang %clangopts -c %p/Inputs/2.c -o %t2.o -RUN: %not %link %linkopts -T %p/Inputs/assert.t %t1.o %t2.o -o %t.out 2>&1 | %filecheck --check-prefix=ERR %s -RUN: %not %link %linkopts -T %p/Inputs/assert_neg1.t %t1.o %t2.o -o %t.out 2>&1 | %filecheck --check-prefix=ERR1 %s -RUN: %not %link %linkopts -T %p/Inputs/assert_neg2.t %t1.o %t2.o -o %t.out 2>&1 | %filecheck --check-prefix=ERR2 %s -RUN: %not %link %linkopts -T %p/Inputs/assert_neg3.t %t1.o %t2.o -o %t.out 2>&1 | %filecheck --check-prefix=ERR3 %s +RUN: %not %link %emulation %linkopts -T %p/Inputs/assert.t %t1.o %t2.o -o %t.out 2>&1 | %filecheck --check-prefix=ERR %s +RUN: %not %link %emulation %linkopts -T %p/Inputs/assert_neg1.t %t1.o %t2.o -o %t.out 2>&1 | %filecheck --check-prefix=ERR1 %s +RUN: %not %link %emulation %linkopts -T %p/Inputs/assert_neg2.t %t1.o %t2.o -o %t.out 2>&1 | %filecheck --check-prefix=ERR2 %s +RUN: %not %link %emulation %linkopts -T %p/Inputs/assert_neg3.t %t1.o %t2.o -o %t.out 2>&1 | %filecheck --check-prefix=ERR3 %s ERR-NOT: should not assert ERR: sym1 smaller then sym2 diff --git a/test/Hexagon/linux/linkerscript/excludeFile/excludeFiles.test b/test/Hexagon/linux/linkerscript/excludeFile/excludeFiles.test index c86c3308f..30c446d2a 100644 --- a/test/Hexagon/linux/linkerscript/excludeFile/excludeFiles.test +++ b/test/Hexagon/linux/linkerscript/excludeFile/excludeFiles.test @@ -4,7 +4,7 @@ RUN: %clang %clangopts -c %p/Inputs/3.c -o %t3.o RUN: %clang %clangopts -c %p/Inputs/4.c -o %t4.o RUN: %clang %clangopts -c %p/Inputs/5.c -o %t5.o RUN: %ar cr %tlib24.a %t2.o %t4.o -RUN: %link %linkopts -T %p/Inputs/exclude.t %t1.o --whole-archive %tlib24.a --no-whole-archive %t3.o %t5.o -o %t.out 2>&1 +RUN: %link %emulation %linkopts -T %p/Inputs/exclude.t %t1.o --whole-archive %tlib24.a --no-whole-archive %t3.o %t5.o -o %t.out 2>&1 RUN: %readelf -S -s %t.out | %filecheck %s CHECK: .section1 PROGBITS diff --git a/test/Hexagon/linux/linkerscript/excludeFilePatterns/excludePatternOne.test b/test/Hexagon/linux/linkerscript/excludeFilePatterns/excludePatternOne.test index 2012d3e40..9ef4b8ad4 100644 --- a/test/Hexagon/linux/linkerscript/excludeFilePatterns/excludePatternOne.test +++ b/test/Hexagon/linux/linkerscript/excludeFilePatterns/excludePatternOne.test @@ -2,7 +2,7 @@ RUN: %clang %clangopts -c -ffunction-sections -fdata-sections %p/Inputs/1.c -o %t1.1.o RUN: %clang %clangopts -c -ffunction-sections -fdata-sections %p/Inputs/2.c -o %t2.2.o RUN: mkdir -p %t1 && rm -f %t1/lib2.a && %ar cr %t1/lib2.a %t2.2.o -RUN: %link %linkopts -T %p/Inputs/script.t %t1.1.o %t1/lib2.a -o %t.out -z max-page-size=4096 +RUN: %link %emulation %linkopts -T %p/Inputs/script.t %t1.1.o %t1/lib2.a -o %t.out -z max-page-size=4096 RUN: %readelf -S %t.out | %filecheck %s #CHECK: [ 1] .text.fns{{.*}} diff --git a/test/Hexagon/linux/linkerscript/excludeFilePatterns/excludePatternTwo.test b/test/Hexagon/linux/linkerscript/excludeFilePatterns/excludePatternTwo.test index 199942e24..91930b020 100644 --- a/test/Hexagon/linux/linkerscript/excludeFilePatterns/excludePatternTwo.test +++ b/test/Hexagon/linux/linkerscript/excludeFilePatterns/excludePatternTwo.test @@ -2,7 +2,7 @@ RUN: %clang %clangopts -c -ffunction-sections -fdata-sections %p/Inputs/1.c -o %t1.1.o RUN: %clang %clangopts -c -ffunction-sections -fdata-sections %p/Inputs/2.c -o %t2.2.o RUN: mkdir -p %t1 && rm -f %t1/lib3.a && %ar cr %t1/lib3.a %t2.2.o -RUN: %link %linkopts -T %p/Inputs/newscript.t %t1.1.o %t1/lib3.a -o %t.out -z max-page-size=4096 +RUN: %link %emulation %linkopts -T %p/Inputs/newscript.t %t1.1.o %t1/lib3.a -o %t.out -z max-page-size=4096 RUN: %readelf -S %t.out | %filecheck %s #CHECK: [ 1] .text.fns{{.*}} diff --git a/test/Hexagon/linux/linkerscript/includeFileExpression/includeLpath.test b/test/Hexagon/linux/linkerscript/includeFileExpression/includeLpath.test index 741e0f28f..344e8a2d8 100644 --- a/test/Hexagon/linux/linkerscript/includeFileExpression/includeLpath.test +++ b/test/Hexagon/linux/linkerscript/includeFileExpression/includeLpath.test @@ -1,2 +1,2 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t.o -RUN: %link %linkopts -L%p/Inputs/ -T %p/script_with_expression.t %t.o -o %t.out 2>&1 +RUN: %link %emulation %linkopts -L%p/Inputs/ -T %p/script_with_expression.t %t.o -o %t.out 2>&1 diff --git a/test/Hexagon/linux/linkerscript/includefileLPath/includeLpath.test b/test/Hexagon/linux/linkerscript/includefileLPath/includeLpath.test index c5c7f54c2..d0ecc4867 100644 --- a/test/Hexagon/linux/linkerscript/includefileLPath/includeLpath.test +++ b/test/Hexagon/linux/linkerscript/includefileLPath/includeLpath.test @@ -1,6 +1,6 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t.o -RUN: %link %linkopts -L%p/Inputs/ -T %p/script_with_archive.t %t.o -o %t.out 2>&1 -RUN: %not %link %linkopts -L%p/Inputs/ -T %p/script_with_include_notfound.t %t.o -o %t.out 2>&1 | %filecheck %s +RUN: %link %emulation %linkopts -L%p/Inputs/ -T %p/script_with_archive.t %t.o -o %t.out 2>&1 +RUN: %not %link %emulation %linkopts -L%p/Inputs/ -T %p/script_with_include_notfound.t %t.o -o %t.out 2>&1 | %filecheck %s CHECK: Fatal: cannot read file 'newinclude.t' diff --git a/test/Hexagon/linux/linkerscript/nonAllocfixup/nonAllocfixup.test b/test/Hexagon/linux/linkerscript/nonAllocfixup/nonAllocfixup.test index 5105119a7..fcde64fe4 100644 --- a/test/Hexagon/linux/linkerscript/nonAllocfixup/nonAllocfixup.test +++ b/test/Hexagon/linux/linkerscript/nonAllocfixup/nonAllocfixup.test @@ -1,6 +1,6 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o -ffunction-sections %clangg0opts RUN: %clang %clangopts -c %p/Inputs/2.c -o %t2.o -ffunction-sections %clangg0opts -RUN: %link %linkopts -T %p/Inputs/script.t %t1.o %t2.o -o %t.out %linkg0opts 2>&1 +RUN: %link %emulation %linkopts -T %p/Inputs/script.t %t1.o %t2.o -o %t.out %linkg0opts 2>&1 RUN: %readelf -s %t.out | %filecheck %s CHECK-DAG: {{[x0-9a-f]+}} 0 NOTYPE GLOBAL DEFAULT ABS __unrecognized_start__ diff --git a/test/Hexagon/linux/linkerscript/nonAllocfixupPHDRS/nonAllocfixupPHDRS.test b/test/Hexagon/linux/linkerscript/nonAllocfixupPHDRS/nonAllocfixupPHDRS.test index b18f44c6a..57c2826f1 100644 --- a/test/Hexagon/linux/linkerscript/nonAllocfixupPHDRS/nonAllocfixupPHDRS.test +++ b/test/Hexagon/linux/linkerscript/nonAllocfixupPHDRS/nonAllocfixupPHDRS.test @@ -1,6 +1,6 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o -ffunction-sections %clangg0opts RUN: %clang %clangopts -c %p/Inputs/2.c -o %t2.o -ffunction-sections %clangg0opts -RUN: %link %linkopts -T %p/Inputs/script.t %t1.o %t2.o -o %t.out %linkg0opts 2>&1 +RUN: %link %emulation %linkopts -T %p/Inputs/script.t %t1.o %t2.o -o %t.out %linkg0opts 2>&1 RUN: %readelf -s %t.out | %filecheck %s CHECK-DAG: {{[x0-9a-f]+}} 0 NOTYPE GLOBAL DEFAULT ABS __unrecognized_start__ diff --git a/test/Hexagon/linux/linkerscript/phdrnoload/phdr-noload.test b/test/Hexagon/linux/linkerscript/phdrnoload/phdr-noload.test index 9c5931f49..ea5908395 100644 --- a/test/Hexagon/linux/linkerscript/phdrnoload/phdr-noload.test +++ b/test/Hexagon/linux/linkerscript/phdrnoload/phdr-noload.test @@ -1,7 +1,7 @@ # Check that PHDR's work properly. RUN: %clang %clangopts -c -ffunction-sections -fdata-sections %p/Inputs/foo.c -o %t1.o -g RUN: %clang %clangopts -c -ffunction-sections -fdata-sections %p/Inputs/bar.c -o %t2.o -g -RUN: %link %linkopts -T %p/Inputs/script.t %t1.o %t2.o -o %t.out --section-start .start=0x1300000 +RUN: %link %emulation %linkopts -T %p/Inputs/script.t %t1.o %t2.o -o %t.out --section-start .start=0x1300000 RUN: %readelf -l %t.out | %filecheck %s #CHECK: There are 3 program headers, starting at offset 52 diff --git a/test/Hexagon/linux/linkerscript/sectionsEndExpr/expr.test b/test/Hexagon/linux/linkerscript/sectionsEndExpr/expr.test index 6f473d769..91282eb2a 100644 --- a/test/Hexagon/linux/linkerscript/sectionsEndExpr/expr.test +++ b/test/Hexagon/linux/linkerscript/sectionsEndExpr/expr.test @@ -1,6 +1,6 @@ RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o RUN: %clang %clangopts -c %p/Inputs/2.c -o %t2.o -RUN: %link %linkopts -T %p/Inputs/expr.t %t1.o %t2.o -o %t.out 2>&1 +RUN: %link %emulation %linkopts -T %p/Inputs/expr.t %t1.o %t2.o -o %t.out 2>&1 RUN: %readelf -s %t.out | %filecheck %s CHECK: 00000001 0 NOTYPE GLOBAL DEFAULT 1 sym1 diff --git a/test/Hexagon/linux/linkerscript/spaceInFile/spaceInFile.test b/test/Hexagon/linux/linkerscript/spaceInFile/spaceInFile.test index 98a4f06e7..543bbdc42 100644 --- a/test/Hexagon/linux/linkerscript/spaceInFile/spaceInFile.test +++ b/test/Hexagon/linux/linkerscript/spaceInFile/spaceInFile.test @@ -1,6 +1,6 @@ # Test that we actually Reserve space in file. RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o %clangg0opts -RUN: %link %linkopts %t1.o -T %p/Inputs/script.t -o %t1.out %linkg0opts -z max-page-size=0x1000 +RUN: %link %emulation %linkopts %t1.o -T %p/Inputs/script.t -o %t1.out %linkg0opts -z max-page-size=0x1000 RUN: %readelf -l -W %t1.out | %filecheck %s -check-prefix=PHDR RUN: %readelf -s -W %t1.out | %filecheck %s -check-prefix=SYMBOLS diff --git a/test/Hexagon/linux/lit.local.cfg b/test/Hexagon/linux/lit.local.cfg index a38f54e2c..adc9b7b62 100644 --- a/test/Hexagon/linux/lit.local.cfg +++ b/test/Hexagon/linux/lit.local.cfg @@ -1,4 +1,4 @@ -config.suffixes = ['.test'] +for i, (k, v) in enumerate(config.substitutions): + if k == '%emulation': + config.substitutions[i] = (k, '-mhexagonlinux') -if 'hexagon-unknown-elf' in config.target_triple: - config.unsupported = True diff --git a/test/Hexagon/linux/mergeCommonStrings/mergestrings.test b/test/Hexagon/linux/mergeCommonStrings/mergestrings.test index d79add452..2ba61f174 100644 --- a/test/Hexagon/linux/mergeCommonStrings/mergestrings.test +++ b/test/Hexagon/linux/mergeCommonStrings/mergestrings.test @@ -1,7 +1,7 @@ # Test that commons are moved to bss, and commons appear at the end. RUN: %clang %clangopts -c %p/Inputs/1.s -o %t1.o RUN: %clang %clangopts -c %p/Inputs/2.s -o %t2.o -RUN: %link %linkopts %t1.o %t2.o -o %t.out 2>&1 +RUN: %link %emulation %linkopts %t1.o %t2.o -o %t.out 2>&1 RUN: %readelf -p .debug_str %t.out | %filecheck %s #CHECK: printf diff --git a/test/Hexagon/linux/mergeCommonStringsPartialLink/mergestrings-partiallink.test b/test/Hexagon/linux/mergeCommonStringsPartialLink/mergestrings-partiallink.test index 6ccd4e730..2f8ba0175 100644 --- a/test/Hexagon/linux/mergeCommonStringsPartialLink/mergestrings-partiallink.test +++ b/test/Hexagon/linux/mergeCommonStringsPartialLink/mergestrings-partiallink.test @@ -1,7 +1,7 @@ # Test that commons are moved to bss, and commons appear at the end. RUN: %clang %clangopts -c %p/Inputs/1.s -o %t1.o RUN: %clang %clangopts -c %p/Inputs/2.s -o %t2.o -RUN: %link %linkopts -r %t1.o %t2.o -o %t.out 2>&1 +RUN: %link %emulation %linkopts -r %t1.o %t2.o -o %t.out 2>&1 RUN: %readelf -p .debug_str %t.out | %filecheck %s RUN: %readelf -p .debug_str %t.out | %filecheck %s diff --git a/test/Hexagon/linux/mergeROData/mergeROData.test b/test/Hexagon/linux/mergeROData/mergeROData.test index 889df7335..431a5be35 100644 --- a/test/Hexagon/linux/mergeROData/mergeROData.test +++ b/test/Hexagon/linux/mergeROData/mergeROData.test @@ -1,11 +1,11 @@ # Check string merging of readonly data. RUN: %clang %clangopts -c %p/Inputs/1.c -o %t1.o.noffdf RUN: %clang %clangopts -c %p/Inputs/2.c -o %t2.o.noffdf -RUN: %link %linkopts --rosegment %t1.o.noffdf %t2.o.noffdf -o %t1.out.noffdfms -z max-page-size=4096 +RUN: %link %emulation %linkopts --rosegment %t1.o.noffdf %t2.o.noffdf -o %t1.out.noffdfms -z max-page-size=4096 RUN: %readelf -S %t1.out.noffdfms | %grep rodata | %filecheck %s -check-prefix=NOFFDFMS RUN: %clang %clangopts -c -ffunction-sections -fdata-sections %p/Inputs/1.c -o %t1.o.ffdf RUN: %clang %clangopts -c -fdata-sections -fdata-sections %p/Inputs/2.c -o %t2.o.ffdf -RUN: %link %linkopts --rosegment --gc-sections --entry=main %t1.o.ffdf %t2.o.ffdf -o %t1.out.ffdfgc -z max-page-size=4096 +RUN: %link %emulation %linkopts --rosegment --gc-sections --entry=main %t1.o.ffdf %t2.o.ffdf -o %t1.out.ffdfgc -z max-page-size=4096 RUN: %readelf -S %t1.out.ffdfgc | %filecheck %s NOFFDFMS: [ 2] .rodata PROGBITS {{.*}} 000009 01 AMS 0 0 1 diff --git a/test/Hexagon/linux/mergeRODataAlign/rodataalign.test b/test/Hexagon/linux/mergeRODataAlign/rodataalign.test index 2e56549d6..bf4032d9f 100644 --- a/test/Hexagon/linux/mergeRODataAlign/rodataalign.test +++ b/test/Hexagon/linux/mergeRODataAlign/rodataalign.test @@ -1,9 +1,9 @@ # Check that rodata alignment is handled in the linker appropriately. RUN: %clang %clangopts -c %p/Inputs/rodataalign.s -o %t1.o -RUN: %link %linkopts %t1.o -o %t1.out +RUN: %link %emulation %linkopts %t1.o -o %t1.out RUN: %readelf -p 2 %t1.out | %filecheck -check-prefix=RODATAMERGE %s RUN: %clang %clangopts -c %p/Inputs/rodata.s -o %t2.o -RUN: %link %linkopts %t2.o -o %t2.out +RUN: %link %emulation %linkopts %t2.o -o %t2.out RUN: %readelf -p 2 %t2.out | %filecheck -check-prefix=RODATAWITHEMPTY %s diff --git a/test/Hexagon/linux/mergeROWithEntSize/rodata_withent.test b/test/Hexagon/linux/mergeROWithEntSize/rodata_withent.test index 33e743394..fe2a61055 100644 --- a/test/Hexagon/linux/mergeROWithEntSize/rodata_withent.test +++ b/test/Hexagon/linux/mergeROWithEntSize/rodata_withent.test @@ -1,9 +1,9 @@ # Check that rodata ent size is handled in the linker appropriately. RUN: %clang %clangopts -c %p/Inputs/rodata_withnoent.s -o %t1.o -RUN: %link %linkopts %t1.o -o %t1.out +RUN: %link %emulation %linkopts %t1.o -o %t1.out RUN: %readelf -p 1 %t1.out | %filecheck -check-prefix=RODATAMERGE %s RUN: %clang %clangopts -c %p/Inputs/rodata_withent.s -o %t2.o -RUN: %link %linkopts %t2.o -o %t2.out +RUN: %link %emulation %linkopts %t2.o -o %t2.out RUN: %readelf -p 1 %t2.out | %filecheck -check-prefix=RODATANOMERGE %s diff --git a/test/Hexagon/linux/nonAllocRelocs/nonAllocRelocs.test b/test/Hexagon/linux/nonAllocRelocs/nonAllocRelocs.test index 61893473c..36e50a188 100644 --- a/test/Hexagon/linux/nonAllocRelocs/nonAllocRelocs.test +++ b/test/Hexagon/linux/nonAllocRelocs/nonAllocRelocs.test @@ -1,6 +1,6 @@ # Check that the linker produces an error when there is a undefined symbol from # a non allocatable section. RUN: %clang %clangopts -c %p/Inputs/debug_reloc_undef.s -o %t1.o -RUN: %not %link %linkopts %t1.o -o %t2 2>&1 | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})*)?m//g" | %filecheck %s +RUN: %not %link %emulation %linkopts %t1.o -o %t2 2>&1 | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})*)?m//g" | %filecheck %s #CHECK: Error: {{[ -\(\)_A-Za-z0-9.\\/:]+}}: undefined reference to `baz' diff --git a/test/Hexagon/linux/notrampolines/no-trampoline.test b/test/Hexagon/linux/notrampolines/no-trampoline.test index 266437c33..cb15d8cbb 100644 --- a/test/Hexagon/linux/notrampolines/no-trampoline.test +++ b/test/Hexagon/linux/notrampolines/no-trampoline.test @@ -1,4 +1,4 @@ RUN: %clang %clangopts -c %p/Inputs/trampoline.s -o %t.o -RUN: %not %link %linkopts --no-trampolines %t.o -o %t.out 2>&1 | %filecheck %s +RUN: %not %link %emulation %linkopts --no-trampolines %t.o -o %t.out 2>&1 | %filecheck %s CHECK: Error: {{.*}}o:(.text.othermain+0x4): relocation R_HEX_B22_PCREL out of range: {{.*}} is not in [-8388608, 8388607]; references 'myfn' diff --git a/test/Hexagon/linux/scommonWithoutGP/scommonWithoutGP.test b/test/Hexagon/linux/scommonWithoutGP/scommonWithoutGP.test index b1a678bf4..3d59b2418 100644 --- a/test/Hexagon/linux/scommonWithoutGP/scommonWithoutGP.test +++ b/test/Hexagon/linux/scommonWithoutGP/scommonWithoutGP.test @@ -3,7 +3,7 @@ # them into .sdata to match default linker script rules. RUN: %clang %clangopts -c %p/Inputs/1.s -o %t1.o RUN: %clang %clangopts -c %p/Inputs/2.c -o %t2.o %clangg0opts -RUN: %link %linkopts %t1.o %t2.o -o %t3.out -z max-page-size=4096 +RUN: %link %emulation %linkopts %t1.o %t2.o -o %t3.out -z max-page-size=4096 RUN: %readelf -S %t3.out | %filecheck %s #CHECK: .sdata PROGBITS {{.*}} 000001 diff --git a/test/Hexagon/linux/trampolines/simple-trampoline.test b/test/Hexagon/linux/trampolines/simple-trampoline.test index 55c48b741..1179d54e1 100644 --- a/test/Hexagon/linux/trampolines/simple-trampoline.test +++ b/test/Hexagon/linux/trampolines/simple-trampoline.test @@ -1,5 +1,5 @@ RUN: %clang %clangopts -c %p/Inputs/trampoline.s -o %t.o -RUN: %link %linkopts %t.o -o %t.out +RUN: %link %emulation %linkopts %t.o -o %t.out RUN: %readelf -s %t.out | %filecheck %s #CHECK: {{[0-9a-f]+}}: {{[0-9a-fx]+}} {{[0-9a-f]+}} FUNC LOCAL DEFAULT 1 trampoline_for_myfn_from_.text.othermain_{{[0-9]+}} diff --git a/test/Hexagon/linux/trampolinesCopy/copy-instead-of-trampolines.test b/test/Hexagon/linux/trampolinesCopy/copy-instead-of-trampolines.test index 7d3344c6f..5edc6d845 100644 --- a/test/Hexagon/linux/trampolinesCopy/copy-instead-of-trampolines.test +++ b/test/Hexagon/linux/trampolinesCopy/copy-instead-of-trampolines.test @@ -2,7 +2,7 @@ # reuse them. RUN: %clang %clangopts -c %p/Inputs/trampoline.s -o %t1.o RUN: %clang %clangopts -c %p/Inputs/myfn.s -o %t2.o -RUN: %link %linkopts %t1.o %t2.o -o %t.out --section-start .boo=0x80000000 -copy-farcalls-from-file=%p/Inputs/dup --trace=trampolines 2>&1 | %filecheck %s -check-prefix=CLONES +RUN: %link %emulation %linkopts %t1.o %t2.o -o %t.out --section-start .boo=0x80000000 -copy-farcalls-from-file=%p/Inputs/dup --trace=trampolines 2>&1 | %filecheck %s -check-prefix=CLONES RUN: %readelf -s -W %t.out | %filecheck %s -check-prefix=CLONESYMS #CLONES: Creating Stub clone_1_for_myfn diff --git a/test/Hexagon/linux/trampolinesLocalFunctions/local-trampoline.test b/test/Hexagon/linux/trampolinesLocalFunctions/local-trampoline.test index a75802044..e0e3e5d18 100644 --- a/test/Hexagon/linux/trampolinesLocalFunctions/local-trampoline.test +++ b/test/Hexagon/linux/trampolinesLocalFunctions/local-trampoline.test @@ -1,6 +1,6 @@ # Checks that the linker is able to create/reuse a local trampoline properly. RUN: %clang %clangopts -c %p/Inputs/main.c -o %t.o -RUN: %link %linkopts -T %p/Inputs/link.script %t.o -o %t.out --trace=trampolines --use-old-style-trampoline-name 2>&1 | %filecheck %s -check-prefix=TRAMPOLINES +RUN: %link %emulation %linkopts -T %p/Inputs/link.script %t.o -o %t.out --trace=trampolines --use-old-style-trampoline-name 2>&1 | %filecheck %s -check-prefix=TRAMPOLINES RUN: %readelf -s -W %t.out | %filecheck %s -check-prefix=CHECKTRAMPOLINESYMS #TRAMPOLINES: Creating Stub trampoline_for_.tcm_static_from_.text_{{[0-9]+}}# diff --git a/test/Hexagon/linux/trampolinesWithAlign/trampolinesWithAlign.test b/test/Hexagon/linux/trampolinesWithAlign/trampolinesWithAlign.test index 1a51d8574..01703f15c 100644 --- a/test/Hexagon/linux/trampolinesWithAlign/trampolinesWithAlign.test +++ b/test/Hexagon/linux/trampolinesWithAlign/trampolinesWithAlign.test @@ -1,7 +1,7 @@ # Tests trampolines when there is a ALIGN directive RUN: %clang %clangopts -c %p/Inputs/main.c -ffunction-sections -o %t1.o RUN: %clang %clangopts -c %p/Inputs/FarFunction.S -o %t2.o -RUN: %link %linkopts -T %p/Inputs/script.t %t1.o %t2.o -o %t2.out +RUN: %link %emulation %linkopts -T %p/Inputs/script.t %t1.o %t2.o -o %t2.out RUN: %objdump -d %t2.out | %filecheck -check-prefix=TRAMPOLINE %s #TRAMPOLINE: : diff --git a/test/Hexagon/linux/zNow/zNow.test b/test/Hexagon/linux/zNow/zNow.test index d80dd800d..2f02af6f7 100644 --- a/test/Hexagon/linux/zNow/zNow.test +++ b/test/Hexagon/linux/zNow/zNow.test @@ -1,8 +1,8 @@ # Check if BIND_NOW works. RUN: %clang %clangopts -c -fPIC %p/Inputs/1.c -o %t1.o -RUN: %link %linkopts -shared %t1.o -o %t2.so.newdtag -z now --enable-new-dtags +RUN: %link %emulation %linkopts -shared %t1.o -o %t2.so.newdtag -z now --enable-new-dtags RUN: %readelf -d %t2.so.newdtag | %filecheck %s --check-prefix=NEWDTAG -RUN: %link %linkopts -shared %t1.o -o %t2.so.nonewdtag -z now +RUN: %link %emulation %linkopts -shared %t1.o -o %t2.so.nonewdtag -z now RUN: %readelf -d %t2.so.nonewdtag | %filecheck %s --check-prefix=NONEWDTAG #NEWDTAG: 0x0000001e (FLAGS) BIND_NOW diff --git a/test/lit.cfg b/test/lit.cfg index 00ec63424..9c2b2a9fb 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -118,6 +118,9 @@ try: except ImportError: pass +if config.has_zlib == "1": + config.available_features.add('zlib') + # Feature: symbol_versioning (enabled only when CMake option is ON) if getattr(config, 'has_symbol_versioning', 'false') == 'true': config.available_features.add('symbol_versioning') @@ -280,27 +283,7 @@ if config.test_target == 'Hexagon': nm = 'llvm-nm' objdump = 'llvm-objdump' size = 'llvm-size' - if config.has_zlib == "1": - config.available_features.add('zlib') - #For Hexagon Linux. - if 'hexagon-unknown-linux' in config.target_triple: - clang ='clang' - clangxx ='clang++' - driver = clang - driverxx = clangxx - link = 'hexagon-linux-link' - ar = 'llvm-ar' - nm = 'llvm-nm' - objdump = 'llvm-objdump' - size = 'llvm-size' - # Environment for hexagon-linux and standalone - if 'hexagon-unknown-linux' in config.target_triple: - config.available_features.add('hexagon-linux-env') - else: - config.available_features.add('hexagon-standalone-env') - if ('hexagon-unknown-linux' in config.available_features or - 'hexagon-standalone-env' in config.available_features): - config.available_features.add('hexagon') + config.available_features.add('hexagon') if config.test_target == 'X86': if not config.target_triple: diff --git a/tools/eld/CMakeLists.txt b/tools/eld/CMakeLists.txt index bab23b630..83659ca2c 100644 --- a/tools/eld/CMakeLists.txt +++ b/tools/eld/CMakeLists.txt @@ -25,21 +25,9 @@ if (NOT LLVM_ENABLE_IDE) COMPONENT ld.eld) endif() -if("${ELD_TARGETS_TO_BUILD}" MATCHES "Hexagon" AND "${TARGET_TRIPLE}" MATCHES - "hexagon-unknown-linux") - set(is_hexagon_linux 1) -endif() if(ELD_CREATE_SYMLINKS) foreach(target_name ${ELD_TARGETS_TO_BUILD}) - string(TOLOWER ${target_name} ld_eld_name) - if(${is_hexagon_linux}) - set(ld_eld_name "${ld_eld_name}-linux-link") - else(NOT ${is_hexagon_linux}) - set(ld_eld_name "${ld_eld_name}-link") - endif() - if(${target_name} MATCHES "X86") - set(ld_eld_name "x86_64-link") - endif() + string(TOLOWER "${target_name}-link" ld_eld_name) add_eld_symlink("${ld_eld_name}" ld.eld) endforeach() endif()