#endif
+/*------------------------------------------------------------*/
+/*--- Forwards decls ---*/
+/*------------------------------------------------------------*/
+
+static Bool is_elf_object_file ( const void *buf );
+static void unload_symbols ( Addr start, SizeT length );
+
+
/*------------------------------------------------------------*/
/*--- TOP LEVEL ---*/
/*------------------------------------------------------------*/
return VG_(strstr)( filename, "/lib/valgrind/" ) != NULL;
}
-////////////
-
-// fwds
-static void unload_symbols ( Addr start, SizeT length );
-
static void nuke_syms_in_range ( Addr start, SizeT length )
{
/* Repeatedly scan the segInfo list, looking for segInfos in this
&& seg->hasR
&& seg->hasX
&& !seg->hasW
- && VG_(is_object_file)( (const void*)seg->start );
+ && is_elf_object_file( (const void*)seg->start );
if (!ok) {
VG_(arena_free)(VG_AR_SYMTAB, filename);
/*--- Read info from a .so/exe file. ---*/
/*------------------------------------------------------------*/
-Bool VG_(is_object_file)(const void *buf)
+static Bool is_elf_object_file(const void *buf)
{
{
ElfXX_Ehdr *ehdr = (ElfXX_Ehdr *)buf;
ehdr = (ElfXX_Ehdr*)oimage;
if (ok)
- ok &= VG_(is_object_file)(ehdr);
+ ok &= is_elf_object_file(ehdr);
if (!ok) {
ML_(symerr)("Invalid ELF header, or missing stringtab/sectiontab.");
if ((dimage = find_debug_file(si->filename, debuglink, crc, &n_dimage)) != 0) {
ehdr = (ElfXX_Ehdr*)dimage;
- if (n_dimage >= sizeof(ElfXX_Ehdr) && VG_(is_object_file)(ehdr))
+ if (n_dimage >= sizeof(ElfXX_Ehdr) && is_elf_object_file(ehdr))
{
shdr = (ElfXX_Shdr*)(dimage + ehdr->e_shoff);
sh_strtab = (UChar*)(dimage + shdr[ehdr->e_shstrndx].sh_offset);
VGP_POPCC(VgpReadSyms);
}
-void VG_(seginfo_decref)(SegInfo *si, Addr start)
-{
- vg_assert(si);
- vg_assert(si->ref >= 1);
- if (--si->ref == 0)
- unload_symbols(si->start, si->size);
-}
-
-void VG_(seginfo_incref)(SegInfo *si)
-{
- vg_assert(si);
- vg_assert(si->ref > 0);
- si->ref++;
-}
+//static void seginfo_decref(SegInfo *si, Addr start)
+//{
+// vg_assert(si);
+// vg_assert(si->ref >= 1);
+// if (--si->ref == 0)
+// unload_symbols(si->start, si->size);
+//}
+//
+//static void seginfo_incref(SegInfo *si)
+//{
+// vg_assert(si);
+// vg_assert(si->ref > 0);
+// si->ref++;
+//}
/*------------------------------------------------------------*/
/*--- Use of symbol table & location info to create ---*/
extern void VG_(di_notify_munmap)( Addr a, SizeT len );
extern void VG_(di_notify_mprotect)( Addr a, SizeT len, UInt prot );
-extern Bool VG_(is_object_file) ( const void *hdr );
extern SegInfo *VG_(read_seg_symbols) ( Addr addr, SizeT len,
OffT offset, const Char* filename);
-extern void VG_(seginfo_incref) ( SegInfo * );
-extern void VG_(seginfo_decref) ( SegInfo *, Addr a );
extern Bool VG_(get_fnname_nodemangle)( Addr a, Char* fnname, Int n_fnname );