Recent

Author Topic: What exactly is the o. file?  (Read 22279 times)

Danail

  • Full Member
  • ***
  • Posts: 151
What exactly is the o. file?
« Reply #15 on: March 29, 2007, 10:21:09 am »
Can I find somewhere information about the structure of the o. file?
 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.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
What exactly is the o. file?
« Reply #16 on: March 29, 2007, 12:04:51 pm »
Quote from: "Danail"
Can I find somewhere information about the structure of the o. file?


google for object file format, coff or similar things

Quote
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

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2645
What exactly is the o. file?
« Reply #17 on: March 29, 2007, 01:37:06 pm »
IIRC fpc used to have an option to pass assembler by pipes, but its gone now.
With the current releases, on most platforms you can choose to use the internal or external assembler. By choosing the external assembler you also get the .s (asm) file.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Danail

  • Full Member
  • ***
  • Posts: 151
What exactly is the o. file?
« Reply #18 on: March 29, 2007, 07:51:40 pm »
How to choose the external assembler?

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
What exactly is the o. file?
« Reply #19 on: March 29, 2007, 08:24:15 pm »
type fpc on the command line. It will give a list of possible options. It´s one of the first ones.

on windows you may need to type the full path to fpc.exe

There is also a list here:

http://www.freepascal.org/docs-html/user/userse16.html#x33-400005.1

 

TinyPortal © 2005-2018