On Tue, Sep 03, 2002 at 07:20:19AM +0200, Martin v. Loewis wrote: > Joel Baker <lucifer@lightbearer.com> writes: > > > I believe they're from the dynamic linker (ld.elf_so), in this case. > > That would indicate that the dynamic linker does not know what .hidden > symbols are, which is a problem on its own. If true, yes. Don't trust me to be right about that. See my other message. > > > We have to consider __dso_handle and __cxa_atexit separately. For > > > __dso_handle, can you tell whether HAVE_GAS_HIDDEN is defined? > > > > root@thenet:/tmp/Build/gcc-3.2-HOLD/gcc-3.2-3.2ds0/src# find . -type f | xargs grep HAVE_GAS_HIDDEN > > ... > > ./gcc/config/cris/cris.h:#define HAVE_GAS_HIDDEN 1 > > > > (All of the others are .in files for autoconf, ChangeLog entries, or > > #ifdef macros in various .c files) > > Correct - and this is how they would be defined for your system: > configure runs, determines whether or not your assembler supports > hidden symbols, and then writes that information into gcc/auto-host.h > of the build directory. Thus, looking at the sources won't help that > much (I could have done that myself). In a previous reply... it appears to have been defined in the build area. Sorry about the confusion, it's been a while since I've prodded at GCC's build setup or tracked things down in it. > > I will note that the __dso_handle references go away if __cxa_atexit is not > > enabled. > > Correct - __dso_handle is only used together with __cxa_atexit. So if > you decide not to use __cxa_atexit, you don't need to worry about > __dso_handle. If you get a definition for __cxa_atexit, you'll have to > come back and study the issue of .hidden symbols. Indeed. > > grep -i cxa /usr/src/lib/libc/stdlib/atexit.* returns nothing; I'm not sure > > where else I would look, but that's not promising. > > That might well be the case - so far, only Linux provides that > function, and perhaps HP-UX. Noted. > > I can file a feature > > request on it, but it won't show up in the stable tree until at least 1.6++ > > (1.6 is at RC3 right now). Is there a simple spec, URL, or similar that I > > can point at when filing the request? > > It's in the C++ ABI, at > > http://www.codesourcery.com/cxx-abi/abi.html#dso-dtor Thank you kindly. I'll see what I can do about getting this. > > Is this something that can be autoconfed or otherwise detected? > > This is tricky. You can try to come up with a test, but you need to test: > > - whether as/ld support .hidden symbols, > - whether the dynamic linker correctly implements them, > - whether the C library provides __cxa_atexit and __cxa_finalize. > > In gcc, since this is information about the target system (for which > you can't run programs), such information is usually hard-coded in the > machine descriptions. > > For __cxa_atexit, it used to be the case that end-users would need to > add -fuse-cxa-atexit at g++ invocation time. The configure option was > added only recently, and nobody has attempted to provide per-target > defaults. Ouch. I see why it's usually hardcoded, yes. Maybe (until GCC gets the defaults in place, or NetBSD gets cxa_atexit) the rules.defs file is the best answer. Ugly, but vastly more easily accomplished than the other two options in the short term. -- *************************************************************************** Joel Baker System Administrator - lightbearer.com lucifer@lightbearer.com http://users.lightbearer.com/lucifer/
Attachment:
pgpIVmPvjonfo.pgp
Description: PGP signature