aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-02-21 12:17:51 +0000
committerNick Clifton <nickc@redhat.com>2003-02-21 12:17:51 +0000
commitecc51f48c5f541514ee80befd8cb05cf16fed919 (patch)
tree2170974c474f35bfd68d714354c4af0527a9d65a /binutils
parentd1c1f9109a358d88e0cd0c7629640547e9a8bf12 (diff)
downloadgdb-ecc51f48c5f541514ee80befd8cb05cf16fed919.zip
gdb-ecc51f48c5f541514ee80befd8cb05cf16fed919.tar.gz
gdb-ecc51f48c5f541514ee80befd8cb05cf16fed919.tar.bz2
Add SHT_IA_64_LOPSREG, SHT_IA_64_HIPSREG and SHT_IA_64_PRIORITY_INIT.
Add code to display these values in readelf.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog11
-rw-r--r--binutils/readelf.c46
2 files changed, 55 insertions, 2 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 214b8c5..4592d2a 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -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>
* doc/binutils.texi: Fix typos and obvious texinfo mistakes. Make
diff --git a/binutils/readelf.c b/binutils/readelf.c
index fa6aa57..00a6d33 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -179,6 +179,8 @@ static const char *get_ppc64_dynamic_type
PARAMS ((unsigned long));
static const char *get_parisc_dynamic_type
PARAMS ((unsigned long));
+static const char *get_ia64_dynamic_type
+ PARAMS ((unsigned long));
static const char *get_dynamic_type
PARAMS ((unsigned long));
static int slurp_rela_relocs
@@ -240,6 +242,8 @@ static void dynamic_segment_mips_val
PARAMS ((Elf_Internal_Dyn *));
static void dynamic_segment_parisc_val
PARAMS ((Elf_Internal_Dyn *));
+static void dynamic_segment_ia64_val
+ PARAMS ((Elf_Internal_Dyn *));
static int process_dynamic_segment
PARAMS ((FILE *));
static int process_symbol_table
@@ -1480,6 +1484,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 *
get_dynamic_type (type)
unsigned long type;
{
@@ -1576,6 +1592,9 @@ get_dynamic_type (type)
case EM_PPC64:
result = get_ppc64_dynamic_type (type);
break;
+ case EM_IA_64:
+ result = get_ia64_dynamic_type (type);
+ break;
default:
result = NULL;
break;
@@ -2331,10 +2350,15 @@ static const char *
get_ia64_section_type_name (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)
{
- case SHT_IA_64_EXT: return "IA_64_EXT";
- case SHT_IA_64_UNWIND: return "IA_64_UNWIND";
+ case SHT_IA_64_EXT: return "IA_64_EXT";
+ case SHT_IA_64_UNWIND: return "IA_64_UNWIND";
+ case SHT_IA_64_PRIORITY_INIT: return "IA_64_PRIORITY_INIT";
default:
break;
}
@@ -4472,6 +4496,21 @@ dynamic_segment_parisc_val (entry)
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
get_32bit_dynamic_segment (file)
FILE *file;
@@ -5121,6 +5160,9 @@ process_dynamic_segment (file)
case EM_PARISC:
dynamic_segment_parisc_val (entry);
break;
+ case EM_IA_64:
+ dynamic_segment_ia64_val (entry);
+ break;
default:
print_vma (entry->d_un.d_val, PREFIX_HEX);
putchar ('\n');