/usr/bin/ld: Relocations in generic ELF (EM: 2)

Posted on 2012-03-29
Last Modified: 2012-06-22
Hi all,
i got this error while doing make (compiling all my files tgt).
Can anybody tell me why is this happening, and how should i solve this?
because my codes runs fine on the other machine but not this.
Thanks in advance:)

$ make
gcc -o m1 matmul_main.o matmul_setup.o matmul_compute.o matmul_output.o -lm -lpthread
/usr/bin/ld: matmul_main.o: Relocations in generic ELF (EM: 2)
matmul_main.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [m1] Error 1

if my make is up-to-date, it gives me another error:
$ make
make: `m1' is up to date.
$ m1 5 10 5 2
-bash: m1: command not found
Question by:crazy4s
  • 5
  • 3
LVL 76

Accepted Solution

slightwv (䄆 Netminder) earned 500 total points
ID: 37786963
I'm responding to a neglected question alert.  My 'make' expertise is pretty rusty.

Is this new code or have you compileed it before?

Have you tried a 'make clean' before the make?

Author Comment

ID: 37787516
yes i tried it my university's csa machine, it runs fine. but when i change to this (8core machines), it just give me the errors even after i do make clean.
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 37787529
Do you have the source to:

or are you just copying them over?

Author Comment

ID: 37787552
okay just because i used m1 instead of ./m1 it gives me the above error!
anyway thanks, problem solved.
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 37787556
Would you like to accept your post as the solution or just have the question deleted?
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 37787564
AS much as I like the points, I don't feel that I earned them.

I would like to unaccept this and let you accept your post as the solution.

Just let me know.

Author Comment

ID: 37787565
hmm is okay other might have the possibility to bump into this error, so i'll just leave it:)
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 37787574
>>other might have the possibility to bump into this error

But my post doesn't help resolve it.  Your post does.

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Kali Linux store / persist wireless password 3 49
I think my Ubuntu 12.10 box is hacked, but not sure... 13 53
Penetration Testing home based work 3 55
Linux VM 6 51
Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. Please see for the updated article. It is avail…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now