public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* undefined virtual table references in 2.12 and later
@ 2003-05-28 18:55 Donald Zoch
  2003-05-28 19:01 ` Ian Lance Taylor
  2003-05-28 22:01 ` H. J. Lu
  0 siblings, 2 replies; 5+ messages in thread
From: Donald Zoch @ 2003-05-28 18:55 UTC (permalink / raw)
  To: binutils; +Cc: Donald Zoch

I have recently encountered a problem when trying to upgrade my
binutils 2.11 to version 2.13.2.1.  I even tried the development
version binutils-2.14.90.0.4.  From what I can tell, the problem
started happening with version 2.12.   The problem is that when I
try and link my executable, I'm getting a bunch of errors like these:

/u/zochd/build2/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/libgcc.a(exception.o):
In function `__check_eh_spec':
/u/zochd/gcc-2.95.3/build2/gcc/../../gcc/cp/exception.cc:307:
undefined reference to `bad_exception type_info function'
/u/zochd/build2/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/libgcc.a(exception.o):
In function `__check_eh_spec':
/u/zochd/gcc-2.95.3/build2/gcc/include/exception:15: undefined
reference to `exception virtual table'
/u/zochd/gcc-2.95.3/build2/gcc/include/exception:22: undefined
reference to `bad_exception virtual table'

I sent a message a few days ago about this and someone responded, 
saying that I should try the latest version and that it might be 
a problem with the way GNU_VTINHERIT and GNU_VTENTRY relocs are 
handled.

From what I can tell though, in my libgcc.a (I'm using gcc 2.95.3),
the symbols are defined as weak objects, but then undefined several
times also:

00000000 V bad_exception virtual table
00000000 V exception virtual table
         U exception virtual table
         U exception virtual table
         U exception virtual table

I was wondering if anyone could explain to me what is happening,
and how that I might fix it.  I'd like to understand what the 
proper behavior should be, and what source files within binutils
I could take a look at to try and make it behave as version 
2.11 did.  Is this a problem with binutils or gcc? 
I work in an environment where we need to provide multiple versions 
of gcc, but preferably have one version of binutils work for them all.   

Thanks,
 
Donald
----
Donald Zoch                         5900 E. Ben White Blvd. MS 625
Advanced Micro Devices              Austin, Tx  78741
MPD Unix Systems Administrator      Phone: (512) 602-7945
donald.zoch@amd.com                 Pager: (512) 604-5401

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

* Re: undefined virtual table references in 2.12 and later
  2003-05-28 18:55 undefined virtual table references in 2.12 and later Donald Zoch
@ 2003-05-28 19:01 ` Ian Lance Taylor
  2003-05-28 19:23   ` Donald Zoch
  2003-05-28 22:01 ` H. J. Lu
  1 sibling, 1 reply; 5+ messages in thread
From: Ian Lance Taylor @ 2003-05-28 19:01 UTC (permalink / raw)
  To: Donald Zoch; +Cc: binutils

"Donald Zoch" <donald.zoch@amd.com> writes:

