Sat Nov 7 16:53:08 2015 UTC ()
Fix inconsistencies with GNU-stack note:
- always use __ELF__ && __linux, not just __ELF__ or just __linux__
- remember to pop back to the previous section where it is missing
XXX: need to file this bug with the GNU folks.


(christos)
diff -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/libgcc/config/alpha/qrnnd.S
diff -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/libgcc/config/i386/morestack.S
diff -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/libitm/config/alpha/sjlj.S
diff -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/libitm/config/arm/sjlj.S
diff -r1.1.1.2 -r1.2 src/external/gpl3/gcc/dist/libitm/config/powerpc/sjlj.S
diff -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/libitm/config/s390/sjlj.S
diff -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/libitm/config/sh/sjlj.S
diff -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/libitm/config/sparc/sjlj.S
diff -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/libitm/config/x86/sjlj.S
diff -r1.2 -r1.3 src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S

cvs diff -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/libgcc/config/alpha/qrnnd.S (expand / switch to unified diff)

--- src/external/gpl3/gcc/dist/libgcc/config/alpha/qrnnd.S 2014/03/01 08:41:46 1.1.1.1
+++ src/external/gpl3/gcc/dist/libgcc/config/alpha/qrnnd.S 2015/11/07 16:53:07 1.2
@@ -12,28 +12,29 @@ @@ -12,28 +12,29 @@
12 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 12 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 13 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 # License for more details. 14 # License for more details.
15 15
16 # Under Section 7 of GPL version 3, you are granted additional 16 # Under Section 7 of GPL version 3, you are granted additional
17 # permissions described in the GCC Runtime Library Exception, version 17 # permissions described in the GCC Runtime Library Exception, version
18 # 3.1, as published by the Free Software Foundation. 18 # 3.1, as published by the Free Software Foundation.
19 19
20 # You should have received a copy of the GNU General Public License and 20 # You should have received a copy of the GNU General Public License and
21 # a copy of the GCC Runtime Library Exception along with this program; 21 # a copy of the GCC Runtime Library Exception along with this program;
22 # see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 22 # see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 # <http://www.gnu.org/licenses/>. 23 # <http://www.gnu.org/licenses/>.
24 24
25#ifdef __ELF__ 25#if defined(__ELF__) && defined(__linux__)
26.section .note.GNU-stack,"" 26.section .note.GNU-stack,""
 27.previous
27#endif 28#endif
28 29
29 .set noreorder 30 .set noreorder
30 .set noat 31 .set noat
31 32
32 .text 33 .text
33 34
34 .globl __udiv_qrnnd 35 .globl __udiv_qrnnd
35 .ent __udiv_qrnnd 36 .ent __udiv_qrnnd
36#ifdef __VMS__ 37#ifdef __VMS__
37__udiv_qrnnd..en: 38__udiv_qrnnd..en:
38 .frame $29,0,$26,0 39 .frame $29,0,$26,0
39 .prologue 40 .prologue

cvs diff -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/libgcc/config/i386/morestack.S (expand / switch to unified diff)

--- src/external/gpl3/gcc/dist/libgcc/config/i386/morestack.S 2014/03/01 08:41:47 1.1.1.1
+++ src/external/gpl3/gcc/dist/libgcc/config/i386/morestack.S 2015/11/07 16:53:07 1.2
@@ -843,18 +843,18 @@ __morestack_make_guard: @@ -843,18 +843,18 @@ __morestack_make_guard:
843 843
844 .section .ctors.65535,"aw",@progbits 844 .section .ctors.65535,"aw",@progbits
845 845
846#ifndef __LP64__ 846#ifndef __LP64__
847 .align 4 847 .align 4
848 .long __stack_split_initialize 848 .long __stack_split_initialize
849 .long __morestack_load_mmap 849 .long __morestack_load_mmap
850#else 850#else
851 .align 8 851 .align 8
852 .quad __stack_split_initialize 852 .quad __stack_split_initialize
853 .quad __morestack_load_mmap 853 .quad __morestack_load_mmap
854#endif 854#endif
855 855
856#ifdef __ELF__ 856#if defined(__ELF__) && defined(__linux__)
857 .section .note.GNU-stack,"",@progbits 857 .section .note.GNU-stack,"",@progbits
858 .section .note.GNU-split-stack,"",@progbits 858 .section .note.GNU-split-stack,"",@progbits
859 .section .note.GNU-no-split-stack,"",@progbits 859 .section .note.GNU-no-split-stack,"",@progbits
860#endif 860#endif

