Skip to contentSkip to conversation

or1k: add .note.GNU-stack section on linux

PATCH In review Stafford Horne 2 participants 5 messages Jan 6, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 libgcc/config/or1k/lib1funcs.S | 5 +++++
 1 file changed, 5 insertions(+)
libgcc/config/or1k/lib1funcs.S +5 -0
index 0c2ec5fc8c4..8f7266bedb9 100644
@@ -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
Signature · 1 line
2.47.0
#1 lore raw
Quoted 5 lines · Stafford Horne

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

Quoted 7 lines

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.

OK for the trunk. You've got write privs, correct?

jeff

#2 lore raw
Quoted 8 lines · Jeff Law
Quoted 5 lines · Stafford Horne

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

Quoted 8 lines
Quoted 7 lines

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.

OK for the trunk. You've got write privs, correct?

Thanks,

Yes I should still have access. Also, I would like to add to the release-14 branch. Is there anything special I need to do to add the patch there?

-Stafford

#3 lore raw
Quoted 14 lines · Stafford Horne
Quoted 13 lines · Jeff Law
Quoted 10 lines · Stafford Horne

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.

Quoted 8 lines
Quoted 3 lines
Quoted 2 lines

libgcc/
* config/or1k/lib1funcs.S: Add .note.GNU-stack section on linux.

OK for the trunk. You've got write privs, correct?

Thanks,

Yes I should still have access. Also, I would like to add to the release-14 branch. Is there anything special I need to do to add the patch there?

Nothing really special on the release branches.

jeff

#4 lore raw
Quoted 19 lines · Jeff Law
Quoted 16 lines · Stafford Horne
Quoted 15 lines · Jeff Law
Quoted 12 lines · Stafford Horne

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.

Quoted 7 lines
Quoted 6 lines
Quoted 1 line

OK for the trunk. You've got write privs, correct?

Thanks,

Yes I should still have access. Also, I would like to add to the release-14 branch. Is there anything special I need to do to add the patch there?

Nothing really special on the release branches.

Thanks, I have pushed the patch to trunk and releases/gcc-14.

-Stafford