Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2021-12

Assembler file option (-a)

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marco Borsari

Hi,
on Linux with FPC 3.2.2 the executable size of programs compiled with fpc -On -a (tried with n 2 or 4)
is smaller than when the assembler files are deleted (-a omitted). Does it is an expected behaviour?

Reply by email

Christo Crause
to Marco Borsari

On Fri, Dec 31, 2021 at 4:41 PM Marco Borsari via fpc-devel <

Show quoted text 8 lines
wrote: Hi, on Linux with FPC 3.2.2 the executable size of programs compiled with fpc -On -a (tried with n 2 or 4) is smaller than when the assembler files are deleted (-a omitted). Does it is an expected behaviour?

Using any of the -a options (not sure about -a5?) to output assembly also automatically switches to an external linker (for targets with internal linkers). Differences in the executables are thus attributable to differences in generated output between the internal and external linkers.

Reply by email

Marco Borsari
to Christo Crause

Il giorno ven, 31/12/2021 alle 17.32 +0200, Christo Crause ha scritto:

Show quoted text 16 lines
On Fri, Dec 31, 2021 at 4:41 PM Marco Borsari via fpc-devel wrote: > Hi, > on Linux with FPC 3.2.2 the executable size of programs compiled > with > fpc -On -a (tried with n 2 or 4) > is smaller than when the assembler files are deleted (-a omitted). > Does it is an expected behaviour? > Using any of the -a options (not sure about -a5?) to output assembly also automatically switches to an external linker (for targets with internal linkers).  Differences in the executables are thus attributable to differences in generated output between the internal and external linkers.

Thank you for the clarification

Reply by email

Sven Barth
to Christo Crause: On Fri, Dec 31, 2021 at 4:41 PM Marco Borsari via fpc-devel < Using any of the -a options…

Christo Crause via fpc-devel schrieb am
Fr., 31. Dez. 2021, 16:58:

Show quoted text 15 lines
On Fri, Dec 31, 2021 at 4:41 PM Marco Borsari via fpc-devel < > wrote: > Hi, > on Linux with FPC 3.2.2 the executable size of programs compiled with > fpc -On -a (tried with n 2 or 4) > is smaller than when the assembler files are deleted (-a omitted). > Does it is an expected behaviour? > Using any of the -a options (not sure about -a5?) to output assembly also automatically switches to an external linker (for targets with internal linkers). Differences in the executables are thus attributable to differences in generated output between the internal and external linkers.

The internal ELF linker isn't enabled by default.

But using -a switches to the external assembler instead of the internal one and there the same point holds true that slightly different binary files are generated.

Regards,
Sven

Reply by email

Christo Crause
to Sven Barth

On Fri, Dec 31, 2021 at 10:43 PM Sven Barth via fpc-devel <

Show quoted text 27 lines
wrote: Christo Crause via fpc-devel schrieb am Fr., 31. Dez. 2021, 16:58: > On Fri, Dec 31, 2021 at 4:41 PM Marco Borsari via fpc-devel < > > wrote: > >> Hi, >> on Linux with FPC 3.2.2 the executable size of programs compiled with >> fpc -On -a (tried with n 2 or 4) >> is smaller than when the assembler files are deleted (-a omitted). >> Does it is an expected behaviour? >> > > Using any of the -a options (not sure about -a5?) to output assembly also > automatically switches to an external linker (for targets with internal > linkers). Differences in the executables are thus attributable to > differences in generated output between the internal and external linkers. > The internal ELF linker isn't enabled by default. But using -a switches to the external assembler instead of the internal one and there the same point holds true that slightly different binary files are generated.

Thanks for the clarification Sven.

Reply by email