Operating System - HP-UX
1753854 Members
7517 Online
108808 Solutions
New Discussion юеВ

Re: gdb error: not in executable format: File format not recognized

 
SOLVED
Go to solution

gdb error: not in executable format: File format not recognized

Hi,

When I try to use gdb with binaries compile as:
ELF-64 executable object file - PA-RISC 2.0 (LP64)

I get the following error:
This GDB was configured as "hppa2.0w-hp-hpux11.11"..."/tmp/jose/2prugdb": not in executable format: File format not recognized

With 32bits binaries is working fine.

Any idea how to correct the problem?

Best regards
jose
9 REPLIES 9
Stephen Keane
Honored Contributor

Re: gdb error: not in executable format: File format not recognized

Are you using a 64-bit enabled version of gdb?

Re: gdb error: not in executable format: File format not recognized


I don't think so, actually I thought that the problem could be there but I couldn't find the option to build the gdb explicity with 64 bit support.

The hppa2.0w-hp-hpux11.11 seems to indicate that it's 64 bits but I'm not sure of that.
Stephen Keane
Honored Contributor

Re: gdb error: not in executable format: File format not recognized

As soon as you see PA-RISC 2.0, its 64-bit. If you either do gdb -v or swlist | grep gdb you can get the version of gdb you are using. Then we can check if it can cope with 64-bit binaries. (I suspect not)
Ermin Borovac
Honored Contributor

Re: gdb error: not in executable format: File format not recognized

HP's supported version of GDB (WDB) works fine with ELF (64 bit) binaries.

You can get it from here.

http://www.hp.com/go/gdb

It installs into /opt/langtools/bin.

$ file a.out
a.out: ELF-64 executable object file - PA-RISC 2.0 (LP64)
$ gdb ./a.out
Detected 64-bit executable.
Invoking /opt/langtools/bin/gdb64.
HP gdb 5.0 for PA-RISC 2.0 (wide), HP-UX 11.00
and target hppa2.0w-hp-hpux11.00.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 5.0 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..(no debugging symbols found)...
(gdb) quit

Re: gdb error: not in executable format: File format not recognized

Yes, it seems that the old versions where 32 bits so I built a new one that it's supposed to be 64bits but I'm getting the same error so I'm doing something wrong...but what?

./gdb -v
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "hppa2.0w-hp-hpux11.11".

I think the w in hppa2.0w-hp-hpux11.11 means 64bits, so now I'm completely lost.
Ermin Borovac
Honored Contributor
Solution

Re: gdb error: not in executable format: File format not recognized

hppa2.0w-hp-hpux11.11 means that gdb configure script detected that your machine is 64-bit capable.

You may be able to compile gdb with 64-bit binary support with

$ ./configure --target=hppa64-hp-hpux11.11 --host=hppa64-hp-hpux11.11

Or simply install it from HP's web site.

Re: gdb error: not in executable format: File format not recognized


GREAT!!

That's the string I was looking for :)

Where in the HP site? I couldn't find it that's why I'm trying to build directly from the source.
Alex Glennie
Honored Contributor

Re: gdb error: not in executable format: File format not recognized

Re: gdb error: not in executable format: File format not recognized


Thanks for all the help with this.