[PATCH] D27532: Remove a special handling of AMDGPU entry points.
Rafael Avila de Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 7 18:38:36 PST 2016
LGTM.
The unix linker is normally used via a compiler (clang/gcc) and that
already has a lot of target specific information, so it can pass -e if
needed.
Cheers,
Rafael
Rui Ueyama via Phabricator via llvm-commits
<llvm-commits at lists.llvm.org> writes:
> ruiu created this revision.
> ruiu added a reviewer: tstellarAMD.
> ruiu added a subscriber: llvm-commits.
> Herald added subscribers: tony-tye, yaxunl, wdng, kzhuravl.
>
> This is the last peculiar semantics left in the linker, and I'd
> like to remove it to streamline it. If you want to always set an
> entry point to 0, you can pass `-e 0` to the linker. I think
> doing it explicitly is much better rather than having special
> code for AMDGPU in the linker.
>
>
> https://reviews.llvm.org/D27532
>
> Files:
> ELF/Driver.cpp
>
>
> Index: ELF/Driver.cpp
> ===================================================================
> --- ELF/Driver.cpp
> +++ ELF/Driver.cpp
> @@ -222,9 +222,6 @@
> if (Config->EMachine == EM_MIPS && Config->GnuHash)
> error("the .gnu.hash section is not compatible with the MIPS target.");
>
> - if (Config->EMachine == EM_AMDGPU && !Config->Entry.empty())
> - error("-e option is not valid for AMDGPU.");
> -
> if (Config->Pie && Config->Shared)
> error("-shared and -pie may not be used together");
>
> @@ -764,11 +761,9 @@
> if (Config->OutputFile.empty())
> Config->OutputFile = "a.out";
>
> - // Use default entry point name if -e was missing. AMDGPU binaries
> - // have no entries. For some reason, MIPS' entry point name is
> - // different from others.
> - if (Config->Entry.empty() && !Config->Relocatable &&
> - Config->EMachine != EM_AMDGPU)
> + // Use default entry point name if -e was missing.
> + // For some reason, MIPS' entry point name is different from others.
> + if (Config->Entry.empty() && !Config->Relocatable)
> Config->Entry = (Config->EMachine == EM_MIPS) ? "__start" : "_start";
>
> // Handle --trace-symbol.
>
>
> Index: ELF/Driver.cpp
> ===================================================================
> --- ELF/Driver.cpp
> +++ ELF/Driver.cpp
> @@ -222,9 +222,6 @@
> if (Config->EMachine == EM_MIPS && Config->GnuHash)
> error("the .gnu.hash section is not compatible with the MIPS target.");
>
> - if (Config->EMachine == EM_AMDGPU && !Config->Entry.empty())
> - error("-e option is not valid for AMDGPU.");
> -
> if (Config->Pie && Config->Shared)
> error("-shared and -pie may not be used together");
>
> @@ -764,11 +761,9 @@
> if (Config->OutputFile.empty())
> Config->OutputFile = "a.out";
>
> - // Use default entry point name if -e was missing. AMDGPU binaries
> - // have no entries. For some reason, MIPS' entry point name is
> - // different from others.
> - if (Config->Entry.empty() && !Config->Relocatable &&
> - Config->EMachine != EM_AMDGPU)
> + // Use default entry point name if -e was missing.
> + // For some reason, MIPS' entry point name is different from others.
> + if (Config->Entry.empty() && !Config->Relocatable)
> Config->Entry = (Config->EMachine == EM_MIPS) ? "__start" : "_start";
>
> // Handle --trace-symbol.
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list