summaryrefslogtreecommitdiffstats
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2003-05-15 06:35:43 +0000
committerAlan Modra <amodra@gmail.com>2003-05-15 06:35:43 +0000
commit09695f5689bb7745efb295ccc0b49919d8cf5a6c (patch)
treee8d0abbcec0f7bfd7e98005cc70e0c1147504bd6 /bfd
parent40f62fa0b5b463171f747094b0c471e8c12b3950 (diff)
downloadppe42-binutils-09695f5689bb7745efb295ccc0b49919d8cf5a6c.tar.gz
ppe42-binutils-09695f5689bb7745efb295ccc0b49919d8cf5a6c.zip
* elf32-i386.c (allocate_dynrelocs): Use SYMBOL_CALLS_LOCAL.
(elf_i386_relocate_section): Likewise. * elf32-ppc.c (allocate_dynrelocs): Likewise. (ppc_elf_relocate_section): Likewise. * elf64-ppc.c (allocate_dynrelocs): Likewise. (ppc64_elf_relocate_section): Likewise.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog10
-rw-r--r--bfd/elf32-i386.c10
-rw-r--r--bfd/elf32-ppc.c10
-rw-r--r--bfd/elf64-ppc.c10
4 files changed, 34 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index c6ec77c12c..e22b592fc6 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,13 @@
+2003-05-15 Alan Modra <amodra@bigpond.net.au>
+ H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (allocate_dynrelocs): Use SYMBOL_CALLS_LOCAL.
+ (elf_i386_relocate_section): Likewise.
+ * elf32-ppc.c (allocate_dynrelocs): Likewise.
+ (ppc_elf_relocate_section): Likewise.
+ * elf64-ppc.c (allocate_dynrelocs): Likewise.
+ (ppc64_elf_relocate_section): Likewise.
+
2003-05-15 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* elf32-mips.c (gprel32_with_gp): Remove useless N64 ABI case.
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 8fbe8a1c60..b1a441aaa7 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -1679,7 +1679,13 @@ allocate_dynrelocs (h, inf)
if (info->shared)
{
- if (SYMBOL_REFERENCES_LOCAL (info, h))
+ /* The only reloc that uses pc_count is R_386_PC32, which will
+ appear on a call or on something like ".long foo - .". We
+ want calls to protected symbols to resolve directly to the
+ function rather than going via the plt. If people want
+ function pointer comparisons to work as expected then they
+ should avoid writing assembly like ".long foo - .". */
+ if (SYMBOL_CALLS_LOCAL (info, h))
{
struct elf_i386_dyn_relocs **pp;
@@ -2434,7 +2440,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
|| h->root.type != bfd_link_hash_undefweak)
&& (r_type != R_386_PC32
|| (h != NULL
- && !SYMBOL_REFERENCES_LOCAL (info, h))))
+ && !SYMBOL_CALLS_LOCAL (info, h))))
|| (ELIMINATE_COPY_RELOCS
&& !info->shared
&& h != NULL
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index ca9fbd9e21..212e5b34f4 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -2799,7 +2799,13 @@ allocate_dynrelocs (h, inf)
if (info->shared)
{
- if (SYMBOL_REFERENCES_LOCAL (info, h))
+ /* Relocs that use pc_count are those that appear on a call
+ insn, or certain REL relocs (see MUST_BE_DYN_RELOC) that can
+ generated via assembly. We want calls to protected symbols
+ to resolve directly to the function rather than going via the
+ plt. If people want function pointer comparisons to work as
+ expected then they should avoid writing weird assembly. */
+ if (SYMBOL_CALLS_LOCAL (info, h))
{
struct ppc_elf_dyn_relocs **pp;
@@ -4991,7 +4997,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|| h->root.type != bfd_link_hash_undefweak)
&& (MUST_BE_DYN_RELOC (r_type)
|| (h != NULL
- && !SYMBOL_REFERENCES_LOCAL (info, h))))
+ && !SYMBOL_CALLS_LOCAL (info, h))))
|| (ELIMINATE_COPY_RELOCS
&& !info->shared
&& (input_section->flags & SEC_ALLOC) != 0
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 331c0ba232..2887d9bfef 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -5621,7 +5621,13 @@ allocate_dynrelocs (h, inf)
if (info->shared)
{
- if (SYMBOL_REFERENCES_LOCAL (info, h))
+ /* Relocs that use pc_count are those that appear on a call
+ insn, or certain REL relocs (see MUST_BE_DYN_RELOC) that can
+ generated via assembly. We want calls to protected symbols
+ to resolve directly to the function rather than going via the
+ plt. If people want function pointer comparisons to work as
+ expected then they should avoid writing weird assembly. */
+ if (SYMBOL_CALLS_LOCAL (info, h))
{
struct ppc_dyn_relocs **pp;
@@ -7874,7 +7880,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|| h->root.type != bfd_link_hash_undefweak)
&& (MUST_BE_DYN_RELOC (r_type)
|| (h != NULL
- && !SYMBOL_REFERENCES_LOCAL (info, h))))
+ && !SYMBOL_CALLS_LOCAL (info, h))))
|| (ELIMINATE_COPY_RELOCS
&& !info->shared
&& h != NULL
OpenPOWER on IntegriCloud