Can I find somewhere information about the structure of the o. file?
google for object file format, coff or similar things
I also want to also how is generated the o. file from Lazarus - directly from the pascal code, or there is another file or files, that apear before the o. file.
The compiler transforms pascal code into assembler, and later transforms the assembler into object code (in object files).
On many platforms fpc uses by default it´s internal assembler, then there are no intermediary files. If you use a external assembler (like gnu as), then we have a intermediary assembler file.
Note that I´m not exactly sure about this. Maybe fpc has an way to feed the assembler to gas that doesn´t require a intermediary file. I wouldn´t know. I know it´s possible to ask fpc to generate asm files.
Anyway, the basic idea is: pascal --> assembler --> machine code