Issue 138390
Summary llvm assembler does not emit the correct symbol names when escaped characters are present
Labels
Assignees
Reporter midnightveil
    ## assembler

https://godbolt.org/z/ac1vev5nh

```asm
.type	"hello \" world", @object
"hello \" world":
    .zero	1
```

In GCC's as:

```
Symbol table '.symtab' contains 2 entries:
   Num:    Value Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 0000000000000000     0 OBJECT  LOCAL DEFAULT    1 hello " world
```

In Clang's as:

```
Symbol table '.symtab' contains 2 entries:
   Num:    Value          Size Type    Bind Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 0000000000000000     0 OBJECT  LOCAL  DEFAULT    2 hello \" world
```

## c frontend

This then seems to make `-save-temps` have different output to without it:

https://godbolt.org/z/4sa7e5dq4

`clang -save-temps main.c -o clang.o` gives:

```
Symbol table '.symtab' contains 10 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
...
     4: 0000000000403000     4 OBJECT  GLOBAL DEFAULT    4 hello \" world
...
```

Without `-save-temps`:

```
Symbol table '.symtab' contains 10 entries:
   Num:    Value          Size Type    Bind   Vis Ndx Name
...
     7: 0000000000403000     4 OBJECT  GLOBAL DEFAULT    4 hello " world
...
```

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to