public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Steven T. Hatton" <hattons@globalsymmetry.com>
To: gcc@gcc.gnu.org
Subject: Re: Fwd: Linking public: static const members in lib*.a's
Date: Fri, 10 Sep 2004 18:12:00 -0000	[thread overview]
Message-ID: <200409101353.30041.hattons@globalsymmetry.com> (raw)
In-Reply-To: <200409100639.52561.hattons@globalsymmetry.com>

On Friday 10 September 2004 06:39, Steven T. Hatton wrote:

It was suggested that I run nm -C on my libraries.  That revealed that 
sth::util::RgbColor::RED was undefined in the ColorTest.o. I added the 
library containing RgbColor.o with -l and its path with -L.  That enabled the 
linker to find what it needed.  

I guess this means that a lib*.a isn't "cumulative" in that it only references 
names in the libraries linked into it. Where can I learn more about what 
things such as this stuff from the nm man page?

           "A" The symbol's value is absolute, and  will  not  be
               changed by further linking.

           "B" The  symbol  is  in the uninitialized data section
               (known as BSS).

           "C" The symbol is common.  Common symbols  are  unini­
               tialized data.  When linking, multiple common sym­
               bols may appear with the same name.  If the symbol
               is   defined  anywhere,  the  common  symbols  are
               treated as undefined references.

This is the nm stuff that gave me the clue I needed.

RgbColor.o:
000001d4 t global constructors keyed to _ZN3sth4util8RgbColorC2ERKhS3_S3_
0000011a t __static_initialization_and_destruction_0(int, int)
00000000 W sth::util::Printable_IF::Printable_IF()
00000000 W sth::util::Printable_IF::~Printable_IF()
00000000 W sth::util::Printable_IF::~Printable_IF()
00000000 W sth::util::Printable_IF::~Printable_IF()
00000000 B sth::util::RgbColor::RED
00000040 T sth::util::RgbColor::RgbColor(unsigned char const&, unsigned char 
const&, unsigned char const&)
00000000 T sth::util::RgbColor::RgbColor(unsigned char const&, unsigned char 
const&, unsigned char const&)
00000000 W sth::util::RgbColor::~RgbColor()
00000000 W sth::util::RgbColor::~RgbColor()
00000080 T sth::util::RgbColor::print(std::basic_ostream<char, 
std::char_traits<char> >&) const
         U std::basic_ostream<char, std::char_traits<char> >::operator<<(int)
00000000 V std::basic_streambuf<char, std::char_traits<char> >::_S_pback_size
00000000 V std::basic_streambuf<wchar_t, std::char_traits<wchar_t> 
>::_S_pback_size
         U std::ios_base::Init::Init()
         U std::ios_base::Init::~Init()
00000008 b std::__ioinit
         U std::basic_ostream<char, std::char_traits<char> >& std::operator<< 
<std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, 
char const*)
00000000 V typeinfo for sth::util::Printable_IF
00000000 V typeinfo for sth::util::RgbColor
00000000 V typeinfo name for sth::util::Printable_IF
00000000 V typeinfo name for sth::util::RgbColor
         U vtable for __cxxabiv1::__class_type_info
         U vtable for __cxxabiv1::__si_class_type_info
00000000 V vtable for sth::util::Printable_IF
00000000 V vtable for sth::util::RgbColor
         U operator delete(void*)
         U __cxa_atexit
         U __cxa_pure_virtual
         U __dso_handle
         U __gxx_personality_v0
000001a4 t __tcf_0
000001bc t __tcf_1


ColorTest.o:
0000012e t global constructors keyed to _ZN3sth9ColorTestC2ERSo
         U _Unwind_Resume
000000d8 t __static_initialization_and_destruction_0(int, int)
00000000 W sth::util::Printable_IF::Printable_IF(sth::util::Printable_IF 
const&)
00000000 W sth::util::Printable_IF::~Printable_IF()
00000000 W sth::util::Printable_IF::~Printable_IF()
00000000 W sth::util::Printable_IF::~Printable_IF()
         U sth::util::RgbColor::RED
00000000 W sth::util::RgbColor::RgbColor(sth::util::RgbColor const&)
00000000 W sth::util::RgbColor::~RgbColor()
00000000 W sth::util::operator<<(std::basic_ostream<char, 
std::char_traits<char> >&, sth::util::Printable_IF const&)
00000066 T sth::ColorTest::ColorTest(std::basic_ostream<char, 
std::char_traits<char> >&)
00000000 T sth::ColorTest::ColorTest(std::basic_ostream<char, 
std::char_traits<char> >&)
000000d2 T sth::ColorTest::~ColorTest()
000000cc T sth::ColorTest::~ColorTest()
00000000 V std::basic_streambuf<char, std::char_traits<char> >::_S_pback_size
00000000 V std::basic_streambuf<wchar_t, std::char_traits<wchar_t> 
>::_S_pback_size
         U std::ios_base::Init::Init()
         U std::ios_base::Init::~Init()
00000000 b std::__ioinit
00000000 V typeinfo for sth::util::Printable_IF
00000000 V typeinfo name for sth::util::Printable_IF
         U vtable for __cxxabiv1::__class_type_info
00000000 V vtable for sth::util::Printable_IF
         U vtable for sth::util::RgbColor
         U operator delete(void*)
         U __cxa_atexit
         U __cxa_pure_virtual
         U __dso_handle
         U __gxx_personality_v0
00000116 t __tcf_0

-- 
Regards,
Steven

      reply	other threads:[~2004-09-10 17:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-10  7:29 Steven T. Hatton
2004-09-10  9:21 ` Florian Weimer
2004-09-10 10:40   ` Steven T. Hatton
2004-09-10 11:39     ` Steven T. Hatton
2004-09-10 18:12       ` Steven T. Hatton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200409101353.30041.hattons@globalsymmetry.com \
    --to=hattons@globalsymmetry.com \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).