[PATCH] D98306: [ELF] Support . and $ in symbol names in expressions

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 10 02:27:16 PST 2021


peter.smith added a comment.

Noticed that ld.bfd will also accept ~ which may be worth adding as well; other than that looks reasonable to me.



================
Comment at: lld/ELF/ScriptParser.cpp:1239
+  auto valid = [](char c) {
+    return isAlnum(c) || c == '$' || c == '.' || c == '_';
+  };
----------------
Looks like ld will also accept a '~' at least in some places, for example:
```
tem~p = 0x1000;
SECTIONS {
  boom tem~p : { *(.temp) }
}
```
Unlikely this will come up in practice but maybe worth matching it as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98306



More information about the llvm-commits mailing list