[PATCH] D50284: [COFF, ARM64] Recognize the .hidden directive

Mandeep Singh Grang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 3 17:12:23 PDT 2018


mgrang added a comment.

In https://reviews.llvm.org/D50284#1188307, @pcc wrote:

> I don't think the .hidden directive is meaningful in COFF, is it?


Yes, I don't think too. But we still need to compile hand-written assembly containing .hidden for COFF. That's why this patch simply eats up the .hidden directive without handling it in the MCWinCOFFStreamer.cpp. I did a small test and found that MSVS exports only those symbols explicitly marked as dllexport.

  > cat a.c
  __declspec( dllexport ) int foo(int x) { return x; }
  int bar(int x) { return x; }
  static int baz(int x) { return x; }



  cl a.c
  dumpbin /all a.obj
  
  RAW DATA #1
    00000030: 45 58 50 4F 52 54 3A 66 6F 6F 20                 EXPORT:foo 
  
     Linker Directives
     -----------------
     /EXPORT:foo

I see that it only exported foo which was marked as dllexport, which means that by default it does not export any symbol. So I guess we don't explicitly need to handle the .hidden symbols.

Could someone please confirm if my understanding is correct?


Repository:
  rL LLVM

https://reviews.llvm.org/D50284





More information about the llvm-commits mailing list