Blame sysdeps/powerpc/powerpc64/dl-machine.c

Packit 6c4009
/* Machine-dependent ELF dynamic relocation functions.  PowerPC64 version.
Packit 6c4009
   Copyright (C) 1995-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Library General Public License as
Packit 6c4009
   published by the Free Software Foundation; either version 2 of the
Packit 6c4009
   License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Library General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Library General Public
Packit 6c4009
   License along with the GNU C Library; see the file COPYING.LIB.  If
Packit 6c4009
   not, see <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#include <string.h>
Packit 6c4009
#include <unistd.h>
Packit 6c4009
#include <ldsodefs.h>
Packit 6c4009
#include <_itoa.h>
Packit 6c4009
#include <dl-machine.h>
Packit 6c4009
Packit 6c4009
void
Packit 6c4009
_dl_reloc_overflow (struct link_map *map,
Packit 6c4009
		    const char *name,
Packit 6c4009
		    Elf64_Addr *const reloc_addr,
Packit 6c4009
		    const Elf64_Sym *refsym)
Packit 6c4009
{
Packit 6c4009
  char buffer[1024];
Packit 6c4009
  char *t;
Packit 6c4009
  t = stpcpy (buffer, name);
Packit 6c4009
  /* Notice that _itoa_word() writes characters from the higher address to the
Packit 6c4009
     lower address, requiring the destination string to reserve all the
Packit 6c4009
     required size before the call.  */
Packit 6c4009
  t = stpcpy (t, " reloc at 0x0000000000000000");
Packit 6c4009
  _itoa_word ((unsigned long) reloc_addr, t, 16, 0);
Packit 6c4009
  if (refsym)
Packit 6c4009
    {
Packit 6c4009
      const char *strtab;
Packit 6c4009
Packit 6c4009
      strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
Packit 6c4009
      t = stpcpy (t, " for symbol `");
Packit 6c4009
      t = stpcpy (t, strtab + refsym->st_name);
Packit 6c4009
      t = stpcpy (t, "'");
Packit 6c4009
    }
Packit 6c4009
  t = stpcpy (t, " out of range");
Packit 6c4009
  _dl_signal_error (0, map->l_name, NULL, buffer);
Packit 6c4009
}
Packit 6c4009
Packit 6c4009
#if _CALL_ELF == 2
Packit 6c4009
void
Packit 6c4009
_dl_error_localentry (struct link_map *map, const Elf64_Sym *refsym)
Packit 6c4009
{
Packit 6c4009
  char buffer[1024];
Packit 6c4009
  char *t;
Packit 6c4009
  const char *strtab;
Packit 6c4009
Packit 6c4009
  strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
Packit 6c4009
  t = stpcpy (buffer, "expected localentry:0 `");
Packit 6c4009
  t = stpcpy (t, strtab + refsym->st_name);
Packit 6c4009
  t = stpcpy (t, "'");
Packit 6c4009
  _dl_signal_error (0, map->l_name, NULL, buffer);
Packit 6c4009
}
Packit 6c4009
#endif