1

I'm tried to debug my binary file (called click) with gdb.

When I run

gdb ./click 

I have the following error

GNU gdb (Ubuntu 7.10-1ubuntu2) 7.10
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
"/home/student/Desktop/./click": not in executable format: File format not recognized 

The outupt of:

uname -a

is

Linux student 4.2.0-36-lowlatency #42-Ubuntu SMP PREEMPT Thu May 12 23:39:42 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

And if I run

file click  

I get this output:

click: ERROR: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2 error reading (Invalid argument)  

Any ideas?

6
  • 1
    Could you please share the command you are using to compile your program? Commented Jul 7, 2016 at 15:25
  • I compile the program with eclipse and I tried to run the binary file in another computer. Commented Jul 7, 2016 at 15:31
  • 1
    What does uname -a output on the computer where you compile the program? Commented Jul 7, 2016 at 16:22
  • 1
    On the computer where gdb gives you that error, what happens if, outside of gdb, you try to run ./click ? Commented Jul 7, 2016 at 16:24
  • @CristiFati the output of uname -a in the computer where I compile the program is: Linux elisabetta-XPS-13-9343 4.2.0-36-generic #42-Ubuntu SMP Thu May 12 22:05:35 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Commented Jul 7, 2016 at 17:06

1 Answer 1

6

click: ERROR: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2 error reading (Invalid argument)

Your file is simply corrupt.

Possibly it is truncated (did you run out of disk space when linking it?), or you transferred it over FTP from another machine in ASCII mode (use binary mode instead).

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! You're right. I transferred a new file and it works!
I have the same problem. I compile my program on my host and tftp it to my target .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.