This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [lto][patch] Fix incorrect undefined reference
- From: Diego Novillo <dnovillo at google dot com>
- To: Rafael Espindola <espindola at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 5 Feb 2009 08:11:05 -0500
- Subject: Re: [lto][patch] Fix incorrect undefined reference
- References: <38a0d8450902050320v73ce0051mbb48557df9f2b71@mail.gmail.com>
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.