Skip to content

Commit

Permalink
Remove a special handling of AMDGPU entry points.
Browse files Browse the repository at this point in the history
This is the last peculiar semantics left in the linker. If you want to
always set an entry point to 0, you can pass `-e 0` to the linker.

Differential Revision: https://reviews.llvm.org/D27532

llvm-svn: 289077
  • Loading branch information
rui314 committed Dec 8, 2016
1 parent 1800956 commit 34bf867
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
10 changes: 3 additions & 7 deletions lld/ELF/Driver.cpp
Expand Up @@ -222,9 +222,6 @@ static void checkOptions(opt::InputArgList &Args) {
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");

Expand Down Expand Up @@ -772,11 +769,10 @@ template <class ELFT> void LinkerDriver::link(opt::InputArgList &Args) {
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
// Use default entry point name if no name was given via the command
// line nor linker scripts. For some reason, MIPS entry point name is
// different from others.
if (Config->Entry.empty() && !Config->Relocatable &&
Config->EMachine != EM_AMDGPU)
if (Config->Entry.empty() && !Config->Relocatable)
Config->Entry = (Config->EMachine == EM_MIPS) ? "__start" : "_start";

// Handle --trace-symbol.
Expand Down
16 changes: 0 additions & 16 deletions lld/test/ELF/amdgpu-entry.s

This file was deleted.

0 comments on commit 34bf867

Please sign in to comment.