[lld] r303378 - Set IMAGE_DLL_CHARACTERISTICS_NO_BIND.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 13 10:14:03 PDT 2017
We probably want to revert this patch now that r303374 is reverted.
Peter
On Thu, May 18, 2017 at 1:26 PM, Rui Ueyama via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> Author: ruiu
> Date: Thu May 18 15:26:58 2017
> New Revision: 303378
>
> URL: http://llvm.org/viewvc/llvm-project?rev=303378&view=rev
> Log:
> Set IMAGE_DLL_CHARACTERISTICS_NO_BIND.
>
> Our output is not compatible with the Binding feature, so make it
> explicit that.
>
> Differential Revision: https://reviews.llvm.org/D33336
>
> Modified:
> lld/trunk/COFF/Config.h
> lld/trunk/COFF/Driver.cpp
> lld/trunk/COFF/Writer.cpp
> lld/trunk/test/COFF/hello32.test
> lld/trunk/test/COFF/options.test
>
> Modified: lld/trunk/COFF/Config.h
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Config.
> h?rev=303378&r1=303377&r2=303378&view=diff
> ============================================================
> ==================
> --- lld/trunk/COFF/Config.h (original)
> +++ lld/trunk/COFF/Config.h Thu May 18 15:26:58 2017
> @@ -155,7 +155,6 @@ struct Configuration {
> uint32_t MajorOSVersion = 6;
> uint32_t MinorOSVersion = 0;
> bool DynamicBase = true;
> - bool AllowBind = true;
> bool NxCompat = true;
> bool AllowIsolation = true;
> bool TerminalServerAware = true;
>
> Modified: lld/trunk/COFF/Driver.cpp
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.
> cpp?rev=303378&r1=303377&r2=303378&view=diff
> ============================================================
> ==================
> --- lld/trunk/COFF/Driver.cpp (original)
> +++ lld/trunk/COFF/Driver.cpp Thu May 18 15:26:58 2017
> @@ -820,8 +820,6 @@ void LinkerDriver::link(ArrayRef<const c
> Config->ManifestInput.push_back(Arg->getValue());
>
> // Handle miscellaneous boolean flags.
> - if (Args.hasArg(OPT_allowbind_no))
> - Config->AllowBind = false;
> if (Args.hasArg(OPT_allowisolation_no))
> Config->AllowIsolation = false;
> if (Args.hasArg(OPT_dynamicbase_no))
>
> Modified: lld/trunk/COFF/Writer.cpp
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Writer.
> cpp?rev=303378&r1=303377&r2=303378&view=diff
> ============================================================
> ==================
> --- lld/trunk/COFF/Writer.cpp (original)
> +++ lld/trunk/COFF/Writer.cpp Thu May 18 15:26:58 2017
> @@ -615,14 +615,19 @@ template <typename PEHeaderTy> void Writ
> PE->SizeOfStackCommit = Config->StackCommit;
> PE->SizeOfHeapReserve = Config->HeapReserve;
> PE->SizeOfHeapCommit = Config->HeapCommit;
> +
> + // Import Descriptor Tables and Import Address Tables are merged
> + // in our output. That's not compatible with the Binding feature
> + // that is sort of prelinking. Setting this flag to make it clear
> + // that our outputs are not for the Binding.
> + PE->DLLCharacteristics = IMAGE_DLL_CHARACTERISTICS_NO_BIND;
> +
> if (Config->AppContainer)
> PE->DLLCharacteristics |= IMAGE_DLL_CHARACTERISTICS_APPCONTAINER;
> if (Config->DynamicBase)
> PE->DLLCharacteristics |= IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE;
> if (Config->HighEntropyVA)
> PE->DLLCharacteristics |= IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA;
> - if (!Config->AllowBind)
> - PE->DLLCharacteristics |= IMAGE_DLL_CHARACTERISTICS_NO_BIND;
> if (Config->NxCompat)
> PE->DLLCharacteristics |= IMAGE_DLL_CHARACTERISTICS_NX_COMPAT;
> if (!Config->AllowIsolation)
>
> Modified: lld/trunk/test/COFF/hello32.test
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/
> hello32.test?rev=303378&r1=303377&r2=303378&view=diff
> ============================================================
> ==================
> --- lld/trunk/test/COFF/hello32.test (original)
> +++ lld/trunk/test/COFF/hello32.test Thu May 18 15:26:58 2017
> @@ -41,9 +41,10 @@ HEADER-NEXT: MinorSubsystemVersion: 0
> HEADER-NEXT: SizeOfImage: 16896
> HEADER-NEXT: SizeOfHeaders: 512
> HEADER-NEXT: Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI (0x3)
> -HEADER-NEXT: Characteristics [ (0x9140)
> +HEADER-NEXT: Characteristics [ (0x9940)
> HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_APPCONTAINER (0x1000)
> HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE (0x40)
> +HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_NO_BIND (0x800)
> HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_NX_COMPAT (0x100)
> HEADER-NEXT: IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE (0x8000)
> HEADER-NEXT: ]
>
> Modified: lld/trunk/test/COFF/options.test
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/
> options.test?rev=303378&r1=303377&r2=303378&view=diff
> ============================================================
> ==================
> --- lld/trunk/test/COFF/options.test (original)
> +++ lld/trunk/test/COFF/options.test Thu May 18 15:26:58 2017
> @@ -2,13 +2,7 @@
>
> # RUN: lld-link /out:%t.exe /entry:main %t.obj
> # RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=BIND %s
> -# RUN: lld-link /allowbind /out:%t.exe /entry:main %t.obj
> -# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=BIND %s
> -BIND-NOT: IMAGE_DLL_CHARACTERISTICS_NO_BIND
> -
> -# RUN: lld-link /allowbind:no /out:%t.exe /entry:main %t.obj
> -# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=NOBIND
> %s
> -NOBIND: IMAGE_DLL_CHARACTERISTICS_NO_BIND
> +BIND: IMAGE_DLL_CHARACTERISTICS_NO_BIND
>
> # RUN: lld-link /out:%t.exe /entry:main %t.obj
> # RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=ISO %s
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
--
--
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170913/662a3f32/attachment.html>
More information about the llvm-commits
mailing list