Skip to main content

read

Function read 

Source
pub fn read(text: &str, arch: Arch) -> Result<Assembled, Trouble>
Expand description

What a file of assembly for this machine says, as the sections and names an object file is written from.

The machine is x86-64 or AArch64. The directives are the same on both, apart from a few that gas spells differently on each, and so are the labels and the expressions. What differs is the instructions, which on AArch64 are read by rucc_target::aarch64::read and encoded by the same encoder the code generator’s listings are checked against.

§Errors

Trouble for a directive this does not know, an instruction it has no bytes for, an operand it cannot read, an expression that does not reduce to something a relocation can say, or a file that is malformed. Every one of them carries the line it was on.