|
From: Nicholas N. <nj...@ca...> - 2003-12-01 11:54:48
|
CVS commit by nethercote:
Fixed test in section finding code that was broken for .plt and .got sections.
Thanks to Tom Hughes for the patch.
M +4 -7 vg_symtab2.c 1.60
--- valgrind/coregrind/vg_symtab2.c #1.59:1.60
@@ -983,15 +983,12 @@ Bool vg_read_lib_symbols ( SegInfo* si )
if (0 != sec_data) \
VG_(core_panic)("repeated section!\n"); \
- if (in_exec) { \
+ if (in_exec) \
sec_data = (type)(si->offset + shdr[i].sh_addr); \
- sec_size = shdr[i].sh_size; \
- } else { \
+ else \
sec_data = (type)(oimage + shdr[i].sh_offset); \
sec_size = shdr[i].sh_size; \
- } \
TRACE_SYMTAB( "%18s: %p .. %p\n", \
sec_name, sec_data, sec_data + sec_size - 1); \
- if ( sec_size + (UChar*)sec_data > n_oimage + (UChar*)oimage) \
- { \
+ if ( shdr[i].sh_offset + sec_size > n_oimage ) { \
VG_(symerr)(" section beyond image end?!"); \
goto out; \
|