From: Julian Seward Date: Fri, 9 Feb 2007 02:11:06 +0000 (+0000) Subject: Unbreak aix build. X-Git-Tag: svn/VALGRIND_3_3_0~386 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9943647c5793aabdcba2efd7ec0c2193fcfa67ba;p=thirdparty%2Fvalgrind.git Unbreak aix build. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6578 --- diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c index fe03908079..f651720536 100644 --- a/coregrind/m_debuginfo/debuginfo.c +++ b/coregrind/m_debuginfo/debuginfo.c @@ -428,11 +428,12 @@ void VG_(di_aix5_notify_segchange)( } else { - /* Dump all the segInfos which intersect code_start/code_len. */ + /* Dump all the segInfos whose text segments intersect + code_start/code_len. */ while (True) { for (si = segInfo_list; si; si = si->next) { - if (code_start + code_len <= si->start - || si->start + si->size <= code_start) + if (code_start + code_len <= si->text_start_avma + || si->text_start_avma + si->text_size <= code_start) continue; /* no overlap */ else break; diff --git a/coregrind/m_debuginfo/readxcoff.c b/coregrind/m_debuginfo/readxcoff.c index cfb21e440a..be1451a253 100644 --- a/coregrind/m_debuginfo/readxcoff.c +++ b/coregrind/m_debuginfo/readxcoff.c @@ -888,7 +888,8 @@ HChar* read_symbol_table ( cand.last += text_bias; cand.name = name; - if (cand.last < si->start || cand.first >= si->start+si->size) + if (cand.last < si->text_start_avma + || cand.first >= si->text_start_avma+si->text_size) continue; if (cand.last < cand.first) continue; @@ -942,7 +943,8 @@ HChar* read_symbol_table ( cand.last += text_bias; cand.name = name; - if (cand.last < si->start || cand.first >= si->start+si->size) + if (cand.last < si->text_start_avma + || cand.first >= si->text_start_avma+si->text_size) continue; if (cand.last < cand.first) continue; @@ -1550,7 +1552,8 @@ HChar* read_symbol_table ( the actual text segment. Discard any that don't. */ Addr fndescr_0 = (Addr)fndescr[0]; - if (fndescr_0 < si->start || fndescr_0 >= si->start+si->size) + if (fndescr_0 < si->text_start_avma + || fndescr_0 >= si->text_start_avma+si->text_size) continue; /* Let's suppose that fndescr is the descriptor for a @@ -1648,7 +1651,8 @@ HChar* read_symbol_table ( break; /* no space left for a 3-word descriptor */ w = wP[0]; - if (!(w >= si->start && w < si->start+si->size)) { + if (!(w >= si->text_start_avma + && w < si->text_start_avma+si->text_size)) { wP++; continue; /* entry pointer is not to text segment */ } @@ -1723,8 +1727,8 @@ HChar* read_symbol_table ( /* If everything worked right, the symbol should fall within the mapped text segment. Hence .. */ - Bool sane = addr >= si->start - && addr+size <= si->start + si->size; + Bool sane = addr >= si->text_start_avma + && addr+size <= si->text_start_avma + si->text_size; if (SHOW && SHOW_SYMS_P6) { VG_(printf)("Phase6: %s %3d 0x%08lx-0x%08lx 0x%08lx ", @@ -1905,8 +1909,9 @@ static void show_loader_section ( UChar* oi_start, UWord size ) The object file from which to read symbols is mapped temporarily at [oimage .. oimage + n_oimage). - The VMA of where the relevant text section really got loaded - (the "actual VMA", _avma) is [si->start .. si->start + si->size). + The VMA of where the relevant text section really got loaded (the + "actual VMA", _avma) is [si->text_start_avma .. si->text_start_avma + + si->text_size). The VMA of the associated data section really got loaded (the "actual VMA", _avma) is [data_avma .. data_avma + data_alen). @@ -2184,7 +2189,7 @@ Bool read_xcoff_mapped_object ( SegInfo* si, .o files. These have a stated text VMA of zero, and so their symbols start from zero and work upwards. In that case the bias is precisely the offset where the text section is - loaded (si->start), that is, the actual text VMA. + loaded (si->text_start_avma), that is, the actual text VMA. Except -- cryptically -- /usr/include/sys/ldr.h says that the ld_info.ldinfo_textorg field is "start of loaded program @@ -2208,15 +2213,15 @@ Bool read_xcoff_mapped_object ( SegInfo* si, if (text_svma_known) { #if 0 if (text_svma == 0) { - text_bias = si->start; + text_bias = si->text_start_avma; if (sntext_1based_if_known >= 1 && sntext_1based_if_known <= t_filehdr->f_nscns) text_bias += t_scnhdr[sntext_1based_if_known - 1].s_scnptr; } else { - text_bias = si->start - VG_PGROUNDDN(text_svma); + text_bias = si->text_start_avma - VG_PGROUNDDN(text_svma); } #else - text_bias = si->start - text_svma; + text_bias = si->text_start_avma - text_svma; if (sntext_1based_if_known >= 1 && sntext_1based_if_known <= t_filehdr->f_nscns) text_bias += t_scnhdr[sntext_1based_if_known - 1].s_scnptr; @@ -2225,7 +2230,7 @@ Bool read_xcoff_mapped_object ( SegInfo* si, if (SHOW) VG_(printf)(" text section: stated vma 0x%lx, " "actual vma 0x%lx, bias 0x%lx\n", - text_svma, si->start, text_bias); + text_svma, si->text_start_avma, text_bias); } else { text_bias = 0; if (SHOW) @@ -2615,10 +2620,10 @@ Bool ML_(read_xcoff_debug_info) ( struct _SegInfo* si, if (VG_(clo_verbosity) > 1 || VG_(clo_trace_redir)) { if (si->memname) { VG_(message)(Vg_DebugMsg, "Reading syms from %s(%s) (%p)", - si->filename, si->memname, si->start); + si->filename, si->memname, si->text_start_avma); } else { VG_(message)(Vg_DebugMsg, "Reading syms from %s (%p)", - si->filename, si->start); + si->filename, si->text_start_avma); } } @@ -2627,8 +2632,8 @@ Bool ML_(read_xcoff_debug_info) ( struct _SegInfo* si, VG_(printf)("--- file: %s\n", si->filename); VG_(printf)("--- mem: %s\n", si->memname ? si->memname : (UChar*)"(none)" ); - VG_(printf)("--- t actual vma: %p\n", si->start); - VG_(printf)("--- t actual len: %ld\n", si->size); + VG_(printf)("--- t actual vma: %p\n", si->text_start_avma); + VG_(printf)("--- t actual len: %ld\n", si->text_size); VG_(printf)("--- d actual vma: %p\n", data_avma); VG_(printf)("--- d actual len: %ld\n", data_alen); } diff --git a/include/vki/vki-ppc32-aix5.h b/include/vki/vki-ppc32-aix5.h index 65b74820a9..8cb3c82a65 100644 --- a/include/vki/vki-ppc32-aix5.h +++ b/include/vki/vki-ppc32-aix5.h @@ -145,7 +145,12 @@ struct vki_iovec { /* ---------------- MMappery ---------------- */ -#define VKI_PAGE_SIZE 4096 /* this is checked by the launcher */ +/* This assumes the page size is 4096. That assumption is checked + by the launcher. */ +#define VKI_PAGE_SHIFT 12 +#define VKI_PAGE_SIZE (1UL << VKI_PAGE_SHIFT) +#define VKI_MAX_PAGE_SHIFT VKI_PAGE_SHIFT +#define VKI_MAX_PAGE_SIZE VKI_PAGE_SIZE #define VKI_PROT_NONE 0x00000000 #define VKI_PROT_READ 0x00000001 diff --git a/include/vki/vki-ppc64-aix5.h b/include/vki/vki-ppc64-aix5.h index 3dcbcd3ca4..aec2347ae6 100644 --- a/include/vki/vki-ppc64-aix5.h +++ b/include/vki/vki-ppc64-aix5.h @@ -145,7 +145,12 @@ struct vki_iovec { /* ---------------- MMappery ---------------- */ -#define VKI_PAGE_SIZE 4096 /* this is checked by the launcher */ +/* This assumes the page size is 4096. That assumption is checked + by the launcher. */ +#define VKI_PAGE_SHIFT 12 +#define VKI_PAGE_SIZE (1UL << VKI_PAGE_SHIFT) +#define VKI_MAX_PAGE_SHIFT VKI_PAGE_SHIFT +#define VKI_MAX_PAGE_SIZE VKI_PAGE_SIZE #define VKI_PROT_NONE 0x00000000 #define VKI_PROT_READ 0x00000001