GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1 says foo not in executable format: File format not recognized
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
deb8_ppc64$ gcc -m64 -g -o hello hello.c
deb8_ppc64$ ./hello
hello world.
deb8_ppc64$
deb8_ppc64$ file hello
hello: ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), dynamically linked, interpreter /lib64/ld64.so.1, for GNU/Linux 2.6.32, BuildID[sha1]=c79bcf90665edeb4b1d9a5972c4f7ddf8ec9877d, not stripped
deb8_ppc64$
However debugger gdb says "no" :
Code:
deb8_ppc64$ which gdb
/usr/bin/gdb
deb8_ppc64$ ls -lap /usr/bin/gdb
-rwxr-xr-x 1 root root 6301688 Nov 9 2014 /usr/bin/gdb
deb8_ppc64$ /usr/bin/gdb hello
GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 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 "powerpc-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"...
"/usr/local/src/test/hello/hello": not in executable format: File format not recognized
(gdb) quit
deb8_ppc64$
Distribution: Debian, RHEL, Solaris, various others and LFS
Posts: 19
Original Poster
Rep:
Problem solved .. I simply built a new gdb :
Code:
deb8_ppc64$ /usr/local/bin/gdb pi_ld
GNU gdb (GDB) 8.0.1
Copyright (C) 2017 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 "powerpc64-unknown-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"...
Reading symbols from pi_ld...done.
(gdb) break 57
Breakpoint 1 at 0x10000670: file pi_ld.c, line 57.
(gdb) run
Starting program: /usr/local/src/test/pi_ld
NOTE : sizeof(long double) = 16
Breakpoint 1, main (argc=1, argv=0x3ffffffff8a8) at pi_ld.c:57
57 for ( j=0; j<sizeof(long double); j++ ) {
(gdb) print pi
$1 = 3.1415926535897932384626433832794812
(gdb) print &pi
$2 = (long double *) 0x3ffffffff440
(gdb) x/16xb 0x3ffffffff440
0x3ffffffff440: 0x40 0x09 0x21 0xfb 0x54 0x44 0x2d 0x18
0x3ffffffff448: 0x3c 0xa1 0xa6 0x26 0x33 0x14 0x5c 0x06
(gdb) cont
Continuing.
hex at memory addess &pi [ 0x3ffffffff440 ] == 40 09 21 fb 54 44 2d 18 3c a1 a6 26 33 14 5c 06
[Inferior 1 (process 8222) exited normally]
(gdb) quit
deb8_ppc64$
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.