thanos
(Athanasios Stamatopoulos)
August 31, 2019, 8:21am
1
I have installed f30
about 4 weeks ago and I keep encountering this error when compiling c++
macros or trying to install programs that require a compilation of a source code in fortran
.
error: ld returned 126 exit status
I’ve tried to look into it and so far I have no explanation.
What I tried to is to find where is ld
and see if I can find something. So, ld
resides in /usr/bin
which is a soft link from /etc/alternatives
.
$ ls -al /usr/bin/ld*
lrwxrwxrwx. 1 root root 20 Apr 26 04:27 /usr/bin/ld -> /etc/alternatives/ld
-rwxr-xr-x. 1 root root 13536 Aug 11 11:27 /usr/bin/ld.bfd
-rwxr-xr-x. 1 root root 5441 Jun 6 13:55 /usr/bin/ldd
-rwxr-xr-x. 1 root root 3853632 Mar 6 11:00 /usr/bin/ld.gold
When I try to execute ld
by itself, I get the following error
$ /usr/bin/ld
bash: /usr/bin/ld: cannot execute binary file: Exec format error
$ sudo /usr/bin/ld
/usr/bin/ld: /usr/bin/ld: cannot execute binary file
Then I searched the original /etc/alternatives
location, but it’s again a soft link to the orignial one!
$ ls -al /etc/alternatives/ld*
lrwxrwxrwx. 1 root root 15 Apr 26 04:27 /etc/alternatives/ld -> /usr/bin/ld.bfd
I tried to find the version of ld.bfd
but it seems that it cannot be executed
$ /usr/bin/ld.bfd --version
bash: /usr/bin/ld.bfd: cannot execute binary file: Exec format error
$ sudo /usr/bin/ld.bfd --version
/usr/bin/ld.bfd: /usr/bin/ld.bfd: cannot execute binary file
Any idea on how to understand what is wrong and solve the issue?
1 Like
vgaetera
(Vladislav Grigoryev)
August 31, 2019, 8:47am
2
Please, collect the related diagnostics:
type ld
rpm -q -f $(type -p ld)
rpm -V $(rpm -q -f $(type -p ld))
thanos
(Athanasios Stamatopoulos)
August 31, 2019, 10:06am
3
Thank you very much for your answer!
This are the diagnostics you asked
$ type ld
ld is /usr/bin/ld
$ rpm -q -f $(type -p ld)
binutils-2.31.1-29.fc30.x86_64
$ rpm -V $(rpm -q -f $(type -p ld))
1 Like
vgaetera
(Vladislav Grigoryev)
August 31, 2019, 10:34am
4
readlink -f $(type -p ld)
rpm -q -f $(readlink -f $(type -p ld))
thanos
(Athanasios Stamatopoulos)
August 31, 2019, 10:37am
5
Thank you once again.
I don’t understand what are you trying to see, but I will do a research!
$ readlink -f $(type -p ld)
/usr/bin/ld.bfd
$ rpm -q -f $(readlink -f $(type -p ld))
binutils-2.31.1-29.fc30.x86_64
1 Like
vgaetera
(Vladislav Grigoryev)
August 31, 2019, 10:50am
6
I wanted to verify the following:
Automatic symlink resolution.
The package which provides the binary:
Package version.
Package integrity.
I don’t see any issues, but still it doesn’t work, and this is confusing.
Please, also check:
uname -a
file $(readlink -f $(type -p ld))
A similar issue:
executable
thanos
(Athanasios Stamatopoulos)
August 31, 2019, 2:53pm
7
Thank you very much for you help!
I think I solve it, unless I destroyed something without knowing it!
I reinstalled binutils
by using
sudo yum reinstall binutils
and it seems it is working!
But I really hope I didn’t messed up with something else!
How can I validate that?
1 Like
system
(system)
Closed
September 28, 2019, 2:53pm
8
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.