commit d49e2d9cbce131e0ffbf72956cb9d49398517f92
parent 00a3bc1d92cadb0415f6ad637febf7f4562a029d
Author: Alexey Yerin <yyp@disroot.org>
Date: Thu, 12 Sep 2024 19:19:08 +0300
hare+libc.sc: Separate .test_array from RELRO sections
In some configurations (on FreeBSD, or on LLD <= 17), putting
.test_array between RELRO sections (for example, between .dynamic and
.got.plt) caused a linking failure.
Signed-off-by: Alexey Yerin <yyp@disroot.org>
Diffstat:
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/rt/+freebsd/hare+libc.sc b/rt/+freebsd/hare+libc.sc
@@ -4,9 +4,12 @@ SECTIONS {
KEEP(*(.init_array))
PROVIDE(__libc_init_array_end = .);
}
+} INSERT AFTER .dynamic;
+
+SECTIONS {
.test_array : {
PROVIDE(__test_array_start = .);
KEEP(*(.test_array*))
PROVIDE(__test_array_end = .);
}
-} INSERT AFTER .dynamic;
+} INSERT AFTER .bss;
diff --git a/rt/+linux/hare+libc.sc b/rt/+linux/hare+libc.sc
@@ -4,9 +4,12 @@ SECTIONS {
KEEP(*(.init_array))
PROVIDE(__libc_init_array_end = .);
}
+} INSERT AFTER .dynamic;
+
+SECTIONS {
.test_array : {
PROVIDE(__test_array_start = .);
KEEP(*(.test_array*))
PROVIDE(__test_array_end = .);
}
-} INSERT AFTER .dynamic;
+} INSERT AFTER .bss;