Forum > General

How to manually build the .exe using AS and LD ?

(1/2) > >>

440bx:
Hello,

First, this is _mostly_ for self education.

After telling FPC to produce an assembly file, I'd like to use the assembler (AS) and linker (LD) to _manually_ create the executable.

Any guidance on how this can be done with both, 64bit and 32bit executables (hopefully it can be done), will be greatly appreciated.  If there is a writeup on how to do this, a link to it would be great.

Thank you for your help.

Leledumbo:

--- Quote from: 440bx on May 10, 2021, 06:43:11 am ---Hello,

First, this is _mostly_ for self education.

After telling FPC to produce an assembly file, I'd like to use the assembler (AS) and linker (LD) to _manually_ create the executable.

Any guidance on how this can be done with both, 64bit and 32bit executables (hopefully it can be done), will be greatly appreciated.  If there is a writeup on how to do this, a link to it would be great.

Thank you for your help.

--- End quote ---
Compile with -s, you will get ppas.sh. The required as and ld commands will be there unless internal assembler/linker is used.

440bx:

--- Quote from: Leledumbo on May 10, 2021, 07:25:23 am ---Compile with -s, you will get ppas.sh. The required as and ld commands will be there unless internal assembler/linker is used.

--- End quote ---
Thank you Leledumbo.  That's great, I'm going to carefully study the entire process.

Jonas Maebe:
Small addition: if you use "-s", the compiler will always switch to an external assembler. And if you add "-a", then the generated shell script for assembling/linking won't delete the assembler files once it's done.

440bx:

--- Quote from: Jonas Maebe on May 10, 2021, 07:36:38 pm ---Small addition: if you use "-s", the compiler will always switch to an external assembler. And if you add "-a", then the generated shell script for assembling/linking won't delete the assembler files once it's done.

--- End quote ---
Thank you Jonas.  I did notice that.  I am using -al.  Should I be using -a instead ?

Navigation

[0] Message Index

[#] Next page

Go to full version