Operating System - HP-UX
1825795 Members
2310 Online
109687 Solutions
New Discussion

Re: problem with gdb and ELF-64 Binaries

 
Alex Green
Frequent Advisor

problem with gdb and ELF-64 Binaries

Hi All,

I get the following error when I use gdb to debug a ELF-64 binary:

warning: Unable to find __d_pid symbol in object file.
warning: Suggest linking with /opt/langtools/lib/end.o.
(no debugging symbols found)...Version of shared library /usr/lib/pa20_64/libc.2 not understood.

"Hello World" compiled with:
/opt/ansic/bin/cc +DA2.0W -oalex.o a.c

file:
alex.o: ELF-64 executable object file - PA-RISC 2.0 (LP64)

chatr:
chatr alex.o
alex.o:
64-bit ELF executable
shared library dynamic path search:
LD_LIBRARY_PATH enabled first
SHLIB_PATH enabled second
embedded path enabled third /usr/lib/pa20_64:/opt/langtools/lib/pa20_64:
shared library list:
libc.2
shared library binding:
deferred
global hash table disabled
global hash table size 1103
shared library mapped private disabled
shared library segment merging disabled
shared vtable support disabled
explicit unloading disabled
segments:
index type address flags size
6 text 4000000000000000 z---c- D (default)
7 data 8000000100000000 ---m-- D (default)
executable from stack: D (default)
static branch prediction disabled
kernel assisted branch prediction enabled
lazy swap allocation for dynamic segments disabled
nulptr references disabled

platform:
HP-UX pawnee B.11.11 U 9000/800 1176921537 unlimited-user license

cmp:
B.11.11.03 HP C/ANSI C

patch level:
June 2003 + PHSS_28871 ld patch.

If compiled with +DA2.0 everything is ok:
alex.o: PA-RISC2.0 shared executable dynamically linked -not stripped

(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)... Hello World
Program exited normally.

chatr alex.o
alex.o:
shared executable
shared library dynamic path search:
SHLIB_PATH disabled second
embedded path disabled first Not Defined
shared library list:
dynamic /usr/lib/libc.2
shared library binding:
deferred
global hash table disabled
plabel caching disabled
global hash array size:1103
global hash array nbuckets:3
shared vtable support disabled
static branch prediction disabled
executable from stack: D (default)
kernel assisted branch prediction enabled
lazy swap allocation disabled
text segment locking disabled
data segment locking disabled
third quadrant private data space disabled
fourth quadrant private data space disabled
third quadrant global data space disabled
data page size: D (default)
instruction page size: D (default)
nulptr references disabled
shared library private mapping disabled
shared library text merging disabled


Can anyone help
"The physicist's greatest tool is his wastebasket." - Albert Einstein.
11 REPLIES 11
H.Merijn Brand (procura
Honored Contributor

Re: problem with gdb and ELF-64 Binaries

for debugging ELF64, you need a 64bit gdb

I have them at

a5:/u/usr/merijn 102 > path -alf gdb64
895 100755 -rwx 1 merijn 23911434 22 Oct 2003 17:29
/pro/local/bin/../../../usr/local/pa20_64/bin/gdb: ELF-64 executable object file - PA-RISC 2.0 (LP64)
13717 100555 -r-x 1 bin 4227072 14 Jun 2002 00:58
/opt/langtools/bin/gdb64: PA-RISC1.1 shared executable dynamically linked -not stripped
a5:/u/usr/merijn 103 >

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Alex Green
Frequent Advisor

Re: problem with gdb and ELF-64 Binaries

I have both gdb and gdb64 version 2.1. When I start gdb it automatically starts the 64bit gdb.

# file alex.o
alex.o: ELF-64 executable object file - PA-RISC 2.0 (LP64)
# gdb64 /tmp/alex.o
HP gdb 2.1
Copyright 1986 - 1999 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 2.1 (based on GDB 5.0-hpwdb-20000630)
Wildebeest 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 Wildebeest. Type "show warranty" for details.
Wildebeest was built for PA-RISC 2.0 (wide), HP-UX 11.00.
..(no debugging symbols found)...
(gdb) r
Starting program: /tmp/alex.o
warning: Unable to find __d_pid symbol in object file.
warning: Suggest linking with /opt/langtools/lib/end.o.
(no debugging symbols found)...Version of shared library /usr/lib/pa20_64/libc.2 not understood.

"The physicist's greatest tool is his wastebasket." - Albert Einstein.
ranganath ramachandra
Esteemed Contributor

Re: problem with gdb and ELF-64 Binaries

----
warning: Unable to find __d_pid symbol in object file.
warning: Suggest linking with /opt/langtools/lib/end.o.
----

to get over the warnings above, you need to compile with the -g compiler option.

----
(no debugging symbols found)...Version of shared library /usr/lib/pa20_64/libc.2 not understood.
----

this one is known to occur after the latest linker / loader patches are installed. you va ignore it - it is not really serious, but i think the latest gdb should fix it.
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

ranganath ramachandra
Esteemed Contributor

Re: problem with gdb and ELF-64 Binaries

i meant to say "you can ignore it" :)
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

