Hey y'all,
I think the title pretty much says it all. I'm messing around with assembly and rust, trying to link them together, so so I of course used #[no_mangle] and pub extern "C" fn function_name in my [no_main], [no_std] file.
Problem is, when I run objdump -s target/debug/[et cetera], I get something like
SYMBOL TABLE:
0000000000000000 l df *ABS* 0000000000000000 4op9q508u3e7bkoe```
which is unideal.
Then I have an idea, and try to swap function_name over to "_start", and do the same thing, getting this:
SYMBOL TABLE:
0000000000000000 l df ABS 0000000000000000 4op9q508u3e7bkoe
0000000000201120 g F .text 0000000000000004 _start```
much more ideal.
But this is still a problem, because I need the assembly to be the "_start" (indeed it already has a _start symbol), so I can't actually use _start for rust.
So, does anyone know why this works the way it does, and what I can do to fix it?
Thanks
if it helps,
#![no_std]
#![no_main]
use core::panic::PanicInfo;
#[no_mangle]
#[export_name = "_start"]
pub extern "C" fn rust_main() -> ! {
loop {}
}
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
loop {}
}``` this is my entire `src/main.rs` file
```json
{
"llvm-target": "x86_64-unknown-none",
"data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
"arch": "x86_64",
"target-endian": "little",
"target-pointer-width": "64",
"target-c-int-width": "32",
"os": "none",
"executables": true,
"linker-flavor": "ld.lld",
"linker": "rust-lld",
"panic-strategy": "abort",
"disable-redzone": true,
"features": "-mmx,-sse,+soft-float"
}``` this is my target