[PATCH] D30500: [ELF] - Do not treat colon(":") as separate token in script parser.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 1 09:41:13 PST 2017


grimar added a comment.

In https://reviews.llvm.org/D30500#689702, @ruiu wrote:

> Are you sure this is correct? I was thinking that this is about quoted strings. This allows something like `extern "C++" { std::foo; }` (as opposed to `extern "C++" { "std::foo"; }`) which seems odd.


I believe its fine.
If I have symbol _ZSt3qux which is std::qux. Lets see what BFD do.

Next script:

  { global: extern "C++" { "std::q*"; };  local: *; }; 

Will leave it local, 
11: 000000000000014e     0 NOTYPE  LOCAL  DEFAULT    4 _ZSt3qux

because wildcard in quotes means exact match. And removing quotes makes symbol global as expected:

  { global: extern "C++" { std::q*; };  local: *; }; 

17: 0000000000000176     0 NOTYPE  GLOBAL DEFAULT    4 _ZSt3qux

Your sample was about

  { global: extern "C++" { "std::qux"; };  local: *; }; 

vs

  { global: extern "C++" { std::qux; };  local: *; }; 

Both are accepted by BFD/gold and symbol is GLOBAL. That is expected behavior I believe,
see nothing odd here.


https://reviews.llvm.org/D30500





More information about the llvm-commits mailing list