Hacker News new | ask | show | jobs
by sp1rit 1282 days ago
Does this mean I can now finally generate object files from .rs sources and link them myself?

That is one of the things that rustc is severely lacking.

2 comments

Is that not what "rustc --emit=obj" does now?
Out of curiosity, why would you need this?
You're basically asking why you'd want object files. They're a container of (usually) relocatable machine code. You can inspect or modify them with nm [1] or objcopy [2]. You can link them with object files generated from other programming languages to mix languages. Maybe you have a custom linker or environment that requires you to convert an ELF or COFF object file to some custom variant. There are lots of reasons.

[1] https://linux.die.net/man/1/nm

[2] https://linux.die.net/man/1/objcopy