[llvm] r240562 - Object: Add XFAILed test case for r239560.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Jun 25 06:38:30 PDT 2015


It is probably more useful to check what we actually produce :-)

I am not sure I agree with "technically emit an unmangled reference",
maybe I am just misunderstanding something.

In a coff .o file each use of an imported symbol becomes a reference
to the symbol itself or to the __imp_* one depending on how it is
accessed. In particular:

* a global pointer like this one becomes a reference to the symbol and
the linker produces a thunk.
* a call to the function uses the __impl_
* references to variables always use __impl_, they cannot be used in a
global initializer in C.

(I assume this is because of some limitation on the dynamic linker).

In any case, the summary is that it is *possible* for any dllimport
symbol to be referenced with a __impl and a few symbol cannot be
referenced directly.

So it seems a perfectly valid simplification for LTO to just say that
every reference to a dllimport symbol is using the __impl_* symbol.

Cheers,
Rafael



On 24 June 2015 at 14:03, Peter Collingbourne <peter at pcc.me.uk> wrote:
> Author: pcc
> Date: Wed Jun 24 13:03:39 2015
> New Revision: 240562
>
> URL: http://llvm.org/viewvc/llvm-project?rev=240562&view=rev
> Log:
> Object: Add XFAILed test case for r239560.
>
> We ought to also emit unmangled references to dllimported functions,
> but no existing linker needs this.
>
> Added:
>     llvm/trunk/test/Object/dllimport-globalref.ll
>
> Added: llvm/trunk/test/Object/dllimport-globalref.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/dllimport-globalref.ll?rev=240562&view=auto
> ==============================================================================
> --- llvm/trunk/test/Object/dllimport-globalref.ll (added)
> +++ llvm/trunk/test/Object/dllimport-globalref.ll Wed Jun 24 13:03:39 2015
> @@ -0,0 +1,14 @@
> +; RUN: llvm-as %s -o - | llvm-nm - | FileCheck %s
> +
> +; We should technically emit an unmangled reference to f here,
> +; but no existing linker needs this.
> +
> +; XFAIL: *
> +
> +target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
> +target triple = "x86_64-pc-windows-msvc"
> +
> +; CHECK: U f
> +
> +declare dllimport void @f()
> + at fp = constant void ()* @f
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list