diff options
author | George Rimar <grimar@accesssoftek.com> | 2016-08-04 08:56:17 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2016-08-04 08:56:17 +0000 |
commit | 9e5386ceae655ac104cd0f3a9233cefa20b3fa36 (patch) | |
tree | 2cbce21586dd93ced2a8c1363f8d39363013e88b /lld/ELF/LinkerScript.cpp | |
parent | b32733423f0dd5932a7a2e6dba12cd510c0c6ed7 (diff) | |
download | bcm5719-llvm-9e5386ceae655ac104cd0f3a9233cefa20b3fa36.tar.gz bcm5719-llvm-9e5386ceae655ac104cd0f3a9233cefa20b3fa36.zip |
[ELF] - Linkerscript: Fixed SORT_BY_ALIGNMENT sorting order.
According to spec:
"SORT_BY_ALIGNMENT will sort sections into descending order by
alignment before placing them in the output file"
Previously they were sorted into ascending order.
llvm-svn: 277706
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-rw-r--r-- | lld/ELF/LinkerScript.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 08d0b953d7a..6117a031be5 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -136,14 +136,14 @@ template <class ELFT> struct SectionsSorter { bool operator()(InputSectionBase<ELFT> *A, InputSectionBase<ELFT> *B) { int AlignmentCmp = A->Alignment - B->Alignment; if (Kind == SortKind::Align || (Kind == SortKind::AlignName && AlignmentCmp != 0)) - return AlignmentCmp < 0; + return AlignmentCmp > 0; int NameCmp = A->getSectionName().compare(B->getSectionName()); if (Kind == SortKind::Name || (Kind == SortKind::NameAlign && NameCmp != 0)) return NameCmp < 0; if (Kind == SortKind::NameAlign) - return AlignmentCmp < 0; + return AlignmentCmp > 0; if (Kind == SortKind::AlignName) return NameCmp < 0; |