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,32 @@ +# 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 excercice -flavor. +# RUN: lld-link -flavor gnu -shared %t.o + + .text + .amdgcn_target "amdgcn-amd-amdhsa--gfx1031" + .p2alignl 6, 3214868480 + .fill 48, 4, 3214868480 + .protected xxx ; @xxx + .type xxx,@object + .data + .globl xxx + .p2align 2 +xxx: + .long 123 ; 0x7b + .size xxx, 4 + + .ident "clang version 14.0.0 (git@github.amd.com:Compute-Mirrors/llvm-project.git ce53ba9aaee8d053604883d5befaf07bad60ba84)" + .section ".note.GNU-stack" + .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)