R_PPC_LOCAL24PC c++ linking problems with current binutils
Ian Lance Taylor
ian@zembu.com
Mon Jul 19 16:49:00 GMT 1999
From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
Date: Tue, 20 Jul 1999 00:07:53 +0200
Compiling with c++ -o mmaptest.so -fPIC -shared mmaptest.cc gives:
mmaptest.o: In function `__default_alloc_template<true, 0>::_S_chunk_alloc(unsigned int, int &)':
mmaptest.o(.__default_alloc_template<true, 0>::gnu.linkonce.t._S_chunk_alloc(unsigned int, int &)+0x234): undefined reference to `__default_alloc_template<true, 0>::_S_chunk_alloc(unsigned int, int &)'
mmaptest.o(.__default_alloc_template<true, 0>::gnu.linkonce.t._S_chunk_alloc(unsigned int, int &)+0x2a8): undefined reference to `__default_alloc_template<true, 0>::_S_chunk_alloc(unsigned int, int &)'
collect2: ld returned 1 exit status
/* It makes no sense to point a local relocation
at a symbol not in this object. */
if (h != NULL
&& (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
&& sec->output_section == NULL)
I think the last is the wrong test. sec->output_section will be NULL
for a linkonce section which is being discarded. More appropriate
would be a test whether ELF_LINK_HASH_DEF_REGULAR is set in
h->elf_link_hash_flags.
Ian
More information about the Binutils
mailing list