+2010-06-30 Roland McGrath <roland@redhat.com>
+
+ * relocate.c (relocate_section): Check for bad reloc type before
+ looking up symndx.
+
2010-06-29 Roland McGrath <roland@redhat.com>
* derelocate.c (check_module): Don't call dwfl_module_getdwarf.
So we just pretend it's OK without further relocation. */
return DWFL_E_NOERROR;
+ /* These are the types we can relocate. */
+ size_t size = 4;
+ for (const int *tp = reloc_symtab->rel8_types; *tp != 0; ++tp)
+ if (*tp == rtype)
+ {
+ size = 8;
+ break;
+ }
+ if (size == 4)
+ {
+ const int *tp = reloc_symtab->rel4_types;
+ while (*tp != 0 && *tp != rtype)
+ ++tp;
+ if (unlikely (*tp == 0))
+ return DWFL_E_BADRELTYPE;
+ }
+
+ if (offset + size > tdata->d_size)
+ return DWFL_E_BADRELOFF;
+
/* First, resolve the symbol to an absolute value. */
GElf_Addr value;
value = sym.st_value;
}
- /* These are the types we can relocate. */
- size_t size = 4;
- for (const int *tp = reloc_symtab->rel8_types; *tp != 0; ++tp)
- if (*tp == rtype)
- {
- size = 8;
- break;
- }
- if (size == 4)
- {
- const int *tp = reloc_symtab->rel4_types;
- while (*tp != 0 && *tp != rtype)
- ++tp;
- if (unlikely (*tp == 0))
- return DWFL_E_BADRELTYPE;
- }
-
- if (offset + size > tdata->d_size)
- return DWFL_E_BADRELOFF;
-
BYTE_ORDER_DUMMY (bo, ehdr->e_ident);
/* XXX check for overflow? */