This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [lto][patch] Fix incorrect undefined reference


On Thu, Feb 5, 2009 at 06:20, Rafael Espindola <espindola@google.com> wrote:

>  g++ -fwhopr -shared -fPIC t.cc  -o t.so
>
> and run nm on the binary. Without the patch you will get an undefined
> references to _ZN12_GLOBAL__N_11F1GEv.YYYY.XXXX.
>
> Is it possible (and desirable) to add a test like this to the testsuite?

You could use { dg-final { scan-assembler } }.  However, in this
case the bad assembler is probably turning up in a .lto.s file,
right?  We generate random names for those.

In any case, when using GNU ld, this test case produces:

/usr/bin/ld: t.o: relocation R_X86_64_PC32 against `(anonymous
namespace)::F::G()' can not be used when making a shared object;
recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status

So, dropping it in the testsuite should give us at least some testing.

Having said that, this doesn't seem like a valid testcase, but
I'm not sure.

> 2009-02-05  Rafael Avila de Espindola  <espindola@google.com>
>
>        * tree.c (free_lang_data_in_decl): For non aliases, set TREE_PUBLIC if
>        DECL_EXTERNAL is set.
>

OK.


Diego.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]