[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/12942] Plugin not handling correctly resolution of COMDATs.

From: hjl.tools at gmail dot com
Subject: [Bug ld/12942] Plugin not handling correctly resolution of COMDATs.
Date: Tue, 28 Jun 2011 17:30:05 +0000


H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
             Status|WAITING                     |NEW
                 CC|                            |amodra at gmail dot com
            Version|unspecified                 |2.22 (HEAD)

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> 2011-06-28 17:29:31 
UTC ---
Here is the real testcase:

address@hidden pr12942]$ cat a.h 
extern void link_error ();

inline int test (void)
  int exp = -1;
  if ((exp < 2 ? 2U : (unsigned int) exp) != 2)
    link_error ();

  return 0;

typedef int (*test_t) (void);
address@hidden pr12942]$ cat a.cc
#include "a.h"
extern "C" void abort ();

test_t b(void);

  if (test != b ())
    abort ();
address@hidden pr12942]$ cat b.cc
#include <stdio.h>
#include "a.h"

test_t b(void)
  return test;
address@hidden pr12942]$ make
-flto    -c -o a.o a.cc
   -c -o b.o b.cc
-O2 -flto -fuse-linker-plugin -B./ -o x a.o b.o
b.o: In function `test()':
b.cc:(.text._Z4testv[test()]+0x16): undefined reference to `link_error()'
collect2: error: ld returned 1 exit status
make: *** [x] Error 1
address@hidden pr12942]$ 

Gold works fine.  The problem is BFD linker failed to pick the
correct definition.

Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]