public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/11885] New: Unkown symbol format 'elf32-sparc'
@ 2010-08-05 14:02 strikosn at gmail dot com
  2010-08-05 14:25 ` [Bug gdb/11885] " pedro at codesourcery dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: strikosn at gmail dot com @ 2010-08-05 14:02 UTC (permalink / raw)
  To: gdb-prs

I have cross-compiled gdb on a x86_64 PC targeting the 32-bit LEON Sparc
architecture running a 2.6.21.1 linux kernel. When I load a file in gdb it fails
with

'Reading symbols from /bin/ls...I'm sorry, Dave, I can't do that.  Symbol format
`elf32-sparc' unknown.'

-- 
           Summary: Unkown symbol format 'elf32-sparc'
           Product: gdb
           Version: 7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: strikosn at gmail dot com
                CC: gdb-prs at sourceware dot org
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: sparc-linux
GCC target triplet: sparc-linux


http://sourceware.org/bugzilla/show_bug.cgi?id=11885

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/11885] Unkown symbol format 'elf32-sparc'
  2010-08-05 14:02 [Bug gdb/11885] New: Unkown symbol format 'elf32-sparc' strikosn at gmail dot com
@ 2010-08-05 14:25 ` pedro at codesourcery dot com
  2010-08-05 14:49 ` strikosn at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: pedro at codesourcery dot com @ 2010-08-05 14:25 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From pedro at codesourcery dot com  2010-08-05 14:25 -------
This most likely means that your gdb build has elf support disabled for some
reason.  It should be enabled automatically.

Check build/gdb/config.h for HAVE_ELF.  You should see this:

/* Define if ELF support should be included. */
#define HAVE_ELF 1

If you don't, you'll need to figure out why.  Check build/gdb/config.log
for hints.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


http://sourceware.org/bugzilla/show_bug.cgi?id=11885

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/11885] Unkown symbol format 'elf32-sparc'
  2010-08-05 14:02 [Bug gdb/11885] New: Unkown symbol format 'elf32-sparc' strikosn at gmail dot com
  2010-08-05 14:25 ` [Bug gdb/11885] " pedro at codesourcery dot com
@ 2010-08-05 14:49 ` strikosn at gmail dot com
  2010-08-05 16:42 ` schwab at linux-m68k dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: strikosn at gmail dot com @ 2010-08-05 14:49 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From strikosn at gmail dot com  2010-08-05 14:49 -------
HAVE_ELF was indeed undefined. Browsing through gdb/config.log I found that
there was an unresolved symbol:

configure:13576: checking for ELF support in BFD
configure:13595: sparc-linux-gcc -o conftest -g -O2 -I./../include -I../bfd
-I./../bfd -L../bfd -L../libiberty conftest.c -lbfd -liberty  -lncurses -lz -lm
    >&5
libbfd.a(cache.o): In function `bfd_open_file':
gdb-7.1/bfd/cache.c:577: undefined reference to `unlink_if_ordinary'
collect2: ld returned 1 exit status

After #defining HAVE_ELF 1 in gdb/config.h, I tried to compile but failed again with

sparc-linux-gcc -g -O2 \
		-o gdb gdb.o libgdb.a \
		   ../readline/libreadline.a ../opcodes/libopcodes.a ../bfd/libbfd.a 
../libiberty/libiberty.a ../libdecnumber/libdecnumber.a    -lncurses -lz -lm 
../libiberty/libiberty.a  gnulib/libgnu.a -ldl -rdynamic
libgdb.a(dbxread.o): In function `start_psymtab':
gdb-7.1/gdb/dbxread.c:2205: undefined reference to `elfstab_offset_sections'
collect2: ld returned 1 exit status


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11885

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/11885] Unkown symbol format 'elf32-sparc'
  2010-08-05 14:02 [Bug gdb/11885] New: Unkown symbol format 'elf32-sparc' strikosn at gmail dot com
  2010-08-05 14:25 ` [Bug gdb/11885] " pedro at codesourcery dot com
  2010-08-05 14:49 ` strikosn at gmail dot com
@ 2010-08-05 16:42 ` schwab at linux-m68k dot org
  2010-08-05 16:59 ` pedro at codesourcery dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: schwab at linux-m68k dot org @ 2010-08-05 16:42 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From schwab at linux-m68k dot org  2010-08-05 16:42 -------
unlink_if_ordinary is defined by libiberty.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11885

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/11885] Unkown symbol format 'elf32-sparc'
  2010-08-05 14:02 [Bug gdb/11885] New: Unkown symbol format 'elf32-sparc' strikosn at gmail dot com
                   ` (2 preceding siblings ...)
  2010-08-05 16:42 ` schwab at linux-m68k dot org
@ 2010-08-05 16:59 ` pedro at codesourcery dot com
  2010-08-05 17:29 ` strikosn at gmail dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: pedro at codesourcery dot com @ 2010-08-05 16:59 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From pedro at codesourcery dot com  2010-08-05 16:59 -------
I just tried building both the 7.1 release, and current mainline in cvs, with
--target=sparc-linux, on x86_64-unknown-linux-gnu (ubuntu 10.04).  Both built
cleanly, and with elf support detected correctly.

You may want to try building again from scratch.  A separate (not nested
within the sources dir) build directory (mkdir build; cd build; ../src/configure
&& make) is also recommended.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11885

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/11885] Unkown symbol format 'elf32-sparc'
  2010-08-05 14:02 [Bug gdb/11885] New: Unkown symbol format 'elf32-sparc' strikosn at gmail dot com
                   ` (3 preceding siblings ...)
  2010-08-05 16:59 ` pedro at codesourcery dot com
@ 2010-08-05 17:29 ` strikosn at gmail dot com
  2010-08-05 17:54 ` pedro at codesourcery dot com
  2010-08-12 19:00 ` strikosn at gmail dot com
  6 siblings, 0 replies; 9+ messages in thread
