Browse Source

entry.c: fini_array is run backwards

fini_array is 65535 to 0 but stored 0 to 65535

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
Callum Farmer 1 year ago
parent
commit
4c6962457f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/entry.c

+ 1 - 1
lib/entry.c

@@ -43,7 +43,7 @@ static void dtors(void)
 			func();
 	}
 
-	for (funcp *location = (void *)&__fini_array_start; location < (funcp *)&__fini_array_end; location++) {
+	for (funcp *location = (void *)&__fini_array_end; location > (funcp *)&__fini_array_start; location--) {
 		funcp func = *location;
 		if (*location != NULL)
 			func();