[3/7] amd/rtld: fix sorting of LDS symbols by alignment

Submitted by Marek Olšák on June 13, 2019, 12:40 a.m.

Details

Message ID 20190613004041.32721-3-maraeo@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Marek Olšák June 13, 2019, 12:40 a.m.
From: Nicolai Hähnle <nicolai.haehnle@amd.com>

---
 src/amd/common/ac_rtld.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/amd/common/ac_rtld.c b/src/amd/common/ac_rtld.c
index dc9cc04705b..92020c5f0dd 100644
--- a/src/amd/common/ac_rtld.c
+++ b/src/amd/common/ac_rtld.c
@@ -123,23 +123,23 @@  static const struct ac_rtld_symbol *find_symbol(const struct util_dynarray *symb
 			return symbol;
 	}
 	return 0;
 }
 
 static int compare_symbol_by_align(const void *lhsp, const void *rhsp)
 {
 	const struct ac_rtld_symbol *lhs = lhsp;
 	const struct ac_rtld_symbol *rhs = rhsp;
 	if (rhs->align > lhs->align)
-		return -1;
-	if (rhs->align < lhs->align)
 		return 1;
+	if (rhs->align < lhs->align)
+		return -1;
 	return 0;
 }
 
 /**
  * Sort the given symbol list by decreasing alignment and assign offsets.
  */
 static bool layout_symbols(struct ac_rtld_symbol *symbols, unsigned num_symbols,
 			   uint64_t *ptotal_size)
 {
 	qsort(symbols, num_symbols, sizeof(*symbols), compare_symbol_by_align);