Skip to content

Commit f90eff3

Browse files
authored
Merge pull request #5197 from e4t/z-arch-exec-stack
On zarch don't produce objects from assembler with a writable stack s…
2 parents f33943d + 61b9339 commit f90eff3

File tree

7 files changed

+22
-2
lines changed

7 files changed

+22
-2
lines changed

Diff for: common_zarch.h

+9-2
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

Diff for: cpuid.S

+3
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,6 @@ _cpuid:
6565
.subsections_via_symbols
6666

6767
#endif
68+
#if defined(__ELF__) && defined(__linux__)
69+
.section .note.GNU-stack,"",@progbits
70+
#endif

Diff for: kernel/zarch/ctrmm4x4V.S

+2
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

Diff for: kernel/zarch/gemm8x4V.S

+2
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

Diff for: kernel/zarch/strmm8x4V.S

+2
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

Diff for: kernel/zarch/trmm8x4V.S

+2
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

Diff for: kernel/zarch/ztrmm4x4V.S

+2
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)