MIPS: add .note.GNU-stack section to assembly sources (#872)
authorIcenowy Zheng <uwu@icenowy.me>
Fri, 13 Dec 2024 10:36:02 +0000 (18:36 +0800)
committerGitHub <noreply@github.com>
Fri, 13 Dec 2024 10:36:02 +0000 (05:36 -0500)
To build ELF shared libraries that do not require executable stack on
MIPS, every object file linked should have a .note.GNU-stack section,
otherwise the linker defaults to executable stack.

As libffi shouldn't require executable stack, add the .note.GNU-stack
section to the assembly source files under src/mips, like other
architectures.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
src/mips/n32.S
src/mips/o32.S

index df58e800ade4a9ac228ecb5c9a0fbd12c393b4e2..08cbb956667e3686fefa19a3e477fabb25554f38 100644 (file)
@@ -821,3 +821,7 @@ cls_epilogue:
 #endif /* __GNUC__ */  
        
 #endif
+
+#if defined __ELF__ && defined __linux__
+       .section .note.GNU-stack,"",%progbits
+#endif
index 78517beb1c5d01fb7fc8bbde56f73ae07db78373..03ceed5dc4524cd1ee0529f43d7e11ccf83ba55d 100644 (file)
@@ -559,3 +559,7 @@ $LASFDE2:
 $LEFDE2:
 
 #endif
+
+#if defined __ELF__ && defined __linux__
+       .section .note.GNU-stack,"",%progbits
+#endif