cvs diff -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/libitm/config/alpha/Attic/sjlj.S (expand / switch to unified diff)

--- src/external/gpl3/gcc/dist/libitm/config/alpha/Attic/sjlj.S 2014/03/01 08:41:18 1.1.1.1
+++ src/external/gpl3/gcc/dist/libitm/config/alpha/Attic/sjlj.S 2015/11/07 16:53:08 1.2
@@ -97,16 +97,16 @@ GTM_longjmp: @@ -97,16 +97,16 @@ GTM_longjmp:
97 ldt $f4, 88($17) 97 ldt $f4, 88($17)
98 98
99 ldt $f5, 96($17) 99 ldt $f5, 96($17)
100 ldt $f6, 104($17) 100 ldt $f6, 104($17)
101 ldt $f7, 112($17) 101 ldt $f7, 112($17)
102 ldt $f8, 120($17) 102 ldt $f8, 120($17)
103 103
104 ldt $f9, 128($17) 104 ldt $f9, 128($17)
105 mov $16, $0 105 mov $16, $0
106 mov $1, $30 106 mov $1, $30
107 ret 107 ret
108.end GTM_longjmp 108.end GTM_longjmp
109 109
110#ifdef __linux__ 110#if defined(__ELF__) && defined(__linux__)
111.section .note.GNU-stack, "", @progbits 111.section .note.GNU-stack, "", @progbits
112#endif 112#endif

cvs diff -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/libitm/config/arm/Attic/sjlj.S (expand / switch to unified diff)

--- src/external/gpl3/gcc/dist/libitm/config/arm/Attic/sjlj.S 2014/03/01 08:41:18 1.1.1.1
+++ src/external/gpl3/gcc/dist/libitm/config/arm/Attic/sjlj.S 2015/11/07 16:53:08 1.2
@@ -149,16 +149,16 @@ GTM_longjmp: @@ -149,16 +149,16 @@ GTM_longjmp:
1491: 1491:
150 add r1, r1, #(14*8) /* Skip both VFP and iWMMXt blocks */ 150 add r1, r1, #(14*8) /* Skip both VFP and iWMMXt blocks */
151#ifdef __thumb2__ 151#ifdef __thumb2__
152 ldm r1, { r4-r11, ip, lr } 152 ldm r1, { r4-r11, ip, lr }
153 cfi_def_cfa(ip, 0) 153 cfi_def_cfa(ip, 0)
154 mov sp, ip 154 mov sp, ip
155 bx lr 155 bx lr
156#else 156#else
157 ldm r1, { r4-r11, sp, pc } 157 ldm r1, { r4-r11, sp, pc }
158#endif 158#endif
159 cfi_endproc 159 cfi_endproc
160 .size GTM_longjmp, . - GTM_longjmp 160 .size GTM_longjmp, . - GTM_longjmp
161 161
162#ifdef __linux__ 162#if defined(__ELF__) && defined(__linux__)
163.section .note.GNU-stack, "", %progbits 163.section .note.GNU-stack, "", %progbits
164#endif 164#endif

cvs diff -r1.1.1.2 -r1.2 src/external/gpl3/gcc/dist/libitm/config/powerpc/Attic/sjlj.S (expand / switch to unified diff)

--- src/external/gpl3/gcc/dist/libitm/config/powerpc/Attic/sjlj.S 2014/05/27 08:40:03 1.1.1.2
+++ src/external/gpl3/gcc/dist/libitm/config/powerpc/Attic/sjlj.S 2015/11/07 16:53:08 1.2
@@ -418,16 +418,16 @@ FUNC GTM_longjmp @@ -418,16 +418,16 @@ FUNC GTM_longjmp
418 ldreg r(24), 10*WS+OFS_GR(r(4)) 418 ldreg r(24), 10*WS+OFS_GR(r(4))
419 ldreg r(25), 11*WS+OFS_GR(r(4)) 419 ldreg r(25), 11*WS+OFS_GR(r(4))
420 ldreg r(26), 12*WS+OFS_GR(r(4)) 420 ldreg r(26), 12*WS+OFS_GR(r(4))
421 ldreg r(27), 13*WS+OFS_GR(r(4)) 421 ldreg r(27), 13*WS+OFS_GR(r(4))
422 ldreg r(28), 14*WS+OFS_GR(r(4)) 422 ldreg r(28), 14*WS+OFS_GR(r(4))
423 ldreg r(29), 15*WS+OFS_GR(r(4)) 423 ldreg r(29), 15*WS+OFS_GR(r(4))
424 ldreg r(30), 16*WS+OFS_GR(r(4)) 424 ldreg r(30), 16*WS+OFS_GR(r(4))
425 ldreg r(31), 17*WS+OFS_GR(r(4)) 425 ldreg r(31), 17*WS+OFS_GR(r(4))
426 mr r(1), r(6) 426 mr r(1), r(6)
427 blr 427 blr
428 cfi_endproc 428 cfi_endproc
429END GTM_longjmp 429END GTM_longjmp
430 430
431#ifdef __linux__ 431#if defined(__ELF__) && defined(__linux__)
432.section .note.GNU-stack, "", @progbits 432.section .note.GNU-stack, "", @progbits
433#endif 433#endif