H.Merijn Brand (procura
Honored Contributor

Re: problem with gdb and ELF-64 Binaries

gdb-2.1 is oooooold

try to get a more recent one

http://hpux.connect.org.uk/hppd/hpux/Gnu/gdb-5.3/
(though I don't know if it contains a 64bit version)

or from my site, where it is included in the most recent gcc port

My HP ITRC site pages can be found at

Seattle http://ww.hpux.ws/merijn/
Singapore https://www.beepz.com/personal/merijn/
Rotterdam http://www.cmve.net/~merijn/

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Alex Green
Frequent Advisor

Re: problem with gdb and ELF-64 Binaries

# /opt/ansic/bin/cc +DA2.0W -g -oalex.o a.c
# file alex.o
alex.o: ELF-64 executable object file - PA-RISC 2.0 (LP64)
# gdb alex.o
Detected 64-bit executable.
Invoking /opt/langtools/bin/gdb64.
HP gdb 2.1
Copyright 1986 - 1999 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 2.1 (based on GDB 5.0-hpwdb-20000630)
Wildebeest 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 Wildebeest. Type "show warranty" for details.
Wildebeest was built for PA-RISC 2.0 (wide), HP-UX 11.00.
..
(gdb) r
Starting program: /tmp/alex.o
Version of shared library /usr/lib/pa20_64/libc.2 not understood.
"The physicist's greatest tool is his wastebasket." - Albert Einstein.
Alex Green
Frequent Advisor

Re: problem with gdb and ELF-64 Binaries

The same binary on another 11i machine. I don't understand why it works on one and not on the other. They both have the same compiler and I have no idea where to start looking to find the difference.


# gdb alex.o
Detected 64-bit executable.
Invoking /opt/langtools/bin/gdb64.
HP gdb 2.1
Copyright 1986 - 1999 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 2.1 (based on GDB 5.0-hpwdb-20000630)
Wildebeest 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 Wildebeest. Type "show warranty" for details.
Wildebeest was built for PA-RISC 2.0 (wide), HP-UX 11.00.
..
(gdb) r
Starting program: /tmp/alex.o
Hello World
Program exited normally.
(gdb)
"The physicist's greatest tool is his wastebasket." - Albert Einstein.
ranganath ramachandra
Esteemed Contributor

Re: problem with gdb and ELF-64 Binaries

as i wrote earlier:

this is known to occur after the latest linker / loader patches are installed. it is not a problem with the linker or loader. nor is it a serious problem with gdb. no part ot the program's, library's or gdb's functionality is impacted. you can ignore it, but i think the latest gdb should fix it.

the linker/loader patches i mention are PHSS_28869 (11.00) and PHSS_28871 (11.11). but please do not uninstall these patches only to avoid these warnings. the patches contain fixes for problems more serious than this warning.
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

ranganath ramachandra
Esteemed Contributor

Re: problem with gdb and ELF-64 Binaries

more information on this:

this is happening because the load_module_desc structure (defined in dlfcn.h) has changed in the latest loader. the only changes are addition of a few fields (which are required by the latest gdb). gdb tries to get this information about each shared library that gets loaded during debugging of an application. however the older gdb which sees the bigger load_module_desc emits this warning just to state that any special functionality provided by the new fields will not be available. this is not a problem because gdb will continue to work as before.
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

Alex Green
Frequent Advisor

Re: problem with gdb and ELF-64 Binaries

but gdb can't run the binary.. or at least it doesn't show the expected "Hello World".

"The physicist's greatest tool is his wastebasket." - Albert Einstein.
ranganath ramachandra
Esteemed Contributor

Re: problem with gdb and ELF-64 Binaries

right, i've been repeating without reading.

i tried the same thing with gdb 3.2 and though it gave me the same warnings it did continue with execution. maybe 2.1 is simply too old for this ? and from what i remember gdb 3.3 wont even give you the warning.
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo