Shared libraries built with multiple tocs resolve plt to local function entry
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
glibc (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Trusty |
New
|
Undecided
|
Unassigned | ||
Utopic |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
-- Problem Description --
An optimisation in glibc is supposed to make calls within a shared library go to the local entry points, when DT_PPC64_OPT does *not* have bit 2 (PPC64_
Libraries correctly have the bit set, but glibc *is* applying the local offset.
When I look at the l_info in question, I see
p ((struct link_map *) 0x3fffb7f925d8)
$6 = {0x0, 0x3fffb7edaf58, 0x3fffb7edb028, 0x3fffb7edb018, 0x3fffb7edafc8,
0x3fffb7edafd8, 0x3fffb7edafe8, 0x3fffb7edb078, 0x3fffb7edb088,
0x3fffb7edb098, 0x3fffb7edaff8, 0x3fffb7edb008, 0x3fffb7edaf68,
0x3fffb7edaf78, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3fffb7edb038, 0x0, 0x0,
0x3fffb7edb048, 0x0, 0x3fffb7edaf88, 0x3fffb7edafa8, 0x3fffb7edaf98,
0x3fffb7edafb8, 0x0, 0x0, 0x0, 0x0, 0x0,
-------
0x3fffb7edb058, 0x0, 0x0, 0x3fffb7edb0b8,
-------
0x3fffb7edb0a8, 0x0, 0x0, 0x0, 0x0, 0x3fffb7edb0d8, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3fffb7edb0c8, 0x0 <repeats 26 times>}
Highlighted part is the DT_PPC64 area, with DT_PPC64_OPT being the last one. It should be "0x2", but is overwritten with some other value due to DT_PPC64_NUM being one too small in the following from elf.h.
/* PowerPC64 specific values for the Dyn d_tag field. */
#define DT_PPC64_GLINK (DT_LOPROC + 0)
#define DT_PPC64_OPD (DT_LOPROC + 1)
#define DT_PPC64_OPDSZ (DT_LOPROC + 2)
#define DT_PPC64_OPT (DT_LOPROC + 3)
#define DT_PPC64_NUM 3
Fix applied for upstream bug https:/
git revision f6c44d47
tags: | added: architecture-ppc64le bugnameltc-113216 severity-medium |
affects: | ubuntu → glibc (Ubuntu) |
tags: | added: targetmilestone-inin1410 |
tags: |
added: targetmilestone-inin14042 removed: targetmilestone-inin1410 |
Changed in glibc (Ubuntu Utopic): | |
status: | New → Won't Fix |
------- Comment From <email address hidden> 2014-10-09 15:48 EDT------- /sourceware. org/bugzilla/ show_bug. cgi?id= 17153 it will be integrated to release 2.20.
According to upstream bug https:/
Currently we are running:
$ dpkg -l |grep libc6
ii libc6:ppc64el 2.19-10ubuntu2 ppc64el GNU C Library: Shared libraries
ii libc6-dbg:ppc64el 2.19-10ubuntu2 ppc64el GNU C Library: detached debugging symbols
ii libc6-dev:ppc64el 2.19-10ubuntu2 ppc64el GNU C Library: Development Libraries and Header Files
and glibc-2.19$ head ChangeLog
2014-06-03 Guo Yixuan <email address hidden>
[BZ #16882] sparc/sparc32/ pthread_ spin_lock. S spin_lock) : Branch out of spin loop to proper location. sparc/sparc64/ pthread_ spin_lock. S spin_lock) : Likewise.
* nptl/sysdeps/
(pthread_
* nptl/sysdeps/
(pthread_
* nptl/tst-spin4.c: New test.
* nptl/Makefile (tests): Add tst-spin4.
so patch is not yet integrated.