Line 139... |
Line 139... |
#include "elf/score.h"
|
#include "elf/score.h"
|
#include "elf/sh.h"
|
#include "elf/sh.h"
|
#include "elf/sparc.h"
|
#include "elf/sparc.h"
|
#include "elf/spu.h"
|
#include "elf/spu.h"
|
#include "elf/tic6x.h"
|
#include "elf/tic6x.h"
|
|
#include "elf/tilegx.h"
|
|
#include "elf/tilepro.h"
|
#include "elf/v850.h"
|
#include "elf/v850.h"
|
#include "elf/vax.h"
|
#include "elf/vax.h"
|
#include "elf/x86-64.h"
|
#include "elf/x86-64.h"
|
#include "elf/xc16x.h"
|
#include "elf/xc16x.h"
|
#include "elf/xstormy16.h"
|
#include "elf/xstormy16.h"
|
Line 285... |
Line 287... |
if (elf_header.e_machine == EM_ARM) \
|
if (elf_header.e_machine == EM_ARM) \
|
(ADDR) &= ~1; \
|
(ADDR) &= ~1; \
|
} \
|
} \
|
while (0)
|
while (0)
|
|
|
|
/* Retrieve NMEMB structures, each SIZE bytes long from FILE starting at OFFSET.
|
|
Put the retrieved data into VAR, if it is not NULL. Otherwise allocate a buffer
|
|
using malloc and fill that. In either case return the pointer to the start of
|
|
the retrieved data or NULL if something went wrong. If something does go wrong
|
|
emit an error message using REASON as part of the context. */
|
|
|
static void *
|
static void *
|
get_data (void * var, FILE * file, long offset, size_t size, size_t nmemb,
|
get_data (void * var, FILE * file, long offset, size_t size, size_t nmemb,
|
const char * reason)
|
const char * reason)
|
{
|
{
|
void * mvar;
|
void * mvar;
|
Line 592... |
Line 600... |
case EM_SPARC:
|
case EM_SPARC:
|
case EM_SPARC32PLUS:
|
case EM_SPARC32PLUS:
|
case EM_SPARCV9:
|
case EM_SPARCV9:
|
case EM_SPU:
|
case EM_SPU:
|
case EM_TI_C6000:
|
case EM_TI_C6000:
|
|
case EM_TILEGX:
|
|
case EM_TILEPRO:
|
case EM_V850:
|
case EM_V850:
|
case EM_CYGNUS_V850:
|
case EM_CYGNUS_V850:
|
case EM_VAX:
|
case EM_VAX:
|
case EM_X86_64:
|
case EM_X86_64:
|
case EM_L1OM:
|
case EM_L1OM:
|
Line 1217... |
Line 1227... |
break;
|
break;
|
|
|
case EM_TI_C6000:
|
case EM_TI_C6000:
|
rtype = elf_tic6x_reloc_type (type);
|
rtype = elf_tic6x_reloc_type (type);
|
break;
|
break;
|
|
|
|
case EM_TILEGX:
|
|
rtype = elf_tilegx_reloc_type (type);
|
|
break;
|
|
|
|
case EM_TILEPRO:
|
|
rtype = elf_tilepro_reloc_type (type);
|
|
break;
|
}
|
}
|
|
|
if (rtype == NULL)
|
if (rtype == NULL)
|
printf (_("unrecognized: %-7lx"), (unsigned long) type & 0xffffffff);
|
printf (_("unrecognized: %-7lx"), (unsigned long) type & 0xffffffff);
|
else
|
else
|
Line 1964... |
Line 1982... |
case EM_SLE9X: return "Infineon Technologies SLE9X core";
|
case EM_SLE9X: return "Infineon Technologies SLE9X core";
|
case EM_AVR32: return "Atmel Corporation 32-bit microprocessor family";
|
case EM_AVR32: return "Atmel Corporation 32-bit microprocessor family";
|
case EM_STM8: return "STMicroeletronics STM8 8-bit microcontroller";
|
case EM_STM8: return "STMicroeletronics STM8 8-bit microcontroller";
|
case EM_TILE64: return "Tilera TILE64 multicore architecture family";
|
case EM_TILE64: return "Tilera TILE64 multicore architecture family";
|
case EM_TILEPRO: return "Tilera TILEPro multicore architecture family";
|
case EM_TILEPRO: return "Tilera TILEPro multicore architecture family";
|
|
case EM_TILEGX: return "Tilera TILE-Gx multicore architecture family";
|
case EM_CUDA: return "NVIDIA CUDA architecture";
|
case EM_CUDA: return "NVIDIA CUDA architecture";
|
default:
|
default:
|
snprintf (buff, sizeof (buff), _("<unknown>: 0x%x"), e_machine);
|
snprintf (buff, sizeof (buff), _("<unknown>: 0x%x"), e_machine);
|
return buff;
|
return buff;
|
}
|
}
|
Line 4553... |
Line 4572... |
}
|
}
|
|
|
dynamic_strings = (char *) get_data (NULL, file, section->sh_offset,
|
dynamic_strings = (char *) get_data (NULL, file, section->sh_offset,
|
1, section->sh_size,
|
1, section->sh_size,
|
_("dynamic strings"));
|
_("dynamic strings"));
|
dynamic_strings_length = section->sh_size;
|
dynamic_strings_length = dynamic_strings == NULL ? 0 : section->sh_size;
|
}
|
}
|
else if (section->sh_type == SHT_SYMTAB_SHNDX)
|
else if (section->sh_type == SHT_SYMTAB_SHNDX)
|
{
|
{
|
if (symtab_shndx_hdr != NULL)
|
if (symtab_shndx_hdr != NULL)
|
{
|
{
|
Line 5034... |
Line 5053... |
}
|
}
|
|
|
start = (unsigned char *) get_data (NULL, file, section->sh_offset,
|
start = (unsigned char *) get_data (NULL, file, section->sh_offset,
|
1, section->sh_size,
|
1, section->sh_size,
|
_("section data"));
|
_("section data"));
|
|
if (start == NULL)
|
|
continue;
|
|
|
indices = start;
|
indices = start;
|
size = (section->sh_size / section->sh_entsize) - 1;
|
size = (section->sh_size / section->sh_entsize) - 1;
|
entry = byte_get (indices, 4);
|
entry = byte_get (indices, 4);
|
indices += 4;
|
indices += 4;
|
Line 5739... |
Line 5760... |
{
|
{
|
aux.nsyms = sec->sh_size / sec->sh_entsize;
|
aux.nsyms = sec->sh_size / sec->sh_entsize;
|
aux.symtab = GET_ELF_SYMBOLS (file, sec);
|
aux.symtab = GET_ELF_SYMBOLS (file, sec);
|
|
|
strsec = section_headers + sec->sh_link;
|
strsec = section_headers + sec->sh_link;
|
|
assert (aux.strtab == NULL);
|
aux.strtab = (char *) get_data (NULL, file, strsec->sh_offset,
|
aux.strtab = (char *) get_data (NULL, file, strsec->sh_offset,
|
1, strsec->sh_size,
|
1, strsec->sh_size,
|
_("string table"));
|
_("string table"));
|
aux.strtab_size = aux.strtab != NULL ? strsec->sh_size : 0;
|
aux.strtab_size = aux.strtab != NULL ? strsec->sh_size : 0;
|
}
|
}
|
Line 5821... |
Line 5843... |
else
|
else
|
printf (_("'%s'"), SECTION_NAME (unwsec));
|
printf (_("'%s'"), SECTION_NAME (unwsec));
|
}
|
}
|
else
|
else
|
{
|
{
|
aux.info_size = sec->sh_size;
|
|
aux.info_addr = sec->sh_addr;
|
aux.info_addr = sec->sh_addr;
|
aux.info = (unsigned char *) get_data (NULL, file, sec->sh_offset, 1,
|
aux.info = (unsigned char *) get_data (NULL, file, sec->sh_offset, 1,
|
aux.info_size,
|
sec->sh_size,
|
_("unwind info"));
|
_("unwind info"));
|
|
aux.info_size = aux.info == NULL ? 0 : sec->sh_size;
|
|
|
printf (_("\nUnwind section "));
|
printf (_("\nUnwind section "));
|
|
|
if (string_table == NULL)
|
if (string_table == NULL)
|
printf ("%d", unwsec->sh_name);
|
printf ("%d", unwsec->sh_name);
|
Line 6152... |
Line 6174... |
{
|
{
|
aux.nsyms = sec->sh_size / sec->sh_entsize;
|
aux.nsyms = sec->sh_size / sec->sh_entsize;
|
aux.symtab = GET_ELF_SYMBOLS (file, sec);
|
aux.symtab = GET_ELF_SYMBOLS (file, sec);
|
|
|
strsec = section_headers + sec->sh_link;
|
strsec = section_headers + sec->sh_link;
|
|
assert (aux.strtab == NULL);
|
aux.strtab = (char *) get_data (NULL, file, strsec->sh_offset,
|
aux.strtab = (char *) get_data (NULL, file, strsec->sh_offset,
|
1, strsec->sh_size,
|
1, strsec->sh_size,
|
_("string table"));
|
_("string table"));
|
aux.strtab_size = aux.strtab != NULL ? strsec->sh_size : 0;
|
aux.strtab_size = aux.strtab != NULL ? strsec->sh_size : 0;
|
}
|
}
|
Line 6278... |
Line 6301... |
arm_free_section (arm_sec);
|
arm_free_section (arm_sec);
|
|
|
arm_sec->sec = sec;
|
arm_sec->sec = sec;
|
arm_sec->data = get_data (NULL, aux->file, sec->sh_offset, 1,
|
arm_sec->data = get_data (NULL, aux->file, sec->sh_offset, 1,
|
sec->sh_size, _("unwind data"));
|
sec->sh_size, _("unwind data"));
|
|
|
arm_sec->rela = NULL;
|
arm_sec->rela = NULL;
|
arm_sec->nrelas = 0;
|
arm_sec->nrelas = 0;
|
|
|
for (relsec = section_headers;
|
for (relsec = section_headers;
|
relsec < section_headers + elf_header.e_shnum;
|
relsec < section_headers + elf_header.e_shnum;
|
Line 7037... |
Line 7059... |
{
|
{
|
aux.nsyms = sec->sh_size / sec->sh_entsize;
|
aux.nsyms = sec->sh_size / sec->sh_entsize;
|
aux.symtab = GET_ELF_SYMBOLS (file, sec);
|
aux.symtab = GET_ELF_SYMBOLS (file, sec);
|
|
|
strsec = section_headers + sec->sh_link;
|
strsec = section_headers + sec->sh_link;
|
|
assert (aux.strtab == NULL);
|
aux.strtab = get_data (NULL, file, strsec->sh_offset,
|
aux.strtab = get_data (NULL, file, strsec->sh_offset,
|
1, strsec->sh_size, _("string table"));
|
1, strsec->sh_size, _("string table"));
|
aux.strtab_size = aux.strtab != NULL ? strsec->sh_size : 0;
|
aux.strtab_size = aux.strtab != NULL ? strsec->sh_size : 0;
|
}
|
}
|
else if (sec->sh_type == sec_type)
|
else if (sec->sh_type == sec_type)
|
Line 7546... |
Line 7569... |
}
|
}
|
|
|
dynamic_strings = (char *) get_data (NULL, file, offset, 1,
|
dynamic_strings = (char *) get_data (NULL, file, offset, 1,
|
str_tab_len,
|
str_tab_len,
|
_("dynamic string table"));
|
_("dynamic string table"));
|
dynamic_strings_length = str_tab_len;
|
dynamic_strings_length = dynamic_strings == NULL ? 0 : str_tab_len;
|
break;
|
break;
|
}
|
}
|
}
|
}
|
|
|
/* And find the syminfo section if available. */
|
/* And find the syminfo section if available. */
|
Line 8084... |
Line 8107... |
: _("<corrupt>"));
|
: _("<corrupt>"));
|
|
|
edefs = (Elf_External_Verdef *)
|
edefs = (Elf_External_Verdef *)
|
get_data (NULL, file, section->sh_offset, 1,section->sh_size,
|
get_data (NULL, file, section->sh_offset, 1,section->sh_size,
|
_("version definition section"));
|
_("version definition section"));
|
endbuf = (char *) edefs + section->sh_size;
|
|
if (!edefs)
|
if (!edefs)
|
break;
|
break;
|
|
endbuf = (char *) edefs + section->sh_size;
|
|
|
for (idx = cnt = 0; cnt < section->sh_info; ++cnt)
|
for (idx = cnt = 0; cnt < section->sh_info; ++cnt)
|
{
|
{
|
char * vstart;
|
char * vstart;
|
Elf_External_Verdef * edef;
|
Elf_External_Verdef * edef;
|
Line 8203... |
Line 8226... |
|
|
eneed = (Elf_External_Verneed *) get_data (NULL, file,
|
eneed = (Elf_External_Verneed *) get_data (NULL, file,
|
section->sh_offset, 1,
|
section->sh_offset, 1,
|
section->sh_size,
|
section->sh_size,
|
_("version need section"));
|
_("version need section"));
|
endbuf = (char *) eneed + section->sh_size;
|
|
if (!eneed)
|
if (!eneed)
|
break;
|
break;
|
|
endbuf = (char *) eneed + section->sh_size;
|
|
|
for (idx = cnt = 0; cnt < section->sh_info; ++cnt)
|
for (idx = cnt = 0; cnt < section->sh_info; ++cnt)
|
{
|
{
|
Elf_External_Verneed * entry;
|
Elf_External_Verneed * entry;
|
Elf_Internal_Verneed ent;
|
Elf_Internal_Verneed ent;
|
Line 8421... |
Line 8444... |
Elf_Internal_Vernaux ivna;
|
Elf_Internal_Vernaux ivna;
|
Elf_External_Verneed evn;
|
Elf_External_Verneed evn;
|
Elf_External_Vernaux evna;
|
Elf_External_Vernaux evna;
|
unsigned long a_off;
|
unsigned long a_off;
|
|
|
get_data (&evn, file, offset, sizeof (evn), 1,
|
if (get_data (&evn, file, offset, sizeof (evn), 1,
|
_("version need"));
|
_("version need")) == NULL)
|
|
break;
|
|
|
ivn.vn_aux = BYTE_GET (evn.vn_aux);
|
ivn.vn_aux = BYTE_GET (evn.vn_aux);
|
ivn.vn_next = BYTE_GET (evn.vn_next);
|
ivn.vn_next = BYTE_GET (evn.vn_next);
|
|
|
a_off = offset + ivn.vn_aux;
|
a_off = offset + ivn.vn_aux;
|
|
|
do
|
do
|
{
|
{
|
get_data (&evna, file, a_off, sizeof (evna),
|
if (get_data (&evna, file, a_off, sizeof (evna),
|
1, _("version need aux (2)"));
|
1, _("version need aux (2)")) == NULL)
|
|
{
|
|
ivna.vna_next = 0;
|
|
ivna.vna_other = 0;
|
|
}
|
|
else
|
|
{
|
ivna.vna_next = BYTE_GET (evna.vna_next);
|
ivna.vna_next = BYTE_GET (evna.vna_next);
|
ivna.vna_other = BYTE_GET (evna.vna_other);
|
ivna.vna_other = BYTE_GET (evna.vna_other);
|
|
}
|
|
|
a_off += ivna.vna_next;
|
a_off += ivna.vna_next;
|
}
|
}
|
while (ivna.vna_other != data[cnt + j]
|
while (ivna.vna_other != data[cnt + j]
|
&& ivna.vna_next != 0);
|
&& ivna.vna_next != 0);
|
Line 8476... |
Line 8506... |
(file, version_info[DT_VERSIONTAGIDX (DT_VERDEF)],
|
(file, version_info[DT_VERSIONTAGIDX (DT_VERDEF)],
|
sizeof evd);
|
sizeof evd);
|
|
|
do
|
do
|
{
|
{
|
get_data (&evd, file, offset, sizeof (evd), 1,
|
if (get_data (&evd, file, offset, sizeof (evd), 1,
|
_("version def"));
|
_("version def")) == NULL)
|
|
{
|
|
ivd.vd_next = 0;
|
|
ivd.vd_ndx = 0;
|
|
}
|
|
else
|
|
{
|
ivd.vd_next = BYTE_GET (evd.vd_next);
|
ivd.vd_next = BYTE_GET (evd.vd_next);
|
ivd.vd_ndx = BYTE_GET (evd.vd_ndx);
|
ivd.vd_ndx = BYTE_GET (evd.vd_ndx);
|
|
}
|
|
|
offset += ivd.vd_next;
|
offset += ivd.vd_next;
|
}
|
}
|
while (ivd.vd_ndx != (data[cnt + j] & VERSYM_VERSION)
|
while (ivd.vd_ndx != (data[cnt + j] & VERSYM_VERSION)
|
&& ivd.vd_next != 0);
|
&& ivd.vd_next != 0);
|
Line 8494... |
Line 8530... |
Elf_External_Verdaux evda;
|
Elf_External_Verdaux evda;
|
Elf_Internal_Verdaux ivda;
|
Elf_Internal_Verdaux ivda;
|
|
|
ivd.vd_aux = BYTE_GET (evd.vd_aux);
|
ivd.vd_aux = BYTE_GET (evd.vd_aux);
|
|
|
get_data (&evda, file,
|
if (get_data (&evda, file,
|
offset - ivd.vd_next + ivd.vd_aux,
|
offset - ivd.vd_next + ivd.vd_aux,
|
sizeof (evda), 1,
|
sizeof (evda), 1,
|
_("version def aux"));
|
_("version def aux")) == NULL)
|
|
break;
|
|
|
ivda.vda_name = BYTE_GET (evda.vda_name);
|
ivda.vda_name = BYTE_GET (evda.vda_name);
|
|
|
if (ivda.vda_name >= string_sec->sh_size)
|
if (ivda.vda_name >= string_sec->sh_size)
|
name = _("*invalid*");
|
name = _("*invalid*");
|
Line 9158... |
Line 9195... |
printf (" [%s] ", get_symbol_other (psym->st_other ^ ELF_ST_VISIBILITY (psym->st_other)));
|
printf (" [%s] ", get_symbol_other (psym->st_other ^ ELF_ST_VISIBILITY (psym->st_other)));
|
printf (" %4s ", get_symbol_index_type (psym->st_shndx));
|
printf (" %4s ", get_symbol_index_type (psym->st_shndx));
|
print_symbol (25, psym->st_name < strtab_size
|
print_symbol (25, psym->st_name < strtab_size
|
? strtab + psym->st_name : _("<corrupt>"));
|
? strtab + psym->st_name : _("<corrupt>"));
|
|
|
if (section->sh_type == SHT_DYNSYM &&
|
if (section->sh_type == SHT_DYNSYM
|
version_info[DT_VERSIONTAGIDX (DT_VERSYM)] != 0)
|
&& version_info[DT_VERSIONTAGIDX (DT_VERSYM)] != 0)
|
{
|
{
|
unsigned char data[2];
|
unsigned char data[2];
|
unsigned short vers_data;
|
unsigned short vers_data;
|
unsigned long offset;
|
unsigned long offset;
|
int is_nobits;
|
int is_nobits;
|
Line 9171... |
Line 9208... |
|
|
offset = offset_from_vma
|
offset = offset_from_vma
|
(file, version_info[DT_VERSIONTAGIDX (DT_VERSYM)],
|
(file, version_info[DT_VERSIONTAGIDX (DT_VERSYM)],
|
sizeof data + si * sizeof (vers_data));
|
sizeof data + si * sizeof (vers_data));
|
|
|
get_data (&data, file, offset + si * sizeof (vers_data),
|
if (get_data (&data, file, offset + si * sizeof (vers_data),
|
sizeof (data), 1, _("version data"));
|
sizeof (data), 1, _("version data")) == NULL)
|
|
break;
|
|
|
vers_data = byte_get (data, 2);
|
vers_data = byte_get (data, 2);
|
|
|
is_nobits = (psym->st_shndx < elf_header.e_shnum
|
is_nobits = (psym->st_shndx < elf_header.e_shnum
|
&& section_headers[psym->st_shndx].sh_type
|
&& section_headers[psym->st_shndx].sh_type
|
Line 9200... |
Line 9238... |
|
|
do
|
do
|
{
|
{
|
unsigned long vna_off;
|
unsigned long vna_off;
|
|
|
get_data (&evn, file, offset, sizeof (evn), 1,
|
if (get_data (&evn, file, offset, sizeof (evn), 1,
|
_("version need"));
|
_("version need")) == NULL)
|
|
{
|
|
ivna.vna_next = 0;
|
|
ivna.vna_other = 0;
|
|
ivna.vna_name = 0;
|
|
break;
|
|
}
|
|
|
ivn.vn_aux = BYTE_GET (evn.vn_aux);
|
ivn.vn_aux = BYTE_GET (evn.vn_aux);
|
ivn.vn_next = BYTE_GET (evn.vn_next);
|
ivn.vn_next = BYTE_GET (evn.vn_next);
|
|
|
vna_off = offset + ivn.vn_aux;
|
vna_off = offset + ivn.vn_aux;
|
|
|
do
|
do
|
{
|
{
|
Elf_External_Vernaux evna;
|
Elf_External_Vernaux evna;
|
|
|
get_data (&evna, file, vna_off,
|
if (get_data (&evna, file, vna_off,
|
sizeof (evna), 1,
|
sizeof (evna), 1,
|
_("version need aux (3)"));
|
_("version need aux (3)")) == NULL)
|
|
{
|
|
ivna.vna_next = 0;
|
|
ivna.vna_other = 0;
|
|
ivna.vna_name = 0;
|
|
}
|
|
else
|
|
{
|
ivna.vna_other = BYTE_GET (evna.vna_other);
|
ivna.vna_other = BYTE_GET (evna.vna_other);
|
ivna.vna_next = BYTE_GET (evna.vna_next);
|
ivna.vna_next = BYTE_GET (evna.vna_next);
|
ivna.vna_name = BYTE_GET (evna.vna_name);
|
ivna.vna_name = BYTE_GET (evna.vna_name);
|
|
}
|
|
|
vna_off += ivna.vna_next;
|
vna_off += ivna.vna_next;
|
}
|
}
|
while (ivna.vna_other != vers_data
|
while (ivna.vna_other != vers_data
|
&& ivna.vna_next != 0);
|
&& ivna.vna_next != 0);
|
Line 9265... |
Line 9316... |
|
|
do
|
do
|
{
|
{
|
Elf_External_Verdef evd;
|
Elf_External_Verdef evd;
|
|
|
get_data (&evd, file, off, sizeof (evd),
|
if (get_data (&evd, file, off, sizeof (evd),
|
1, _("version def"));
|
1, _("version def")) == NULL)
|
|
{
|
|
ivd.vd_ndx = 0;
|
|
ivd.vd_aux = 0;
|
|
ivd.vd_next = 0;
|
|
}
|
|
else
|
|
{
|
ivd.vd_ndx = BYTE_GET (evd.vd_ndx);
|
ivd.vd_ndx = BYTE_GET (evd.vd_ndx);
|
ivd.vd_aux = BYTE_GET (evd.vd_aux);
|
ivd.vd_aux = BYTE_GET (evd.vd_aux);
|
ivd.vd_next = BYTE_GET (evd.vd_next);
|
ivd.vd_next = BYTE_GET (evd.vd_next);
|
|
}
|
|
|
off += ivd.vd_next;
|
off += ivd.vd_next;
|
}
|
}
|
while (ivd.vd_ndx != (vers_data & VERSYM_VERSION)
|
while (ivd.vd_ndx != (vers_data & VERSYM_VERSION)
|
&& ivd.vd_next != 0);
|
&& ivd.vd_next != 0);
|
|
|
off -= ivd.vd_next;
|
off -= ivd.vd_next;
|
off += ivd.vd_aux;
|
off += ivd.vd_aux;
|
|
|
get_data (&evda, file, off, sizeof (evda),
|
if (get_data (&evda, file, off, sizeof (evda),
|
1, _("version def aux"));
|
1, _("version def aux")) == NULL)
|
|
break;
|
|
|
ivda.vda_name = BYTE_GET (evda.vda_name);
|
ivda.vda_name = BYTE_GET (evda.vda_name);
|
|
|
if (psym->st_name != ivda.vda_name)
|
if (psym->st_name != ivda.vda_name)
|
printf ((vers_data & VERSYM_HIDDEN)
|
printf ((vers_data & VERSYM_HIDDEN)
|
Line 9692... |
Line 9751... |
|| reloc_type == 23; /* R_SPARC_UA32. */
|
|| reloc_type == 23; /* R_SPARC_UA32. */
|
case EM_SPU:
|
case EM_SPU:
|
return reloc_type == 6; /* R_SPU_ADDR32 */
|
return reloc_type == 6; /* R_SPU_ADDR32 */
|
case EM_TI_C6000:
|
case EM_TI_C6000:
|
return reloc_type == 1; /* R_C6000_ABS32. */
|
return reloc_type == 1; /* R_C6000_ABS32. */
|
|
case EM_TILEGX:
|
|
return reloc_type == 2; /* R_TILEGX_32. */
|
|
case EM_TILEPRO:
|
|
return reloc_type == 1; /* R_TILEPRO_32. */
|
case EM_CYGNUS_V850:
|
case EM_CYGNUS_V850:
|
case EM_V850:
|
case EM_V850:
|
return reloc_type == 6; /* R_V850_ABS32. */
|
return reloc_type == 6; /* R_V850_ABS32. */
|
case EM_VAX:
|
case EM_VAX:
|
return reloc_type == 1; /* R_VAX_32. */
|
return reloc_type == 1; /* R_VAX_32. */
|
Line 9751... |
Line 9814... |
case EM_SPARCV9:
|
case EM_SPARCV9:
|
case EM_SPARC:
|
case EM_SPARC:
|
return reloc_type == 6; /* R_SPARC_DISP32. */
|
return reloc_type == 6; /* R_SPARC_DISP32. */
|
case EM_SPU:
|
case EM_SPU:
|
return reloc_type == 13; /* R_SPU_REL32. */
|
return reloc_type == 13; /* R_SPU_REL32. */
|
|
case EM_TILEGX:
|
|
return reloc_type == 6; /* R_TILEGX_32_PCREL. */
|
|
case EM_TILEPRO:
|
|
return reloc_type == 4; /* R_TILEPRO_32_PCREL. */
|
case EM_X86_64:
|
case EM_X86_64:
|
case EM_L1OM:
|
case EM_L1OM:
|
return reloc_type == 2; /* R_X86_64_PC32. */
|
return reloc_type == 2; /* R_X86_64_PC32. */
|
case EM_XTENSA_OLD:
|
case EM_XTENSA_OLD:
|
case EM_XTENSA:
|
case EM_XTENSA:
|
Line 9792... |
Line 9859... |
case EM_X86_64:
|
case EM_X86_64:
|
case EM_L1OM:
|
case EM_L1OM:
|
return reloc_type == 1; /* R_X86_64_64. */
|
return reloc_type == 1; /* R_X86_64_64. */
|
case EM_S390_OLD:
|
case EM_S390_OLD:
|
case EM_S390:
|
case EM_S390:
|
return reloc_type == 22; /* R_S390_64 */
|
return reloc_type == 22; /* R_S390_64. */
|
|
case EM_TILEGX:
|
|
return reloc_type == 1; /* R_TILEGX_64. */
|
case EM_MIPS:
|
case EM_MIPS:
|
return reloc_type == 18; /* R_MIPS_64 */
|
return reloc_type == 18; /* R_MIPS_64. */
|
default:
|
default:
|
return FALSE;
|
return FALSE;
|
}
|
}
|
}
|
}
|
|
|
Line 9809... |
Line 9878... |
is_64bit_pcrel_reloc (unsigned int reloc_type)
|
is_64bit_pcrel_reloc (unsigned int reloc_type)
|
{
|
{
|
switch (elf_header.e_machine)
|
switch (elf_header.e_machine)
|
{
|
{
|
case EM_ALPHA:
|
case EM_ALPHA:
|
return reloc_type == 11; /* R_ALPHA_SREL64 */
|
return reloc_type == 11; /* R_ALPHA_SREL64. */
|
case EM_IA_64:
|
case EM_IA_64:
|
return reloc_type == 0x4f; /* R_IA64_PCREL64LSB */
|
return reloc_type == 0x4f; /* R_IA64_PCREL64LSB. */
|
case EM_PARISC:
|
case EM_PARISC:
|
return reloc_type == 72; /* R_PARISC_PCREL64 */
|
return reloc_type == 72; /* R_PARISC_PCREL64. */
|
case EM_PPC64:
|
case EM_PPC64:
|
return reloc_type == 44; /* R_PPC64_REL64 */
|
return reloc_type == 44; /* R_PPC64_REL64. */
|
case EM_SPARC32PLUS:
|
case EM_SPARC32PLUS:
|
case EM_SPARCV9:
|
case EM_SPARCV9:
|
case EM_SPARC:
|
case EM_SPARC:
|
return reloc_type == 46; /* R_SPARC_DISP64 */
|
return reloc_type == 46; /* R_SPARC_DISP64. */
|
case EM_X86_64:
|
case EM_X86_64:
|
case EM_L1OM:
|
case EM_L1OM:
|
return reloc_type == 24; /* R_X86_64_PC64 */
|
return reloc_type == 24; /* R_X86_64_PC64. */
|
case EM_S390_OLD:
|
case EM_S390_OLD:
|
case EM_S390:
|
case EM_S390:
|
return reloc_type == 23; /* R_S390_PC64 */
|
return reloc_type == 23; /* R_S390_PC64. */
|
|
case EM_TILEGX:
|
|
return reloc_type == 5; /* R_TILEGX_64_PCREL. */
|
default:
|
default:
|
return FALSE;
|
return FALSE;
|
}
|
}
|
}
|
}
|
|
|
Line 9919... |
Line 9990... |
case EM_L1OM: /* R_X86_64_NONE. */
|
case EM_L1OM: /* R_X86_64_NONE. */
|
case EM_MN10300: /* R_MN10300_NONE. */
|
case EM_MN10300: /* R_MN10300_NONE. */
|
case EM_MOXIE: /* R_MOXIE_NONE. */
|
case EM_MOXIE: /* R_MOXIE_NONE. */
|
case EM_M32R: /* R_M32R_NONE. */
|
case EM_M32R: /* R_M32R_NONE. */
|
case EM_TI_C6000:/* R_C6000_NONE. */
|
case EM_TI_C6000:/* R_C6000_NONE. */
|
|
case EM_TILEGX: /* R_TILEGX_NONE. */
|
|
case EM_TILEPRO: /* R_TILEPRO_NONE. */
|
case EM_XC16X:
|
case EM_XC16X:
|
case EM_C166: /* R_XC16X_NONE. */
|
case EM_C166: /* R_XC16X_NONE. */
|
return reloc_type == 0;
|
return reloc_type == 0;
|
case EM_XTENSA_OLD:
|
case EM_XTENSA_OLD:
|
case EM_XTENSA:
|
case EM_XTENSA:
|
Line 10370... |
Line 10443... |
if (section->start != NULL)
|
if (section->start != NULL)
|
return 1;
|
return 1;
|
|
|
snprintf (buf, sizeof (buf), _("%s section data"), section->name);
|
snprintf (buf, sizeof (buf), _("%s section data"), section->name);
|
section->address = sec->sh_addr;
|
section->address = sec->sh_addr;
|
section->size = sec->sh_size;
|
|
section->start = (unsigned char *) get_data (NULL, (FILE *) file,
|
section->start = (unsigned char *) get_data (NULL, (FILE *) file,
|
sec->sh_offset, 1,
|
sec->sh_offset, 1,
|
sec->sh_size, buf);
|
sec->sh_size, buf);
|
|
if (section->start == NULL)
|
|
section->size = 0;
|
|
else
|
|
{
|
|
section->size = sec->sh_size;
|
if (uncompress_section_contents (§ion->start, §ion->size))
|
if (uncompress_section_contents (§ion->start, §ion->size))
|
sec->sh_size = section->size;
|
sec->sh_size = section->size;
|
|
}
|
|
|
if (section->start == NULL)
|
if (section->start == NULL)
|
return 0;
|
return 0;
|
|
|
if (debug_displays [debug].relocate)
|
if (debug_displays [debug].relocate)
|
Line 11943... |
Line 12021... |
global_end = local_end + (symtabno - gotsym) * addr_size;
|
global_end = local_end + (symtabno - gotsym) * addr_size;
|
|
|
offset = offset_from_vma (file, pltgot, global_end - pltgot);
|
offset = offset_from_vma (file, pltgot, global_end - pltgot);
|
data = (unsigned char *) get_data (NULL, file, offset,
|
data = (unsigned char *) get_data (NULL, file, offset,
|
global_end - pltgot, 1, _("GOT"));
|
global_end - pltgot, 1, _("GOT"));
|
|
if (data == NULL)
|
|
return 0;
|
|
|
printf (_("\nPrimary GOT:\n"));
|
printf (_("\nPrimary GOT:\n"));
|
printf (_(" Canonical gp value: "));
|
printf (_(" Canonical gp value: "));
|
print_vma (pltgot + 0x7ff0, LONG_HEX);
|
print_vma (pltgot + 0x7ff0, LONG_HEX);
|
printf ("\n\n");
|
printf ("\n\n");
|
|
|
Line 12039... |
Line 12120... |
end = mips_pltgot + (2 + count) * addr_size;
|
end = mips_pltgot + (2 + count) * addr_size;
|
|
|
offset = offset_from_vma (file, mips_pltgot, end - mips_pltgot);
|
offset = offset_from_vma (file, mips_pltgot, end - mips_pltgot);
|
data = (unsigned char *) get_data (NULL, file, offset, end - mips_pltgot,
|
data = (unsigned char *) get_data (NULL, file, offset, end - mips_pltgot,
|
1, _("PLT GOT"));
|
1, _("PLT GOT"));
|
|
if (data == NULL)
|
|
return 0;
|
|
|
printf (_("\nPLT GOT:\n\n"));
|
printf (_("\nPLT GOT:\n\n"));
|
printf (_(" Reserved entries:\n"));
|
printf (_(" Reserved entries:\n"));
|
printf (_(" %*s %*s Purpose\n"),
|
printf (_(" %*s %*s Purpose\n"),
|
addr_size * 2, _("Address"), addr_size * 2, _("Initial"));
|
addr_size * 2, _("Address"), addr_size * 2, _("Initial"));
|
ent = print_mips_pltgot_entry (data, mips_pltgot, ent);
|
ent = print_mips_pltgot_entry (data, mips_pltgot, ent);
|
Line 12117... |
Line 12201... |
string_sec = section_headers + section->sh_link;
|
string_sec = section_headers + section->sh_link;
|
|
|
strtab = (char *) get_data (NULL, file, string_sec->sh_offset, 1,
|
strtab = (char *) get_data (NULL, file, string_sec->sh_offset, 1,
|
string_sec->sh_size,
|
string_sec->sh_size,
|
_("liblist string table"));
|
_("liblist string table"));
|
strtab_size = string_sec->sh_size;
|
|
|
|
if (strtab == NULL
|
if (strtab == NULL
|
|| section->sh_entsize != sizeof (Elf32_External_Lib))
|
|| section->sh_entsize != sizeof (Elf32_External_Lib))
|
{
|
{
|
free (elib);
|
free (elib);
|
free (strtab);
|
free (strtab);
|
break;
|
break;
|
}
|
}
|
|
strtab_size = string_sec->sh_size;
|
|
|
printf (_("\nLibrary list section '%s' contains %lu entries:\n"),
|
printf (_("\nLibrary list section '%s' contains %lu entries:\n"),
|
SECTION_NAME (section),
|
SECTION_NAME (section),
|
(unsigned long) (section->sh_size / sizeof (Elf32_External_Lib)));
|
(unsigned long) (section->sh_size / sizeof (Elf32_External_Lib)));
|
|
|