[Mesa-dev] [PATCH 3/7] amd/rtld: fix sorting of LDS symbols by alignment

Marek Olšák maraeo at gmail.com
Thu Jun 13 00:40:37 UTC 2019


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

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

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);
-- 
2.17.1



More information about the mesa-dev mailing list