summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2016-08-19 20:44:54 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-23 17:44:34 +0100
commit63ac3520b4d277ffb0f379397a5415e930c20d1d (patch)
tree729c1626f0d36c138feec4921e6b5a28b1c9883a /meta
parent1bb1200a93c7e58e900f396ba718ccf84c7ecfa0 (diff)
downloadpoky-63ac3520b4d277ffb0f379397a5415e930c20d1d.tar.gz
glibc: Fix scope resolution in glibc to be breadth first.
The ELF specification indicates symbol resolution should be breadth first, not depth first. The dl-deps.c: dl_build_locale_scope function is processing in a depth first mode. This is causes certain symbols to be incorrectly reported when LD_TRACE_PRELINKING=1 is enabled. See glibc BZ #20488 for more information. (From OE-Core rev: fb72263eaa94e64ddeee457b5b1bc999f0e647da) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/glibc/glibc/0026-build_local_scope.patch56
-rw-r--r--meta/recipes-core/glibc/glibc_2.24.bb1
2 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc/0026-build_local_scope.patch b/meta/recipes-core/glibc/glibc/0026-build_local_scope.patch
new file mode 100644
index 0000000000..8e0cb83194
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0026-build_local_scope.patch
@@ -0,0 +1,56 @@
1From 6e4ec5a3c5fe63b6458036f18d43124de4a7e724 Mon Sep 17 00:00:00 2001
2From: Mark Hatle <mark.hatle@windriver.com>
3Date: Thu, 18 Aug 2016 14:07:58 -0500
4Subject: [PATCH] elf/dl-deps.c: Make _dl_build_local_scope breadth first
5
6According to the ELF specification:
7
8When resolving symbolic references, the dynamic linker examines the symbol
9tables with a breadth-first search.
10
11This function was using a depth first search. By doing so the conflict
12resolution reported to the prelinker (when LD_TRACE_PRELINKING=1 is set)
13was incorrect. This caused problems when their were various circular
14dependencies between libraries. The problem usually manifested itself by
15the wrong IFUNC being executed.
16
17[BZ# 20488]
18
19Upstream-Status: Submitted [libc-alpha]
20
21Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
22---
23 elf/dl-deps.c | 14 ++++++++++----
24 1 file changed, 10 insertions(+), 4 deletions(-)
25
26diff --git a/elf/dl-deps.c b/elf/dl-deps.c
27index 6a82987..fc37c87 100644
28--- a/elf/dl-deps.c
29+++ b/elf/dl-deps.c
30@@ -73,13 +73,19 @@ _dl_build_local_scope (struct link_map **list, struct link_map *map)
31 {
32 struct link_map **p = list;
33 struct link_map **q;
34+ struct link_map **r;
35
36 *p++ = map;
37 map->l_reserved = 1;
38- if (map->l_initfini)
39- for (q = map->l_initfini + 1; *q; ++q)
40- if (! (*q)->l_reserved)
41- p += _dl_build_local_scope (p, *q);
42+
43+ for (r = list; r < p; ++r)
44+ if ((*r)->l_initfini)
45+ for (q = (*r)->l_initfini + 1; *q; ++q)
46+ if (! (*q)->l_reserved)
47+ {
48+ *p++ = *q;
49+ (*q)->l_reserved = 1;
50+ }
51 return p - list;
52 }
53
54--
552.5.5
56
diff --git a/meta/recipes-core/glibc/glibc_2.24.bb b/meta/recipes-core/glibc/glibc_2.24.bb
index e446e7ab4f..a3ac73841d 100644
--- a/meta/recipes-core/glibc/glibc_2.24.bb
+++ b/meta/recipes-core/glibc/glibc_2.24.bb
@@ -36,6 +36,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
36 file://0023-eglibc-Install-PIC-archives.patch \ 36 file://0023-eglibc-Install-PIC-archives.patch \
37 file://0024-eglibc-Forward-port-cross-locale-generation-support.patch \ 37 file://0024-eglibc-Forward-port-cross-locale-generation-support.patch \
38 file://0025-Define-DUMMY_LOCALE_T-if-not-defined.patch \ 38 file://0025-Define-DUMMY_LOCALE_T-if-not-defined.patch \
39 file://0026-build_local_scope.patch \
39" 40"
40 41
41SRC_URI += "\ 42SRC_URI += "\