File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 9393// RUN: wasm-ld -pie --experimental-pic --emit-relocs --no-gc-sections -o %t3 %t.o -L%t.dir -Bstatic -call_shared -lls
9494// RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=DYNAMIC %s
9595
96+ /// -r implies -Bstatic and has precedence over -Bdynamic.
97+ // RUN: wasm-ld -r -Bdynamic %t.o -L%t.dir -lls -o %t3.ro
98+ // RUN: llvm-readobj -s -h %t3.ro | FileCheck --check-prefix=RELOCATABLE %s
99+ // RELOCATABLE: Name: _static
100+
96101.globl _start, _bar
97102_start:
98103 .functype _start () -> ()
Original file line number Diff line number Diff line change @@ -406,7 +406,8 @@ void LinkerDriver::createFiles(opt::InputArgList &args) {
406406 ctx.arg .isStatic = true ;
407407 break ;
408408 case OPT_Bdynamic:
409- ctx.arg .isStatic = false ;
409+ if (!ctx.arg .relocatable )
410+ ctx.arg .isStatic = false ;
410411 break ;
411412 case OPT_whole_archive:
412413 inWholeArchive = true ;
You can’t perform that action at this time.
0 commit comments