bors 486b5dfe74 Auto merge of #1832 - hyd-dev:1776-follow-up, r=RalfJung
Report an error if a `#[no_mangle]`/`#[export_name = ...]` function has the same symbol name as a built-in shim

Implements https://github.com/rust-lang/miri/pull/1776#issuecomment-821322605.

The error looks like this:
```
error: found `malloc` symbol definition that clashes with a built-in shim
  --> tests/compile-fail/function_calls/exported_symbol_shim_clashing.rs:12:9
   |
12 |         malloc(0);
   |         ^^^^^^^^^ found `malloc` symbol definition that clashes with a built-in shim
   |
help: the `malloc` symbol is defined here

  --> tests/compile-fail/function_calls/exported_symbol_shim_clashing.rs:2:1
   |
2  | / extern "C" fn malloc(_: usize) -> *mut std::ffi::c_void {
3  | |     //~^ HELP the `malloc` symbol is defined here
4  | |     unreachable!()
5  | | }
   | |_^
   = note: inside `main` at tests/compile-fail/function_calls/exported_symbol_shim_clashing.rs:12:9
```

This does not implement "better error messages than we do currently for arg/ABI mismatches" in https://github.com/rust-lang/miri/pull/1776#issuecomment-821343175 -- I failed to remove all `check_arg_count()` and `check_abi()` (they are still used in `src/shims/intrinsics.rs` and `call_dlsym()`) and they don't receive the name of the shim.
2021-06-15 09:53:05 +00:00
..
2021-06-15 16:12:47 +08:00
2020-03-30 10:23:16 +02:00
2021-02-05 10:08:05 +01:00
2021-03-02 20:17:05 +05:30
2020-11-19 09:21:11 +01:00
2020-11-19 09:21:11 +01:00
2020-09-10 08:44:27 +02:00
2020-10-29 20:57:38 +01:00
2020-10-27 17:26:36 +01:00
2021-05-11 15:32:05 +02:00
2019-11-25 15:08:47 +01:00
2020-10-29 20:57:38 +01:00
2019-09-20 08:53:35 +02:00
2020-03-27 08:43:08 -04:00
2020-03-06 08:21:53 -05:00
2019-11-25 15:08:47 +01:00
2021-04-25 16:57:48 +02:00
2020-11-10 16:51:07 +01:00
2020-10-04 12:06:51 -04:00
2020-10-04 12:06:51 -04:00
2020-09-10 08:44:27 +02:00
2020-05-20 00:00:35 +02:00
2021-01-26 11:43:39 +01:00
2020-01-19 10:03:18 -06:00
2020-01-19 10:03:18 -06:00
2021-01-31 13:12:25 +01:00
2019-11-08 12:43:26 +01:00
2020-09-02 20:57:20 -05:00
2020-09-10 08:44:27 +02:00
2019-08-04 16:44:32 -04:00
2021-04-30 19:35:59 +08:00
2021-01-31 13:12:25 +01:00
2020-03-22 08:55:39 +01:00
2021-01-31 13:12:25 +01:00
2020-06-20 11:48:42 +02:00
2020-01-19 10:03:18 -06:00
2020-09-07 15:05:26 -05:00
2021-04-25 16:57:48 +02:00
2020-06-01 01:12:31 +02:00