[fpc-devel] how to produce object codes that do not reference symbolic registers

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Tue Jun 18 12:28:02 CEST 2013

Sergei Gorelkin wrote:
> 17.06.2013 19:20, Dennis пишет:
>> I am trying to create a cross compiler from x86 Debian-Linus -> 
>> mips-eb (endian big) Linux (OpenWrt).
>> The target platform is a netgear 3700 router.
>> I downloaded the toolchain for openwrt mips-eb and try to make the 
>> cross compiler.
>> when I run
>> make all CPU_TARGET=mips OS_TARGET=linux 
>> BINUTILSPREFIX=/usr/bin/mips-linux-gnu-
>> there were errors:
>> /home/dennis/toolchains/staging_dir_mips/bin/mips-linux-as -32 -mips32 
>> -EB -o
>> /home/dennis/fpc/2.7.1/rtl/units/mips-linux/prt0.o mips/prt0.as
>> mips/prt0.as: Assembler messages:
>> mips/prt0.as:23: Error: illegal operands `lui $a2,%hi(__dl_fini)'
>> looks like the mips-linux-as  assembler cannot understand the symbolic 
>> register $a2.
>> May be the assembler version is too old (late 2009) but I cannot find 
>> a newer assembler so I am
>> wondering if I can make the fpc compiler product object files that DO 
>> NOT REFERENCE symbolic registers.
>> If you know of any options parameters that I can pass to fpc to 
>> achieve that, please kindly let me know.
>> Thanks a lot.
> There are no compiler switches that influence output of symbolic 
> registers. Moreover, the code in prt0.as
> is written by hand, so compiler has nothing to do with it.
> At the same time, on one of the testing machines we use even older gas 
> (May 2008) and it gives no such issues.

The MIPS symbolic registers were introduced by binutils at 2.18, before 
that it was necessary to insert an include file in each unit. It's 
possible to tell FPC to generate assembler source plus a script to 
handle the backend stuff, which would allow you to do this.

I'd suggest rebuilding binutils (using their standard ./configure etc.), 
but so far I've not seen instructions to do that for that target (which 
appears to differ in some way from standard mips/mipseb). If I had time 
I'd put OpenWRT or DD-WRT on a Qemu system and take a look at it, but 
I'm afraid I don't.

Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

More information about the fpc-devel mailing list