diff --git a/lld/test/ELF/amdgpu-duplicate-sym.s b/lld/test/ELF/amdgpu-duplicate-sym.s new file mode 100644 --- /dev/null +++ b/lld/test/ELF/amdgpu-duplicate-sym.s @@ -0,0 +1,26 @@ +# REQUIRES: amdgpu +# RUN: llvm-mc -filetype=obj -triple amdgcn-amd-amdhsa -mcpu=gfx1031 --position-independent --relax-relocations %s -o %t.o + +# We use lld-link on purpose to exercise -flavor. +# RUN: lld-link -flavor gnu -shared %t.o + + .text + .amdgcn_target "amdgcn-amd-amdhsa--gfx1031" + .protected xxx ; @xxx + .type xxx,@object + .data + .globl xxx +xxx: + .long 123 ; 0x7b + + .addrsig + .amdgpu_metadata +--- +amdhsa.kernels: [] +amdhsa.target: amdgcn-amd-amdhsa--gfx1031 +amdhsa.version: + - 1 + - 1 +... + + .end_amdgpu_metadata diff --git a/lld/tools/lld/lld.cpp b/lld/tools/lld/lld.cpp --- a/lld/tools/lld/lld.cpp +++ b/lld/tools/lld/lld.cpp @@ -159,9 +159,9 @@ die("lld is a generic driver.\n" "Invoke ld.lld (Unix), ld64.lld (macOS), lld-link (Windows), wasm-ld" " (WebAssembly) instead"); - }; + }(); // Run the driver. If an error occurs, false will be returned. - bool r = link()(args, stdoutOS, stderrOS, exitEarly, inTestOutputDisabled); + bool r = link(args, stdoutOS, stderrOS, exitEarly, inTestOutputDisabled); // Call exit() if we can to avoid calling destructors. if (exitEarly)