new file mode 100644
@@ -0,0 +1,35 @@
+Subject: [PATCH] libgcc: aarch64: keep outline atomics hidden after Darwin ENTRY conversion
+
+0101 replaces lse.S's local STARTFN macro (which emitted HIDDEN(\name)) with
+the generic ENTRY macro, which has no HIDDEN. Every __aarch64_{cas,swp,ld*}
+helper in libgcc.a thus becomes default-visibility. Mark them hidden again.
+HIDDEN is .hidden on ELF and .private_extern on Mach-O.
+
+Upstream-Status: Inappropriate [fixes a downstream Darwin backport]
+---
+--- a/libgcc/config/aarch64/lse.S
++++ b/libgcc/config/aarch64/lse.S
+@@ -186,6 +186,7 @@
+
+ #ifdef L_cas
+
++ HIDDEN (ASMNAME (NAME(cas)))
+ ENTRY (ASMNAME (NAME(cas)))
+ JUMP_IF_NOT_LSE 8f
+
+@@ -249,6 +250,7 @@
+ # define SWP .inst 0x38208020 + B + N
+ #endif
+
++ HIDDEN (ASMNAME (NAME (swp)))
+ ENTRY (ASMNAME (NAME (swp)))
+ JUMP_IF_NOT_LSE 8f
+
+@@ -293,6 +295,7 @@
+ # define LDOP .inst 0x38200020 + OPN + B + N
+ #endif
+
++ HIDDEN (ASMNAME (NAME (LDNM)))
+ ENTRY (ASMNAME (NAME (LDNM)))
+ JUMP_IF_NOT_LSE 8f
+
@@ -25,6 +25,13 @@ SRC_URI:append = " \
file://0103-libgcc-i386-cpuinfo-avoid-darwin-alias-ice.patch \
"
+# 0101 replaces lse.S's STARTFN (which emitted HIDDEN) with the generic ENTRY
+# macro, which does not; this restores hidden visibility of the outline-atomic
+# helpers, which would otherwise leak out of every shared library using them.
+SRC_URI:append = " \
+ file://0104-libgcc-aarch64-keep-outline-atomics-hidden.patch \
+"
+
# gcc-15.3.0 tarball ships zlib/zlib.map with CRLF; 0101 tail hunk is LF-only.
python do_patch:prepend() {
import pathlib