[PATCH] D39625: Attribute nonlazybind should not affect calls to functions with hidden visibility

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 6 12:43:42 PST 2017


Sriraman Tallam via Phabricator <reviews at reviews.llvm.org> writes:
> Index: test/CodeGen/X86/no-plt.ll
> ===================================================================
> --- test/CodeGen/X86/no-plt.ll
> +++ test/CodeGen/X86/no-plt.ll
> @@ -6,18 +6,25 @@
>  define i32 @main() #0 {
>  ; X64: callq *_Z3foov at GOTPCREL(%rip)
>  ; X64: callq _Z3barv
> +; X64: callq _Z3bazv

Nit: why use mangled names on a IR testcase?

> Index: lib/Target/TargetMachine.cpp
> ===================================================================
> --- lib/Target/TargetMachine.cpp
> +++ lib/Target/TargetMachine.cpp
> @@ -167,6 +167,12 @@
>      if (GV && !GV->isDeclarationForLinker())
>        return true;
>  
> +    // A potentially external function marked as "nonlazybind" should be
> +    // accessed via the GOT.

I would expand this a bit. How about:

A symbol marked nonlazybind should not be accessed with a plt. If the
symbol turns out to be external, the linker will convert a direct access
to an access via the plt, so don't assume it is local.

LGTM with that.

Cheers,
Rafael


More information about the llvm-commits mailing list