cvs diff -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/libitm/config/s390/Attic/sjlj.S (expand / switch to unified diff)

--- src/external/gpl3/gcc/dist/libitm/config/s390/Attic/sjlj.S 2014/03/01 08:41:18 1.1.1.1
+++ src/external/gpl3/gcc/dist/libitm/config/s390/Attic/sjlj.S 2015/11/07 16:53:08 1.2
@@ -95,14 +95,16 @@ GTM_longjmp: @@ -95,14 +95,16 @@ GTM_longjmp:
95 ld %f15,136(%r3) 95 ld %f15,136(%r3)
96 lmg %r6,%r15,0(%r3) 96 lmg %r6,%r15,0(%r3)
97 br %r14 97 br %r14
98#else 98#else
99 ld %f4,40(%r3) 99 ld %f4,40(%r3)
100 ld %f6,48(%r3) 100 ld %f6,48(%r3)
101 lm %r6,%r15,0(%r3) 101 lm %r6,%r15,0(%r3)
102 br %r14 102 br %r14
103#endif 103#endif
104 cfi_endproc 104 cfi_endproc
105 105
106 .size GTM_longjmp, .-GTM_longjmp 106 .size GTM_longjmp, .-GTM_longjmp
107 107
 108#if defined(__ELF__) && defined(__linux__)
108 .section .note.GNU-stack, "", @progbits 109 .section .note.GNU-stack, "", @progbits
 110#endif

cvs diff -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/libitm/config/sh/Attic/sjlj.S (expand / switch to unified diff)

--- src/external/gpl3/gcc/dist/libitm/config/sh/Attic/sjlj.S 2014/03/01 08:41:18 1.1.1.1
+++ src/external/gpl3/gcc/dist/libitm/config/sh/Attic/sjlj.S 2015/11/07 16:53:08 1.2
@@ -107,16 +107,16 @@ GTM_longjmp: @@ -107,16 +107,16 @@ GTM_longjmp:
107 ldc.l @r5+, gbr 107 ldc.l @r5+, gbr
108#ifdef __SH_FPU_ANY__ 108#ifdef __SH_FPU_ANY__
109 lds.l @r5+, fpscr 109 lds.l @r5+, fpscr
110 fmov.s @r5+, fr12 110 fmov.s @r5+, fr12
111 fmov.s @r5+, fr13 111 fmov.s @r5+, fr13
112 fmov.s @r5+, fr14 112 fmov.s @r5+, fr14
113 fmov.s @r5+, fr15 113 fmov.s @r5+, fr15
114#endif 114#endif
115 rts 115 rts
116 mov r4, r0 116 mov r4, r0
117 117
118 .size GTM_longjmp, . - GTM_longjmp 118 .size GTM_longjmp, . - GTM_longjmp
119 119
120#ifdef __linux__ 120#if defined(__ELF__) && defined(__linux__)
121.section .note.GNU-stack, "", %progbits 121.section .note.GNU-stack, "", %progbits
122#endif 122#endif

cvs diff -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/libitm/config/sparc/Attic/sjlj.S (expand / switch to unified diff)

