aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorCatherine Moore <clm@redhat.com>2008-02-27 17:06:06 +0000
committerCatherine Moore <clm@redhat.com>2008-02-27 17:06:06 +0000
commitad9563d653f3fbd7a8e55d542cc5297657a78714 (patch)
tree1f1b63a6587a6481688e0977f4c357ec46f130db /bfd/elf.c
parent2faca73a4ef891db004ed3a263aaf6a4ef205308 (diff)
downloadgdb-ad9563d653f3fbd7a8e55d542cc5297657a78714.zip
gdb-ad9563d653f3fbd7a8e55d542cc5297657a78714.tar.gz
gdb-ad9563d653f3fbd7a8e55d542cc5297657a78714.tar.bz2
* elf.c ( _bfd_elf_print_private_bfd_data): Call
elf_backend_get_target_dtag if defined. * elf32-mips.c (elf_backend_get_target_dtag): Define. * elf64-mips.c: Likewise. * elfn32-mips.c: Likewise. * elfxx-mips.c (_bfd_mips_elf_get_target_dtag): New. * elfxx-mips.h (_bfd_mips_elf_get_target_dtag): Declare. * elf-bfd.h (elf_backend_get_target_dtag): Add prototype. * elfxx-target.h (elf_backend_get_target_dtag): Add default. (elf_backend_data): Add elf_backend_get_target_dtag.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index b0030c7..54375c2 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1204,9 +1204,10 @@ _bfd_elf_print_private_bfd_data (bfd *abfd, void *farg)
for (; extdyn < extdynend; extdyn += extdynsize)
{
Elf_Internal_Dyn dyn;
- const char *name;
+ const char *name = "";
char ab[20];
bfd_boolean stringp;
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
(*swap_dyn_in) (abfd, extdyn, &dyn);
@@ -1217,8 +1218,14 @@ _bfd_elf_print_private_bfd_data (bfd *abfd, void *farg)
switch (dyn.d_tag)
{
default:
- sprintf (ab, "0x%lx", (unsigned long) dyn.d_tag);
- name = ab;
+ if (bed->elf_backend_get_target_dtag)
+ name = (*bed->elf_backend_get_target_dtag) (dyn.d_tag);
+
+ if (!strcmp (name, ""))
+ {
+ sprintf (ab, "0x%lx", (unsigned long) dyn.d_tag);
+ name = ab;
+ }
break;
case DT_NEEDED: name = "NEEDED"; stringp = TRUE; break;
@@ -1281,7 +1288,7 @@ _bfd_elf_print_private_bfd_data (bfd *abfd, void *farg)
case DT_GNU_HASH: name = "GNU_HASH"; break;
}
- fprintf (f, " %-11s ", name);
+ fprintf (f, " %-20s ", name);
if (! stringp)
fprintf (f, "0x%lx", (unsigned long) dyn.d_un.d_val);
else