Sign in Join

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

Mailing lists / fpc-devel / 2019-07

FPC 3.0.4 ld error on opensuse 13.2

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Nikolai Zhubr

Hi all,

I've just discovered fpc-3.0.4-1.x86_64.rpm does not quite work on opensuse 13.2. That is, linking helloworld fails with:

fpc hello.pas
Free Pascal Compiler version 3.0.4 [2017/10/02] for x86_64 Copyright (c) 1993-2017 by Florian Klaempfl and others Target OS: Linux for x86-64
Compiling hello.pas
Linking hello
/usr/bin/ld: warning: link.res contains output sections; did you forget -T? /usr/bin/ld: /usr/lib64/fpc/3.0.4/units/x86_64-linux/rtl/prt0.o: unrecognized relocation (0x2a) in section `.text'
/usr/bin/ld: final link failed: Bad value
hello.pas(7,1) Error: Error while linking
hello.pas(7,1) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode

Meanwhile, fpc-2.6.4-1.x86_64.rpm does work fine.

/usr/bin/ld --version
GNU ld (GNU Binutils; openSUSE 13.2) 2.24.0.20140403-6.1

Of course this ld is pretty old, so my first thought was that I need some newer binutils. However, I've found fpcbuild-3.0.4.zip contains 2.22 version (for windows, but anyway), and also on windows I use cross-binutils 2.16 and 2.31 (and they work fine and produce perfectly valid linux-i386 and linux-arm executables), so now I'm somewhat confused about what to do next. AFAICS docs does not explicitely mention any particular binutils requirement. I could repackage/patch/replace stock binutils package, but because I don't understand the exact reason for the error, I thought I'd ask for advice first.

Thank you,

Regards,
Nikolai

Reply by email

Florian Klämpfl
to Nikolai Zhubr
Nikolai Zhubr wrote 29 lines
Hi all, I've just discovered fpc-3.0.4-1.x86_64.rpm does not quite work on opensuse 13.2. That is, linking helloworld fails with: fpc hello.pas Free Pascal Compiler version 3.0.4 [2017/10/02] for x86_64 Copyright (c) 1993-2017 by Florian Klaempfl and others Target OS: Linux for x86-64 Compiling hello.pas Linking hello /usr/bin/ld: warning: link.res contains output sections; did you forget -T? /usr/bin/ld: /usr/lib64/fpc/3.0.4/units/x86_64-linux/rtl/prt0.o: unrecognized relocation (0x2a) in section `.text' /usr/bin/ld: final link failed: Bad value hello.pas(7,1) Error: Error while linking hello.pas(7,1) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted Error: /usr/bin/ppcx64 returned an error exitcode Meanwhile, fpc-2.6.4-1.x86_64.rpm does work fine. /usr/bin/ld --version GNU ld (GNU Binutils; openSUSE 13.2) 2.24.0.20140403-6.1 Of course this ld is pretty old, so my first thought was that I need some newer binutils. However, I've found fpcbuild-3.0.4.zip contains 2.22 version (for windows, but anyway), and also on windows I use cross-binutils 2.16 and 2.31 (and they work fine and produce perfectly valid linux-i386 and linux-arm executables), so now I'm somewhat confused about what to do next. AFAICS docs does not explicitely mention any particular binutils requirement. I could repackage/patch/replace stock binutils package, but because I don't understand the exact reason for the error, I thought I'd ask for advice first.

As windows uses a different binary format, it is not possible to judge from windows to linux. I am pretty convinced, a newer ld might help.

Reply by email

Nikolai Zhubr
to Florian Klämpfl

Hi,

09.07.2019 22:32, Florian Klämpfl:

> /usr/bin/ld: /usr/lib64/fpc/3.0.4/units/x86_64-linux/rtl/prt0.o: unrecognized relocation (0x2a) in section `.text'

[...]

As windows uses a different binary format, it is not possible to judge from windows to linux. I am pretty convinced, a newer ld might help.

Indeed.
Updating binutils from ver 2.24 to 2.30 eliminated the ld error.

Thank you,

Regards,
Nikolai

Reply by email