--- src/external/gpl3/gcc/dist/libitm/config/sparc/Attic/sjlj.S 2014/03/01 08:41:18 1.1.1.1
+++ src/external/gpl3/gcc/dist/libitm/config/sparc/Attic/sjlj.S 2015/11/07 16:53:08 1.2
@@ -82,16 +82,16 @@ GTM_longjmp: @@ -82,16 +82,16 @@ GTM_longjmp:
82#if STACK_BIAS 82#if STACK_BIAS
83 load [%o1 + OFFSET (JB_CFA)], %g1 83 load [%o1 + OFFSET (JB_CFA)], %g1
84 sub %g1, STACK_BIAS, %fp 84 sub %g1, STACK_BIAS, %fp
85#else 85#else
86 load [%o1 + OFFSET (JB_CFA)], %fp 86 load [%o1 + OFFSET (JB_CFA)], %fp
87#endif 87#endif
88 cfi_def_cfa(%fp, STACK_BIAS) 88 cfi_def_cfa(%fp, STACK_BIAS)
89 load [%o1 + OFFSET (JB_PC)], %o7 89 load [%o1 + OFFSET (JB_PC)], %o7
90 jmp %o7+8 90 jmp %o7+8
91 restore %g0, %o0, %o0 91 restore %g0, %o0, %o0
92 cfi_endproc 92 cfi_endproc
93 .size GTM_longjmp, . - GTM_longjmp 93 .size GTM_longjmp, . - GTM_longjmp
94 94
95#ifdef __linux__ 95#if defined(__ELF__) && defined(__linux__)
96 .section .note.GNU-stack, "", @progbits 96 .section .note.GNU-stack, "", @progbits
97#endif 97#endif

cvs diff -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/libitm/config/x86/Attic/sjlj.S (expand / switch to unified diff)

--- src/external/gpl3/gcc/dist/libitm/config/x86/Attic/sjlj.S 2014/03/01 08:41:18 1.1.1.1
+++ src/external/gpl3/gcc/dist/libitm/config/x86/Attic/sjlj.S 2015/11/07 16:53:08 1.2
@@ -132,16 +132,16 @@ SYM(GTM_longjmp): @@ -132,16 +132,16 @@ SYM(GTM_longjmp):
132 movl 16(%edx), %ebp 132 movl 16(%edx), %ebp
133 cfi_def_cfa(%edx, 0) 133 cfi_def_cfa(%edx, 0)
134 cfi_offset(%eip, 20) 134 cfi_offset(%eip, 20)
135 cfi_register(%esp, %ecx) 135 cfi_register(%esp, %ecx)
136 movl %ecx, %esp 136 movl %ecx, %esp
137 jmp *20(%edx) 137 jmp *20(%edx)
138#endif 138#endif
139 cfi_endproc 139 cfi_endproc
140 140
141 TYPE(GTM_longjmp) 141 TYPE(GTM_longjmp)
142 HIDDEN(GTM_longjmp) 142 HIDDEN(GTM_longjmp)
143 SIZE(GTM_longjmp) 143 SIZE(GTM_longjmp)
144 144
145#ifdef __linux__ 145#if defined(__ELF__) && defined(__linux__)
146.section .note.GNU-stack, "", @progbits 146.section .note.GNU-stack, "", @progbits
147#endif 147#endif

cvs diff -r1.2 -r1.3 src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S (expand / switch to unified diff)

--- src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S 2015/01/25 20:06:46 1.2
+++ src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S 2015/11/07 16:53:08 1.3
@@ -156,17 +156,17 @@ __tsan_report_race_thunk: @@ -156,17 +156,17 @@ __tsan_report_race_thunk:
156 .cfi_restore %rax 156 .cfi_restore %rax
157 .cfi_restore %rbx 157 .cfi_restore %rbx
158 .cfi_restore %rcx 158 .cfi_restore %rcx
159 .cfi_restore %rdx 159 .cfi_restore %rdx
160 .cfi_restore %rsi 160 .cfi_restore %rsi
161 .cfi_restore %rdi 161 .cfi_restore %rdi
162 .cfi_restore %r8 162 .cfi_restore %r8
163 .cfi_restore %r9 163 .cfi_restore %r9
164 .cfi_restore %r10 164 .cfi_restore %r10
165 .cfi_restore %r11 165 .cfi_restore %r11
166 ret 166 ret
167 .cfi_endproc 167 .cfi_endproc
168 168
169#ifdef __linux__ 169#if defined(__ELF__) && defined(__linux__)
170/* We do not need executable stack. */ 170/* We do not need executable stack. */
171.section .note.GNU-stack,"",@progbits 171.section .note.GNU-stack,"",@progbits
172#endif 172#endif