diff options
author | Daniel Jacobowitz <drow@false.org> | 2002-10-09 13:44:27 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2002-10-09 13:44:27 +0000 |
commit | 09fc3b02306558c8e0d32b37cfbdd3bfbf941f5b (patch) | |
tree | e8f4a5b4427da6f94dad1569e3dde4bd1916e56a /binutils/readelf.c | |
parent | f74fa174bfe402c8883c1a6198d8ef8920698594 (diff) | |
download | gdb-09fc3b02306558c8e0d32b37cfbdd3bfbf941f5b.zip gdb-09fc3b02306558c8e0d32b37cfbdd3bfbf941f5b.tar.gz gdb-09fc3b02306558c8e0d32b37cfbdd3bfbf941f5b.tar.bz2 |
* 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.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r-- | binutils/readelf.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c index 69e50f6..8cbc8fa 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -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; } |