public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: What's bringing these symbols in???
@ 2001-09-17 11:23 Benjamin Kosnik
  0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Kosnik @ 2001-09-17 11:23 UTC (permalink / raw)
  To: gcc, scherrey

> I'm writing a utility that will exist in very limited disk space (a
> boot floppy) and cannot afford to link in libstdc++. No where do I use
> iostreams in my application. I do use new & delete as well as a
> vector.

Iff you use gcc-3, you have more options. 

These include the use of -ffunction-sections, not using std::vector
and linking with libsupc++, etc. 

-benjamin




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

* Re: What's bringing these symbols in???
@ 2001-09-17 15:27 mike stump
  0 siblings, 0 replies; 3+ messages in thread
From: mike stump @ 2001-09-17 15:27 UTC (permalink / raw)
  To: gcc, scherrey

> From: Benjamin Scherrey <scherrey@innoverse.com>
> To: gcc@gcc.gnu.org
> Date: Sun, 16 Sep 2001 22:32:09 -0400

> When doing:
> gcc -Wl,-Bstatic -o wipedrive Display.o Eraser.o FileDevice.o Progress.o 
> Selection.o /usr/lib/libncurses.a /usr/local/lib/libcdk.a

> I get these linker errors:

> What is causing the reference to these symbols?

There is a utility called nm that will answer this question directly
for you.  It is part of a package called binutils.  Please consult the
documentation for nm for additional information.

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

* What's bringing these symbols in???
@ 2001-09-16 19:34 Benjamin Scherrey
  0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Scherrey @ 2001-09-16 19:34 UTC (permalink / raw)
  To: gcc

When doing:
gcc -Wl,-Bstatic -o wipedrive Display.o Eraser.o FileDevice.o Progress.o 
Selection.o /usr/lib/libncurses.a /usr/local/lib/libcdk.a

I get these linker errors:

Eraser.o: In function 
'__malloc_alloc_template<0>::gnu.linkonce.t._S_oom_malloc(unsigned int)':
Eraser.o(.__malloc_alloc_template<0>::gnu.linkonce.t._S_oom_malloc(unsigned 
int)+0x22): undefined reference to 'cerr'
Eraser.o(.__malloc_alloc_template<0>::gnu.linkonce.t._S_oom_malloc(unsigned 
int)+0x22): undefined reference to 'ostream::operator<<(char const *)'
Eraser.o(.__malloc_alloc_template<0>::gnu.linkonce.t._S_oom_malloc(unsigned 
int)+0x22): undefined reference to 'endl(ostream &)'

I'm writing a utility that will exist in very limited disk space (a boot 
floppy) and cannot afford to link in libstdc++. No where do I use iostreams 
in my application. I do use new & delete as well as a vector.

What is causing the reference to these symbols? How can I kill these linker 
requirements? Is there any way I can force the linkage with the symbols 
missing? My program will never get to these symbols unless it crashes so 
frankly I don't care if they're faked. This is driving me nuts! My program is 
700K when i include libstdc++ which is completely insane. It needs to be 
under 400K.

I'm running under gcc-2.95.2.1 with Intel Linux 2.2.19.

	thanx & later,

		Ben Scherrey

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

end of thread, other threads:[~2001-09-17 15:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-17 11:23 What's bringing these symbols in??? Benjamin Kosnik
  -- strict thread matches above, loose matches on Subject: below --
2001-09-17 15:27 mike stump
2001-09-16 19:34 Benjamin Scherrey

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