https://gcc.gnu.org/g:f690bd46da8d6b92d3d3eb8a276b2e35b9f6034b

commit r14-11131-gf690bd46da8d6b92d3d3eb8a276b2e35b9f6034b
Author: Stafford Horne <sho...@gmail.com>
Date:   Mon Jan 6 12:12:40 2025 +0000

    or1k: add .note.GNU-stack section on linux
    
    In the OpenRISC build we get the following warning:
    
        ld: warning: __modsi3_s.o: missing .note.GNU-stack section implies 
executable stack
        ld: NOTE: This behaviour is deprecated and will be removed in a future 
version of the linker
    
    Fix this by adding a .note.GNU-stack to indicate the stack does not need to 
be
    executable for the lib1funcs.
    
    Note, this is also needed for the upcoming glibc 2.41.
    
    libgcc/
            * config/or1k/lib1funcs.S: Add .note.GNU-stack section on linux.

Diff:
---
 libgcc/config/or1k/lib1funcs.S | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libgcc/config/or1k/lib1funcs.S b/libgcc/config/or1k/lib1funcs.S
index 0c2ec5fc8c44..8f7266bedb96 100644
--- a/libgcc/config/or1k/lib1funcs.S
+++ b/libgcc/config/or1k/lib1funcs.S
@@ -19,6 +19,11 @@ a copy of the GCC Runtime Library Exception along with this 
program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+/* An executable stack is *not* required for these functions.  */
+#ifdef __linux__
+.section .note.GNU-stack,"",%progbits
+.previous
+#endif
 
 #ifdef L__mulsi3
        .balign 4

Reply via email to