* readelf.c (display_debug_info): Ignore empty .rela.debug_info
authorDaniel Jacobowitz <drow@false.org>
Wed, 9 Oct 2002 13:44:27 +0000 (13:44 +0000)
committerDaniel Jacobowitz <drow@false.org>
Wed, 9 Oct 2002 13:44:27 +0000 (13:44 +0000)
        sections.  Allow relocations against the absolute symbol.  Don't
        use the value in compunit.cu_abbrev_offset if we found a RELA
        relocation.

binutils/ChangeLog
binutils/readelf.c

index 372893a589b14857f28b5fd4ccdf7867cfc5cec1..75feac9578bf37fc1c522dc66b68d3c902a240d5 100644 (file)
@@ -1,3 +1,10 @@
+2002-10-09  Daniel Jacobowitz  <drow@mvista.com>
+
+       * readelf.c (display_debug_info): Ignore empty .rela.debug_info
+       sections.  Allow relocations against the absolute symbol.  Don't
+       use the value in compunit.cu_abbrev_offset if we found a RELA
+       relocation.   
+
 2002-10-07  Gordon Chaffee <chaffee@netvmg.com>
 
        * addr2line.c (slurp_symtab): Read in dynamic symbols if no
index 69e50f63fce85d971b81b702b9455d1e852ca515..8cbc8fa2c5f6c77622058afa22f8331deffb7679 100644 (file)
@@ -7978,7 +7978,8 @@ display_debug_info (section, start, file)
          Elf_Internal_Sym *sym;
 
          if (relsec->sh_type != SHT_RELA
-             || SECTION_HEADER (relsec->sh_info) != section)
+             || SECTION_HEADER (relsec->sh_info) != section
+             || relsec->sh_size == 0)
            continue;
 
          if (!slurp_rela_relocs (file, relsec->sh_offset, relsec->sh_size,
@@ -7999,7 +8000,8 @@ display_debug_info (section, start, file)
                {
                  sym = symtab + ELF32_R_SYM (rp->r_info);
 
-                 if (ELF32_ST_TYPE (sym->st_info) != STT_SECTION)
+                 if (ELF32_R_SYM (rp->r_info) != 0
+                     && ELF32_ST_TYPE (sym->st_info) != STT_SECTION)
                    {
                      warn (_("Skipping unexpected symbol type %u\n"),
                            ELF32_ST_TYPE (sym->st_info));
@@ -8010,7 +8012,8 @@ display_debug_info (section, start, file)
                {
                  sym = symtab + ELF64_R_SYM (rp->r_info);
 
-                 if (ELF64_ST_TYPE (sym->st_info) != STT_SECTION)
+                 if (ELF64_R_SYM (rp->r_info) != 0
+                     && ELF64_ST_TYPE (sym->st_info) != STT_SECTION)
                    {
                      warn (_("Skipping unexpected symbol type %u\n"),
                            ELF64_ST_TYPE (sym->st_info));
@@ -8018,7 +8021,7 @@ display_debug_info (section, start, file)
                    }
                }
 
-             compunit.cu_abbrev_offset += rp->r_addend;
+             compunit.cu_abbrev_offset = rp->r_addend;
              break;
            }