summaryrefslogtreecommitdiff
path: root/system/binutils/pr25749-test-size.patch
diff options
context:
space:
mode:
Diffstat (limited to 'system/binutils/pr25749-test-size.patch')
-rw-r--r--system/binutils/pr25749-test-size.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/system/binutils/pr25749-test-size.patch b/system/binutils/pr25749-test-size.patch
new file mode 100644
index 000000000..c5d4c46d9
--- /dev/null
+++ b/system/binutils/pr25749-test-size.patch
@@ -0,0 +1,26 @@
+Loading these libraries on musl appear to be affected by ASLR.
+
+The size has the entire address loaded, and we only want the size bytes.
+
+Not reported upstream.
+
+--- binutils-2.41/ld/testsuite/ld-elf/pr25749-1b.c.old 2023-07-02 18:00:00.000000000 -0500
++++ binutils-2.41/ld/testsuite/ld-elf/pr25749-1b.c 2023-09-29 22:43:56.154343091 -0500
+@@ -5,5 +5,5 @@
+ intptr_t
+ size (void)
+ {
+- return (intptr_t) &_binary_pr25749_1_c_size;
++ return (intptr_t) &_binary_pr25749_1_c_size & 0xfff;
+ }
+--- binutils-2.41/ld/testsuite/ld-elf/pr25749-2.c.old 2023-07-02 18:00:00.000000000 -0500
++++ binutils-2.41/ld/testsuite/ld-elf/pr25749-2.c 2023-09-30 00:20:28.484403583 -0500
+@@ -6,7 +6,7 @@
+ int
+ main ()
+ {
+- if (size == 289 /* size of this file */)
++ if ((size & 0xfff) == 299 /* size of this file */)
+ printf ("PASS\n");
+ #ifdef __GLIBC_PREREQ
+ # if !__GLIBC_PREREQ (2, 28)