1 |
vapier 12/03/04 06:08:05 |
2 |
|
3 |
Modified: README.history |
4 |
Added: 51_all_binutils-2.22-hppa-plt-pr13387.patch |
5 |
Log: |
6 |
add fix from upstream for hppa/plt handling #406349 |
7 |
|
8 |
Revision Changes Path |
9 |
1.6 src/patchsets/binutils/2.22/README.history |
10 |
|
11 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.22/README.history?rev=1.6&view=markup |
12 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.22/README.history?rev=1.6&content-type=text/plain |
13 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.22/README.history?r1=1.5&r2=1.6 |
14 |
|
15 |
Index: README.history |
16 |
=================================================================== |
17 |
RCS file: /var/cvsroot/gentoo/src/patchsets/binutils/2.22/README.history,v |
18 |
retrieving revision 1.5 |
19 |
retrieving revision 1.6 |
20 |
diff -u -r1.5 -r1.6 |
21 |
--- README.history 11 Dec 2011 21:02:01 -0000 1.5 |
22 |
+++ README.history 4 Mar 2012 06:08:05 -0000 1.6 |
23 |
@@ -1,3 +1,6 @@ |
24 |
+1.2 04 Mar 2012 |
25 |
+ + 51_all_binutils-2.22-hppa-plt-pr13387.patch |
26 |
+ |
27 |
1.1 11 Dec 2011 |
28 |
+ 10_all_binutils-2.22-ppc-textrels.patch |
29 |
+ 40_all_binutils-2.22-s390x-PIC.patch |
30 |
|
31 |
|
32 |
|
33 |
1.1 src/patchsets/binutils/2.22/51_all_binutils-2.22-hppa-plt-pr13387.patch |
34 |
|
35 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.22/51_all_binutils-2.22-hppa-plt-pr13387.patch?rev=1.1&view=markup |
36 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.22/51_all_binutils-2.22-hppa-plt-pr13387.patch?rev=1.1&content-type=text/plain |
37 |
|
38 |
Index: 51_all_binutils-2.22-hppa-plt-pr13387.patch |
39 |
=================================================================== |
40 |
https://bugs.gentoo.org/406349 |
41 |
|
42 |
From ad4d50cb827aa965902553badfe9fdef40a7c29a Mon Sep 17 00:00:00 2001 |
43 |
From: Dave Anglin <dave.anglin@×××.ca> |
44 |
Date: Sun, 6 Nov 2011 20:25:16 +0000 |
45 |
Subject: [PATCH] PR ld/13387 * elf32-hppa.c |
46 |
(elf32_hppa_hide_symbol): Make STT_GNU_IFUNC symbol go |
47 |
through PLT. Reset plt field with init_plt_offset. |
48 |
(elf32_hppa_adjust_dynamic_symbol): Ensure that a PLT slot |
49 |
is allocated for symbols referenced by a plabel. |
50 |
|
51 |
--- |
52 |
bfd/ChangeLog | 8 ++++++++ |
53 |
bfd/elf32-hppa.c | 13 +++++++++++-- |
54 |
2 files changed, 19 insertions(+), 2 deletions(-) |
55 |
|
56 |
2011-11-06 John David Anglin <dave.anglin@×××××××××××.ca> |
57 |
|
58 |
PR ld/13387 |
59 |
* elf32-hppa.c (elf32_hppa_hide_symbol): Make STT_GNU_IFUNC symbol |
60 |
go through PLT. Reset plt field with init_plt_offset. |
61 |
(elf32_hppa_adjust_dynamic_symbol): Ensure that a PLT slot is |
62 |
allocated for symbols referenced by a plabel. |
63 |
|
64 |
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c |
65 |
index 7f0f2cb..fcf51cf 100644 |
66 |
--- a/bfd/elf32-hppa.c |
67 |
+++ b/bfd/elf32-hppa.c |
68 |
@@ -1789,10 +1789,12 @@ elf32_hppa_hide_symbol (struct bfd_link_info *info, |
69 |
} |
70 |
} |
71 |
|
72 |
- if (! hppa_elf_hash_entry (eh)->plabel) |
73 |
+ /* STT_GNU_IFUNC symbol must go through PLT. */ |
74 |
+ if (! hppa_elf_hash_entry (eh)->plabel |
75 |
+ && eh->type != STT_GNU_IFUNC) |
76 |
{ |
77 |
eh->needs_plt = 0; |
78 |
- eh->plt = elf_hash_table (info)->init_plt_refcount; |
79 |
+ eh->plt = elf_hash_table (info)->init_plt_offset; |
80 |
} |
81 |
} |
82 |
|
83 |
@@ -1814,6 +1816,13 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info, |
84 |
if (eh->type == STT_FUNC |
85 |
|| eh->needs_plt) |
86 |
{ |
87 |
+ /* If the symbol is used by a plabel, we must allocate a PLT slot. |
88 |
+ The refcounts are not reliable when it has been hidden since |
89 |
+ hide_symbol can be called before the plabel flag is set. */ |
90 |
+ if (hppa_elf_hash_entry (eh)->plabel |
91 |
+ && eh->plt.refcount <= 0) |
92 |
+ eh->plt.refcount = 1; |
93 |
+ |
94 |
if (eh->plt.refcount <= 0 |
95 |
|| (eh->def_regular |
96 |
&& eh->root.type != bfd_link_hash_defweak |
97 |
-- |
98 |
1.7.8.4 |