Skip to content

Instantly share code, notes, and snippets.

@rui314
Created February 12, 2016 00:06
Show Gist options
  • Save rui314/2ba27dbb8766a4f16fcb to your computer and use it in GitHub Desktop.
Save rui314/2ba27dbb8766a4f16fcb to your computer and use it in GitHub Desktop.
diff --git a/ELF/OutputSections.cpp b/ELF/OutputSections.cpp
index c941993..cefdb46 100644
--- a/ELF/OutputSections.cpp
+++ b/ELF/OutputSections.cpp
@@ -844,8 +844,8 @@ static bool compCtors(const InputSection<ELFT> *A,
assert(Y.startswith(".ctors") || Y.startswith(".dtors"));
X = X.substr(6);
Y = Y.substr(6);
- if (X.empty() || Y.empty())
- return X.empty();
+ if (X.empty() && Y.empty())
+ return false;
return X < Y;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment