Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lld/test/wasm/libsearch.s
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@
// RUN: wasm-ld -pie --experimental-pic --emit-relocs --no-gc-sections -o %t3 %t.o -L%t.dir -Bstatic -call_shared -lls
// RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=DYNAMIC %s

/// -r implies -Bstatic and has precedence over -Bdynamic.
// RUN: wasm-ld -r -Bdynamic %t.o -L%t.dir -lls -o %t3.ro
// RUN: llvm-readobj -s -h %t3.ro | FileCheck --check-prefix=RELOCATABLE %s
// RELOCATABLE: Name: _static

.globl _start, _bar
_start:
.functype _start () -> ()
Expand Down
3 changes: 2 additions & 1 deletion lld/wasm/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ void LinkerDriver::createFiles(opt::InputArgList &args) {
ctx.arg.isStatic = true;
break;
case OPT_Bdynamic:
ctx.arg.isStatic = false;
if (!ctx.arg.relocatable)
ctx.arg.isStatic = false;
break;
case OPT_whole_archive:
inWholeArchive = true;
Expand Down