[PATCH] D73139: [LLD][COFF] Enable linking of __declspec(selectany) symbols from Clang and GCC

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 22 03:49:26 PST 2020


mstorsjo added a comment.

In D73139#1832587 <https://reviews.llvm.org/D73139#1832587>, @rnk wrote:

> That sounds right to me. You know, I wonder if this would work for test structure:
>
>   # RUN: llvm-mc %s -defsym obj=1 -filetype=obj -o %t1.obj
>   # RUN: llvm-mc %s -defsym obj=2 -filetype=obj -o %t2.obj
>   # RUN: lld-link ... %t1.obj %t2.obj
>  
>   .if obj=1
>   # obj1 contents
>   .endif
>  
>   .if obj2
>   # obj2 contents
>   .endif
>
>
> I haven't tried it, but `.if` seems nicer than echo escapes.


Nice! That seems to work indeed, but the condition needs to be `.if obj==1`. I'll try to keep it in mind the next time I need a multi-file testcase myself as well.


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73139/new/

https://reviews.llvm.org/D73139





More information about the llvm-commits mailing list