public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* R_PPC_LOCAL24PC c++ linking problems with current binutils
@ 1999-07-19 15:21 Franz Sirl
  1999-07-19 16:49 ` Ian Lance Taylor
  1999-07-19 19:30 ` Geoff Keating
  0 siblings, 2 replies; 9+ messages in thread
From: Franz Sirl @ 1999-07-19 15:21 UTC (permalink / raw)
  To: binutils; +Cc: drow, geoffk

Hi,

linking this little program currently fails on Linux/PPC, glibc-2.1:

mmaptest.cc:
#include <string>
class FileFd
{
public:
   int iFd;
   unsigned long Flags;
   string FileName;


   FileFd(int Fd,bool) : iFd(Fd), Flags(0) {};
   virtual ~FileFd();
};


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

The relevant code in elf32-ppc.c looks like:

        /* Relocations that need no special processing.  */
        case (int)R_PPC_LOCAL24PC:
          /* 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)
            {
              if (! (*info->callbacks->undefined_symbol) (info,
                                                          h->root.root.string,
                                                          input_bfd,
                                                          input_section,
                                                          rel->r_offset))
                return false;
              continue;
            }
          break;

We enter here with h->root.type == bfd_link_hash_defined and
sec->output_section == NULL for the symbols in question. This didn't happen
older binutils (2.9.1) and it maybe related to the following patch:

Tue Jun  2 13:51:00 1998  Geoff Keating  <geoffk@ozemail.com.au>

        * elf32-ppc.c (ppc_elf_relocate_section): The target of an
        R_PPC_LOCAL24PC relocation should be local; if not, print an error
        message instead of crashing.

I'm lost here for the moment. If I can test anything else, please let me know.

Franz.

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

end of thread, other threads:[~1999-07-20  9:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-19 15:21 R_PPC_LOCAL24PC c++ linking problems with current binutils Franz Sirl
1999-07-19 16:49 ` Ian Lance Taylor
1999-07-19 17:49   ` Daniel Jacobowitz
1999-07-19 19:56     ` Ian Lance Taylor
1999-07-19 20:07   ` Daniel Jacobowitz
1999-07-20  9:33     ` Ian Lance Taylor
1999-07-19 19:30 ` Geoff Keating
1999-07-19 20:05   ` Daniel Jacobowitz
1999-07-20  9:43   ` Ian Lance Taylor

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