[PATCH] D27532: Remove a special handling of AMDGPU entry points.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 11:33:54 PST 2016


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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27532.80632.patch
Type: text/x-patch
Size: 1133 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161207/f00d5933/attachment.bin>


More information about the llvm-commits mailing list