#4881 closed defect (fixed)

powerpc gas and ld warnings

Reported by: Chris Johns Owned by: Chris Johns
Priority: normal Milestone: 6.1
Component: tool/binutils Version: 6
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

The upgraded binutils generates new warnings when linking executables:

/opt/work/6/lib/gcc/powerpc-rtems6/12.2.1/../../../../powerpc-rtems6/bin/ld: warning: /opt/work/rtems/6-bsp/powerpc-rtems6/mvme2307/lib/vectors_entry.o: missing .note.GNU-stack section implies executable stack
/opt/work/6/lib/gcc/powerpc-rtems6/12.2.1/../../../../powerpc-rtems6/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/opt/work/6/lib/gcc/powerpc-rtems6/12.2.1/../../../../powerpc-rtems6/bin/ld: warning: /opt/work/chris/rtems/libbsd/rtems-libbsd.git/build/powerpc-rtems6-mvme2307-default/termios05.exe has a LOAD segment with RWX permissions
/opt/work/6/lib/gcc/powerpc-rtems6/12.2.1/../../../../powerpc-rtems6/bin/ld: warning: /opt/work/chris/rtems/libbsd/rtems-libbsd.git/build/powerpc-rtems6-mvme2307-default/termios05.exe has a LOAD segment with RWX permissions

Change History (6)

comment:1 Changed on 03/21/23 at 06:23:45 by Chris Johns

This article by Nick Clifton explains the changes in binutils-2.39:

https://www.redhat.com/en/blog/linkers-warnings-about-executable-stacks-and-segments

comment:2 Changed on 03/21/23 at 06:57:19 by Chris Johns

This diff removes the warning:

diff --git a/bsps/powerpc/shared/start/vectors_entry.S b/bsps/powerpc/shared/start/vectors_entry.S
index 07b17a48af..9140c55121 100644
--- a/bsps/powerpc/shared/start/vectors_entry.S
+++ b/bsps/powerpc/shared/start/vectors_entry.S
@@ -10,6 +10,7 @@
 #include <rtems/score/cpu.h>
 
        PUBLIC_VAR (__rtems_start)
+       .section .note.GNU-stack,"",@progbits
        .section .entry_point_section,"awx",@progbits
 /*
  * Entry point information used by bootloader code

however it moves to another object file:

/opt/work/6/lib/gcc/powerpc-rtems6/12.2.1/../../../../powerpc-rtems6/bin/ld: warning: /opt/work/6/lib/gcc/powerpc-rtems6/12.2.1/m604/ecrtn.o: missing .note.GNU-stack section implies executable stack
/opt/work/6/lib/gcc/powerpc-rtems6/12.2.1/../../../../powerpc-rtems6/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker

This time it is in the gcc build object files.

comment:3 Changed on 03/21/23 at 09:26:15 by Chris Johns

The following removes the warnings:

[powerpc/mvme2307]
LINKFLAGS = -Wl,--no-warn-execstack -Wl,--no-warn-rwx-segments

I do not know how to add these options to the LINKFLAGS in the spec files.

comment:4 Changed on 03/21/23 at 09:51:24 by Chris Johns

I will get the RSB to disable these warnings for RTEMS. This will mean we will not have to change anything and users will not see these warnings and be confused.

comment:5 Changed on 03/21/23 at 10:50:55 by Chris Johns

Owner: set to Chris Johns
Status: newassigned

comment:6 Changed on 03/21/23 at 21:55:03 by Chris Johns <chrisj@…>

Resolution: fixed
Status: assignedclosed

In f0e34ea/rtems-source-builder:

binutils: Disable stack exec and RWX section warnings

Binutils 2.39 and later enable by default warnings for executables
with executable stack and RWX sections. Disable them.

Closes #4881

Note: See TracTickets for help on using tickets.