> >From what I can tell though, in my libgcc.a (I'm using gcc 2.95.3),
> the symbols are defined as weak objects, but then undefined several
> times also:
> 
> 00000000 V bad_exception virtual table
> 00000000 V exception virtual table
>          U exception virtual table
>          U exception virtual table
>          U exception virtual table

Note that several different symbol names can be demangled into
``... virtual table''.  You should double check the real symbol names,
to make sure this isn't some sort of weird situation in which
different mangling is being used in different places.

nm demangles by default; the --no-demangle option turns it off.

Ian

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

* Re: undefined virtual table references in 2.12 and later
  2003-05-28 19:01 ` Ian Lance Taylor
@ 2003-05-28 19:23   ` Donald Zoch
  2003-05-28 19:27     ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: Donald Zoch @ 2003-05-28 19:23 UTC (permalink / raw)
  To: binutils, donald.zoch

> > >From what I can tell though, in my libgcc.a (I'm using gcc 2.95.3),
> > the symbols are defined as weak objects, but then undefined several
> > times also:
> > 
> > 00000000 V bad_exception virtual table
> > 00000000 V exception virtual table
> >          U exception virtual table
> >          U exception virtual table
> >          U exception virtual table
> 
> Note that several different symbol names can be demangled into
> ``... virtual table''.  You should double check the real symbol names,
> to make sure this isn't some sort of weird situation in which
> different mangling is being used in different places.
> 
> nm demangles by default; the --no-demangle option turns it off.

Thanks, but I did double check the real symbol names.  The above
symbol, exception virtual table appears mangled as __vt_9exception
both in one of the objects that it's undefined in 

libgcc.a:tinfo.o:         U exception virtual table

with --no-demangle:

libgcc.a:tinfo.o:         U __vt_9exception

and it appears as 

libgcc.a:exception.o:00000000 V exception virtual table

with --no-demangle:

libgcc.a:exception.o:00000000 V __vt_9exception


Donald
----
Donald Zoch                         5900 E. Ben White Blvd. MS 625
Advanced Micro Devices              Austin, Tx  78741
MPD Unix Systems Administrator      Phone: (512) 602-7945
donald.zoch@amd.com                 Pager: (512) 604-5401

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

* Re: undefined virtual table references in 2.12 and later
  2003-05-28 19:23   ` Donald Zoch
@ 2003-05-28 19:27     ` Ian Lance Taylor
  0 siblings, 0 replies; 5+ messages in thread
From: Ian Lance Taylor @ 2003-05-28 19:27 UTC (permalink / raw)
  To: Donald Zoch; +Cc: binutils

"Donald Zoch" <donald.zoch@amd.com> writes:

> Thanks, but I did double check the real symbol names.  The above
> symbol, exception virtual table appears mangled as __vt_9exception
> both in one of the objects that it's undefined in 
> 
> libgcc.a:tinfo.o:         U exception virtual table
> 
> with --no-demangle:
> 
> libgcc.a:tinfo.o:         U __vt_9exception
> 
> and it appears as 
> 
> libgcc.a:exception.o:00000000 V exception virtual table
> 
> with --no-demangle:
> 
> libgcc.a:exception.o:00000000 V __vt_9exception

Hmmm, from your original message:

> /u/zochd/build2/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/libgcc.a(exception.o):
> In function `__check_eh_spec':
> /u/zochd/gcc-2.95.3/build2/gcc/include/exception:15: undefined
> reference to `exception virtual table'

This error message says that exception.o has an undefined reference to
`exception virtual table'.  The above nm output says that exception.o
defines `exception virtual table' as a weak symbol.  In other words,
you are getting an undefined reference from an object which actually
defines the symbol.

I can not explain that.

Ian

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

* Re: undefined virtual table references in 2.12 and later
  2003-05-28 18:55 undefined virtual table references in 2.12 and later Donald Zoch
  2003-05-28 19:01 ` Ian Lance Taylor
@ 2003-05-28 22:01 ` H. J. Lu
  1 sibling, 0 replies; 5+ messages in thread
From: H. J. Lu @ 2003-05-28 22:01 UTC (permalink / raw)
  To: Donald Zoch; +Cc: binutils

On Wed, May 28, 2003 at 01:43:35PM -0500, Donald Zoch wrote:
> I have recently encountered a problem when trying to upgrade my
> binutils 2.11 to version 2.13.2.1.  I even tried the development
> version binutils-2.14.90.0.4.  From what I can tell, the problem
> started happening with version 2.12.   The problem is that when I
> try and link my executable, I'm getting a bunch of errors like these:
> 
> /u/zochd/build2/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/libgcc.a(exception.o):
> In function `__check_eh_spec':
> /u/zochd/gcc-2.95.3/build2/gcc/../../gcc/cp/exception.cc:307:
> undefined reference to `bad_exception type_info function'
> /u/zochd/build2/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/libgcc.a(exception.o):
> In function `__check_eh_spec':
> /u/zochd/gcc-2.95.3/build2/gcc/include/exception:15: undefined
> reference to `exception virtual table'
> /u/zochd/gcc-2.95.3/build2/gcc/include/exception:22: undefined
> reference to `bad_exception virtual table'
> 
> I sent a message a few days ago about this and someone responded, 
> saying that I should try the latest version and that it might be 
> a problem with the way GNU_VTINHERIT and GNU_VTENTRY relocs are 
> handled.
> 
> >From what I can tell though, in my libgcc.a (I'm using gcc 2.95.3),
> the symbols are defined as weak objects, but then undefined several
> times also:
> 
> 00000000 V bad_exception virtual table
> 00000000 V exception virtual table
>          U exception virtual table
>          U exception virtual table
>          U exception virtual table
> 
> I was wondering if anyone could explain to me what is happening,
> and how that I might fix it.  I'd like to understand what the 
> proper behavior should be, and what source files within binutils
> I could take a look at to try and make it behave as version 
> 2.11 did.  Is this a problem with binutils or gcc? 
> I work in an environment where we need to provide multiple versions 
> of gcc, but preferably have one version of binutils work for them all.   

Please provide a small testcase. I will look into it.


H.J.

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

end of thread, other threads:[~2003-05-28 20:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-28 18:55 undefined virtual table references in 2.12 and later Donald Zoch
2003-05-28 19:01 ` Ian Lance Taylor
2003-05-28 19:23   ` Donald Zoch
2003-05-28 19:27     ` Ian Lance Taylor
2003-05-28 22:01 ` H. J. Lu

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).