Skip to content

Commit ea6515c

Browse files
committed
On zarch don't produce objects from assembler with a writable stack section
On z-series, the current version of the GNU toolchain produces warnings such as: ``` /usr/lib64/gcc/[...]/s390x-suse-linux/bin/ld: warning: ztrmm_kernel_RC_Z14.o: missing .note.GNU-stack section implies executable stack /usr/lib64/[...]/s390x-suse-linux/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker ``` To prevent this message and make sure we are future proof, add ``` .section .note.GNU-stack,"",@progbits ``` Also add the `.size` bit to give the asm defined functions a proper size in the symbol table. Signed-off-by: Egbert Eich <eich@suse.com>
1 parent 72f0abe commit ea6515c

File tree

6 files changed

+19
-2
lines changed

6 files changed

+19
-2
lines changed

common_zarch.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,16 @@ static inline int blas_quickdivide(blasint x, blasint y){
103103
.global REALNAME ;\
104104
.type REALNAME, %function ;\
105105
REALNAME:
106-
107106

108-
#define EPILOGUE
107+
#if defined(__ELF__) && defined(__linux__)
108+
# define GNUSTACK .section .note.GNU-stack,"",@progbits
109+
#else
110+
# define GNUSTACK
111+
#endif
112+
113+
#define EPILOGUE \
114+
.size REALNAME, .-REALNAME; \
115+
GNUSTACK
109116

110117
#define PROFCODE
111118

kernel/zarch/ctrmm4x4V.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,8 @@ ld %f10,136(%r15)
714714
ld %f11,144(%r15)
715715
ld %f12,152(%r15)
716716
br %r14
717+
718+
EPILOGUE
717719
.end
718720

719721

kernel/zarch/gemm8x4V.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,8 @@ ALIGN_2
604604
/*end*/
605605
lmg %r6,%r12,48(%r15)
606606
br %r14
607+
608+
EPILOGUE
607609
.end
608610

609611

kernel/zarch/strmm8x4V.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,8 @@ ALIGN_2
845845
lmg %r6,%r12,48(%r15)
846846
#endif
847847
br %r14
848+
849+
EPILOGUE
848850
.end
849851

850852

kernel/zarch/trmm8x4V.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,8 @@ ALIGN_2
864864
lmg %r6,%r12,48(%r15)
865865
#endif
866866
br %r14
867+
868+
EPILOGUE
867869
.end
868870

869871

kernel/zarch/ztrmm4x4V.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,8 @@ ld %f10,136(%r15)
719719
ld %f11,144(%r15)
720720
ld %f12,152(%r15)
721721
br %r14
722+
723+
EPILOGUE
722724
.end
723725

724726

0 commit comments

Comments
 (0)