Add SHT_IA_64_LOPSREG, SHT_IA_64_HIPSREG and SHT_IA_64_PRIORITY_INIT.

Add code to display these values in readelf.
This commit is contained in:
Nick Clifton
2003-02-21 12:17:51 +00:00
parent d1c1f9109a
commit ecc51f48c5
4 changed files with 93 additions and 33 deletions

View File

@ -1,3 +1,14 @@
2003-02-21 Ian Wienand <ianw@gelato.unsw.edu.au>
* readelf.c (get_ia64_dynamic_type): New function.
(dynamic_segment_ia64_val): New function.
(get_dynamic_type): If machine type is EM_IA_64 call
get_ia64_dynamic_val.
(get_ia64_section_type_name): Handle sections with types in the
SHT_IA_64_LOPSREG to SHT_IA_64_HIPSREG range.
(get_dynamic_flags): If machine type is EM_IA_64 call
dynamic_segment_ia64_val.
2003-02-21 Bob Wilson <bob.wilson@acm.org> 2003-02-21 Bob Wilson <bob.wilson@acm.org>
* doc/binutils.texi: Fix typos and obvious texinfo mistakes. Make * doc/binutils.texi: Fix typos and obvious texinfo mistakes. Make

View File

@ -179,6 +179,8 @@ static const char *get_ppc64_dynamic_type
PARAMS ((unsigned long)); PARAMS ((unsigned long));
static const char *get_parisc_dynamic_type static const char *get_parisc_dynamic_type
PARAMS ((unsigned long)); PARAMS ((unsigned long));
static const char *get_ia64_dynamic_type
PARAMS ((unsigned long));
static const char *get_dynamic_type static const char *get_dynamic_type
PARAMS ((unsigned long)); PARAMS ((unsigned long));
static int slurp_rela_relocs static int slurp_rela_relocs
@ -240,6 +242,8 @@ static void dynamic_segment_mips_val
PARAMS ((Elf_Internal_Dyn *)); PARAMS ((Elf_Internal_Dyn *));
static void dynamic_segment_parisc_val static void dynamic_segment_parisc_val
PARAMS ((Elf_Internal_Dyn *)); PARAMS ((Elf_Internal_Dyn *));
static void dynamic_segment_ia64_val
PARAMS ((Elf_Internal_Dyn *));
static int process_dynamic_segment static int process_dynamic_segment
PARAMS ((FILE *)); PARAMS ((FILE *));
static int process_symbol_table static int process_symbol_table
@ -1479,6 +1483,18 @@ get_parisc_dynamic_type (type)
} }
} }
static const char *
get_ia64_dynamic_type (type)
unsigned long type;
{
switch (type)
{
case DT_IA_64_PLT_RESERVE: return "IA_64_PLT_RESERVE";
default:
return NULL;
}
}
static const char * static const char *
get_dynamic_type (type) get_dynamic_type (type)
unsigned long type; unsigned long type;
@ -1576,6 +1592,9 @@ get_dynamic_type (type)
case EM_PPC64: case EM_PPC64:
result = get_ppc64_dynamic_type (type); result = get_ppc64_dynamic_type (type);
break; break;
case EM_IA_64:
result = get_ia64_dynamic_type (type);
break;
default: default:
result = NULL; result = NULL;
break; break;
@ -2331,10 +2350,15 @@ static const char *
get_ia64_section_type_name (sh_type) get_ia64_section_type_name (sh_type)
unsigned int sh_type; unsigned int sh_type;
{ {
/* If the top 8 bits are 0x78 the next 8 are the os/abi ID. */
if ((sh_type & 0xFF000000) == SHT_IA_64_LOPSREG)
return get_osabi_name ((sh_type & 0x00FF0000) >> 16);
switch (sh_type) switch (sh_type)
{ {
case SHT_IA_64_EXT: return "IA_64_EXT"; case SHT_IA_64_EXT: return "IA_64_EXT";
case SHT_IA_64_UNWIND: return "IA_64_UNWIND"; case SHT_IA_64_UNWIND: return "IA_64_UNWIND";
case SHT_IA_64_PRIORITY_INIT: return "IA_64_PRIORITY_INIT";
default: default:
break; break;
} }
@ -4472,6 +4496,21 @@ dynamic_segment_parisc_val (entry)
putchar ('\n'); putchar ('\n');
} }
static void
dynamic_segment_ia64_val (entry)
Elf_Internal_Dyn *entry;
{
switch (entry->d_tag)
{
case DT_IA_64_PLT_RESERVE:
/* First 3 bytes reserved. */
print_vma (entry->d_un.d_ptr, PREFIX_HEX);
printf (" -- ");
print_vma (entry->d_un.d_ptr + (3 * 8), PREFIX_HEX);
printf ("\n");
}
}
static int static int
get_32bit_dynamic_segment (file) get_32bit_dynamic_segment (file)
FILE *file; FILE *file;
@ -5121,6 +5160,9 @@ process_dynamic_segment (file)
case EM_PARISC: case EM_PARISC:
dynamic_segment_parisc_val (entry); dynamic_segment_parisc_val (entry);
break; break;
case EM_IA_64:
dynamic_segment_ia64_val (entry);
break;
default: default:
print_vma (entry->d_un.d_val, PREFIX_HEX); print_vma (entry->d_un.d_val, PREFIX_HEX);
putchar ('\n'); putchar ('\n');