From: strikosn at gmail dot com @ 2010-08-05 17:29 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From strikosn at gmail dot com  2010-08-05 17:29 -------
Ok, it did compile. The source of the problem was not compiling with HAVE_ELF
which seemed to stem from a dependency problem between iberty and bfd libraries.
I was able to temporarily resolve by changing

--- ../gdb-7.1/gdb/configure	2010-08-05 20:16:06.000000000 +0300
+++ source/gdb-7.1/gdb/configure	2010-03-15 19:06:12.000000000 +0200
@@ -13572,7 +13572,7 @@
 CFLAGS="$CFLAGS -I${srcdir}/../include -I../bfd -I${srcdir}/../bfd"
 LDFLAGS="$LDFLAGS -L../bfd -L../libiberty"
 intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
-LIBS="../libiberty/unlink-if-ordinary.o -lbfd -liberty $intl $LIBS"
+LIBS="-lbfd -liberty $intl $LIBS"
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELF support in BFD" >&5
 $as_echo_n "checking for ELF support in BFD... " >&6; }
 if test "${gdb_cv_var_elf+set}" = set; then :


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11885

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/11885] Unkown symbol format 'elf32-sparc'
  2010-08-05 14:02 [Bug gdb/11885] New: Unkown symbol format 'elf32-sparc' strikosn at gmail dot com
                   ` (4 preceding siblings ...)
  2010-08-05 17:29 ` strikosn at gmail dot com
@ 2010-08-05 17:54 ` pedro at codesourcery dot com
  2010-08-12 19:00 ` strikosn at gmail dot com
  6 siblings, 0 replies; 9+ messages in thread
From: pedro at codesourcery dot com @ 2010-08-05 17:54 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From pedro at codesourcery dot com  2010-08-05 17:54 -------
(I think you posted a reversed diff.)

Did you try the rebuild from scratch suggestion?  If that doesn't solve it
cleanly, we need to understand why didn't unlink-if-ordinary.o end up
in libiberty.a.  Otherwise, if you're happy with the workaround, there's
nothing else we can do.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11885

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/11885] Unkown symbol format 'elf32-sparc'
  2010-08-05 14:02 [Bug gdb/11885] New: Unkown symbol format 'elf32-sparc' strikosn at gmail dot com
                   ` (5 preceding siblings ...)
  2010-08-05 17:54 ` pedro at codesourcery dot com
@ 2010-08-12 19:00 ` strikosn at gmail dot com
  6 siblings, 0 replies; 9+ messages in thread
From: strikosn at gmail dot com @ 2010-08-12 19:00 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From strikosn at gmail dot com  2010-08-12 19:00 -------
I did try to build it cleanly but that didn't do it. I can't afford the time to
investigate deeper right now, I'm afraid it will have to wait a bit...

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11885

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/11885] Unkown symbol format 'elf32-sparc'
       [not found] <bug-11885-4717@http.sourceware.org/bugzilla/>
@ 2011-04-20 19:59 ` phantall at gmail dot com
  0 siblings, 0 replies; 9+ messages in thread
From: phantall at gmail dot com @ 2011-04-20 19:59 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=11885

phantall at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |phantall at gmail dot com

--- Comment #8 from phantall at gmail dot com 2011-04-20 19:58:22 UTC ---
This is still an issue.  I downloaded the source for 7.2 around a year ago (my
apologies -- airgapped network with a lot of restrictions).  I'm building in
solaris 2.10 on a sparc machine, and I'm running into the same symptoms Nick
reports.

HAVE_ELF isn't defined -- though a commented out #undef for it is there.

libiberty doesn't have the symbol referenced.

I'm not familiar enough with this build process, and I don't have a lot of free
time to delve into it.  Also, because of the restrictions I mentioned I can't
[easily] get logs to post.

I noticed 'libelf' wasn't found during the configure process ... does that
relate to this issue at all?

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-04-20 19:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-05 14:02 [Bug gdb/11885] New: Unkown symbol format 'elf32-sparc' strikosn at gmail dot com
2010-08-05 14:25 ` [Bug gdb/11885] " pedro at codesourcery dot com
2010-08-05 14:49 ` strikosn at gmail dot com
2010-08-05 16:42 ` schwab at linux-m68k dot org
2010-08-05 16:59 ` pedro at codesourcery dot com
2010-08-05 17:29 ` strikosn at gmail dot com
2010-08-05 17:54 ` pedro at codesourcery dot com
2010-08-12 19:00 ` strikosn at gmail dot com
     [not found] <bug-11885-4717@http.sourceware.org/bugzilla/>
2011-04-20 19:59 ` phantall at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).