- Added support for .got.plt sections.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8127
return di->text_present ? di->text_size : 0;
}
+Addr VG_(seginfo_get_plt_avma)(const DebugInfo* di)
+{
+ return di->plt_present ? di->plt_avma : 0;
+}
+
+SizeT VG_(seginfo_get_plt_size)(const DebugInfo* di)
+{
+ return di->plt_present ? di->plt_size : 0;
+}
+
+Addr VG_(seginfo_get_gotplt_avma)(const DebugInfo* di)
+{
+ return di->gotplt_present ? di->gotplt_avma : 0;
+}
+
+SizeT VG_(seginfo_get_gotplt_size)(const DebugInfo* di)
+{
+ return di->gotplt_present ? di->gotplt_size : 0;
+}
+
const UChar* VG_(seginfo_soname)(const DebugInfo* di)
{
return di->soname;
res = Vg_SectGOT;
break;
}
+ if (di->gotplt_present
+ && di->gotplt_size > 0
+ && a >= di->gotplt_avma && a < di->gotplt_avma + di->gotplt_size) {
+ res = Vg_SectGOTPLT;
+ break;
+ }
if (di->opd_present
&& di->opd_size > 0
&& a >= di->opd_avma && a < di->opd_avma + di->opd_size) {
Bool got_present;
Addr got_avma;
SizeT got_size;
+ /* .got.plt */
+ Bool gotplt_present;
+ Addr gotplt_avma;
+ SizeT gotplt_size;
/* .opd -- needed on ppc64-linux for finding symbols */
Bool opd_present;
Addr opd_avma;
}
}
+ /* Accept .got.plt where mapped as rw (data) */
+ if (0 == VG_(strcmp)(name, ".got.plt")) {
+ if (inrw && size > 0 && !di->gotplt_present) {
+ di->gotplt_present = True;
+ di->gotplt_avma = di->rw_map_avma + foff - di->rw_map_foff;
+ di->gotplt_size = size;
+ TRACE_SYMTAB("acquiring .got.plt avma = %p\n", di->gotplt_avma);
+ } else {
+ BAD(".got.plt");
+ }
+ }
+
/* PLT is different on different platforms, it seems. */
# if defined(VGP_x86_linux) || defined(VGP_amd64_linux)
/* Accept .plt where mapped as rx (code) */
/* Fish bits out of DebugInfos. */
extern Addr VG_(seginfo_get_text_avma)( const DebugInfo *di );
extern SizeT VG_(seginfo_get_text_size)( const DebugInfo *di );
+extern Addr VG_(seginfo_get_plt_avma) ( const DebugInfo *di );
+extern SizeT VG_(seginfo_get_plt_size) ( const DebugInfo *di );
+extern Addr VG_(seginfo_get_gotplt_avma)( const DebugInfo *di );
+extern SizeT VG_(seginfo_get_gotplt_size)( const DebugInfo *di );
extern const UChar* VG_(seginfo_soname) ( const DebugInfo *di );
extern const UChar* VG_(seginfo_filename) ( const DebugInfo *di );
extern ULong VG_(seginfo_get_text_bias)( const DebugInfo *di );
Vg_SectBSS,
Vg_SectGOT,
Vg_SectPLT,
+ Vg_SectGOTPLT,
Vg_SectOPD
}
VgSectKind;