bug-binutils
[Top][All Lists]
Advanced

[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

http://sourceware.org/bugzilla/show_bug.cgi?id=12942

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

int
main(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
/export/build/gnu/gcc/build-x86_64-linux/gcc/../../release/usr/gcc-4.7.0/bin/g++
-flto    -c -o a.o a.cc
/export/build/gnu/gcc/build-x86_64-linux/gcc/../../release/usr/gcc-4.7.0/bin/g++
   -c -o b.o b.cc
/export/build/gnu/gcc/build-x86_64-linux/gcc/../../release/usr/gcc-4.7.0/bin/g++
-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]