diff options
| author | Folkert <folkert@folkertdev.nl> | 2024-08-08 10:20:40 +0200 |
|---|---|---|
| committer | Folkert de Vries <folkert@folkertdev.nl> | 2024-12-10 21:41:03 +0100 |
| commit | 91425f2c85764af92fd2cbae23b22f5d264d150d (patch) | |
| tree | 5f902654629f733019672cc2548f47b239fb6674 | |
| parent | 2c205e1d4443cb965426ab64ac916cfadbe06fd5 (diff) | |
| download | rust-91425f2c85764af92fd2cbae23b22f5d264d150d.tar.gz rust-91425f2c85764af92fd2cbae23b22f5d264d150d.zip | |
codegen `#[naked]` functions using `global_asm!`
| -rw-r--r-- | src/asm.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/asm.rs b/src/asm.rs index a1f9eab10e7..415f8affab9 100644 --- a/src/asm.rs +++ b/src/asm.rs @@ -867,6 +867,13 @@ impl<'gcc, 'tcx> AsmCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> { template_str.push_str("\n.popsection"); self.context.add_top_level_asm(None, &template_str); } + + fn mangled_name(&self, instance: Instance<'tcx>) -> String { + // TODO(@Amanieu): Additional mangling is needed on + // some targets to add a leading underscore (Mach-O) + // or byte count suffixes (x86 Windows). + self.tcx.symbol_name(instance).name.to_string() + } } fn modifier_to_gcc( |
