Issue 101776
Summary Dollar sign in section name is handled incorrectly for intel-style inline assembly for Windows target
Labels new issue
Assignees
Reporter Evian-Zhang
    This was first found in Rust, see [rust-lang/rust#128177](https://github.com/rust-lang/rust/issues/128177).

The issue exists in the following inline assembly, for both Rust and Clang:

```x86asm
.pushsection .foo$a
.long 0x1234
.popsection
```

For x86-64 Windows target, when we compile with AT&T syntax, the result section name is ".foo", for intel syntax, the result is ".fooa".

As described in [this Microsoft blog](https://devblogs.microsoft.com/oldnewthing/20181107-00/?p=100155), the part before dollar sign should be the final name, and the part after should be used to sort the corresponding section. And this feature is extremely useful to create pointers to specific sections, as stated in [this](https://stackoverflow.com/a/14783759/10005095) and used in [this](https://docs.rs/linkme-impl/0.3.27/src/linkme_impl/linker.rs.html#55).
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to