summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCallum Farmer <gmbr3@opensuse.org>2023-04-28 20:22:05 +0100
committerCallum Farmer <gmbr3@opensuse.org>2023-05-04 14:29:47 +0100
commitb3cc412aadc6448c62224013ce122b5449e67ec3 (patch)
tree4fb80aa079f13831dd95b42087e75b1199ced9cd
parente2aa099738e1bd527929b5fb6fe7312962b6b4e4 (diff)
downloadgnu-efi-b3cc412aadc6448c62224013ce122b5449e67ec3.tar.gz
entry.c: .ctors is run backwards
Store forwards, run backwards (65535 to 0) Ref: https://github.com/bminor/binutils-gdb/blob/5a8e7e1332c35d4d5bed67adccd9d66f5cf62c4e/ld/scripttempl/elf.sc#L310 Ref: https://sourceware.org/binutils/docs/ld/Input-Section-Wildcards.html Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
-rw-r--r--lib/entry.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/entry.c b/lib/entry.c
index d852608..21bf0e6 100644
--- a/lib/entry.c
+++ b/lib/entry.c
@@ -28,7 +28,7 @@ static void ctors(void)
func();
}
- for (funcp *location = (void *)&__CTOR_LIST__; location < (funcp *)&__CTOR_END__; location++) {
+ for (funcp *location = (void *)&__CTOR_END__; location > (funcp *)&__CTOR_LIST__; location--) {
funcp func = *location;
if (location != NULL)
func();