aboutsummaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2006-09-01 11:38:20 +0000
committerNick Clifton <nickc@redhat.com>2006-09-01 11:38:20 +0000
commit157c25995f7179bfc47faf1a73331f157e56177c (patch)
tree02addcb69d128568ea07255c4c15adaa31d7f7c6 /binutils/readelf.c
parent3f8e43c08b0a2fc62828e22ea5b179da2a510ae1 (diff)
downloadgdb-157c25995f7179bfc47faf1a73331f157e56177c.zip
gdb-157c25995f7179bfc47faf1a73331f157e56177c.tar.gz
gdb-157c25995f7179bfc47faf1a73331f157e56177c.tar.bz2
PR binutils/3146
* readelf.c (dump_relocations): Check for a NULL value in rtype before using it.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r--binutils/readelf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 6bb2e4c..9644256 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -1148,6 +1148,7 @@ dump_relocations (FILE *file,
printf (do_wide ? "%-22.22s" : "%-17.17s", rtype);
if (elf_header.e_machine == EM_ALPHA
+ && rtype != NULL
&& streq (rtype, "R_ALPHA_LITUSE")
&& is_rela)
{
@@ -1246,7 +1247,9 @@ dump_relocations (FILE *file,
print_vma (rels[i].r_addend, LONG_HEX);
}
- if (elf_header.e_machine == EM_SPARCV9 && streq (rtype, "R_SPARC_OLO10"))
+ if (elf_header.e_machine == EM_SPARCV9
+ && rtype != NULL
+ && streq (rtype, "R_SPARC_OLO10"))
printf (" + %lx", (unsigned long) ELF64_R_TYPE_DATA (info));
putchar ('\n');