Skip to content

Commit 109faef

Browse files
Lukasaweissi
authored andcommitted
Use .note.GNU-stack section in ASM. (#137)
Motivation: Well-formed Linux assembly code declares a .note.GNU-stack section in order to help out the linker. When absent, the linker makes some suboptimal linking decisions that can cause pain in running programs. Modifications: - Amend the vendoring script to add the .note.GNU-stack section to all assembly files on Linux. - Updated BoringSSL Results: Better linker behaviour.
1 parent 71aa686 commit 109faef

149 files changed

Lines changed: 4442 additions & 1075 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import PackageDescription
2222
// Sources/CNIOBoringSSL directory. The source repository is at
2323
// https://boringssl.googlesource.com/boringssl.
2424
//
25-
// BoringSSL Commit: 9806ae005b3085683a2fcf2953e4170893e0973d
25+
// BoringSSL Commit: 6e7255c17e1a7348a2377fbc804441dd284806e2
2626

2727
let package = Package(
2828
name: "swift-nio-ssl",

Sources/CNIOBoringSSL/crypto/asn1/tasn_enc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
192192
/* Use indefinite length constructed if requested */
193193
if (aclass & ASN1_TFLG_NDEF)
194194
ndef = 2;
195-
/* fall through */
195+
OPENSSL_FALLTHROUGH;
196196

197197
case ASN1_ITYPE_SEQUENCE:
198198
i = asn1_enc_restore(&seqcontlen, out, pval, it);

Sources/CNIOBoringSSL/crypto/chacha/chacha-armv4.ios.arm.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,3 +1499,7 @@ OPENSSL_armcap_P:
14991499
#endif
15001500
#endif // !OPENSSL_NO_ASM
15011501
#endif // defined(__arm__) && defined(__APPLE__)
1502+
#if defined(__linux__) && defined(__ELF__)
1503+
.section .note.GNU-stack,"",%progbits
1504+
#endif
1505+

Sources/CNIOBoringSSL/crypto/chacha/chacha-armv4.linux.arm.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,3 +1493,7 @@ ChaCha20_neon:
14931493
#endif
14941494
#endif // !OPENSSL_NO_ASM
14951495
#endif // defined(__arm__) && defined(__linux__)
1496+
#if defined(__linux__) && defined(__ELF__)
1497+
.section .note.GNU-stack,"",%progbits
1498+
#endif
1499+

Sources/CNIOBoringSSL/crypto/chacha/chacha-armv8.ios.aarch64.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,3 +1983,7 @@ Ldone_512_neon:
19831983

19841984
#endif // !OPENSSL_NO_ASM
19851985
#endif // defined(__aarch64__) && defined(__APPLE__)
1986+
#if defined(__linux__) && defined(__ELF__)
1987+
.section .note.GNU-stack,"",%progbits
1988+
#endif
1989+

Sources/CNIOBoringSSL/crypto/chacha/chacha-armv8.linux.aarch64.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,3 +1985,7 @@ ChaCha20_512_neon:
19851985
#endif
19861986
#endif // !OPENSSL_NO_ASM
19871987
#endif // defined(__aarch64__) && defined(__linux__)
1988+
#if defined(__linux__) && defined(__ELF__)
1989+
.section .note.GNU-stack,"",%progbits
1990+
#endif
1991+

Sources/CNIOBoringSSL/crypto/chacha/chacha-x86.linux.x86.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,3 +975,7 @@ ChaCha20_ssse3:
975975
.byte 114,103,62,0
976976
#endif
977977
#endif // defined(__i386__) && defined(__linux__)
978+
#if defined(__linux__) && defined(__ELF__)
979+
.section .note.GNU-stack,"",%progbits
980+
#endif
981+

Sources/CNIOBoringSSL/crypto/chacha/chacha-x86_64.linux.x86_64.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,3 +1633,7 @@ ChaCha20_8x:
16331633
.size ChaCha20_8x,.-ChaCha20_8x
16341634
#endif
16351635
#endif // defined(__x86_64__) && defined(__linux__)
1636+
#if defined(__linux__) && defined(__ELF__)
1637+
.section .note.GNU-stack,"",%progbits
1638+
#endif
1639+

Sources/CNIOBoringSSL/crypto/chacha/chacha-x86_64.mac.x86_64.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,3 +1626,7 @@ L$8x_epilogue:
16261626

16271627
#endif
16281628
#endif // defined(__x86_64__) && defined(__APPLE__)
1629+
#if defined(__linux__) && defined(__ELF__)
1630+
.section .note.GNU-stack,"",%progbits
1631+
#endif
1632+

Sources/CNIOBoringSSL/crypto/cipher_extra/aes128gcmsiv-x86_64.linux.x86_64.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3079,3 +3079,7 @@ aes256gcmsiv_kdf:
30793079
.size aes256gcmsiv_kdf, .-aes256gcmsiv_kdf
30803080
#endif
30813081
#endif // defined(__x86_64__) && defined(__linux__)
3082+
#if defined(__linux__) && defined(__ELF__)
3083+
.section .note.GNU-stack,"",%progbits
3084+
#endif
3085+

0 commit comments

Comments
 (0)