(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 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.
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;
|| 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
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;
|| 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
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;
|| 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