https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221107

--- Comment #4 from Mark Millard <mar...@dsl-only.net> ---
The "reloc against local symbol" text
is omitted by code from:

/usr/src/contrib/binutils/bfd/elf32-ppc.c

in its routine:

/* Look through the relocs for a section during the first phase, and
   allocate space in the global offset table or procedure linkage
   table.  */

static bfd_boolean
ppc_elf_check_relocs (bfd *abfd,
                      struct bfd_link_info *info,
                      asection *sec,
                      const Elf_Internal_Rela *relocs)

via:

      tls_type = 0;
      r_type = ELF32_R_TYPE (rel->r_info);
. . .              
      switch (r_type)
        {
. . .
        case R_PPC_PLT32:
        case R_PPC_PLTREL24:
        case R_PPC_PLTREL32:
        case R_PPC_PLT16_LO:
        case R_PPC_PLT16_HI:
        case R_PPC_PLT16_HA:
#ifdef DEBUG
          fprintf (stderr, "Reloc requires a PLT entry\n");
#endif
          /* This symbol requires a procedure linkage table entry.  We
             actually build the entry in finish_dynamic_symbol,
             because this might be a case of linking PIC code without
             linking in any dynamic objects, in which case we don't
             need to generate a procedure linkage table after all.  */

          if (h == NULL)
            {
              /* It does not make sense to have a procedure linkage
                 table entry for a local symbol.  */
              (*_bfd_error_handler) (_("%B(%A+0x%lx): %s reloc against "
                                       "local symbol"),
                                     abfd,
                                     sec,
                                     (long) rel->r_offset,
                                     ppc_elf_howto_table[r_type]->name);
              bfd_set_error (bfd_error_bad_value);
              return FALSE;
            }
          else
            {
              bfd_vma addend = 0;

              if (r_type == R_PPC_PLTREL24)
                {
                  ppc_elf_tdata (abfd)->makes_plt_call = 1;
                  addend = rel->r_addend;
                }
              h->needs_plt = 1;
              if (!update_plt_info (abfd, h, got2, addend))
                return FALSE;
            }
          break;

where the earlier code for finding the h value is:

      r_symndx = ELF32_R_SYM (rel->r_info);
      if (r_symndx < symtab_hdr->sh_info)
        h = NULL;
      else  
        {
          h = sym_hashes[r_symndx - symtab_hdr->sh_info];
          while (h->root.type == bfd_link_hash_indirect
                 || h->root.type == bfd_link_hash_warning)
            h = (struct elf_link_hash_entry *) h->root.u.i.link;
        }

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to