Miguel Ojeda
74b8d324eb
Support .comment
section like GCC/Clang (!llvm.ident
)
...
Both GCC and Clang write by default a `.comment` section with compiler
information:
```txt
$ gcc -c -xc /dev/null && readelf -p '.comment' null.o
String dump of section '.comment':
[ 1] GCC: (GNU) 11.2.0
$ clang -c -xc /dev/null && readelf -p '.comment' null.o
String dump of section '.comment':
[ 1] clang version 14.0.1 (https://github.com/llvm/llvm-project.git c62053979489ccb002efe411c3af059addcb5d7d)
```
They also implement the `-Qn` flag to avoid doing so:
```txt
$ gcc -Qn -c -xc /dev/null && readelf -p '.comment' null.o
readelf: Warning: Section '.comment' was not dumped because it does not exist!
$ clang -Qn -c -xc /dev/null && readelf -p '.comment' null.o
readelf: Warning: Section '.comment' was not dumped because it does not exist!
```
So far, `rustc` only does it for WebAssembly targets and only
when debug info is enabled:
```txt
$ echo 'fn main(){}' | rustc --target=wasm32-unknown-unknown --emit=llvm-ir -Cdebuginfo=2 - && grep llvm.ident rust_out.ll
!llvm.ident = !{!27}
```
In the RFC part of this PR it was decided to always add
the information, which gets us closer to other popular compilers.
An opt-out flag like GCC and Clang may be added later on if deemed
necessary.
Implementation-wise, this covers both `ModuleLlvm::new()` and
`ModuleLlvm::new_metadata()` cases by moving the addition to
`context::create_module` and adds a few test cases.
ThinLTO also sees the `llvm.ident` named metadata duplicated (in
temporary outputs), so this deduplicates it like it is done for
`wasm.custom_sections`. The tests also check this duplication does
not take place.
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-07-21 22:01:50 +02:00
..
2023-03-30 08:46:31 -05:00
2023-06-19 17:31:54 +00:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-05-05 18:32:20 +00:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-05-02 12:07:55 +00:00
2023-05-02 12:07:55 +00:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-07-21 22:01:50 +02:00
2023-03-30 08:46:31 -05:00
2023-04-02 17:54:24 -04:00
2023-06-23 18:36:25 +01:00
2023-04-21 16:14:44 +00:00
2023-04-24 01:56:37 +02:00
2023-06-28 11:09:19 +10:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-05-17 23:54:21 -05:00
2023-05-02 12:07:55 +00:00
2023-05-17 11:39:11 +02:00
2023-03-30 07:58:50 -05:00
2023-03-30 08:46:31 -05:00
2023-07-19 14:10:13 +00:00
2023-03-30 07:58:50 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-06-06 17:54:34 -04:00
2023-03-30 07:58:50 -05:00
2023-07-19 14:10:07 +00:00
2023-03-30 07:58:50 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-07-19 14:47:05 +00:00
2023-07-14 16:22:29 -04:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-07-10 19:19:38 -04:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-04-03 01:34:05 +00:00
2023-05-07 12:38:47 +01:00
2023-05-02 12:07:55 +00:00
2023-05-02 12:07:55 +00:00
2023-05-02 12:07:55 +00:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-04-28 16:11:45 +02:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-05-19 11:02:16 +02:00
2023-03-30 07:58:50 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-04-25 00:08:35 +02:00
2023-03-30 08:46:31 -05:00
2023-04-25 00:08:35 +02:00
2023-03-30 07:58:50 -05:00
2023-05-23 07:37:16 +00:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 08:46:31 -05:00
2023-04-17 18:53:52 +02:00
2023-05-03 15:52:31 -07:00
2023-04-15 07:40:19 -07:00
2023-03-30 08:46:31 -05:00
2023-05-02 12:07:55 +00:00
2023-06-16 20:56:01 -04:00
2023-04-03 01:34:05 +00:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-07-21 22:01:50 +02:00
2023-03-30 07:58:50 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-07-19 14:47:05 +00:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-05-11 14:47:56 +00:00
2023-07-18 22:15:47 +08:00
2023-07-19 14:47:05 +00:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-07-02 13:41:36 +02:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-06-07 21:03:51 +01:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 08:46:31 -05:00
2023-04-21 18:38:17 -07:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-07-20 11:04:30 -07:00
2023-07-12 20:04:30 +02:00
2023-03-30 08:46:31 -05:00
2023-04-18 11:01:07 -07:00
2023-04-18 11:01:07 -07:00
2023-04-18 11:01:07 -07:00
2023-04-18 11:01:07 -07:00
2023-04-18 11:01:07 -07:00
2023-04-18 11:01:07 -07:00
2023-04-18 11:01:07 -07:00
2023-04-18 11:01:07 -07:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-07-19 14:47:06 +00:00
2023-06-30 21:13:24 +00:00
2023-03-30 07:58:50 -05:00
2023-06-16 20:56:01 -04:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-04-12 05:34:21 -05:00
2023-06-27 23:22:44 +02:00
2023-04-13 21:58:35 +02:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-07-19 14:10:07 +00:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-04-03 10:23:08 +02:00
2023-05-02 12:07:55 +00:00
2023-04-27 18:22:06 +00:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 08:46:31 -05:00
2023-06-16 20:56:01 -04:00
2023-06-23 17:22:07 +00:00
2023-05-02 12:07:55 +00:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-04-19 00:39:20 -05:00
2023-03-30 07:58:50 -05:00
2023-04-03 10:23:15 +02:00
2023-05-05 01:22:17 -05:00
2023-03-30 08:46:31 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-07-01 20:24:15 +02:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-03-30 07:58:50 -05:00
2023-04-25 00:08:35 +02:00
2023-03-30 07:58:50 -05:00
2023-03-30 08:46:31 -05:00
2023-06-05 17:33:26 +02:00
2023-03-30 07:58:50 -05:00