pub fn assembled(
input: &Assembled,
target: &TargetInfo,
) -> Result<Vec<u8>, Error>Expand description
That, as a relocatable object in whichever of the two formats the target wants.
Both formats, the same two the module that writes a compilation writes it into, and the differences between them are the same answers there. That is the whole reason this is not two functions: a file of assembly names its own sections and a compilation does not, but what a relocation is called and whether a symbol has anywhere to keep a visibility are facts about the format rather than about where the bytes came from, and a second set of answers to them would be a second set to get wrong.
What a Part carries is the section type and flags the source wrote in as many words. ELF has
a field for each of them and they are written down as they stand. COFF has no field they map
onto, so what the section is comes from the kind on the shape and the writer underneath turns it
into the characteristics every other Windows assembler writes. A program that means a Windows
section to be something other than what its name says is a program that has to say so some other
way, which is what .section with COFF’s own letters is for and what tamnd/rucc#1514 left open.
§Errors
Error::Format for a machine or a platform this does not write, and Error::Refused for a
relocation against a name the list does not hold or one this format has no relocation for.