[fpc-devel] FPC -Rintel and -alr options

Sergei Gorelkin sergei_gorelkin at mail.ru
Tue Aug 21 09:19:24 CEST 2012


21.08.2012 10:32, ABorka пишет:
> That requires masm to compile the project.
>
Likewise, using "-al" requires GNU AS to compile. The latter is typically installed together with 
FPC, so it just works transparently.

> What I actually want is to see the disassembled code from my project (as Intel Syntax assembly code)
> to look at how the win32 and win64 code is optimized and then to fine tune the pascal source.
>
FPC does not generate *disassembled* code. It generates code that is subject to be assembled - 
either with internal assembler or by one of external tools.

"-al" (and in general any "-a") switch implies using an external assembler, which is GNU AS by 
default on most targets. It can be overridden with "-A". Thus, "-al -Amasm" will generate MASM 
format listing with line information inserted.

For the purposes of reading assembler source you can also add "-s" switch, which will stop after 
producing the listing (MASM output probably won't assemble even if you have ml.exe available).

> 1. The objdump ("objdump.exe" and "x86_64-win64-objdump.exe") utility from the binutils programs
> works and displays the code with the -Mintel option as Intel syntax from the "*.o" files, however
> when I try to see the line numbers (objdump.exe -l ...) and source code lines (objdump.exe -S ...)
> it does not put them in the right places within the disassembled code.
>
> As an example, I used:
> objdump.exe -d -Mintel -w -l -S -EL something.o > something.disassembled
>
This may be an issue to fix (or maybe not, given that gdb usually locates source lines correctly 
using the same line information from the object files).

> 2. The fpc "-al" flag generates a nice "*.s" assembler file during compilation, where everything is
> in place, except it is not Intel syntax assembly but AT&T.
>
>
> Anyone had experience with something like this (display the disassembled code of a project
> unit/object_file in Intel syntax, with source code lines)?
>
> Thanks for any help
>
Regards,
Sergei




More information about the fpc-devel mailing list