View File

@ -1,3 +1,8 @@
2003-02-21 Ian Wienand <ianw@gelato.unsw.edu.au>
* ia64.h (SHT_IA_64_LOPSREG, SHT_IA_64_HIPSREG,
SHT_IA_64_PRIORITY_INIT): Define.
2003-02-18 Alan Modra <amodra@bigpond.net.au> 2003-02-18 Alan Modra <amodra@bigpond.net.au>
* ppc64.h (IS_PPC64_TLS_RELOC): Rename from IS_TLS_RELOC. * ppc64.h (IS_PPC64_TLS_RELOC): Rename from IS_TLS_RELOC.

View File

@ -1,45 +1,44 @@
/* IA-64 ELF support for BFD. /* IA-64 ELF support for BFD.
Copyright 1998, 1999, 2000 Free Software Foundation, Inc. Copyright 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com> Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _ELF_IA64_H #ifndef _ELF_IA64_H
#define _ELF_IA64_H #define _ELF_IA64_H
/* Bits in the e_flags field of the Elf64_Ehdr: */ /* Bits in the e_flags field of the Elf64_Ehdr: */
#define EF_IA_64_MASKOS 0x0000000f /* os-specific flags */ #define EF_IA_64_MASKOS 0x0000000f /* OS-specific flags. */
#define EF_IA_64_ARCH 0xff000000 /* arch. version mask */ #define EF_IA_64_ARCH 0xff000000 /* Arch. version mask. */
/* ??? These four definitions are not part of the SVR4 ABI. /* ??? These four definitions are not part of the SVR4 ABI.
They were present in David's initial code drop, so it is probable They were present in David's initial code drop, so it is probable
that they are used by HP/UX. */ that they are used by HP/UX. */
#define EF_IA_64_TRAPNIL (1 << 0) /* trap NIL pointer dereferences */ #define EF_IA_64_TRAPNIL (1 << 0) /* Trap NIL pointer dereferences. */
#define EF_IA_64_EXT (1 << 2) /* program uses arch. extensions */ #define EF_IA_64_EXT (1 << 2) /* Program uses arch. extensions. */
#define EF_IA_64_BE (1 << 3) /* PSR BE bit set (big-endian) */ #define EF_IA_64_BE (1 << 3) /* PSR BE bit set (big-endian). */
#define EFA_IA_64_EAS2_3 0x23000000 /* ia64 EAS 2.3 */ #define EFA_IA_64_EAS2_3 0x23000000 /* IA64 EAS 2.3. */
#define EF_IA_64_ABI64 (1 << 4) /* 64-bit ABI */ #define EF_IA_64_ABI64 (1 << 4) /* 64-bit ABI. */
/* Not used yet. */ /* Not used yet. */
#define EF_IA_64_REDUCEDFP (1 << 5) /* Only FP6-FP11 used. */ #define EF_IA_64_REDUCEDFP (1 << 5) /* Only FP6-FP11 used. */
#define EF_IA_64_CONS_GP (1 << 6) /* gp as program wide constant. */ #define EF_IA_64_CONS_GP (1 << 6) /* gp as program wide constant. */
#define EF_IA_64_NOFUNCDESC_CONS_GP (1 << 7) /* And no function descriptors. */ #define EF_IA_64_NOFUNCDESC_CONS_GP (1 << 7) /* And no function descriptors. */
/* Not used yet. */ /* Not used yet. */
#define EF_IA_64_ABSOLUTE (1 << 8) /* Load at absolute addresses. */ #define EF_IA_64_ABSOLUTE (1 << 8) /* Load at absolute addresses. */
@ -54,13 +53,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Bits in the sh_flags field of Elf64_Shdr: */ /* Bits in the sh_flags field of Elf64_Shdr: */
#define SHF_IA_64_SHORT 0x10000000 /* section near gp */ #define SHF_IA_64_SHORT 0x10000000 /* Section near gp. */
#define SHF_IA_64_NORECOV 0x20000000 /* spec insns w/o recovery */ #define SHF_IA_64_NORECOV 0x20000000 /* Spec insns w/o recovery. */
/* Possible values for sh_type in Elf64_Shdr: */ /* Possible values for sh_type in Elf64_Shdr: */
#define SHT_IA_64_EXT (SHT_LOPROC + 0) /* extension bits */ #define SHT_IA_64_EXT (SHT_LOPROC + 0) /* Extension bits. */
#define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* unwind bits */ #define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* Unwind bits. */
#define SHT_IA_64_LOPSREG (SHT_LOPROC + 0x8000000)
/* ABI says (SHT_LOPROC + 0xfffffff) but I think it's a typo -- this makes sense. */
#define SHT_IA_64_HIPSREG (SHT_LOPROC + 0x8ffffff)
#define SHT_IA_64_PRIORITY_INIT (SHT_LOPROC + 0x9000000)
/* SHT_IA_64_HP_OPT_ANOT is only generated by HPUX compilers for its /* SHT_IA_64_HP_OPT_ANOT is only generated by HPUX compilers for its
optimization annotation section. GCC does not generate it but we optimization annotation section. GCC does not generate it but we
@ -74,8 +77,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Possible values for p_type in Elf64_Phdr: */ /* Possible values for p_type in Elf64_Phdr: */
#define PT_IA_64_ARCHEXT (PT_LOPROC + 0) /* arch extension bits */ #define PT_IA_64_ARCHEXT (PT_LOPROC + 0) /* Arch extension bits, */
#define PT_IA_64_UNWIND (PT_LOPROC + 1) /* ia64 unwind bits */ #define PT_IA_64_UNWIND (PT_LOPROC + 1) /* IA64 unwind bits. */
/* HP-UX specific values for p_type in Elf64_Phdr. /* HP-UX specific values for p_type in Elf64_Phdr.
These values are currently just used to make These values are currently just used to make
@ -92,10 +95,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* This section only used by HP-UX, The HP linker gives weak symbols /* This section only used by HP-UX, The HP linker gives weak symbols
precedence over regular common symbols. We want common to override precedence over regular common symbols. We want common to override
weak. Using this common instead of SHN_COMMON does that. */ weak. Using this common instead of SHN_COMMON does that. */
#define SHN_IA_64_ANSI_COMMON 0xFF00 #define SHN_IA_64_ANSI_COMMON 0xFF00
/* ia64-specific relocation types: */ /* IA64-specific relocation types: */
/* Relocs apply to specific instructions within a bundle. The least /* Relocs apply to specific instructions within a bundle. The least
significant 2 bits of the address indicate which instruction in the significant 2 bits of the address indicate which instruction in the