Package: thunderbird / 1:60.8.0-1~deb9u1

fixes/Bug-1505608-Try-to-ensure-the-bss-section-of-the-elf.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From: Mike Hommey <mh+mozilla@glandium.org>
Date: Thu, 8 Nov 2018 14:50:22 +0000
Subject: Bug 1505608 - Try to ensure the bss section of the elfhack testcase
 stays large enough. r=froydnj

In bug 1470701, we added a dummy global variable so that it ends up in
the bss section, making it large enough for two pointers. Unfortunately,
in some cases, the symbol is eliminated by the linker because it is
unused. So we try to ensure it stays there.

Differential Revision: https://phabricator.services.mozilla.com/D11257
---
 build/unix/elfhack/test.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/build/unix/elfhack/test.c b/build/unix/elfhack/test.c
index ab994a4..6e824a1 100644
--- a/build/unix/elfhack/test.c
+++ b/build/unix/elfhack/test.c
@@ -134,7 +134,12 @@ size_t dummy;
 void end_test() {
   static size_t count = 0;
   /* Only exit when both constructors have been called */
-  if (++count == 2) ret = 0;
+  if (++count == 2) {
+    ret = 0;
+    // Avoid the dummy variable being stripped out at link time because
+    // it's unused.
+    dummy = 1;
+  }
 }
 
 void test() {