wok-current view glibc/stuff/glibc-2.23-gcc.patch @ rev 25728
Merge wok for both arch and few updates
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Thu Dec 05 08:39:45 2024 +0000 (9 months ago) |
parents | |
children |
line source
1 From bc566388d68eb631a6ff0408d57a78d0a2781025 Mon Sep 17 00:00:00 2001
2 From: "H.J. Lu" <hjl.tools@gmail.com>
3 Date: Thu, 19 Oct 2017 08:42:59 -0700
4 Subject: [PATCH] Avoid .symver on common symbols [BZ #21666]
6 The .symver directive on common symbol just creates a new common symbol,
7 not an alias and the newer assembler with the bug fix for
9 https://sourceware.org/bugzilla/show_bug.cgi?id=21661
11 will issue an error. Before the fix, we got
13 $ readelf -sW libc.so | grep "loc[12s]"
14 5109: 00000000003a0608 8 OBJECT LOCAL DEFAULT 36 loc1
15 5188: 00000000003a0610 8 OBJECT LOCAL DEFAULT 36 loc2
16 5455: 00000000003a0618 8 OBJECT LOCAL DEFAULT 36 locs
17 6575: 00000000003a05f0 8 OBJECT GLOBAL DEFAULT 36 locs@GLIBC_2.2.5
18 7156: 00000000003a05f8 8 OBJECT GLOBAL DEFAULT 36 loc1@GLIBC_2.2.5
19 7312: 00000000003a0600 8 OBJECT GLOBAL DEFAULT 36 loc2@GLIBC_2.2.5
21 in libc.so. The versioned loc1, loc2 and locs have the wrong addresses.
22 After the fix, we got
24 $ readelf -sW libc.so | grep "loc[12s]"
25 6570: 000000000039e3b8 8 OBJECT GLOBAL DEFAULT 34 locs@GLIBC_2.2.5
26 7151: 000000000039e3c8 8 OBJECT GLOBAL DEFAULT 34 loc1@GLIBC_2.2.5
27 7307: 000000000039e3c0 8 OBJECT GLOBAL DEFAULT 34 loc2@GLIBC_2.2.5
29 [BZ #21666]
30 * misc/regexp.c (loc1): Add __attribute__ ((nocommon));
31 (loc2): Likewise.
32 (locs): Likewise.
34 (cherry picked from commit 388b4f1a02f3a801965028bbfcd48d905638b797)
35 ---
36 ChangeLog | 7 +++++++
37 misc/regexp.c | 9 +++++----
38 2 files changed, 12 insertions(+), 4 deletions(-)
40 diff --git a/ChangeLog b/ChangeLog
41 index 697bffd99e..def4183de3 100644
42 --- a/ChangeLog
43 +++ b/ChangeLog
44 @@ -1,3 +1,10 @@
45 +2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
46 +
47 + [BZ #21666]
48 + * misc/regexp.c (loc1): Add __attribute__ ((nocommon));
49 + (loc2): Likewise.
50 + (locs): Likewise.
51 +
52 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
54 * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_resolve): Don't
55 diff --git a/misc/regexp.c b/misc/regexp.c
56 index 3b3668272f..b2a2c6e636 100644
57 --- a/misc/regexp.c
58 +++ b/misc/regexp.c
59 @@ -29,14 +29,15 @@
61 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
63 -/* Define the variables used for the interface. */
64 -char *loc1;
65 -char *loc2;
66 +/* Define the variables used for the interface. Avoid .symver on common
67 + symbol, which just creates a new common symbol, not an alias. */
68 +char *loc1 __attribute__ ((nocommon));
69 +char *loc2 __attribute__ ((nocommon));
70 compat_symbol (libc, loc1, loc1, GLIBC_2_0);
71 compat_symbol (libc, loc2, loc2, GLIBC_2_0);
73 /* Although we do not support the use we define this variable as well. */
74 -char *locs;
75 +char *locs __attribute__ ((nocommon));
76 compat_symbol (libc, locs, locs, GLIBC_2_0);
79 --
80 2.39.3